Skip to content

Commit

Permalink
Rename package to SafariUI
Browse files Browse the repository at this point in the history
  • Loading branch information
vsanthanam committed Aug 11, 2023
1 parent dd998d1 commit eb6f40a
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 55 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 'SafariUI' -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 "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."
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: "SafariUI",
platforms: [
.iOS(.v14),
.macCatalyst(.v14)
],
products: [
.library(
name: "SafariView",
targets: ["SafariView"]
name: "SafariUI",
targets: ["SafariUI"]
),
],
dependencies: [
Expand All @@ -21,12 +21,12 @@ let package = Package(
],
targets: [
.target(
name: "SafariView",
name: "SafariUI",
dependencies: []
),
.testTarget(
name: "SafariViewTests",
dependencies: ["SafariView"]
name: "SafariUITests",
dependencies: ["SafariUI"]
),
]
)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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: [
Expand Down
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

0 comments on commit eb6f40a

Please sign in to comment.