diff --git a/BetterSafariView.xcworkspace/contents.xcworkspacedata b/BetterSafariView.xcworkspace/contents.xcworkspacedata index ca0bf9a..f090caf 100644 --- a/BetterSafariView.xcworkspace/contents.xcworkspacedata +++ b/BetterSafariView.xcworkspace/contents.xcworkspacedata @@ -5,6 +5,6 @@ location = "group:"> + location = "group:Demo/BetterSafariViewDemo.xcodeproj"> diff --git a/CHANGELOG.md b/CHANGELOG.md index 82dce74..bb86e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v2.3.0](https://github.com/stleamist/BetterSafariView/releases/tag/v2.3.0) (2021-01-19) +### Added +- Added `WebAuthenticationSession` support for macOS and watchOS. + ## [v2.2.2](https://github.com/stleamist/BetterSafariView/releases/tag/v2.2.2) (2020-09-19) ### Fixed - Fixed an issue where the changes of `SafariView` and `WebAuthenticationSession` is not applied after an initialization. diff --git a/Demo/BetterSafariViewDemo.xcodeproj/project.pbxproj b/Demo/BetterSafariViewDemo.xcodeproj/project.pbxproj index 3023c04..a70a38e 100644 --- a/Demo/BetterSafariViewDemo.xcodeproj/project.pbxproj +++ b/Demo/BetterSafariViewDemo.xcodeproj/project.pbxproj @@ -7,175 +7,352 @@ objects = { /* Begin PBXBuildFile section */ - C7A28ED924E76DC7001FACA6 /* BetterSafariViewDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28ED824E76DC7001FACA6 /* BetterSafariViewDemoApp.swift */; }; - C7A28EDD24E76DC8001FACA6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7A28EDC24E76DC8001FACA6 /* Assets.xcassets */; }; - C7A28EE024E76DC8001FACA6 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7A28EDF24E76DC8001FACA6 /* Preview Assets.xcassets */; }; - C7A28EE924E76E0D001FACA6 /* BetterSafariView in Frameworks */ = {isa = PBXBuildFile; productRef = C7A28EE824E76E0D001FACA6 /* BetterSafariView */; }; - C7A28EEB24E76EA3001FACA6 /* SafariViewOptionsForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28EEA24E76EA3001FACA6 /* SafariViewOptionsForm.swift */; }; - C7A28EED24E76EAE001FACA6 /* NaiveSafariView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28EEC24E76EAE001FACA6 /* NaiveSafariView.swift */; }; - C7A28EF124E7D58B001FACA6 /* WebAuthenticationSessionOptionsForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28EF024E7D58B001FACA6 /* WebAuthenticationSessionOptionsForm.swift */; }; - C7A28EF324E7E5BC001FACA6 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28EF224E7E5BC001FACA6 /* Constants.swift */; }; - C7A28EF524E7E852001FACA6 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28EF424E7E852001FACA6 /* RootView.swift */; }; - C7A28EF924E817AF001FACA6 /* TitleLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28EF824E817AF001FACA6 /* TitleLabel.swift */; }; - C7A28EFB24E817BB001FACA6 /* DetailButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28EFA24E817BB001FACA6 /* DetailButton.swift */; }; - C7A28EFD24E817C4001FACA6 /* DisclosureIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28EFC24E817C4001FACA6 /* DisclosureIndicator.swift */; }; - C7A28F0224E82633001FACA6 /* WebAuthenticationSessionOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28F0124E82633001FACA6 /* WebAuthenticationSessionOptions.swift */; }; - C7A28F0424E8263C001FACA6 /* SafariViewOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7A28F0324E8263C001FACA6 /* SafariViewOptions.swift */; }; + C71240082524CF40001A648E /* SafariViewOptionsForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240002524CF40001A648E /* SafariViewOptionsForm.swift */; }; + C71240092524CF40001A648E /* WebAuthenticationSessionOptionsForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240012524CF40001A648E /* WebAuthenticationSessionOptionsForm.swift */; }; + C712400A2524CF40001A648E /* NaiveSafariView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240022524CF40001A648E /* NaiveSafariView.swift */; }; + C712400B2524CF40001A648E /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240032524CF40001A648E /* RootView.swift */; }; + C712400C2524CF40001A648E /* DisclosureIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240052524CF40001A648E /* DisclosureIndicator.swift */; }; + C712400D2524CF40001A648E /* TitleLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240062524CF40001A648E /* TitleLabel.swift */; }; + C712400E2524CF40001A648E /* DetailButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240072524CF40001A648E /* DetailButton.swift */; }; + C71240122524CF69001A648E /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240112524CF69001A648E /* Constants.swift */; }; + C71240132524CF69001A648E /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240112524CF69001A648E /* Constants.swift */; }; + C71240192524CF71001A648E /* SafariViewOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240172524CF71001A648E /* SafariViewOptions.swift */; }; + C712401B2524CF71001A648E /* WebAuthenticationSessionOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240182524CF71001A648E /* WebAuthenticationSessionOptions.swift */; }; + C712401C2524CF71001A648E /* WebAuthenticationSessionOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240182524CF71001A648E /* WebAuthenticationSessionOptions.swift */; }; + C71240232524CFAB001A648E /* BetterSafariView in Frameworks */ = {isa = PBXBuildFile; productRef = C71240222524CFAB001A648E /* BetterSafariView */; }; + C72B59482525E1F80052270A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7EFD5112524CED800A08BEA /* Assets.xcassets */; }; + C72B59522525E2080052270A /* WebAuthenticationSessionOptionsForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240012524CF40001A648E /* WebAuthenticationSessionOptionsForm.swift */; }; + C72B59532525E2080052270A /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240112524CF69001A648E /* Constants.swift */; }; + C72B59542525E2080052270A /* WebAuthenticationSessionOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240182524CF71001A648E /* WebAuthenticationSessionOptions.swift */; }; + C72B59552525E2080052270A /* BetterSafariViewDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7EFD50F2524CED600A08BEA /* BetterSafariViewDemoApp.swift */; }; + C72B595E2525E2140052270A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7EFD5112524CED800A08BEA /* Assets.xcassets */; }; + C72B59642525E2680052270A /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C72B59632525E2680052270A /* RootView.swift */; }; + C72B59722525E2D60052270A /* BetterSafariView in Frameworks */ = {isa = PBXBuildFile; productRef = C72B59712525E2D60052270A /* BetterSafariView */; }; + C754A76C2526A9D100A2A620 /* View+Modify.swift in Sources */ = {isa = PBXBuildFile; fileRef = C754A76B2526A9D100A2A620 /* View+Modify.swift */; }; + C754A76D2526A9D100A2A620 /* View+Modify.swift in Sources */ = {isa = PBXBuildFile; fileRef = C754A76B2526A9D100A2A620 /* View+Modify.swift */; }; + C754A76E2526A9D100A2A620 /* View+Modify.swift in Sources */ = {isa = PBXBuildFile; fileRef = C754A76B2526A9D100A2A620 /* View+Modify.swift */; }; + C7BA0FFD2525D4A9002BC9F7 /* BetterSafariViewDemo Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = C7BA0FFC2525D4A9002BC9F7 /* BetterSafariViewDemo Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + C7C1F8C52524D6D800B693F9 /* WebAuthenticationSessionOptionsForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71240012524CF40001A648E /* WebAuthenticationSessionOptionsForm.swift */; }; + C7DEBCBE258DC83E00690CC3 /* BetterSafariView in Frameworks */ = {isa = PBXBuildFile; productRef = C7DEBCBD258DC83E00690CC3 /* BetterSafariView */; }; + C7DEBCC4258DC87900690CC3 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7DEBCC3258DC87900690CC3 /* RootView.swift */; }; + C7DEBCCE258DCC7300690CC3 /* HorizontalAlignment+PreferenceLabelAlignment.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7DEBCCD258DCC7300690CC3 /* HorizontalAlignment+PreferenceLabelAlignment.swift */; }; + C7EFD5222524CED800A08BEA /* BetterSafariViewDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7EFD50F2524CED600A08BEA /* BetterSafariViewDemoApp.swift */; }; + C7EFD5232524CED800A08BEA /* BetterSafariViewDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7EFD50F2524CED600A08BEA /* BetterSafariViewDemoApp.swift */; }; + C7EFD5262524CED800A08BEA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7EFD5112524CED800A08BEA /* Assets.xcassets */; }; + C7EFD5272524CED800A08BEA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7EFD5112524CED800A08BEA /* Assets.xcassets */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + C7BA0FFE2525D4A9002BC9F7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C7EFD50A2524CED600A08BEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = C7BA0FFB2525D4A9002BC9F7; + remoteInfo = "BetterSafariViewDemo WatchKit Extension"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + C7BA10122525D4AA002BC9F7 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + C7BA0FFD2525D4A9002BC9F7 /* BetterSafariViewDemo Extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ - C7A28ED524E76DC7001FACA6 /* BetterSafariViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BetterSafariViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C7A28ED824E76DC7001FACA6 /* BetterSafariViewDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BetterSafariViewDemoApp.swift; sourceTree = ""; }; - C7A28EDC24E76DC8001FACA6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C7A28EDF24E76DC8001FACA6 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - C7A28EE124E76DC8001FACA6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C7A28EEA24E76EA3001FACA6 /* SafariViewOptionsForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariViewOptionsForm.swift; sourceTree = ""; }; - C7A28EEC24E76EAE001FACA6 /* NaiveSafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NaiveSafariView.swift; sourceTree = ""; }; - C7A28EF024E7D58B001FACA6 /* WebAuthenticationSessionOptionsForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebAuthenticationSessionOptionsForm.swift; sourceTree = ""; }; - C7A28EF224E7E5BC001FACA6 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; - C7A28EF424E7E852001FACA6 /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; - C7A28EF824E817AF001FACA6 /* TitleLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleLabel.swift; sourceTree = ""; }; - C7A28EFA24E817BB001FACA6 /* DetailButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailButton.swift; sourceTree = ""; }; - C7A28EFC24E817C4001FACA6 /* DisclosureIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisclosureIndicator.swift; sourceTree = ""; }; - C7A28F0124E82633001FACA6 /* WebAuthenticationSessionOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebAuthenticationSessionOptions.swift; sourceTree = ""; }; - C7A28F0324E8263C001FACA6 /* SafariViewOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariViewOptions.swift; sourceTree = ""; }; + C71240002524CF40001A648E /* SafariViewOptionsForm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SafariViewOptionsForm.swift; sourceTree = ""; }; + C71240012524CF40001A648E /* WebAuthenticationSessionOptionsForm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebAuthenticationSessionOptionsForm.swift; sourceTree = ""; }; + C71240022524CF40001A648E /* NaiveSafariView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NaiveSafariView.swift; sourceTree = ""; }; + C71240032524CF40001A648E /* RootView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; + C71240052524CF40001A648E /* DisclosureIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisclosureIndicator.swift; sourceTree = ""; }; + C71240062524CF40001A648E /* TitleLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TitleLabel.swift; sourceTree = ""; }; + C71240072524CF40001A648E /* DetailButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailButton.swift; sourceTree = ""; }; + C71240112524CF69001A648E /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; + C71240172524CF71001A648E /* SafariViewOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SafariViewOptions.swift; sourceTree = ""; }; + C71240182524CF71001A648E /* WebAuthenticationSessionOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebAuthenticationSessionOptions.swift; sourceTree = ""; }; + C72B59632525E2680052270A /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; + C754A76B2526A9D100A2A620 /* View+Modify.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Modify.swift"; sourceTree = ""; }; + C7BA0FF02525D4A7002BC9F7 /* BetterSafariViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BetterSafariViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C7BA0FF72525D4A8002BC9F7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C7BA0FFC2525D4A9002BC9F7 /* BetterSafariViewDemo Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "BetterSafariViewDemo Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + C7BA100C2525D4A9002BC9F7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C7DEBCC3258DC87900690CC3 /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; + C7DEBCCD258DCC7300690CC3 /* HorizontalAlignment+PreferenceLabelAlignment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HorizontalAlignment+PreferenceLabelAlignment.swift"; sourceTree = ""; }; + C7EFD50F2524CED600A08BEA /* BetterSafariViewDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BetterSafariViewDemoApp.swift; sourceTree = ""; }; + C7EFD5112524CED800A08BEA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + C7EFD5162524CED800A08BEA /* BetterSafariViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BetterSafariViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C7EFD5192524CED800A08BEA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C7EFD51E2524CED800A08BEA /* BetterSafariViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BetterSafariViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C7EFD5202524CED800A08BEA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C7EFD5212524CED800A08BEA /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C7A28ED224E76DC7001FACA6 /* Frameworks */ = { + C7BA0FF92525D4A9002BC9F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C72B59722525E2D60052270A /* BetterSafariView in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C7EFD5132524CED800A08BEA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C7A28EE924E76E0D001FACA6 /* BetterSafariView in Frameworks */, + C71240232524CFAB001A648E /* BetterSafariView in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C7EFD51B2524CED800A08BEA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C7DEBCBE258DC83E00690CC3 /* BetterSafariView in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C7A28ECC24E76DC7001FACA6 = { + C7123FFE2524CF40001A648E /* Views */ = { isa = PBXGroup; children = ( - C7A28ED724E76DC7001FACA6 /* BetterSafariViewDemo */, - C7A28ED624E76DC7001FACA6 /* Products */, - C7A28EE724E76E0D001FACA6 /* Frameworks */, + C71240032524CF40001A648E /* RootView.swift */, + C71240022524CF40001A648E /* NaiveSafariView.swift */, + C7123FFF2524CF40001A648E /* Options */, + C71240042524CF40001A648E /* Components */, ); + path = Views; sourceTree = ""; }; - C7A28ED624E76DC7001FACA6 /* Products */ = { + C7123FFF2524CF40001A648E /* Options */ = { isa = PBXGroup; children = ( - C7A28ED524E76DC7001FACA6 /* BetterSafariViewDemo.app */, + C71240172524CF71001A648E /* SafariViewOptions.swift */, + C71240002524CF40001A648E /* SafariViewOptionsForm.swift */, ); - name = Products; + path = Options; sourceTree = ""; }; - C7A28ED724E76DC7001FACA6 /* BetterSafariViewDemo */ = { + C71240042524CF40001A648E /* Components */ = { isa = PBXGroup; children = ( - C7A28ED824E76DC7001FACA6 /* BetterSafariViewDemoApp.swift */, - C7A28F0024E81803001FACA6 /* Views */, - C7A28F0524E82645001FACA6 /* Models */, - C7A28EF224E7E5BC001FACA6 /* Constants.swift */, - C7A28EDC24E76DC8001FACA6 /* Assets.xcassets */, - C7A28EE124E76DC8001FACA6 /* Info.plist */, - C7A28EDE24E76DC8001FACA6 /* Preview Content */, - ); - path = BetterSafariViewDemo; + C71240062524CF40001A648E /* TitleLabel.swift */, + C71240072524CF40001A648E /* DetailButton.swift */, + C71240052524CF40001A648E /* DisclosureIndicator.swift */, + ); + path = Components; sourceTree = ""; }; - C7A28EDE24E76DC8001FACA6 /* Preview Content */ = { + C71240162524CF71001A648E /* Options */ = { isa = PBXGroup; children = ( - C7A28EDF24E76DC8001FACA6 /* Preview Assets.xcassets */, + C71240182524CF71001A648E /* WebAuthenticationSessionOptions.swift */, + C71240012524CF40001A648E /* WebAuthenticationSessionOptionsForm.swift */, ); - path = "Preview Content"; + path = Options; sourceTree = ""; }; - C7A28EE724E76E0D001FACA6 /* Frameworks */ = { + C71240212524CFAB001A648E /* Frameworks */ = { isa = PBXGroup; children = ( ); name = Frameworks; sourceTree = ""; }; - C7A28EFE24E817CE001FACA6 /* Components */ = { + C754A77B2526A9E900A2A620 /* Extensions */ = { isa = PBXGroup; children = ( - C7A28EF824E817AF001FACA6 /* TitleLabel.swift */, - C7A28EFA24E817BB001FACA6 /* DetailButton.swift */, - C7A28EFC24E817C4001FACA6 /* DisclosureIndicator.swift */, + C754A76B2526A9D100A2A620 /* View+Modify.swift */, ); - path = Components; + path = Extensions; sourceTree = ""; }; - C7A28EFF24E817DD001FACA6 /* Form */ = { + C7BA0FF42525D4A7002BC9F7 /* watchOS */ = { isa = PBXGroup; children = ( - C7A28EEA24E76EA3001FACA6 /* SafariViewOptionsForm.swift */, - C7A28EF024E7D58B001FACA6 /* WebAuthenticationSessionOptionsForm.swift */, + C7BA0FF72525D4A8002BC9F7 /* Info.plist */, ); - path = Form; + path = watchOS; sourceTree = ""; }; - C7A28F0024E81803001FACA6 /* Views */ = { + C7BA10002525D4A9002BC9F7 /* watchOS Extension */ = { isa = PBXGroup; children = ( - C7A28EF424E7E852001FACA6 /* RootView.swift */, - C7A28EEC24E76EAE001FACA6 /* NaiveSafariView.swift */, - C7A28EFF24E817DD001FACA6 /* Form */, - C7A28EFE24E817CE001FACA6 /* Components */, + C72B59632525E2680052270A /* RootView.swift */, + C7BA100C2525D4A9002BC9F7 /* Info.plist */, ); - path = Views; + path = "watchOS Extension"; + sourceTree = ""; + }; + C7EFD5092524CED600A08BEA = { + isa = PBXGroup; + children = ( + C7EFD50E2524CED600A08BEA /* Shared */, + C7EFD5182524CED800A08BEA /* iOS */, + C7EFD51F2524CED800A08BEA /* macOS */, + C7BA0FF42525D4A7002BC9F7 /* watchOS */, + C7BA10002525D4A9002BC9F7 /* watchOS Extension */, + C7EFD5172524CED800A08BEA /* Products */, + C71240212524CFAB001A648E /* Frameworks */, + ); + sourceTree = ""; + }; + C7EFD50E2524CED600A08BEA /* Shared */ = { + isa = PBXGroup; + children = ( + C7EFD50F2524CED600A08BEA /* BetterSafariViewDemoApp.swift */, + C71240112524CF69001A648E /* Constants.swift */, + C71240162524CF71001A648E /* Options */, + C754A77B2526A9E900A2A620 /* Extensions */, + C7EFD5112524CED800A08BEA /* Assets.xcassets */, + C7EFD5212524CED800A08BEA /* macOS.entitlements */, + ); + path = Shared; sourceTree = ""; }; - C7A28F0524E82645001FACA6 /* Models */ = { + C7EFD5172524CED800A08BEA /* Products */ = { isa = PBXGroup; children = ( - C7A28F0324E8263C001FACA6 /* SafariViewOptions.swift */, - C7A28F0124E82633001FACA6 /* WebAuthenticationSessionOptions.swift */, + C7EFD5162524CED800A08BEA /* BetterSafariViewDemo.app */, + C7EFD51E2524CED800A08BEA /* BetterSafariViewDemo.app */, + C7BA0FF02525D4A7002BC9F7 /* BetterSafariViewDemo.app */, + C7BA0FFC2525D4A9002BC9F7 /* BetterSafariViewDemo Extension.appex */, ); - path = Models; + name = Products; + sourceTree = ""; + }; + C7EFD5182524CED800A08BEA /* iOS */ = { + isa = PBXGroup; + children = ( + C7123FFE2524CF40001A648E /* Views */, + C7EFD5192524CED800A08BEA /* Info.plist */, + ); + path = iOS; + sourceTree = ""; + }; + C7EFD51F2524CED800A08BEA /* macOS */ = { + isa = PBXGroup; + children = ( + C7DEBCC3258DC87900690CC3 /* RootView.swift */, + C7DEBCCD258DCC7300690CC3 /* HorizontalAlignment+PreferenceLabelAlignment.swift */, + C7EFD5202524CED800A08BEA /* Info.plist */, + ); + path = macOS; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C7A28ED424E76DC7001FACA6 /* BetterSafariViewDemo */ = { + C7BA0FEF2525D4A7002BC9F7 /* BetterSafariViewDemo (watchOS) */ = { isa = PBXNativeTarget; - buildConfigurationList = C7A28EE424E76DC8001FACA6 /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo" */; + buildConfigurationList = C7BA10162525D4AA002BC9F7 /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo (watchOS)" */; buildPhases = ( - C7A28ED124E76DC7001FACA6 /* Sources */, - C7A28ED224E76DC7001FACA6 /* Frameworks */, - C7A28ED324E76DC7001FACA6 /* Resources */, + C7BA0FEE2525D4A7002BC9F7 /* Resources */, + C7BA10122525D4AA002BC9F7 /* Embed App Extensions */, ); buildRules = ( ); dependencies = ( + C7BA0FFF2525D4A9002BC9F7 /* PBXTargetDependency */, ); - name = BetterSafariViewDemo; + name = "BetterSafariViewDemo (watchOS)"; + productName = "BetterSafariViewDemo WatchKit App"; + productReference = C7BA0FF02525D4A7002BC9F7 /* BetterSafariViewDemo.app */; + productType = "com.apple.product-type.application.watchapp2"; + }; + C7BA0FFB2525D4A9002BC9F7 /* BetterSafariViewDemo (watchOS Extension) */ = { + isa = PBXNativeTarget; + buildConfigurationList = C7BA10152525D4AA002BC9F7 /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo (watchOS Extension)" */; + buildPhases = ( + C7BA0FF82525D4A9002BC9F7 /* Sources */, + C7BA0FF92525D4A9002BC9F7 /* Frameworks */, + C7BA0FFA2525D4A9002BC9F7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "BetterSafariViewDemo (watchOS Extension)"; + packageProductDependencies = ( + C72B59712525E2D60052270A /* BetterSafariView */, + ); + productName = "BetterSafariViewDemo WatchKit Extension"; + productReference = C7BA0FFC2525D4A9002BC9F7 /* BetterSafariViewDemo Extension.appex */; + productType = "com.apple.product-type.watchkit2-extension"; + }; + C7EFD5152524CED800A08BEA /* BetterSafariViewDemo (iOS) */ = { + isa = PBXNativeTarget; + buildConfigurationList = C7EFD52A2524CED800A08BEA /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo (iOS)" */; + buildPhases = ( + C7EFD5122524CED800A08BEA /* Sources */, + C7EFD5132524CED800A08BEA /* Frameworks */, + C7EFD5142524CED800A08BEA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "BetterSafariViewDemo (iOS)"; packageProductDependencies = ( - C7A28EE824E76E0D001FACA6 /* BetterSafariView */, + C71240222524CFAB001A648E /* BetterSafariView */, ); - productName = BetterSafariViewDemo; - productReference = C7A28ED524E76DC7001FACA6 /* BetterSafariViewDemo.app */; + productName = "BetterSafariViewDemo (iOS)"; + productReference = C7EFD5162524CED800A08BEA /* BetterSafariViewDemo.app */; + productType = "com.apple.product-type.application"; + }; + C7EFD51D2524CED800A08BEA /* BetterSafariViewDemo (macOS) */ = { + isa = PBXNativeTarget; + buildConfigurationList = C7EFD52D2524CED800A08BEA /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo (macOS)" */; + buildPhases = ( + C7EFD51A2524CED800A08BEA /* Sources */, + C7EFD51B2524CED800A08BEA /* Frameworks */, + C7EFD51C2524CED800A08BEA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "BetterSafariViewDemo (macOS)"; + packageProductDependencies = ( + C7DEBCBD258DC83E00690CC3 /* BetterSafariView */, + ); + productName = "BetterSafariViewDemo (macOS)"; + productReference = C7EFD51E2524CED800A08BEA /* BetterSafariViewDemo.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C7A28ECD24E76DC7001FACA6 /* Project object */ = { + C7EFD50A2524CED600A08BEA /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1200; - LastUpgradeCheck = 1200; + LastSwiftUpdateCheck = 1220; + LastUpgradeCheck = 1220; TargetAttributes = { - C7A28ED424E76DC7001FACA6 = { - CreatedOnToolsVersion = 12.0; + C7BA0FEF2525D4A7002BC9F7 = { + CreatedOnToolsVersion = 12.2; + }; + C7BA0FFB2525D4A9002BC9F7 = { + CreatedOnToolsVersion = 12.2; + }; + C7EFD5152524CED800A08BEA = { + CreatedOnToolsVersion = 12.2; + }; + C7EFD51D2524CED800A08BEA = { + CreatedOnToolsVersion = 12.2; }; }; }; - buildConfigurationList = C7A28ED024E76DC7001FACA6 /* Build configuration list for PBXProject "BetterSafariViewDemo" */; + buildConfigurationList = C7EFD50D2524CED600A08BEA /* Build configuration list for PBXProject "BetterSafariViewDemo" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; @@ -183,51 +360,207 @@ en, Base, ); - mainGroup = C7A28ECC24E76DC7001FACA6; - productRefGroup = C7A28ED624E76DC7001FACA6 /* Products */; + mainGroup = C7EFD5092524CED600A08BEA; + productRefGroup = C7EFD5172524CED800A08BEA /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C7A28ED424E76DC7001FACA6 /* BetterSafariViewDemo */, + C7EFD5152524CED800A08BEA /* BetterSafariViewDemo (iOS) */, + C7EFD51D2524CED800A08BEA /* BetterSafariViewDemo (macOS) */, + C7BA0FEF2525D4A7002BC9F7 /* BetterSafariViewDemo (watchOS) */, + C7BA0FFB2525D4A9002BC9F7 /* BetterSafariViewDemo (watchOS Extension) */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C7A28ED324E76DC7001FACA6 /* Resources */ = { + C7BA0FEE2525D4A7002BC9F7 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C7A28EE024E76DC8001FACA6 /* Preview Assets.xcassets in Resources */, - C7A28EDD24E76DC8001FACA6 /* Assets.xcassets in Resources */, + C72B59482525E1F80052270A /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C7BA0FFA2525D4A9002BC9F7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C72B595E2525E2140052270A /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C7EFD5142524CED800A08BEA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C7EFD5262524CED800A08BEA /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C7EFD51C2524CED800A08BEA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C7EFD5272524CED800A08BEA /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C7A28ED124E76DC7001FACA6 /* Sources */ = { + C7BA0FF82525D4A9002BC9F7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C7A28EF124E7D58B001FACA6 /* WebAuthenticationSessionOptionsForm.swift in Sources */, - C7A28EED24E76EAE001FACA6 /* NaiveSafariView.swift in Sources */, - C7A28EF324E7E5BC001FACA6 /* Constants.swift in Sources */, - C7A28EF524E7E852001FACA6 /* RootView.swift in Sources */, - C7A28F0224E82633001FACA6 /* WebAuthenticationSessionOptions.swift in Sources */, - C7A28EFB24E817BB001FACA6 /* DetailButton.swift in Sources */, - C7A28F0424E8263C001FACA6 /* SafariViewOptions.swift in Sources */, - C7A28EF924E817AF001FACA6 /* TitleLabel.swift in Sources */, - C7A28ED924E76DC7001FACA6 /* BetterSafariViewDemoApp.swift in Sources */, - C7A28EEB24E76EA3001FACA6 /* SafariViewOptionsForm.swift in Sources */, - C7A28EFD24E817C4001FACA6 /* DisclosureIndicator.swift in Sources */, + C72B59642525E2680052270A /* RootView.swift in Sources */, + C72B59542525E2080052270A /* WebAuthenticationSessionOptions.swift in Sources */, + C754A76E2526A9D100A2A620 /* View+Modify.swift in Sources */, + C72B59552525E2080052270A /* BetterSafariViewDemoApp.swift in Sources */, + C72B59532525E2080052270A /* Constants.swift in Sources */, + C72B59522525E2080052270A /* WebAuthenticationSessionOptionsForm.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C7EFD5122524CED800A08BEA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C712400A2524CF40001A648E /* NaiveSafariView.swift in Sources */, + C71240092524CF40001A648E /* WebAuthenticationSessionOptionsForm.swift in Sources */, + C754A76C2526A9D100A2A620 /* View+Modify.swift in Sources */, + C712401B2524CF71001A648E /* WebAuthenticationSessionOptions.swift in Sources */, + C712400C2524CF40001A648E /* DisclosureIndicator.swift in Sources */, + C7EFD5222524CED800A08BEA /* BetterSafariViewDemoApp.swift in Sources */, + C712400E2524CF40001A648E /* DetailButton.swift in Sources */, + C712400D2524CF40001A648E /* TitleLabel.swift in Sources */, + C71240082524CF40001A648E /* SafariViewOptionsForm.swift in Sources */, + C712400B2524CF40001A648E /* RootView.swift in Sources */, + C71240122524CF69001A648E /* Constants.swift in Sources */, + C71240192524CF71001A648E /* SafariViewOptions.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C7EFD51A2524CED800A08BEA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C7EFD5232524CED800A08BEA /* BetterSafariViewDemoApp.swift in Sources */, + C7DEBCCE258DCC7300690CC3 /* HorizontalAlignment+PreferenceLabelAlignment.swift in Sources */, + C712401C2524CF71001A648E /* WebAuthenticationSessionOptions.swift in Sources */, + C7DEBCC4258DC87900690CC3 /* RootView.swift in Sources */, + C7C1F8C52524D6D800B693F9 /* WebAuthenticationSessionOptionsForm.swift in Sources */, + C71240132524CF69001A648E /* Constants.swift in Sources */, + C754A76D2526A9D100A2A620 /* View+Modify.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + C7BA0FFF2525D4A9002BC9F7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C7BA0FFB2525D4A9002BC9F7 /* BetterSafariViewDemo (watchOS Extension) */; + targetProxy = C7BA0FFE2525D4A9002BC9F7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ - C7A28EE224E76DC8001FACA6 /* Debug */ = { + C7BA10102525D4AA002BC9F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-watchOS"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2765226H97; + IBSC_MODULE = BetterSafariViewDemo_Extension; + INFOPLIST_FILE = watchOS/Info.plist; + MARKETING_VERSION = 2.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.stleam.BetterSafariViewDemo; + PRODUCT_NAME = BetterSafariViewDemo; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 7.0; + }; + name = Debug; + }; + C7BA10112525D4AA002BC9F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-watchOS"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2765226H97; + IBSC_MODULE = BetterSafariViewDemo_Extension; + INFOPLIST_FILE = watchOS/Info.plist; + MARKETING_VERSION = 2.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.stleam.BetterSafariViewDemo; + PRODUCT_NAME = BetterSafariViewDemo; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 7.0; + }; + name = Release; + }; + C7BA10132525D4AA002BC9F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2765226H97; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "watchOS Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 2.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.stleam.BetterSafariViewDemo.extension; + PRODUCT_NAME = "BetterSafariViewDemo Extension"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 7.0; + }; + name = Debug; + }; + C7BA10142525D4AA002BC9F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2765226H97; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "watchOS Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 2.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.stleam.BetterSafariViewDemo.extension; + PRODUCT_NAME = "BetterSafariViewDemo Extension"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 7.0; + }; + name = Release; + }; + C7EFD5282524CED800A08BEA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -278,17 +611,15 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C7A28EE324E76DC8001FACA6 /* Release */ = { + C7EFD5292524CED800A08BEA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -333,81 +664,162 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; - SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; }; name = Release; }; - C7A28EE524E76DC8001FACA6 /* Debug */ = { + C7EFD52B2524CED800A08BEA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-iOS"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Shared/macOS.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; - DEVELOPMENT_ASSET_PATHS = "\"BetterSafariViewDemo/Preview Content\""; - DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2765226H97; ENABLE_PREVIEWS = YES; - INFOPLIST_FILE = BetterSafariViewDemo/Info.plist; + INFOPLIST_FILE = iOS/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0; + MARKETING_VERSION = 2.3.0; PRODUCT_BUNDLE_IDENTIFIER = com.stleam.BetterSafariViewDemo; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = BetterSafariViewDemo; + SDKROOT = iphoneos; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C7A28EE624E76DC8001FACA6 /* Release */ = { + C7EFD52C2524CED800A08BEA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-iOS"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Shared/macOS.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; - DEVELOPMENT_ASSET_PATHS = "\"BetterSafariViewDemo/Preview Content\""; - DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2765226H97; ENABLE_PREVIEWS = YES; - INFOPLIST_FILE = BetterSafariViewDemo/Info.plist; + INFOPLIST_FILE = iOS/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0; + MARKETING_VERSION = 2.3.0; PRODUCT_BUNDLE_IDENTIFIER = com.stleam.BetterSafariViewDemo; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = BetterSafariViewDemo; + SDKROOT = iphoneos; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C7EFD52E2524CED800A08BEA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-macOS"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Shared/macOS.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2765226H97; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = macOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 11.0; + MARKETING_VERSION = 2.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.stleam.BetterSafariViewDemo; + PRODUCT_NAME = BetterSafariViewDemo; + SDKROOT = macosx; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + C7EFD52F2524CED800A08BEA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-macOS"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Shared/macOS.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2765226H97; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = macOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 11.0; + MARKETING_VERSION = 2.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.stleam.BetterSafariViewDemo; + PRODUCT_NAME = BetterSafariViewDemo; + SDKROOT = macosx; + SWIFT_VERSION = 5.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C7A28ED024E76DC7001FACA6 /* Build configuration list for PBXProject "BetterSafariViewDemo" */ = { + C7BA10152525D4AA002BC9F7 /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo (watchOS Extension)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C7BA10132525D4AA002BC9F7 /* Debug */, + C7BA10142525D4AA002BC9F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C7BA10162525D4AA002BC9F7 /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo (watchOS)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C7BA10102525D4AA002BC9F7 /* Debug */, + C7BA10112525D4AA002BC9F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C7EFD50D2524CED600A08BEA /* Build configuration list for PBXProject "BetterSafariViewDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C7EFD5282524CED800A08BEA /* Debug */, + C7EFD5292524CED800A08BEA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C7EFD52A2524CED800A08BEA /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo (iOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( - C7A28EE224E76DC8001FACA6 /* Debug */, - C7A28EE324E76DC8001FACA6 /* Release */, + C7EFD52B2524CED800A08BEA /* Debug */, + C7EFD52C2524CED800A08BEA /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C7A28EE424E76DC8001FACA6 /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo" */ = { + C7EFD52D2524CED800A08BEA /* Build configuration list for PBXNativeTarget "BetterSafariViewDemo (macOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( - C7A28EE524E76DC8001FACA6 /* Debug */, - C7A28EE624E76DC8001FACA6 /* Release */, + C7EFD52E2524CED800A08BEA /* Debug */, + C7EFD52F2524CED800A08BEA /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -415,11 +827,19 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - C7A28EE824E76E0D001FACA6 /* BetterSafariView */ = { + C71240222524CFAB001A648E /* BetterSafariView */ = { + isa = XCSwiftPackageProductDependency; + productName = BetterSafariView; + }; + C72B59712525E2D60052270A /* BetterSafariView */ = { + isa = XCSwiftPackageProductDependency; + productName = BetterSafariView; + }; + C7DEBCBD258DC83E00690CC3 /* BetterSafariView */ = { isa = XCSwiftPackageProductDependency; productName = BetterSafariView; }; /* End XCSwiftPackageProductDependency section */ }; - rootObject = C7A28ECD24E76DC7001FACA6 /* Project object */; + rootObject = C7EFD50A2524CED600A08BEA /* Project object */; } diff --git a/Demo/BetterSafariViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Demo/BetterSafariViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/Demo/BetterSafariViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (iOS).xcscheme b/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (iOS).xcscheme new file mode 100644 index 0000000..31c1df9 --- /dev/null +++ b/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (iOS).xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (macOS).xcscheme b/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (macOS).xcscheme new file mode 100644 index 0000000..aa8e887 --- /dev/null +++ b/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (macOS).xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (watchOS).xcscheme b/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (watchOS).xcscheme new file mode 100644 index 0000000..3023fee --- /dev/null +++ b/Demo/BetterSafariViewDemo.xcodeproj/xcshareddata/xcschemes/BetterSafariViewDemo (watchOS).xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AccentColor.colorset/Contents.json b/Demo/BetterSafariViewDemo/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb87897..0000000 --- a/Demo/BetterSafariViewDemo/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Demo/BetterSafariViewDemo/Preview Content/Preview Assets.xcassets/Contents.json b/Demo/BetterSafariViewDemo/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/Demo/BetterSafariViewDemo/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Demo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json b/Demo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..2614387 --- /dev/null +++ b/Demo/Shared/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFA", + "green" : "0x94", + "red" : "0x20" + } + }, + "idiom" : "watch" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-1024px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-1024px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-1024px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-1024px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-120px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-120px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-120px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-120px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-152px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-152px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-152px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-152px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-167px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-167px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-167px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-167px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-180px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-180px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-180px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-180px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-20px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-20px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-20px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-20px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-29px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-29px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-29px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-29px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-40px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-40px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-40px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-40px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-58px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-58px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-58px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-58px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-60px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-60px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-60px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-60px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-76px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-76px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-76px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-76px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-80px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-80px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-80px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-80px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-87px.png b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-87px.png similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/BetterSafariView-87px.png rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/AppIcon-iOS-87px.png diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/Contents.json similarity index 64% rename from Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/Contents.json index 5d12e70..a1c184a 100644 --- a/Demo/BetterSafariViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Demo/Shared/Assets.xcassets/AppIcon-iOS.appiconset/Contents.json @@ -1,109 +1,109 @@ { "images" : [ { - "filename" : "BetterSafariView-40px.png", + "filename" : "AppIcon-iOS-40px.png", "idiom" : "iphone", "scale" : "2x", "size" : "20x20" }, { - "filename" : "BetterSafariView-60px.png", + "filename" : "AppIcon-iOS-60px.png", "idiom" : "iphone", "scale" : "3x", "size" : "20x20" }, { - "filename" : "BetterSafariView-58px.png", + "filename" : "AppIcon-iOS-58px.png", "idiom" : "iphone", "scale" : "2x", "size" : "29x29" }, { - "filename" : "BetterSafariView-87px.png", + "filename" : "AppIcon-iOS-87px.png", "idiom" : "iphone", "scale" : "3x", "size" : "29x29" }, { - "filename" : "BetterSafariView-80px.png", + "filename" : "AppIcon-iOS-80px.png", "idiom" : "iphone", "scale" : "2x", "size" : "40x40" }, { - "filename" : "BetterSafariView-120px.png", + "filename" : "AppIcon-iOS-120px.png", "idiom" : "iphone", "scale" : "3x", "size" : "40x40" }, { - "filename" : "BetterSafariView-120px.png", + "filename" : "AppIcon-iOS-120px.png", "idiom" : "iphone", "scale" : "2x", "size" : "60x60" }, { - "filename" : "BetterSafariView-180px.png", + "filename" : "AppIcon-iOS-180px.png", "idiom" : "iphone", "scale" : "3x", "size" : "60x60" }, { - "filename" : "BetterSafariView-20px.png", + "filename" : "AppIcon-iOS-20px.png", "idiom" : "ipad", "scale" : "1x", "size" : "20x20" }, { - "filename" : "BetterSafariView-40px.png", + "filename" : "AppIcon-iOS-40px.png", "idiom" : "ipad", "scale" : "2x", "size" : "20x20" }, { - "filename" : "BetterSafariView-29px.png", + "filename" : "AppIcon-iOS-29px.png", "idiom" : "ipad", "scale" : "1x", "size" : "29x29" }, { - "filename" : "BetterSafariView-58px.png", + "filename" : "AppIcon-iOS-58px.png", "idiom" : "ipad", "scale" : "2x", "size" : "29x29" }, { - "filename" : "BetterSafariView-40px.png", + "filename" : "AppIcon-iOS-40px.png", "idiom" : "ipad", "scale" : "1x", "size" : "40x40" }, { - "filename" : "BetterSafariView-80px.png", + "filename" : "AppIcon-iOS-80px.png", "idiom" : "ipad", "scale" : "2x", "size" : "40x40" }, { - "filename" : "BetterSafariView-76px.png", + "filename" : "AppIcon-iOS-76px.png", "idiom" : "ipad", "scale" : "1x", "size" : "76x76" }, { - "filename" : "BetterSafariView-152px.png", + "filename" : "AppIcon-iOS-152px.png", "idiom" : "ipad", "scale" : "2x", "size" : "76x76" }, { - "filename" : "BetterSafariView-167px.png", + "filename" : "AppIcon-iOS-167px.png", "idiom" : "ipad", "scale" : "2x", "size" : "83.5x83.5" }, { - "filename" : "BetterSafariView-1024px.png", + "filename" : "AppIcon-iOS-1024px.png", "idiom" : "ios-marketing", "scale" : "1x", "size" : "1024x1024" diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-128px.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-128px.png new file mode 100644 index 0000000..39dc83b Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-128px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-128px@2x.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-128px@2x.png new file mode 100644 index 0000000..245cb72 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-128px@2x.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-16px.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-16px.png new file mode 100644 index 0000000..ee61d73 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-16px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-16px@2x.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-16px@2x.png new file mode 100644 index 0000000..dbd20f8 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-16px@2x.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-256px.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-256px.png new file mode 100644 index 0000000..31b88c9 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-256px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-256px@2x.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-256px@2x.png new file mode 100644 index 0000000..f366a42 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-256px@2x.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-32px.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-32px.png new file mode 100644 index 0000000..dbd20f8 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-32px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-32x@2x.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-32x@2x.png new file mode 100644 index 0000000..6fc5da5 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-32x@2x.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-512px.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-512px.png new file mode 100644 index 0000000..f366a42 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-512px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-512x@2x.png b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-512x@2x.png new file mode 100644 index 0000000..e61b291 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/AppIcon-macOS-512x@2x.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/Contents.json b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/Contents.json new file mode 100644 index 0000000..8c9bfc1 --- /dev/null +++ b/Demo/Shared/Assets.xcassets/AppIcon-macOS.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "filename" : "AppIcon-macOS-16px.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "filename" : "AppIcon-macOS-16px@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "filename" : "AppIcon-macOS-32px.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "filename" : "AppIcon-macOS-32x@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "filename" : "AppIcon-macOS-128px.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "filename" : "AppIcon-macOS-128px@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "filename" : "AppIcon-macOS-256px.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "filename" : "AppIcon-macOS-256px@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "filename" : "AppIcon-macOS-512px.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "filename" : "AppIcon-macOS-512x@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-100px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-100px.png new file mode 100644 index 0000000..46d2fe4 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-100px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-1024px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-1024px.png new file mode 100644 index 0000000..a0bc252 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-1024px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-172px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-172px.png new file mode 100644 index 0000000..a60d836 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-172px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-196px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-196px.png new file mode 100644 index 0000000..ee24bb0 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-196px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-216px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-216px.png new file mode 100644 index 0000000..2c9f372 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-216px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-48px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-48px.png new file mode 100644 index 0000000..823f634 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-48px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-55px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-55px.png new file mode 100644 index 0000000..f0807e5 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-55px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-58px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-58px.png new file mode 100644 index 0000000..ca75ad0 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-58px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-80px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-80px.png new file mode 100644 index 0000000..ffefe8a Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-80px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-87px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-87px.png new file mode 100644 index 0000000..0c678f3 Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-87px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-88px.png b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-88px.png new file mode 100644 index 0000000..051c8ed Binary files /dev/null and b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/AppIcon-watchOS-88px.png differ diff --git a/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/Contents.json b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/Contents.json new file mode 100644 index 0000000..87c862a --- /dev/null +++ b/Demo/Shared/Assets.xcassets/AppIcon-watchOS.appiconset/Contents.json @@ -0,0 +1,92 @@ +{ + "images" : [ + { + "filename" : "AppIcon-watchOS-48px.png", + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "24x24", + "subtype" : "38mm" + }, + { + "filename" : "AppIcon-watchOS-55px.png", + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "27.5x27.5", + "subtype" : "42mm" + }, + { + "filename" : "AppIcon-watchOS-58px.png", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AppIcon-watchOS-87px.png", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "AppIcon-watchOS-80px.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "40x40", + "subtype" : "38mm" + }, + { + "filename" : "AppIcon-watchOS-88px.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "44x44", + "subtype" : "40mm" + }, + { + "filename" : "AppIcon-watchOS-100px.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "50x50", + "subtype" : "44mm" + }, + { + "filename" : "AppIcon-watchOS-172px.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "86x86", + "subtype" : "38mm" + }, + { + "filename" : "AppIcon-watchOS-196px.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "98x98", + "subtype" : "42mm" + }, + { + "filename" : "AppIcon-watchOS-216px.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "108x108", + "subtype" : "44mm" + }, + { + "filename" : "AppIcon-watchOS-1024px.png", + "idiom" : "watch-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Demo/BetterSafariViewDemo/Assets.xcassets/Contents.json b/Demo/Shared/Assets.xcassets/Contents.json similarity index 100% rename from Demo/BetterSafariViewDemo/Assets.xcassets/Contents.json rename to Demo/Shared/Assets.xcassets/Contents.json diff --git a/Demo/BetterSafariViewDemo/BetterSafariViewDemoApp.swift b/Demo/Shared/BetterSafariViewDemoApp.swift similarity index 100% rename from Demo/BetterSafariViewDemo/BetterSafariViewDemoApp.swift rename to Demo/Shared/BetterSafariViewDemoApp.swift diff --git a/Demo/BetterSafariViewDemo/Constants.swift b/Demo/Shared/Constants.swift similarity index 100% rename from Demo/BetterSafariViewDemo/Constants.swift rename to Demo/Shared/Constants.swift diff --git a/Demo/Shared/Extensions/View+Modify.swift b/Demo/Shared/Extensions/View+Modify.swift new file mode 100644 index 0000000..4efefad --- /dev/null +++ b/Demo/Shared/Extensions/View+Modify.swift @@ -0,0 +1,28 @@ +import SwiftUI + +extension View { + + @ViewBuilder + func modify(@ModifiedViewBuilder modificationBlock: (Self) -> Modified) -> some View { + + let modified = modificationBlock(self) + + if modified is EmptyView { + self + } else { + modified + } + } +} + +@_functionBuilder +struct ModifiedViewBuilder { + + static func buildBlock() -> EmptyView { + EmptyView() + } + + static func buildBlock(_ content: Content) -> Content { + content + } +} diff --git a/Demo/BetterSafariViewDemo/Models/WebAuthenticationSessionOptions.swift b/Demo/Shared/Options/WebAuthenticationSessionOptions.swift similarity index 100% rename from Demo/BetterSafariViewDemo/Models/WebAuthenticationSessionOptions.swift rename to Demo/Shared/Options/WebAuthenticationSessionOptions.swift diff --git a/Demo/BetterSafariViewDemo/Views/Form/WebAuthenticationSessionOptionsForm.swift b/Demo/Shared/Options/WebAuthenticationSessionOptionsForm.swift similarity index 58% rename from Demo/BetterSafariViewDemo/Views/Form/WebAuthenticationSessionOptionsForm.swift rename to Demo/Shared/Options/WebAuthenticationSessionOptionsForm.swift index 4e4d9dd..c75ca62 100644 --- a/Demo/BetterSafariViewDemo/Views/Form/WebAuthenticationSessionOptionsForm.swift +++ b/Demo/Shared/Options/WebAuthenticationSessionOptionsForm.swift @@ -22,24 +22,44 @@ struct WebAuthenticationSessionOptionsForm: View { Form { Section(header: Text("URL")) { TextField(gitHubAuthorizationURLString, text: $temporaryOptions.urlString) - .textContentType(.URL) - .keyboardType(.URL) - .autocapitalization(.none) + .modify { + #if os(iOS) + $0 + .textContentType(.URL) + .keyboardType(.URL) + .autocapitalization(.none) + #endif + } + .modify { + #if os(watchOS) + $0 + .textContentType(.URL) + #endif + } } Section(header: Text("Callback URL Scheme")) { TextField(gitHubCallbackURLScheme, text: $temporaryOptions.callbackURLScheme) - .textContentType(.URL) - .keyboardType(.asciiCapable) - .autocapitalization(.none) + .modify { + #if os(iOS) + $0 + .textContentType(.URL) + .keyboardType(.asciiCapable) + .autocapitalization(.none) + #endif + } + .modify { + #if os(watchOS) + $0 + .textContentType(.URL) + #endif + } } Section(header: Text("Modifiers")) { Toggle("Ephemeral Session", isOn: $temporaryOptions.prefersEphemeralWebBrowserSession) } } - .navigationTitle(Text("Session Options")) - .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Cancel") { @@ -51,8 +71,16 @@ struct WebAuthenticationSessionOptionsForm: View { options = temporaryOptions presentationMode.wrappedValue.dismiss() } + .disabled(urlIsInvalid) } } + .modify { + #if os(iOS) + $0 + .navigationTitle(Text("Session Options")) + .navigationBarTitleDisplayMode(.inline) + #endif + } } } } diff --git a/Demo/BetterSafariViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Demo/Shared/macOS.entitlements similarity index 61% rename from Demo/BetterSafariViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Demo/Shared/macOS.entitlements index 18d9810..1981043 100644 --- a/Demo/BetterSafariViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ b/Demo/Shared/macOS.entitlements @@ -2,7 +2,9 @@ - IDEDidComputeMac32BitWarning - + com.apple.security.app-sandbox + + com.apple.security.network.client + diff --git a/Demo/BetterSafariViewDemo/Info.plist b/Demo/iOS/Info.plist similarity index 98% rename from Demo/BetterSafariViewDemo/Info.plist rename to Demo/iOS/Info.plist index a2c2ff4..d4d8d80 100644 --- a/Demo/BetterSafariViewDemo/Info.plist +++ b/Demo/iOS/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - SafariView + BetterSafari CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/Demo/BetterSafariViewDemo/Views/Components/DetailButton.swift b/Demo/iOS/Views/Components/DetailButton.swift similarity index 100% rename from Demo/BetterSafariViewDemo/Views/Components/DetailButton.swift rename to Demo/iOS/Views/Components/DetailButton.swift diff --git a/Demo/BetterSafariViewDemo/Views/Components/DisclosureIndicator.swift b/Demo/iOS/Views/Components/DisclosureIndicator.swift similarity index 100% rename from Demo/BetterSafariViewDemo/Views/Components/DisclosureIndicator.swift rename to Demo/iOS/Views/Components/DisclosureIndicator.swift diff --git a/Demo/BetterSafariViewDemo/Views/Components/TitleLabel.swift b/Demo/iOS/Views/Components/TitleLabel.swift similarity index 100% rename from Demo/BetterSafariViewDemo/Views/Components/TitleLabel.swift rename to Demo/iOS/Views/Components/TitleLabel.swift diff --git a/Demo/BetterSafariViewDemo/Views/NaiveSafariView.swift b/Demo/iOS/Views/NaiveSafariView.swift similarity index 100% rename from Demo/BetterSafariViewDemo/Views/NaiveSafariView.swift rename to Demo/iOS/Views/NaiveSafariView.swift diff --git a/Demo/BetterSafariViewDemo/Models/SafariViewOptions.swift b/Demo/iOS/Views/Options/SafariViewOptions.swift similarity index 100% rename from Demo/BetterSafariViewDemo/Models/SafariViewOptions.swift rename to Demo/iOS/Views/Options/SafariViewOptions.swift diff --git a/Demo/BetterSafariViewDemo/Views/Form/SafariViewOptionsForm.swift b/Demo/iOS/Views/Options/SafariViewOptionsForm.swift similarity index 98% rename from Demo/BetterSafariViewDemo/Views/Form/SafariViewOptionsForm.swift rename to Demo/iOS/Views/Options/SafariViewOptionsForm.swift index 21ccf46..2b2c0e9 100644 --- a/Demo/BetterSafariViewDemo/Views/Form/SafariViewOptionsForm.swift +++ b/Demo/iOS/Views/Options/SafariViewOptionsForm.swift @@ -80,6 +80,7 @@ struct SafariViewOptionsForm: View { options = temporaryOptions presentationMode.wrappedValue.dismiss() } + .disabled(urlIsInvalid) } } } diff --git a/Demo/BetterSafariViewDemo/Views/RootView.swift b/Demo/iOS/Views/RootView.swift similarity index 100% rename from Demo/BetterSafariViewDemo/Views/RootView.swift rename to Demo/iOS/Views/RootView.swift diff --git a/Demo/macOS/HorizontalAlignment+PreferenceLabelAlignment.swift b/Demo/macOS/HorizontalAlignment+PreferenceLabelAlignment.swift new file mode 100644 index 0000000..d3036d7 --- /dev/null +++ b/Demo/macOS/HorizontalAlignment+PreferenceLabelAlignment.swift @@ -0,0 +1,11 @@ +import SwiftUI + +extension HorizontalAlignment { + private enum PreferenceLabelAlignment: AlignmentID { + static func defaultValue(in context: ViewDimensions) -> CGFloat { + context[HorizontalAlignment.center] + } + } + + static let preferenceLabel = HorizontalAlignment(PreferenceLabelAlignment.self) +} diff --git a/Demo/macOS/Info.plist b/Demo/macOS/Info.plist new file mode 100644 index 0000000..f15d7ce --- /dev/null +++ b/Demo/macOS/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + + diff --git a/Demo/macOS/RootView.swift b/Demo/macOS/RootView.swift new file mode 100644 index 0000000..4669044 --- /dev/null +++ b/Demo/macOS/RootView.swift @@ -0,0 +1,81 @@ +import SwiftUI +import BetterSafariView + +struct RootView: View { + + @State private var webAuthenticationSessionOptions = WebAuthenticationSessionOptions() + @State private var showingWebAuthenticationSession = false + @State private var webAuthenticationSessionCallbackURL: URL? = nil + + private var urlIsInvalid: Bool { + (webAuthenticationSessionOptions.url == nil) || !["http", "https"].contains(webAuthenticationSessionOptions.url?.scheme) + } + + var body: some View { + VStack(alignment: .trailing) { + GroupBox(label: Text("WebAuthenticationSession")) { + VStack(alignment: .preferenceLabel) { + HStack { + Text("URL:") + TextField(gitHubAuthorizationURLString, text: $webAuthenticationSessionOptions.urlString) + .frame(maxWidth: 240) + .alignmentGuide(.preferenceLabel, computeValue: { $0[.leading] }) + } + HStack { + Text("Callback URL Scheme:") + TextField(gitHubAuthorizationURLString, text: $webAuthenticationSessionOptions.callbackURLScheme) + .frame(maxWidth: 240) + .alignmentGuide(.preferenceLabel, computeValue: { $0[.leading] }) + } + HStack { + Text("Modifiers:") + Toggle("Ephemeral Session", isOn: $webAuthenticationSessionOptions.prefersEphemeralWebBrowserSession) + .alignmentGuide(.preferenceLabel, computeValue: { $0[.leading] }) + } + Spacer() + } + .padding() + .frame(maxWidth: .infinity, maxHeight: .infinity) + } + Button(action: { showingWebAuthenticationSession = true }) { + Text("Start Session") + } + .keyboardShortcut(.defaultAction) + .disabled(urlIsInvalid) + // Capture `webAuthenticationSessionOptions` to fix an issue + // where SwiftUI doesn't pass the latest value to the modifier. + // https://developer.apple.com/documentation/swiftui/view/onchange(of:perform:) + .webAuthenticationSession( + isPresented: $showingWebAuthenticationSession + ) { [webAuthenticationSessionOptions] in + WebAuthenticationSession( + url: webAuthenticationSessionOptions.url!, + callbackURLScheme: webAuthenticationSessionOptions.callbackURLScheme + ) { callbackURL, error in + webAuthenticationSessionCallbackURL = callbackURL + } + .prefersEphemeralWebBrowserSession(webAuthenticationSessionOptions.prefersEphemeralWebBrowserSession) + } + .alert(item: $webAuthenticationSessionCallbackURL) { callbackURL in + Alert( + title: Text("Session Completed with Callback URL"), + message: Text(callbackURL.absoluteString), + dismissButton: nil + ) + } + } + .padding() + .frame(width: 480, height: 320) + .toolbar { + ToolbarItem(placement: .automatic) { + Spacer() + } + } + } +} + +struct RootView_Previews: PreviewProvider { + static var previews: some View { + RootView() + } +} diff --git a/Demo/watchOS Extension/Info.plist b/Demo/watchOS Extension/Info.plist new file mode 100644 index 0000000..a5c543b --- /dev/null +++ b/Demo/watchOS Extension/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + BetterSafariViewDemo Extension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSExtension + + NSExtensionAttributes + + WKAppBundleIdentifier + com.stleam.BetterSafariViewDemo + + NSExtensionPointIdentifier + com.apple.watchkit + + WKWatchOnly + + + diff --git a/Demo/watchOS Extension/RootView.swift b/Demo/watchOS Extension/RootView.swift new file mode 100644 index 0000000..7259ed5 --- /dev/null +++ b/Demo/watchOS Extension/RootView.swift @@ -0,0 +1,52 @@ +import SwiftUI +import BetterSafariView + +struct RootView: View { + + @State private var webAuthenticationSessionOptions = WebAuthenticationSessionOptions() + @State private var showingWebAuthenticationSession = false + @State private var showingWebAuthenticationSessionOptionsForm = false + @State private var webAuthenticationSessionCallbackURL: URL? = nil + + var body: some View { + NavigationView { + List { + Section(header: Text("WebAuthenticationSession").textCase(nil)) { + Button(action: { showingWebAuthenticationSession = true }) { + Text("Start Session") + } + .webAuthenticationSession(isPresented: $showingWebAuthenticationSession) { + WebAuthenticationSession( + url: webAuthenticationSessionOptions.url!, + callbackURLScheme: webAuthenticationSessionOptions.callbackURLScheme + ) { callbackURL, error in + webAuthenticationSessionCallbackURL = callbackURL + } + .prefersEphemeralWebBrowserSession(webAuthenticationSessionOptions.prefersEphemeralWebBrowserSession) + } + .alert(item: $webAuthenticationSessionCallbackURL) { callbackURL in + Alert( + title: Text("Session Completed with Callback URL"), + message: Text(callbackURL.absoluteString), + dismissButton: nil + ) + } + + Button(action: { showingWebAuthenticationSessionOptionsForm = true }) { + Text("Options") + } + .sheet(isPresented: $showingWebAuthenticationSessionOptionsForm) { + WebAuthenticationSessionOptionsForm(options: $webAuthenticationSessionOptions) + } + } + } + .navigationTitle(Text("BetterSafari")) + } + } +} + +struct RootView_Previews: PreviewProvider { + static var previews: some View { + RootView() + } +} diff --git a/Demo/watchOS/Info.plist b/Demo/watchOS/Info.plist new file mode 100644 index 0000000..9b81e1f --- /dev/null +++ b/Demo/watchOS/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + BetterSafari + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + WKWatchKitApp + + + diff --git a/Docs/Images/BetterSafariViewDemo-RootView.png b/Docs/Images/BetterSafariViewDemo-iOS.png similarity index 100% rename from Docs/Images/BetterSafariViewDemo-RootView.png rename to Docs/Images/BetterSafariViewDemo-iOS.png diff --git a/Docs/Images/BetterSafariViewDemo-macOS.png b/Docs/Images/BetterSafariViewDemo-macOS.png new file mode 100644 index 0000000..a4a8105 Binary files /dev/null and b/Docs/Images/BetterSafariViewDemo-macOS.png differ diff --git a/Docs/Images/BetterSafariViewDemo-watchOS.png b/Docs/Images/BetterSafariViewDemo-watchOS.png new file mode 100644 index 0000000..6d0cd60 Binary files /dev/null and b/Docs/Images/BetterSafariViewDemo-watchOS.png differ diff --git a/Package.swift b/Package.swift index a97cca1..2ff047a 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( name: "BetterSafariView", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v13), .macOS(.v10_15), .watchOS("6.2")], products: [ .library(name: "BetterSafariView", targets: ["BetterSafariView"]) ], diff --git a/README.md b/README.md index 2afa331..9a70950 100644 --- a/README.md +++ b/README.md @@ -5,22 +5,29 @@

- version + version - Swift: 5.1+ + Swift: 5.1+ - iOS: 13.0+ + iOS: 13.0+ + + macOS: 10.15+ + + + watchOS: 6.2+ + +
- SwiftPM: compatible + SwiftPM: compatible - license + license - contact: @stleamist + contact: @stleamist

@@ -31,11 +38,11 @@ A better way to present a SFSafariViewController or start a ASWebAuthenticationS ## Contents - [Motivation](#motivation) +- [Requirements](#requirements) - [Usage](#usage) - [SafariView](#safariview) - [WebAuthenticationSession](#webauthenticationsession) - [Known Issues](#known-issues) -- [Requirements](#requirements) - [Installation](#installation) - [Swift Package Manager](#swift-package-manager) - [Xcode](#xcode) @@ -53,19 +60,24 @@ However, there’s a problem in this approach: it can’t present the `SFSafariV `BetterSafariView` clearly achieves this goal by hosting a simple `UIViewController` to present a `SFSafariViewController` as a view’s background. In this way, a [`ASWebAuthenticationSession`](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession) is also able to be started without any issue in SwiftUI. +## Requirements +- Xcode 11.0+ +- Swift 5.1+ + +#### SafariView +- iOS 13.0+ +- Mac Catalyst 13.0+ + +#### WebAuthenticationSession +- iOS 13.0+ +- Mac Catalyst 13.0+ +- macOS 10.15+ +- watchOS 6.2+ + ## Usage With the following modifiers, you can use it in a similar way to present a sheet. ### SafariView -#### Modifiers -```swift -.safariView(isPresented:onDismiss:content:) -``` - -```swift -.safariView(item:onDismiss:content:) -``` - #### Example ```swift import SwiftUI @@ -97,16 +109,81 @@ struct ContentView: View { } ``` -### WebAuthenticationSession -#### Modifiers +#### `View` Modifiers +
+safariView(isPresented:onDismiss:content:) + +```swift +/// Presents a Safari view when a given condition is true. +func safariView( + isPresented: Binding, + onDismiss: (() -> Void)? = nil, + content: @escaping () -> SafariView +) -> some View +``` +
+ +
+safariView(item:onDismiss:content:) + +```swift +/// Presents a Safari view using the given item as a data source for the `SafariView` to present. +func safariView( + item: Binding, + onDismiss: (() -> Void)? = nil, + content: @escaping (Item) -> SafariView +) -> some View +``` +
+ +#### `SafariView` Initializers +
+init(url:) + +```swift +/// Creates a Safari view that loads the specified URL. +init(url: URL) +``` +
+ +
+init(url:configuration:) + +```swift +/// Creates and configures a Safari view that loads the specified URL. +init(url: URL, configuration: SafariView.Configuration) +``` +
+ +#### `SafariView` Modifiers +
+preferredBarAccentColor(_:) + ```swift -.webAuthenticationSession(isPresented:content:) +/// Sets the accent color for the background of the navigation bar and the toolbar. +func preferredBarAccentColor(_ color: Color?) -> SafariView ``` +
+ +
+preferredControlAccentColor(_:) ```swift -.webAuthenticationSession(item:content:) +/// Sets the accent color for the control buttons on the navigation bar and the toolbar. +func preferredControlAccentColor(_ color: Color?) -> SafariView ``` +
+ +
+dismissButtonStyle(_:) +```swift +/// Sets the style of dismiss button to use in the navigation bar to close `SafariView`. +func dismissButtonStyle(_ style: SafariView.DismissButtonStyle) -> SafariView +``` +
+ +### WebAuthenticationSession #### Example ```swift import SwiftUI @@ -135,19 +212,77 @@ struct ContentView: View { } ``` +#### `View` Modifiers +
+webAuthenticationSession(isPresented:content:) + +```swift +/// Starts a web authentication session when a given condition is true. +func webAuthenticationSession( + isPresented: Binding, + content: @escaping () -> WebAuthenticationSession +) -> some View +``` +
+ +
+webAuthenticationSession(item:content:) + +```swift +/// Starts a web authentication session using the given item as a data source for the `WebAuthenticationSession` to start. +func webAuthenticationSession( + item: Binding, + content: @escaping (Item) -> WebAuthenticationSession +) -> some View +``` +
+ +#### `WebAuthenticationSession` Initializers +
+init(url:callbackURLScheme:completionHandler:) + +```swift +/// Creates a web authentication session instance. +init( + url: URL, + callbackURLScheme: String?, + completionHandler: @escaping (URL?, Error?) -> Void +) +``` +
+ +
+init(url:callbackURLScheme:onCompletion:) + +```swift +/// Creates a web authentication session instance. +init( + url: URL, + callbackURLScheme: String?, + onCompletion: @escaping (Result) -> Void +) +``` +
+ +#### `WebAuthenticationSession` Modifier +
+prefersEphemeralWebBrowserSession(_:) + +```swift +/// Configures whether the session should ask the browser for a private authentication session. +func prefersEphemeralWebBrowserSession(_ prefersEphemeralWebBrowserSession: Bool) -> WebAuthenticationSession +``` +
+ ## Known Issues - In `.webAuthenticationSession(item:content:)` modifier, the functionality that replaces a session on the `item`'s identity change is not implemented, as there is no non-hacky way to be notified when the session's dismissal animation is completed. -## Requirements -- Swift 5.1+ -- iOS 13.0+ - ## Installation ### Swift Package Manager Add the following line to the `dependencies` in your [`Package.swift`](https://developer.apple.com/documentation/swift_packages/package) file: ```swift -.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.2")) +.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.3.0")) ``` Next, add `BetterSafariView` as a dependency for your targets: @@ -166,7 +301,7 @@ import PackageDescription let package = Package( name: "MyPackage", dependencies: [ - .package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.2")) + .package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.3.0")) ], targets: [ .target(name: "MyTarget", dependencies: ["BetterSafariView"]) @@ -185,11 +320,15 @@ https://github.com/stleamist/BetterSafariView.git For more details, see [Adding Package Dependencies to Your App](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). ## Demo - +

+ + + +

-You can compare the behavior of BetterSafariView with the other ways above in the demo project. Check out the demo app by opening BetterSafariView.xcworkspace. +You can see how it works on each platform and compare it with the other naive implementations in the demo project. Check out the demo app by opening BetterSafariView.xcworkspace. -**NOTE:** This demo project is designed for iOS 14.0+, though the package is compatible with iOS 13.0+. +**NOTE:** This demo project is available for iOS 14.0+, macOS 11.0+, and watchOS 7.0+, while the package is compatible with iOS 13.0+, macOS 10.15+, and watchOS 6.2+. ## License BetterSafariView is released under the MIT license. See [LICENSE](/LICENSE) for details. diff --git a/Sources/BetterSafariView/SafariView/SafariView+View.swift b/Sources/BetterSafariView/SafariView/SafariView+View.swift index 747b8eb..20ea602 100644 --- a/Sources/BetterSafariView/SafariView/SafariView+View.swift +++ b/Sources/BetterSafariView/SafariView/SafariView+View.swift @@ -1,10 +1,13 @@ +#if os(iOS) + import SwiftUI import SafariServices // A `View` conformance for the advanced usage. extension SafariView: View { - #if compiler(>=5.3) + // There is a bug on Xcode 12.0 (Swift 5.3.0) where `ignoresSafeArea(_:edges:)` is missing for Mac Catalyst target. + #if compiler(>=5.3.1) || (compiler(>=5.3) && !targetEnvironment(macCatalyst)) // To apply `ignoresSafeArea(_:edges:)` modifier to the `UIViewRepresentable`, // define nested `Representable` struct and wrap it with `View`. @@ -76,3 +79,5 @@ extension SafariView { } } } + +#endif diff --git a/Sources/BetterSafariView/SafariView/SafariView.swift b/Sources/BetterSafariView/SafariView/SafariView.swift index 912488b..10f9052 100644 --- a/Sources/BetterSafariView/SafariView/SafariView.swift +++ b/Sources/BetterSafariView/SafariView/SafariView.swift @@ -1,3 +1,5 @@ +#if os(iOS) + import SwiftUI import SafariServices @@ -27,6 +29,7 @@ import SafariServices /// public struct SafariView { + /// A configuration object that defines how a Safari view controller should be initialized. public typealias Configuration = SFSafariViewController.Configuration public typealias DismissButtonStyle = SFSafariViewController.DismissButtonStyle @@ -45,7 +48,7 @@ public struct SafariView { /// - url: The URL to navigate to. The URL must use the http or https scheme. /// - configuration: The configuration for the new view controller. /// - public init(url: URL, configuration: SFSafariViewController.Configuration = .init()) { + public init(url: URL, configuration: Configuration = .init()) { self.url = url self.configuration = configuration } @@ -56,7 +59,8 @@ public struct SafariView { var preferredControlTintColor: UIColor? var dismissButtonStyle: DismissButtonStyle = .done - #if compiler(>=5.3) + // There is a bug on Xcode 12.0 (Swift 5.3.0) where `UIColor.init(_ color: Color)` is missing for Mac Catalyst target. + #if compiler(>=5.3.1) || (compiler(>=5.3) && !targetEnvironment(macCatalyst)) /// Sets the accent color for the background of the navigation bar and the toolbar. /// @@ -161,3 +165,5 @@ public extension SafariView.Configuration { self.barCollapsingEnabled = barCollapsingEnabled } } + +#endif diff --git a/Sources/BetterSafariView/SafariView/SafariViewPresentationModifier.swift b/Sources/BetterSafariView/SafariView/SafariViewPresentationModifier.swift index ce2dff2..8adca32 100644 --- a/Sources/BetterSafariView/SafariView/SafariViewPresentationModifier.swift +++ b/Sources/BetterSafariView/SafariView/SafariViewPresentationModifier.swift @@ -1,3 +1,5 @@ +#if os(iOS) + import SwiftUI struct SafariViewPresentationModifier: ViewModifier { @@ -95,3 +97,5 @@ public extension View { ) } } + +#endif diff --git a/Sources/BetterSafariView/SafariView/SafariViewPresenter.swift b/Sources/BetterSafariView/SafariView/SafariViewPresenter.swift index 48e91cb..c024dfc 100644 --- a/Sources/BetterSafariView/SafariView/SafariViewPresenter.swift +++ b/Sources/BetterSafariView/SafariView/SafariViewPresenter.swift @@ -1,3 +1,5 @@ +#if os(iOS) + import SwiftUI import SafariServices @@ -126,3 +128,5 @@ extension SafariViewPresenter { } } } + +#endif diff --git a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresentationModifier.swift b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresentationModifier.swift index 000fa56..e4f0023 100644 --- a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresentationModifier.swift +++ b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresentationModifier.swift @@ -1,3 +1,5 @@ +#if os(iOS) || os(macOS) || os(watchOS) + import SwiftUI struct WebAuthenticationPresentationModifier: ViewModifier { @@ -91,3 +93,5 @@ public extension View { ) } } + +#endif diff --git a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift index 277eeb2..1975e33 100644 --- a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift +++ b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift @@ -1,31 +1,86 @@ +#if os(iOS) || os(macOS) || os(watchOS) + import SwiftUI -import SafariServices import AuthenticationServices +#if os(iOS) +import SafariServices +#endif -struct WebAuthenticationPresenter: UIViewControllerRepresentable { +#if os(iOS) +typealias ConcreteViewController = UIViewController +typealias ViewController = UIViewController +typealias ViewControllerRepresentable = UIViewControllerRepresentable +#elseif os(macOS) +typealias ConcreteViewController = NSTabViewController +typealias ViewController = NSViewController +typealias ViewControllerRepresentable = NSViewControllerRepresentable +#elseif os(watchOS) +// Use `WKInterfaceInlineMovie` as a concrete interface objct type, +// since there is no public initializer for `WKInterfaceObject`. +typealias ConcreteViewController = WKInterfaceInlineMovie +typealias ViewController = WKInterfaceObject +typealias ViewControllerRepresentable = WKInterfaceObjectRepresentable +#endif + +struct WebAuthenticationPresenter: ViewControllerRepresentable { // MARK: Representation @Binding var item: Item? var representationBuilder: (Item) -> WebAuthenticationSession - // MARK: UIViewControllerRepresentable + // MARK: ViewControllerRepresentable func makeCoordinator() -> Coordinator { return Coordinator(parent: self) } - func makeUIViewController(context: Context) -> UIViewController { - return context.coordinator.uiViewController + #if os(iOS) + + func makeUIViewController(context: Context) -> ViewController { + return makeViewController(context: context) } - func updateUIViewController(_ uiViewController: UIViewController, context: Context) { + func updateUIViewController(_ uiViewController: ViewController, context: Context) { + + updateViewController(uiViewController, context: context) // To set a delegate for the presentation controller of an `SFAuthenticationViewController` as soon as possible, // check the view controller presented by `uiViewController` then set it as a delegate on every view updates. // INFO: `SFAuthenticationViewController` is a private subclass of `SFSafariViewController`. - context.coordinator.setInteractiveDismissalDelegateIfPossible() - + guard #available(iOS 14.0, *) else { + context.coordinator.setInteractiveDismissalDelegateIfPossible() + return + } + } + + #elseif os(macOS) + + func makeNSViewController(context: Context) -> ViewController { + return makeViewController(context: context) + } + + func updateNSViewController(_ nsViewController: ViewController, context: Context) { + updateViewController(nsViewController, context: context) + } + + #elseif os(watchOS) + + func makeWKInterfaceObject(context: Context) -> ViewController { + return makeViewController(context: context) + } + + func updateWKInterfaceObject(_ wkInterfaceObject: ViewController, context: Context) { + updateViewController(wkInterfaceObject, context: context) + } + + #endif + + private func makeViewController(context: Context) -> ViewController { + return context.coordinator.viewController + } + + private func updateViewController(_ viewController: ViewController, context: Context) { // Keep the coordinator updated with a new presenter struct. context.coordinator.parent = self context.coordinator.item = item @@ -34,7 +89,7 @@ struct WebAuthenticationPresenter: UIViewControllerRepresent extension WebAuthenticationPresenter { - class Coordinator: NSObject, ASWebAuthenticationPresentationContextProviding, UIAdaptivePresentationControllerDelegate { + class Coordinator: NSObject { // MARK: Parent Copying @@ -46,7 +101,7 @@ extension WebAuthenticationPresenter { // MARK: View Controller Holding - let uiViewController = UIViewController() + let viewController = ConcreteViewController() private var session: ASWebAuthenticationSession? // MARK: Item Handling @@ -84,7 +139,11 @@ extension WebAuthenticationPresenter { representation.completionHandler(callbackURL, error) } ) - session.presentationContextProvider = self + + #if os(iOS) || os(macOS) + session.presentationContextProvider = presentationContextProvider + #endif + representation.applyModification(to: session) self.session = session @@ -102,32 +161,71 @@ extension WebAuthenticationPresenter { parent.item = nil } - // MARK: ASWebAuthenticationPresentationContextProviding + #if os(iOS) || os(macOS) + + // MARK: PresentationContextProvider // INFO: `ASWebAuthenticationPresentationContextProviding` provides an window // to present an `SFAuthenticationViewController`, and usually presents the `SFAuthenticationViewController` // by calling `present(_:animated:completion:)` method from a root view controller of the window. - func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { - return uiViewController.view.window! + private lazy var presentationContextProvider = PresentationContextProvider(coordinator: self) + + class PresentationContextProvider: NSObject, ASWebAuthenticationPresentationContextProviding { + + weak var coordinator: WebAuthenticationPresenter.Coordinator? + + init(coordinator: WebAuthenticationPresenter.Coordinator) { + self.coordinator = coordinator + } + + // MARK: ASWebAuthenticationPresentationContextProviding + + func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { + return coordinator!.viewController.view.window! + } } - // MARK: UIAdaptivePresentationControllerDelegate + #endif + + #if os(iOS) + + // MARK: InteractiveDismissalDelegate // There is a problem that `item` is not set to `nil` after the sheet is dismissed with pulling down - // because the completion handler is not called on this case due to a system bug. - // To resolve this issue, set `Coordinator` as a presentation controller delegate of `SFAuthenticationViewController` - // so that ensures the completion handler is always called. + // because the completion handler is not called on this case due to a system bug on iOS 13. + // To resolve this issue, set `interactiveDismissalDelegate` as a presentation controller delegate of + // `SFAuthenticationViewController` so that ensures the completion handler is always called. + + @available(iOS, introduced: 13.0, deprecated: 14.0) + private lazy var interactiveDismissalDelegate = InteractiveDismissalDelegate(coordinator: self) + @available(iOS, introduced: 13.0, deprecated: 14.0) func setInteractiveDismissalDelegateIfPossible() { - guard let safariViewController = uiViewController.presentedViewController as? SFSafariViewController else { + guard let safariViewController = viewController.presentedViewController as? SFSafariViewController else { return } - safariViewController.presentationController?.delegate = self + safariViewController.presentationController?.delegate = interactiveDismissalDelegate } - func presentationControllerDidDismiss(_ presentationController: UIPresentationController) { - resetItemBinding() + @available(iOS, introduced: 13.0, deprecated: 14.0) + class InteractiveDismissalDelegate: NSObject, UIAdaptivePresentationControllerDelegate { + + weak var coordinator: WebAuthenticationPresenter.Coordinator? + + init(coordinator: WebAuthenticationPresenter.Coordinator) { + self.coordinator = coordinator + } + + // MARK: UIAdaptivePresentationControllerDelegate + + func presentationControllerDidDismiss(_ presentationController: UIPresentationController) { + coordinator?.resetItemBinding() + } } + + #endif } } + +#endif diff --git a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationSession.swift b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationSession.swift index d0e7d84..4c8b9d0 100644 --- a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationSession.swift +++ b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationSession.swift @@ -1,5 +1,6 @@ +#if os(iOS) || os(macOS) || os(watchOS) + import SwiftUI -import SafariServices import AuthenticationServices // Used for getting a public completion handler to inject an assignment that sets `item` to `nil`. @@ -97,5 +98,10 @@ public struct WebAuthenticationSession { } } +/// Errors that a web authentication session can generate. public typealias WebAuthenticationSessionError = ASWebAuthenticationSessionError + +/// The error domain for a web authentication session. public let WebAuthenticationSessionErrorDomain = ASWebAuthenticationSessionErrorDomain + +#endif