Skip to content

Commit

Permalink
Rename package to Safari ahead of inclusion of other safari services
Browse files Browse the repository at this point in the history
  • Loading branch information
vsanthanam committed Aug 5, 2023
1 parent eec1b7d commit c97421d
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 49 deletions.
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"]
),
]
)
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

0 comments on commit c97421d

Please sign in to comment.