diff --git a/.github/workflows/xcodebuild-build-test.yml b/.github/workflows/xcodebuild-build-test.yml index e9c3db0f3..26bbcbbc4 100644 --- a/.github/workflows/xcodebuild-build-test.yml +++ b/.github/workflows/xcodebuild-build-test.yml @@ -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 \ No newline at end of file + run: xcodebuild -scheme 'SafariUI' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4' test \ No newline at end of file diff --git a/.spi.yml b/.spi.yml index 693699c21..7fed6f63a 100644 --- a/.spi.yml +++ b/.spi.yml @@ -2,5 +2,5 @@ version: 1 builder: configs: - platform: ios - scheme: SafariView - - documentation_targets: [SafariView] \ No newline at end of file + scheme: SafariUI + - documentation_targets: [SafariUI] \ No newline at end of file diff --git a/.swiftformat b/.swiftformat index 08ebe9ef3..f2c738d4f 100644 --- a/.swiftformat +++ b/.swiftformat @@ -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." \ No newline at end of file +--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." \ No newline at end of file diff --git a/Package.resolved b/Package.resolved index 03dd6dd5e..b0bba1e94 100644 --- a/Package.resolved +++ b/Package.resolved @@ -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" } } ], diff --git a/Package.swift b/Package.swift index 5465a7855..1b91b97ef 100644 --- a/Package.swift +++ b/Package.swift @@ -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"] ), ] ) diff --git a/README.md b/README.md index f65f231b8..30b0a4266 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# 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) @@ -10,34 +10,34 @@ 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. diff --git a/Sources/SafariView/DismissButtonStyle.swift b/Sources/SafariUI/DismissButtonStyle.swift similarity index 99% rename from Sources/SafariView/DismissButtonStyle.swift rename to Sources/SafariUI/DismissButtonStyle.swift index 2b2fa1007..9661c9752 100644 --- a/Sources/SafariView/DismissButtonStyle.swift +++ b/Sources/SafariUI/DismissButtonStyle.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // DismissButtonStyle.swift // // MIT License diff --git a/Sources/SafariView/Environment.swift b/Sources/SafariUI/Environment.swift similarity index 99% rename from Sources/SafariView/Environment.swift rename to Sources/SafariUI/Environment.swift index d50c23d24..f1fb407a9 100644 --- a/Sources/SafariView/Environment.swift +++ b/Sources/SafariUI/Environment.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // Environment.swift // // MIT License diff --git a/Sources/SafariView/ExcludedActivityTypes.swift b/Sources/SafariUI/ExcludedActivityTypes.swift similarity index 99% rename from Sources/SafariView/ExcludedActivityTypes.swift rename to Sources/SafariUI/ExcludedActivityTypes.swift index 25b1ab5de..3509f9ba9 100644 --- a/Sources/SafariView/ExcludedActivityTypes.swift +++ b/Sources/SafariUI/ExcludedActivityTypes.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // ExcludedActivityTypes.swift // // MIT License diff --git a/Sources/SafariView/IncludedActivities.swift b/Sources/SafariUI/IncludedActivities.swift similarity index 99% rename from Sources/SafariView/IncludedActivities.swift rename to Sources/SafariUI/IncludedActivities.swift index 5b5f9b3e1..353582c58 100644 --- a/Sources/SafariView/IncludedActivities.swift +++ b/Sources/SafariUI/IncludedActivities.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // IncludedActivities.swift // // MIT License diff --git a/Sources/SafariView/Modifiers.swift b/Sources/SafariUI/Modifiers.swift similarity index 99% rename from Sources/SafariView/Modifiers.swift rename to Sources/SafariUI/Modifiers.swift index 5d51fdeb6..1e7f53f54 100644 --- a/Sources/SafariView/Modifiers.swift +++ b/Sources/SafariUI/Modifiers.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // Modifiers.swift // // MIT License diff --git a/Sources/SafariView/Presentation.swift b/Sources/SafariUI/Presentation.swift similarity index 99% rename from Sources/SafariView/Presentation.swift rename to Sources/SafariUI/Presentation.swift index 52df52dae..1d82a7bd4 100644 --- a/Sources/SafariView/Presentation.swift +++ b/Sources/SafariUI/Presentation.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // Presentation.swift // // MIT License diff --git a/Sources/SafariView/PrewarmingToken.swift b/Sources/SafariUI/PrewarmingToken.swift similarity index 99% rename from Sources/SafariView/PrewarmingToken.swift rename to Sources/SafariUI/PrewarmingToken.swift index a53e1ecd3..2dcc940c2 100644 --- a/Sources/SafariView/PrewarmingToken.swift +++ b/Sources/SafariUI/PrewarmingToken.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // PrewarmingToken.swift // // MIT License diff --git a/Sources/SafariView/SafariView.docc/ExcludedActivityTypes.md b/Sources/SafariUI/SafariUI.docc/ExcludedActivityTypes.md similarity index 72% rename from Sources/SafariView/SafariView.docc/ExcludedActivityTypes.md rename to Sources/SafariUI/SafariUI.docc/ExcludedActivityTypes.md index 5da743a1b..fdbdebeb3 100644 --- a/Sources/SafariView/SafariView.docc/ExcludedActivityTypes.md +++ b/Sources/SafariUI/SafariUI.docc/ExcludedActivityTypes.md @@ -1,4 +1,4 @@ -# ``SafariView/SafariView/ExcludedActivityTypes`` +# ``SafariView/ExcludedActivityTypes`` @Metadata { @DocumentationExtension(mergeBehavior: append) @@ -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 diff --git a/Sources/SafariView/SafariView.docc/IncludedActivities.md b/Sources/SafariUI/SafariUI.docc/IncludedActivities.md similarity index 79% rename from Sources/SafariView/SafariView.docc/IncludedActivities.md rename to Sources/SafariUI/SafariUI.docc/IncludedActivities.md index c90ed05e7..9fdf47c24 100644 --- a/Sources/SafariView/SafariView.docc/IncludedActivities.md +++ b/Sources/SafariUI/SafariUI.docc/IncludedActivities.md @@ -1,4 +1,4 @@ -# ``SafariView/SafariView/IncludedActivities`` +# ``SafariView/IncludedActivities`` @Metadata { @DocumentationExtension(mergeBehavior: append) @@ -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 diff --git a/Sources/SafariView/SafariView.docc/Modifiers.md b/Sources/SafariUI/SafariUI.docc/Modifiers.md similarity index 66% rename from Sources/SafariView/SafariView.docc/Modifiers.md rename to Sources/SafariUI/SafariUI.docc/Modifiers.md index 5c4c16cc1..efa3d6915 100644 --- a/Sources/SafariView/SafariView.docc/Modifiers.md +++ b/Sources/SafariUI/SafariUI.docc/Modifiers.md @@ -1,6 +1,6 @@ # ``SwiftUI/View`` -SwiftUI view modifiers used to configure a ``SafariView/SafariView`` +SwiftUI view modifiers used to configure a ``SafariView`` ## Topics @@ -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`` diff --git a/Sources/SafariUI/SafariUI.docc/SafariUI.md b/Sources/SafariUI/SafariUI.docc/SafariUI.md new file mode 100644 index 000000000..484045b17 --- /dev/null +++ b/Sources/SafariUI/SafariUI.docc/SafariUI.md @@ -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`` diff --git a/Sources/SafariView/SafariView.docc/View.md b/Sources/SafariUI/SafariUI.docc/SafariView.md similarity index 86% rename from Sources/SafariView/SafariView.docc/View.md rename to Sources/SafariUI/SafariUI.docc/SafariView.md index 5b5bdc7f9..d322a5649 100644 --- a/Sources/SafariView/SafariView.docc/View.md +++ b/Sources/SafariUI/SafariUI.docc/SafariView.md @@ -1,4 +1,4 @@ -# ``SafariView/SafariView`` +# ``SafariView`` @Metadata { @DocumentationExtension(mergeBehavior: append) @@ -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: @@ -42,7 +40,7 @@ You can also use sheet presentation, or any other presentation mechanism of your ### Appearance -- ``SafariView/SafariView/DismissButtonStyle`` +- ``DismissButtonStyle`` ### Connection Prewarming @@ -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 diff --git a/Sources/SafariView/SafariView.swift b/Sources/SafariUI/SafariView.swift similarity index 99% rename from Sources/SafariView/SafariView.swift rename to Sources/SafariUI/SafariView.swift index acd93aa8c..e168a13d4 100644 --- a/Sources/SafariView/SafariView.swift +++ b/Sources/SafariUI/SafariView.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // SafariView.swift // // MIT License diff --git a/Sources/SafariView/SafariView.docc/SafariView.md b/Sources/SafariView/SafariView.docc/SafariView.md deleted file mode 100644 index e4162a68c..000000000 --- a/Sources/SafariView/SafariView.docc/SafariView.md +++ /dev/null @@ -1,13 +0,0 @@ -# ``SafariView`` - -SafariServices in SwiftUI - -## Overview - -`SafariView` 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/SafariView`` diff --git a/Tests/SafariViewTests/SafariViewTests.swift b/Tests/SafariUITests/SafariViewTests.swift similarity index 94% rename from Tests/SafariViewTests/SafariViewTests.swift rename to Tests/SafariUITests/SafariViewTests.swift index 0b86c539a..9ee96b907 100644 --- a/Tests/SafariViewTests/SafariViewTests.swift +++ b/Tests/SafariUITests/SafariViewTests.swift @@ -1,4 +1,4 @@ -// SafariView +// SafariUI // SafariViewTests.swift // // MIT License @@ -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 diff --git a/generate-static-site.sh b/generate-static-site.sh index 2514be4ce..897cfb977 100755 --- a/generate-static-site.sh +++ b/generate-static-site.sh @@ -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 () {