Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename package to Safari ahead of inclusion of other safari services #21

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/xcodebuild-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Lint
run: swift package plugin --allow-writing-to-package-directory swiftformat --lint
- name: Build & Test
run: xcodebuild -scheme 'SafariView' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4' test
run: xcodebuild -scheme 'Safari' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4' test
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--enable isEmpty
--disable blankLinesAtEndOfScope, blankLinesAtStartOfScope, redundantNilInit, unusedArguments, redundantParens, wrapMultilineStatementBraces, trailingCommas, braces
--swiftversion 5.8
--header "SafariView\n{file}\n\nMIT License\n\nCopyright (c) 2021 Varun Santhanam\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\n\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
--header "Safari\n{file}\n\nMIT License\n\nCopyright (c) 2021 Varun Santhanam\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\n\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import PackageDescription

let package = Package(
name: "SafariView",
name: "Safari",
platforms: [
.iOS(.v14),
.macCatalyst(.v14)
],
products: [
.library(
name: "SafariView",
targets: ["SafariView"]
name: "Safari",
targets: ["Safari"]
),
],
dependencies: [
Expand All @@ -21,12 +21,12 @@ let package = Package(
],
targets: [
.target(
name: "SafariView",
name: "Safari",
dependencies: []
),
.testTarget(
name: "SafariViewTests",
dependencies: ["SafariView"]
name: "SafariTests",
dependencies: ["Safari"]
),
]
)
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# SafariView
# Safari

[![MIT License](https://img.shields.io/github/license/vsanthanam/SafariView)](https://github.com/vsanthanam/SafariView/blob/main/LICENSE)
[![Package Releases](https://img.shields.io/github/v/release/vsanthanam/SafariView)](https://github.com/vsanthanam/SafariView/releases)
[![Build Statis](https://img.shields.io/github/actions/workflow/status/vsanthanam/SafariView/xcodebuild-build-test.yml)](https://github.com/vsanthanam/SafariView/actions)
[![Swift Version](https://img.shields.io/badge/swift-5.8-critical)](https://swift.org)
[![Supported Platforms](https://img.shields.io/badge/platform-iOS%2014.0%20%7C%20Catalyst%2014.0-lightgrey)](https://developer.apple.com)

A SwiftUI wrapper around `SFSafariViewController`
A SwiftUI wrapper around [`SafariServices`](https://developer.apple.com/documentation/safariservices/)

## Installation

SafariView currently distributed exclusively through the [Swift Package Manager](https://www.swift.org/package-manager/).
Safari currently distributed exclusively through the [Swift Package Manager](https://www.swift.org/package-manager/).

To add SafariView as a dependency to an existing Swift package, add the following line of code to the `dependencies` parameter of your `Package.swift` file:
To add Safari as a dependency to an existing Swift package, add the following line of code to the `dependencies` parameter of your `Package.swift` file:

```swift
dependencies: [
.package(url: "https://github.com/vsanthanam/SafariView.git", .upToNextMajor(from: "2.0.0"))
]
```

To add SafariView as a dependency to an Xcode Project:
To add Safari as a dependency to an Xcode Project:

- Choose `File` → `Add Packages...`
- Enter package URL `https://github.com/vsanthanam/SafariView.git` and select your release and of choice.
Expand All @@ -29,15 +29,15 @@ Other distribution mechanisms like CocoaPods or Carthage may be added in the fut

## Usage & Documentation

SafariView's documentation is built with [DocC](https://developer.apple.com/documentation/docc) and included in the repository as a DocC archive. The latest version is hosted on [GitHub Pages](https://pages.github.com) and is available [here](https://vsanthanam.github.io/SafariView/docs/documentation/safariview).
Safari's documentation is built with [DocC](https://developer.apple.com/documentation/docc) and included in the repository as a DocC archive. The latest version is hosted on [GitHub Pages](https://pages.github.com) and is available [here](https://vsanthanam.github.io/SafariView/docs/documentation/safari).

Additional installation instructions are available on the [Swift Package Index](https://swiftpackageindex.com/vsanthanam/SafariView)

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvsanthanam%2FSafariView%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/vsanthanam/SafariView)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvsanthanam%2FSafariView%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/vsanthanam/SafariView)

Explore [the documentation](https://vsanthanam.github.io/SafariView/docs/documentation/safariview) for more details.
Explore [the documentation](https://vsanthanam.github.io/SafariView/docs/documentation/safari) for more details.

## License

**SafariView** is available under the MIT license. See the LICENSE file for more information.
**Safari** is available under the MIT license. See the LICENSE file for more information.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// DismissButtonStyle.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// Environment.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// ExcludedActivityTypes.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// IncludedActivities.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// Modifiers.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// Presentation.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// PrewarmingToken.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ``SafariView/SafariView/ExcludedActivityTypes``
# ``SafariView/ExcludedActivityTypes``

@Metadata {
@DocumentationExtension(mergeBehavior: append)
Expand All @@ -12,14 +12,14 @@ You can initialize instances of this type using an array literal of `UIActivity.
let excluded: SafariView.ExcludedActivityTypes = [.addToReadingList, .airDrop, .print, .sharePlay]
```

To change the the excluded activity types used by ``SafariView`` at the current scope, use the ``SwiftUI/View/excludedSafariActivityTypes(_:)-tvrg`` view modifier, or the ``SwiftUI/EnvironmentValues/safariViewExcludedActivityTypes`` environment value.
To change the the excluded activity types used by ``SafariView`` at the current scope, use the ``SwiftUI/View/excludedSafariActivityTypes(_:)-3j01b`` view modifier, or the ``SwiftUI/EnvironmentValues/safariViewExcludedActivityTypes`` environment value.

## Topics

### Initializers

- ``init(_:)-1ktmq``
- ``init(_:)-67duh``
- ``init(_:)-4ttl7``
- ``init(_:)-641yv``

### Operators

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ``SafariView/SafariView/IncludedActivities``
# ``SafariView/IncludedActivities``

@Metadata {
@DocumentationExtension(mergeBehavior: append)
Expand All @@ -12,14 +12,14 @@ You can initialize instances of this type using an array literal of `UIActivity`
let excluded: SafariView.IncludedActivities = [someActivity, someOtherActivity]
```

To change the the included activities used by ``SafariView`` at the current scope, use the ``SwiftUI/View/includedSafariActivities(_:)-2u8l9`` view modifier, or the ``SwiftUI/EnvironmentValues/safariViewIncludedActivities`` environment value.
To change the the included activities used by ``SafariView`` at the current scope, use the ``SwiftUI/View/includedSafariActivities(_:)-5y6z0`` view modifier, or the ``SwiftUI/EnvironmentValues/safariViewIncludedActivities`` environment value.

## Topics

### Initializers

- ``init(_:)-6d955``
- ``init(_:)-9q5v6``
- ``init(_:)-b58a``
- ``init(_:)-7gbd7``

### Operators

Expand Down
13 changes: 13 additions & 0 deletions Sources/Safari/Safari.docc/Safari.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ``Safari``

SafariServices in SwiftUI

## Overview

`Safari` is a package that wraps [`SafariServices`](https://developer.apple.com/documentation/safariservices/) for use with SwiftUI applications. Currently, it contains a single SwiftUI view, also called `SafariView`, which wraps [`SFSafariViewController`](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller).

## Topics

### Views

- ``SafariView``
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ``SafariView/SafariView``
# ``SafariView``

@Metadata {
@DocumentationExtension(mergeBehavior: append)
Expand All @@ -15,8 +15,6 @@ UI features include the following:
- An Action button that invokes an activity view controller offering custom services from your app, and activities, such as messaging, from the system and other extensions
- A Done button, back and forward navigation buttons, and a button to open the page directly in Safari

The library contains a single `View`-conforming struct, also named `SafariView`, as well as several view modifiers used to control the appearance, behavior and presentation of a ``SafariView/SafariView``

- Note: In Mac apps built with Mac Catalyst, SafariView launches the default web browser instead of displaying a modal window. SafariView is not compatible with macOS, tvOS, or watchOS.

You can present a `SafariView` using the built-in presentation view modifiers:
Expand Down Expand Up @@ -46,7 +44,7 @@ You can also use sheet presentation, or any other presentation mechanism of your
- ``SwiftUI/View/safariBarTintColor(_:)``
- ``SwiftUI/View/safariControlTintColor(_:)``
- ``SwiftUI/View/safariDismissButtonStyle(_:)``
- ``SafariView/SafariView/DismissButtonStyle``
- ``DismissButtonStyle``

### Presentation

Expand All @@ -67,12 +65,12 @@ You can also use sheet presentation, or any other presentation mechanism of your

### Custom Activities

- ``SwiftUI/View/includedSafariActivities(_:)-2u8l9``
- ``SwiftUI/View/includedSafariActivities(_:)-362lz``
- ``SafariView/SafariView/IncludedActivities``
- ``SwiftUI/View/excludedSafariActivityTypes(_:)-tvrg``
- ``SwiftUI/View/excludedSafariActivityTypes(_:)-1v8zq``
- ``SafariView/SafariView/ExcludedActivityTypes``
- ``SwiftUI/View/includedSafariActivities(_:)-6530n``
- ``SwiftUI/View/includedSafariActivities(_:)-5y6z0``
- ``IncludedActivities``
- ``SwiftUI/View/excludedSafariActivityTypes(_:)-xd5l``
- ``SwiftUI/View/excludedSafariActivityTypes(_:)-3j01b``
- ``ExcludedActivityTypes``

### Environment Values

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// SafariView.swift
//
// MIT License
Expand Down Expand Up @@ -712,3 +712,9 @@ private extension UIView {
}

}

struct SafariView_Previews: PreviewProvider {
static var previews: some View {
SafariView(url: URL(string: "https://www.apple.com")!)
}
}
13 changes: 0 additions & 13 deletions Sources/SafariView/SafariView.docc/SafariView.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// Safari
// SafariViewTests.swift
//
// MIT License
Expand All @@ -23,7 +23,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

@testable import SafariView
@testable import Safari
import XCTest

final class SafariViewTests: XCTestCase {
Expand Down