Skip to content

Commit

Permalink
Split into multiple packages.
Browse files Browse the repository at this point in the history
Splitting into multiple packages allows users to import only the package they intend to use, which leads to smaller binary sizes. This is backwards compatible with no changes needed by end users.

For users who may not be interested in say web auth sessions, they need only `import SafariView`.

fix access control
  • Loading branch information
ericlewis committed Feb 14, 2022
1 parent 9c051d2 commit 04c2b0a
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 3 deletions.
15 changes: 13 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ let package = Package(
name: "BetterSafariView",
platforms: [.iOS(.v13), .macOS(.v10_15), .watchOS("6.2")],
products: [
.library(name: "BetterSafariView", targets: ["BetterSafariView"])
.library(name: "BetterSafariView",
targets: ["BetterSafariView"]),
.library(name: "SafariView",
targets: ["SafariView"]),
.library(name: "WebAuthenticationSession",
targets: ["WebAuthenticationSession"])
],
targets: [
.target(name: "BetterSafariView")
.target(name: "BetterSafariView",
dependencies: ["SafariView", "WebAuthenticationSession"]),
.target(name: "SafariView",
dependencies: ["Shared"]),
.target(name: "WebAuthenticationSession",
dependencies: ["Shared"]),
.target(name: "Shared")
]
)
2 changes: 2 additions & 0 deletions Sources/BetterSafariView/BetterSafariView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@_exported import SafariView
@_exported import WebAuthenticationSession
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if os(iOS)

import SwiftUI
import Shared

struct SafariViewPresentationModifier: ViewModifier {

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extension UIView {
/// The receiver’s view controller, or `nil` if it has none.
///
/// This property is `nil` if the view has not yet been added to a view controller.
var viewController: UIViewController? {
public var _viewController: UIViewController? {
if let nextResponder = self.next as? UIViewController {
return nextResponder
} else if let nextResponder = self.next as? UIView {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if os(iOS) || os(macOS) || os(watchOS)

import SwiftUI
import Shared

struct WebAuthenticationPresentationModifier: ViewModifier {

Expand Down

0 comments on commit 04c2b0a

Please sign in to comment.