From cbd4b7acef1d51d2fc3d5b2a0b5046750d741098 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Thu, 19 Jan 2023 18:33:22 +0100 Subject: [PATCH] Fix share extension --- IceCubesApp.xcodeproj/project.pbxproj | 10 ++++++---- IceCubesShareExtension/Info.plist | 4 ++-- IceCubesShareExtension/ShareViewController.swift | 6 ++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/IceCubesApp.xcodeproj/project.pbxproj b/IceCubesApp.xcodeproj/project.pbxproj index 41664ae9..5df0ea73 100644 --- a/IceCubesApp.xcodeproj/project.pbxproj +++ b/IceCubesApp.xcodeproj/project.pbxproj @@ -43,9 +43,11 @@ 9F7335EF29674F7100AFF0BA /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F7335EE29674F7100AFF0BA /* QuickLook.framework */; }; 9F7335F22967608F00AFF0BA /* AddRemoteTimelineVIew.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7335F12967608F00AFF0BA /* AddRemoteTimelineVIew.swift */; }; 9F7335F92968576500AFF0BA /* DisplaySettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7335F82968576500AFF0BA /* DisplaySettingsView.swift */; }; + 9F8CA5972979B61100481E8E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = E9B576C529743F4C00BCE646 /* Localizable.strings */; }; + 9F8CA5982979B63D00481E8E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = E9B576C529743F4C00BCE646 /* Localizable.strings */; }; 9FAD85832971BF7200496AB1 /* Secret.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9FAD85822971BF7200496AB1 /* Secret.plist */; }; 9FAD858B29743F7400496AB1 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FAD858A29743F7400496AB1 /* ShareViewController.swift */; }; - 9FAD858E29743F7400496AB1 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9FAD858C29743F7400496AB1 /* MainInterface.storyboard */; }; + 9FAD858E29743F7400496AB1 /* (null) in Resources */ = {isa = PBXBuildFile; }; 9FAD859229743F7400496AB1 /* IceCubesShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 9FAD858829743F7400496AB1 /* IceCubesShareExtension.appex */; platformFilter = ios; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 9FAD85982974405D00496AB1 /* Status in Frameworks */ = {isa = PBXBuildFile; productRef = 9FAD85972974405D00496AB1 /* Status */; }; 9FAD859A297440CB00496AB1 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 9FAD8599297440CB00496AB1 /* KeychainSwift */; }; @@ -139,7 +141,6 @@ 9FAD85822971BF7200496AB1 /* Secret.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Secret.plist; sourceTree = ""; }; 9FAD858829743F7400496AB1 /* IceCubesShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = IceCubesShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 9FAD858A29743F7400496AB1 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; - 9FAD858D29743F7400496AB1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; 9FAD858F29743F7400496AB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9FAD859629743F7E00496AB1 /* IceCubesShareExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = IceCubesShareExtension.entitlements; sourceTree = ""; }; 9FAD85A7297582F100496AB1 /* QuickLookRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickLookRepresentable.swift; sourceTree = ""; }; @@ -257,7 +258,6 @@ children = ( 9FAD859629743F7E00496AB1 /* IceCubesShareExtension.entitlements */, 9FAD858A29743F7400496AB1 /* ShareViewController.swift */, - 9FAD858C29743F7400496AB1 /* MainInterface.storyboard */, 9FAD858F29743F7400496AB1 /* Info.plist */, ); path = IceCubesShareExtension; @@ -493,6 +493,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9F8CA5982979B63D00481E8E /* Localizable.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -500,7 +501,8 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9FAD858E29743F7400496AB1 /* MainInterface.storyboard in Resources */, + 9FAD858E29743F7400496AB1 /* (null) in Resources */, + 9F8CA5972979B61100481E8E /* Localizable.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/IceCubesShareExtension/Info.plist b/IceCubesShareExtension/Info.plist index 48ab9005..56c1137f 100644 --- a/IceCubesShareExtension/Info.plist +++ b/IceCubesShareExtension/Info.plist @@ -4,6 +4,8 @@ NSExtension + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).ShareViewController NSExtensionAttributes NSExtensionActivationRule @@ -18,8 +20,6 @@ 1 - NSExtensionMainStoryboard - MainInterface NSExtensionPointIdentifier com.apple.share-services diff --git a/IceCubesShareExtension/ShareViewController.swift b/IceCubesShareExtension/ShareViewController.swift index 6abda4e3..7c0436c5 100644 --- a/IceCubesShareExtension/ShareViewController.swift +++ b/IceCubesShareExtension/ShareViewController.swift @@ -8,8 +8,6 @@ import SwiftUI import UIKit class ShareViewController: UIViewController { - @IBOutlet var container: UIView! - override func viewDidLoad() { super.viewDidLoad() @@ -36,8 +34,8 @@ class ShareViewController: UIViewController { .preferredColorScheme(colorScheme == .light ? .light : .dark) let childView = UIHostingController(rootView: view) addChild(childView) - childView.view.frame = container.bounds - container.addSubview(childView.view) + childView.view.frame = self.view.bounds + self.view.addSubview(childView.view) childView.didMove(toParent: self) } }