From eb6f40ac55d9e039908238489126d8721398b1a4 Mon Sep 17 00:00:00 2001 From: Varun Santhanam Date: Fri, 11 Aug 2023 08:45:50 -0700 Subject: [PATCH] Rename package to SafariUI --- .github/workflows/xcodebuild-build-test.yml | 2 +- .swiftformat | 2 +- Package.swift | 12 ++++++------ README.md | 6 +++--- .../DismissButtonStyle.swift | 2 +- Sources/{SafariView => SafariUI}/Environment.swift | 2 +- .../ExcludedActivityTypes.swift | 2 +- .../IncludedActivities.swift | 2 +- Sources/{SafariView => SafariUI}/Modifiers.swift | 2 +- Sources/{SafariView => SafariUI}/Presentation.swift | 2 +- .../{SafariView => SafariUI}/PrewarmingToken.swift | 2 +- .../SafariUI.docc}/ExcludedActivityTypes.md | 8 ++++---- .../SafariUI.docc}/IncludedActivities.md | 8 ++++---- .../SafariUI.docc}/Modifiers.md | 10 +++++----- Sources/SafariUI/SafariUI.docc/SafariUI.md | 13 +++++++++++++ .../SafariUI.docc/SafariView.md} | 12 +++++------- Sources/{SafariView => SafariUI}/SafariView.swift | 2 +- Sources/SafariView/SafariView.docc/SafariView.md | 13 ------------- .../SafariViewTests.swift | 6 +++--- 19 files changed, 53 insertions(+), 55 deletions(-) rename Sources/{SafariView => SafariUI}/DismissButtonStyle.swift (99%) rename Sources/{SafariView => SafariUI}/Environment.swift (99%) rename Sources/{SafariView => SafariUI}/ExcludedActivityTypes.swift (99%) rename Sources/{SafariView => SafariUI}/IncludedActivities.swift (99%) rename Sources/{SafariView => SafariUI}/Modifiers.swift (99%) rename Sources/{SafariView => SafariUI}/Presentation.swift (99%) rename Sources/{SafariView => SafariUI}/PrewarmingToken.swift (99%) rename Sources/{SafariView/SafariView.docc => SafariUI/SafariUI.docc}/ExcludedActivityTypes.md (72%) rename Sources/{SafariView/SafariView.docc => SafariUI/SafariUI.docc}/IncludedActivities.md (79%) rename Sources/{SafariView/SafariView.docc => SafariUI/SafariUI.docc}/Modifiers.md (66%) create mode 100644 Sources/SafariUI/SafariUI.docc/SafariUI.md rename Sources/{SafariView/SafariView.docc/View.md => SafariUI/SafariUI.docc/SafariView.md} (86%) rename Sources/{SafariView => SafariUI}/SafariView.swift (99%) delete mode 100644 Sources/SafariView/SafariView.docc/SafariView.md rename Tests/{SafariViewTests => SafariUITests}/SafariViewTests.swift (94%) 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/.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.swift b/Package.swift index 5465a7855..3ea3dee20 100644 --- a/Package.swift +++ b/Package.swift @@ -4,15 +4,15 @@ 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: [ @@ -21,12 +21,12 @@ let package = Package( ], 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..03cb93d0b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 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) @@ -10,9 +10,9 @@ 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: [ 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