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 SafariUI #23

Merged
merged 1 commit into from
Aug 11, 2023
Merged
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 'SafariUI' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4' test
4 changes: 2 additions & 2 deletions .spi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ version: 1
builder:
configs:
- platform: ios
scheme: SafariView
- documentation_targets: [SafariView]
scheme: SafariUI
- documentation_targets: [SafariUI]
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 "SafariUI\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."
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/nicklockwood/SwiftFormat",
"state" : {
"revision" : "fee7e1a1ac9518cfe3c4673382368641ccbdc62c",
"version" : "0.51.7"
"revision" : "507d63f6e890621f055397c9503bfc9468e8bcb6",
"version" : "0.51.15"
}
}
],
Expand Down
14 changes: 7 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
import PackageDescription

let package = Package(
name: "SafariView",
name: "SafariUI",
platforms: [
.iOS(.v14),
.macCatalyst(.v14)
],
products: [
.library(
name: "SafariView",
targets: ["SafariView"]
name: "SafariUI",
targets: ["SafariUI"]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/nicklockwood/SwiftFormat", exact: "0.51.7")
.package(url: "https://github.com/nicklockwood/SwiftFormat", exact: "0.51.15")
],
targets: [
.target(
name: "SafariView",
name: "SafariUI",
dependencies: []
),
.testTarget(
name: "SafariViewTests",
dependencies: ["SafariView"]
name: "SafariUITests",
dependencies: ["SafariUI"]
),
]
)
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# SafariView
# SafariUI

[![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)
[![MIT License](https://img.shields.io/github/license/vsanthanam/SafariUI)](https://github.com/vsanthanam/SafariUI/blob/main/LICENSE)
[![Package Releases](https://img.shields.io/github/v/release/vsanthanam/SafariUI)](https://github.com/vsanthanam/SafariUI/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/vsanthanam/SafariUI/xcodebuild-build-test.yml)](https://github.com/vsanthanam/SafariUI/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`

## Installation

SafariView currently distributed exclusively through the [Swift Package Manager](https://www.swift.org/package-manager/).
SafariUI 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 SafariUI 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"))
.package(url: "https://github.com/vsanthanam/SafariUI.git", .upToNextMajor(from: "2.0.0"))
]
```

To add SafariView as a dependency to an Xcode Project:
To add SafariUI 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.
- Enter package URL `https://github.com/vsanthanam/SafariUI.git` and select your release and of choice.

Other distribution mechanisms like CocoaPods or Carthage may be added in the future.

## 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).
SafariUI'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/SafariUI/docs/documentation/safariui).

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

[![](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)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvsanthanam%2FSafariUI%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/vsanthanam/SafariUI)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvsanthanam%2FSafariUI%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/vsanthanam/SafariUI)

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

## License

**SafariView** is available under the MIT license. See the LICENSE file for more information.
**SafariUI** 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
// SafariUI
// DismissButtonStyle.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// SafariUI
// Environment.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// SafariUI
// ExcludedActivityTypes.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// SafariUI
// IncludedActivities.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// SafariUI
// Modifiers.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// SafariUI
// Presentation.swift
//
// MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// SafariUI
// 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(_:)-4omxw`` view modifier, or the ``SwiftUI/EnvironmentValues/safariViewExcludedActivityTypes`` environment value.

## Topics

### Initializers

- ``init(_:)-1ktmq``
- ``init(_:)-67duh``
- ``init(_:)-92zvd``
- ``init(_:)-93kn9``

### 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(_:)-7buso`` view modifier, or the ``SwiftUI/EnvironmentValues/safariViewIncludedActivities`` environment value.

## Topics

### Initializers

- ``init(_:)-6d955``
- ``init(_:)-9q5v6``
- ``init(_:)-6ig8b``
- ``init(_:)-43y6f``

### Operators

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ``SwiftUI/View``

SwiftUI view modifiers used to configure a ``SafariView/SafariView``
SwiftUI view modifiers used to configure a ``SafariView``

## Topics

Expand All @@ -24,7 +24,7 @@ SwiftUI view modifiers used to configure a ``SafariView/SafariView``

### Custom Activities

- ``SwiftUI/View/includedSafariActivities(_:)-2u8l9``
- ``SwiftUI/View/includedSafariActivities(_:)-362lz``
- ``SwiftUI/View/excludedSafariActivityTypes(_:)-tvrg``
- ``SwiftUI/View/excludedSafariActivityTypes(_:)-1v8zq``
- ``SwiftUI/View/includedSafariActivities(_:)-1yaml``
- ``SwiftUI/View/includedSafariActivities(_:)-7buso``
- ``SwiftUI/View/excludedSafariActivityTypes(_:)-5sf78``
- ``SwiftUI/View/excludedSafariActivityTypes(_:)-4omxw``
13 changes: 13 additions & 0 deletions Sources/SafariUI/SafariUI.docc/SafariUI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ``SafariUI``

SafariServices in SwiftUI

## Overview

`SafariUI` is a package that wraps [`SafariServices`](https://developer.apple.com/documentation/safariservices/) for use with SwiftUI applications. Currently, it contains a single SwiftUI view, 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 All @@ -42,7 +40,7 @@ You can also use sheet presentation, or any other presentation mechanism of your

### Appearance

- ``SafariView/SafariView/DismissButtonStyle``
- ``DismissButtonStyle``

### Connection Prewarming

Expand All @@ -56,9 +54,9 @@ You can also use sheet presentation, or any other presentation mechanism of your

### Custom Activities

- ``SafariView/SafariView/IncludedActivities``
- ``SafariView/SafariView/ExcludedActivityTypes``
- ``SafariView/SafariView/ActivityButton``
- ``IncludedActivities``
- ``ExcludedActivityTypes``
- ``ActivityButton``

### Environment Values

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SafariView
// SafariUI
// SafariView.swift
//
// MIT License
Expand Down
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
// SafariUI
// SafariViewTests.swift
//
// MIT License
Expand All @@ -23,10 +23,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

@testable import SafariView
@testable import SafariUI
import XCTest

final class SafariViewTests: XCTestCase {
final class SafariUITests: XCTestCase {
func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
Expand Down
2 changes: 1 addition & 1 deletion generate-static-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')

run_docc () {
xcodebuild docbuild -scheme SafariView -destination generic/platform=iOS OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path SafariView/docs --output-path docs" | xcbeautify
xcodebuild docbuild -scheme SafariUI -destination generic/platform=iOS OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path SafariUI/docs --output-path docs" | xcbeautify
}

create_branches () {
Expand Down