├── ObjCParentApp ├── Assets.xcassets │ ├── Contents.json │ ├── AccentColor.colorset │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── OCPAViewController.h ├── OCPAAppDelegate.h ├── OCPASceneDelegate.h ├── OCPAViewController.m ├── main.m ├── OCPAAppDelegate.m ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── OCPASceneDelegate.m ├── SwiftChildWidget ├── Assets.xcassets │ ├── Contents.json │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── WidgetBackground.colorset │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── Swift-Bridging-Header.h ├── Info.plist ├── SwiftChildWidget.intentdefinition └── SwiftChildWidget.swift ├── ObjCParentApp.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── project.pbxproj ├── Shared Code ├── OCPAItem.m ├── OCPAItem.h ├── OCPADataModel.h └── OCPADataModel.m └── README.md /ObjCParentApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SwiftChildWidget/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ObjCParentApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Shared Code/OCPAItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCPAItem.m 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import "OCPAItem.h" 9 | 10 | @implementation OCPAItem 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /ObjCParentApp/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SwiftChildWidget/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SwiftChildWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ObjCParentApp/OCPAViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import 9 | 10 | @interface OCPAViewController : UIViewController 11 | 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /ObjCParentApp/OCPAAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import 9 | 10 | @interface OCPAAppDelegate : UIResponder 11 | 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /ObjCParentApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ObjCParentApp/OCPASceneDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.h 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import 9 | 10 | @interface OCPASceneDelegate : UIResponder 11 | 12 | @property (strong, nonatomic) UIWindow * window; 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Shared Code/OCPAItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCPAItem.h 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | @import UIKit; 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface OCPAItem : NSObject 13 | 14 | @property UIImage *image; 15 | @property NSString *text; 16 | @property UIColor *color; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /Shared Code/OCPADataModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCPADataModel.h 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @class OCPAItem; 13 | @interface OCPADataModel : NSObject 14 | 15 | @property NSArray *items; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /SwiftChildWidget/Swift-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Swift-Bridging-Header.h 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #ifndef Swift_Bridging_Header_h 9 | #define Swift_Bridging_Header_h 10 | 11 | #import "OCPAConfigurationIntent.h" 12 | 13 | #import "OCPADataModel.h" 14 | #import "OCPAItem.h" 15 | 16 | #endif /* Swift_Bridging_Header_h */ 17 | -------------------------------------------------------------------------------- /ObjCParentApp/OCPAViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import "OCPAViewController.h" 9 | 10 | @interface OCPAViewController () 11 | 12 | @end 13 | 14 | @implementation OCPAViewController 15 | 16 | - (void)viewDidLoad { 17 | [super viewDidLoad]; 18 | // Do any additional setup after loading the view. 19 | } 20 | 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ObjCParentApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import 9 | #import "OCPAAppDelegate.h" 10 | 11 | int main(int argc, char * argv[]) { 12 | NSString * appDelegateClassName; 13 | @autoreleasepool { 14 | // Setup code that might create autoreleased objects goes here. 15 | appDelegateClassName = NSStringFromClass([OCPAAppDelegate class]); 16 | } 17 | return UIApplicationMain(argc, argv, nil, appDelegateClassName); 18 | } 19 | -------------------------------------------------------------------------------- /SwiftChildWidget/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | SwiftChildWidget 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionPointIdentifier 26 | com.apple.widgetkit-extension 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Shared Code/OCPADataModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCPADataModel.m 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | @import UIKit; 9 | 10 | #import "OCPADataModel.h" 11 | #import "OCPAItem.h" 12 | 13 | @implementation OCPADataModel 14 | 15 | - (instancetype)init 16 | { 17 | self = [super init]; 18 | if (self) { 19 | self.items = @[]; 20 | 21 | [self _generateSampleContent]; 22 | } 23 | return self; 24 | } 25 | 26 | -(void)_generateSampleContent 27 | { 28 | NSMutableArray *_mutableArray = [NSMutableArray new]; 29 | 30 | for (int i = 0; i < 3; i++) 31 | { 32 | OCPAItem *item = [OCPAItem new]; 33 | 34 | item.text = [NSString stringWithFormat:@"Item %i", i]; 35 | item.image = [UIImage systemImageNamed:@"applescript.fill"]; 36 | item.color = (i % 2 == 0) ? [UIColor redColor] : [UIColor greenColor]; 37 | 38 | [_mutableArray addObject:item]; 39 | } 40 | 41 | self.items = [NSArray arrayWithArray:_mutableArray]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # swiftuiwidgetswithobjc 2 | 3 | This is a trivial example showing an Objective-C app, and example data model, with a SwiftUI widget designed for iOS 14. 4 | 5 | ### Notes 6 | 7 | - Your Objective-C class prefix is not respected by Xcode when you add a Widget Extension target, so be prepared to manually add it to any instances of 'ConfigurationIntent' in the template 8 | - Once you add any Objective-C code into a Widget Extension, its Intent will automatically generate code in ObjC and not Swift and no longer compile by default, which means you must manually add an Objective-C Bridging Header and manually import the Configuration Intent's header file — which will not physically be in your project, and is based on a filename convention generated from the items in your intentdefinition file. See `Swift-Bridging-Header.h` 9 | 10 | ### Screenshot 11 | 12 | ![https://hccdata.s3.us-east-1.amazonaws.com/gh_objc_widget.jpg "Screenshot of ObjC-backed widget running in Xcode Preview Pane"](https://hccdata.s3.us-east-1.amazonaws.com/gh_objc_widget.jpg "Screenshot of ObjC-backed widget running in Xcode Preview Pane") 13 | -------------------------------------------------------------------------------- /ObjCParentApp/OCPAAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import "OCPAAppDelegate.h" 9 | 10 | @interface OCPAAppDelegate () 11 | 12 | @end 13 | 14 | @implementation OCPAAppDelegate 15 | 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 18 | // Override point for customization after application launch. 19 | return YES; 20 | } 21 | 22 | 23 | #pragma mark - UISceneSession lifecycle 24 | 25 | 26 | - (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { 27 | // Called when a new scene session is being created. 28 | // Use this method to select a configuration to create the new scene with. 29 | return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; 30 | } 31 | 32 | 33 | - (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { 34 | // Called when the user discards a scene session. 35 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 36 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ObjCParentApp/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /SwiftChildWidget/SwiftChildWidget.intentdefinition: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | INEnums 6 | 7 | INIntentDefinitionModelVersion 8 | 1.2 9 | INIntentDefinitionNamespace 10 | 88xZPY 11 | INIntentDefinitionSystemVersion 12 | 20A294 13 | INIntentDefinitionToolsBuildVersion 14 | 12A6144 15 | INIntentDefinitionToolsVersion 16 | 12.0 17 | INIntents 18 | 19 | 20 | INIntentCategory 21 | information 22 | INIntentDescriptionID 23 | tVvJ9c 24 | INIntentEligibleForWidgets 25 | 26 | INIntentIneligibleForSuggestions 27 | 28 | INIntentName 29 | Configuration 30 | INIntentResponse 31 | 32 | INIntentResponseCodes 33 | 34 | 35 | INIntentResponseCodeName 36 | success 37 | INIntentResponseCodeSuccess 38 | 39 | 40 | 41 | INIntentResponseCodeName 42 | failure 43 | 44 | 45 | 46 | INIntentTitle 47 | Configuration 48 | INIntentTitleID 49 | gpCwrM 50 | INIntentType 51 | Custom 52 | INIntentVerb 53 | View 54 | 55 | 56 | INTypes 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /ObjCParentApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /SwiftChildWidget/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ObjCParentApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ObjCParentApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | SceneDelegate 36 | UISceneStoryboardFile 37 | Main 38 | 39 | 40 | 41 | 42 | UIApplicationSupportsIndirectInputEvents 43 | 44 | UILaunchStoryboardName 45 | LaunchScreen 46 | UIMainStoryboardFile 47 | Main 48 | UIRequiredDeviceCapabilities 49 | 50 | armv7 51 | 52 | UISupportedInterfaceOrientations 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationLandscapeLeft 56 | UIInterfaceOrientationLandscapeRight 57 | 58 | UISupportedInterfaceOrientations~ipad 59 | 60 | UIInterfaceOrientationPortrait 61 | UIInterfaceOrientationPortraitUpsideDown 62 | UIInterfaceOrientationLandscapeLeft 63 | UIInterfaceOrientationLandscapeRight 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /ObjCParentApp/OCPASceneDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.m 3 | // ObjCParentApp 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | #import "OCPASceneDelegate.h" 9 | 10 | @interface OCPASceneDelegate () 11 | 12 | @end 13 | 14 | @implementation OCPASceneDelegate 15 | 16 | 17 | - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | } 22 | 23 | 24 | - (void)sceneDidDisconnect:(UIScene *)scene { 25 | // Called as the scene is being released by the system. 26 | // This occurs shortly after the scene enters the background, or when its session is discarded. 27 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 28 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 29 | } 30 | 31 | 32 | - (void)sceneDidBecomeActive:(UIScene *)scene { 33 | // Called when the scene has moved from an inactive state to an active state. 34 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 35 | } 36 | 37 | 38 | - (void)sceneWillResignActive:(UIScene *)scene { 39 | // Called when the scene will move from an active state to an inactive state. 40 | // This may occur due to temporary interruptions (ex. an incoming phone call). 41 | } 42 | 43 | 44 | - (void)sceneWillEnterForeground:(UIScene *)scene { 45 | // Called as the scene transitions from the background to the foreground. 46 | // Use this method to undo the changes made on entering the background. 47 | } 48 | 49 | 50 | - (void)sceneDidEnterBackground:(UIScene *)scene { 51 | // Called as the scene transitions from the foreground to the background. 52 | // Use this method to save data, release shared resources, and store enough scene-specific state information 53 | // to restore the scene back to its current state. 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /SwiftChildWidget/SwiftChildWidget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftChildWidget.swift 3 | // SwiftChildWidget 4 | // 5 | // Created by Steven Troughton-Smith on 02/10/2020. 6 | // 7 | 8 | import WidgetKit 9 | import SwiftUI 10 | import Intents 11 | 12 | struct Provider: IntentTimelineProvider { 13 | func placeholder(in context: Context) -> SimpleEntry { 14 | SimpleEntry(date: Date(), configuration: OCPAConfigurationIntent()) 15 | } 16 | 17 | func getSnapshot(for configuration: OCPAConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) { 18 | let entry = SimpleEntry(date: Date(), configuration: configuration) 19 | completion(entry) 20 | } 21 | 22 | func getTimeline(for configuration: OCPAConfigurationIntent, in context: Context, completion: @escaping (Timeline) -> ()) { 23 | var entries: [SimpleEntry] = [] 24 | 25 | // Generate a timeline consisting of five entries an hour apart, starting from the current date. 26 | let currentDate = Date() 27 | for hourOffset in 0 ..< 5 { 28 | let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! 29 | let entry = SimpleEntry(date: entryDate, configuration: configuration) 30 | entries.append(entry) 31 | } 32 | 33 | let timeline = Timeline(entries: entries, policy: .atEnd) 34 | completion(timeline) 35 | } 36 | } 37 | 38 | struct SimpleEntry: TimelineEntry { 39 | let date: Date 40 | let configuration: OCPAConfigurationIntent 41 | } 42 | 43 | struct SwiftChildWidgetEntryView : View { 44 | var entry: Provider.Entry 45 | var dataModel:OCPADataModel 46 | 47 | var body: some View { 48 | 49 | VStack { 50 | ForEach(0 ..< dataModel.items.count) { i in 51 | ZStack { 52 | RoundedRectangle(cornerRadius: 4, style: .continuous) 53 | .fill(Color(dataModel.items[i].color)) 54 | HStack { 55 | Image(uiImage: dataModel.items[i].image) 56 | Text(dataModel.items[i].text) 57 | } 58 | } 59 | } 60 | } 61 | .padding() 62 | } 63 | } 64 | 65 | @main 66 | struct SwiftChildWidget: Widget { 67 | let kind: String = "SwiftChildWidget" 68 | 69 | let dataModel = OCPADataModel() 70 | 71 | var body: some WidgetConfiguration { 72 | IntentConfiguration(kind: kind, intent: OCPAConfigurationIntent.self, provider: Provider()) { entry in 73 | SwiftChildWidgetEntryView(entry: entry, dataModel:dataModel) 74 | } 75 | .configurationDisplayName("My Widget") 76 | .description("This is an example widget.") 77 | } 78 | } 79 | 80 | struct SwiftChildWidget_Previews: PreviewProvider { 81 | static var previews: some View { 82 | SwiftChildWidgetEntryView(entry: SimpleEntry(date: Date(), configuration: OCPAConfigurationIntent()), dataModel:OCPADataModel()) 83 | .previewContext(WidgetPreviewContext(family: .systemSmall)) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /ObjCParentApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B099C4FA252759DD00EF8898 /* OCPAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B099C4F9252759DD00EF8898 /* OCPAAppDelegate.m */; }; 11 | B099C4FD252759DD00EF8898 /* OCPASceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B099C4FC252759DD00EF8898 /* OCPASceneDelegate.m */; }; 12 | B099C500252759DD00EF8898 /* OCPAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B099C4FF252759DD00EF8898 /* OCPAViewController.m */; }; 13 | B099C503252759DD00EF8898 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B099C501252759DD00EF8898 /* Main.storyboard */; }; 14 | B099C505252759DE00EF8898 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B099C504252759DE00EF8898 /* Assets.xcassets */; }; 15 | B099C508252759DE00EF8898 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B099C506252759DE00EF8898 /* LaunchScreen.storyboard */; }; 16 | B099C50B252759DE00EF8898 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B099C50A252759DE00EF8898 /* main.m */; }; 17 | B099C51525275A0A00EF8898 /* OCPADataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = B099C51425275A0A00EF8898 /* OCPADataModel.m */; }; 18 | B099C51D25275A7E00EF8898 /* OCPAItem.m in Sources */ = {isa = PBXBuildFile; fileRef = B099C51C25275A7E00EF8898 /* OCPAItem.m */; }; 19 | B099C52625275BE100EF8898 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B099C52525275BE100EF8898 /* WidgetKit.framework */; }; 20 | B099C52825275BE100EF8898 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B099C52725275BE100EF8898 /* SwiftUI.framework */; }; 21 | B099C52B25275BE100EF8898 /* SwiftChildWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = B099C52A25275BE100EF8898 /* SwiftChildWidget.swift */; }; 22 | B099C52E25275BE200EF8898 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B099C52D25275BE200EF8898 /* Assets.xcassets */; }; 23 | B099C53025275BE200EF8898 /* SwiftChildWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = B099C52C25275BE100EF8898 /* SwiftChildWidget.intentdefinition */; }; 24 | B099C53125275BE200EF8898 /* SwiftChildWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = B099C52C25275BE100EF8898 /* SwiftChildWidget.intentdefinition */; }; 25 | B099C53425275BE200EF8898 /* SwiftChildWidgetExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = B099C52325275BE100EF8898 /* SwiftChildWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 26 | B099C53B25275C0100EF8898 /* OCPADataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = B099C51425275A0A00EF8898 /* OCPADataModel.m */; }; 27 | B099C53C25275C0100EF8898 /* OCPAItem.m in Sources */ = {isa = PBXBuildFile; fileRef = B099C51C25275A7E00EF8898 /* OCPAItem.m */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | B099C53225275BE200EF8898 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = B099C4ED252759DD00EF8898 /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = B099C52225275BE100EF8898; 36 | remoteInfo = SwiftChildWidgetExtension; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXCopyFilesBuildPhase section */ 41 | B099C53825275BE200EF8898 /* Embed App Extensions */ = { 42 | isa = PBXCopyFilesBuildPhase; 43 | buildActionMask = 2147483647; 44 | dstPath = ""; 45 | dstSubfolderSpec = 13; 46 | files = ( 47 | B099C53425275BE200EF8898 /* SwiftChildWidgetExtension.appex in Embed App Extensions */, 48 | ); 49 | name = "Embed App Extensions"; 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXCopyFilesBuildPhase section */ 53 | 54 | /* Begin PBXFileReference section */ 55 | B099C4F5252759DD00EF8898 /* ObjCParentApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ObjCParentApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | B099C4F8252759DD00EF8898 /* OCPAAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OCPAAppDelegate.h; sourceTree = ""; }; 57 | B099C4F9252759DD00EF8898 /* OCPAAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OCPAAppDelegate.m; sourceTree = ""; }; 58 | B099C4FB252759DD00EF8898 /* OCPASceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OCPASceneDelegate.h; sourceTree = ""; }; 59 | B099C4FC252759DD00EF8898 /* OCPASceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OCPASceneDelegate.m; sourceTree = ""; }; 60 | B099C4FE252759DD00EF8898 /* OCPAViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OCPAViewController.h; sourceTree = ""; }; 61 | B099C4FF252759DD00EF8898 /* OCPAViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OCPAViewController.m; sourceTree = ""; }; 62 | B099C502252759DD00EF8898 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 63 | B099C504252759DE00EF8898 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 64 | B099C507252759DE00EF8898 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 65 | B099C509252759DE00EF8898 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 66 | B099C50A252759DE00EF8898 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 67 | B099C51325275A0A00EF8898 /* OCPADataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OCPADataModel.h; sourceTree = ""; }; 68 | B099C51425275A0A00EF8898 /* OCPADataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OCPADataModel.m; sourceTree = ""; }; 69 | B099C51B25275A7E00EF8898 /* OCPAItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OCPAItem.h; sourceTree = ""; }; 70 | B099C51C25275A7E00EF8898 /* OCPAItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OCPAItem.m; sourceTree = ""; }; 71 | B099C52325275BE100EF8898 /* SwiftChildWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SwiftChildWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 72 | B099C52525275BE100EF8898 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; 73 | B099C52725275BE100EF8898 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; 74 | B099C52A25275BE100EF8898 /* SwiftChildWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftChildWidget.swift; sourceTree = ""; }; 75 | B099C52C25275BE100EF8898 /* SwiftChildWidget.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = SwiftChildWidget.intentdefinition; sourceTree = ""; }; 76 | B099C52D25275BE200EF8898 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 77 | B099C52F25275BE200EF8898 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 78 | B099C53F25275C3D00EF8898 /* Swift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Swift-Bridging-Header.h"; sourceTree = ""; }; 79 | B099C54625275F8100EF8898 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 80 | /* End PBXFileReference section */ 81 | 82 | /* Begin PBXFrameworksBuildPhase section */ 83 | B099C4F2252759DD00EF8898 /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | B099C52025275BE100EF8898 /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | B099C52825275BE100EF8898 /* SwiftUI.framework in Frameworks */, 95 | B099C52625275BE100EF8898 /* WidgetKit.framework in Frameworks */, 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | /* End PBXFrameworksBuildPhase section */ 100 | 101 | /* Begin PBXGroup section */ 102 | B099C4EC252759DD00EF8898 = { 103 | isa = PBXGroup; 104 | children = ( 105 | B099C54625275F8100EF8898 /* README.md */, 106 | B099C512252759E400EF8898 /* Shared Code */, 107 | B099C4F7252759DD00EF8898 /* ObjCParentApp */, 108 | B099C52925275BE100EF8898 /* SwiftChildWidget */, 109 | B099C52425275BE100EF8898 /* Frameworks */, 110 | B099C4F6252759DD00EF8898 /* Products */, 111 | ); 112 | sourceTree = ""; 113 | }; 114 | B099C4F6252759DD00EF8898 /* Products */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | B099C4F5252759DD00EF8898 /* ObjCParentApp.app */, 118 | B099C52325275BE100EF8898 /* SwiftChildWidgetExtension.appex */, 119 | ); 120 | name = Products; 121 | sourceTree = ""; 122 | }; 123 | B099C4F7252759DD00EF8898 /* ObjCParentApp */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | B099C4F8252759DD00EF8898 /* OCPAAppDelegate.h */, 127 | B099C4F9252759DD00EF8898 /* OCPAAppDelegate.m */, 128 | B099C4FB252759DD00EF8898 /* OCPASceneDelegate.h */, 129 | B099C4FC252759DD00EF8898 /* OCPASceneDelegate.m */, 130 | B099C4FE252759DD00EF8898 /* OCPAViewController.h */, 131 | B099C4FF252759DD00EF8898 /* OCPAViewController.m */, 132 | B099C501252759DD00EF8898 /* Main.storyboard */, 133 | B099C504252759DE00EF8898 /* Assets.xcassets */, 134 | B099C506252759DE00EF8898 /* LaunchScreen.storyboard */, 135 | B099C509252759DE00EF8898 /* Info.plist */, 136 | B099C50A252759DE00EF8898 /* main.m */, 137 | ); 138 | path = ObjCParentApp; 139 | sourceTree = ""; 140 | }; 141 | B099C512252759E400EF8898 /* Shared Code */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | B099C51325275A0A00EF8898 /* OCPADataModel.h */, 145 | B099C51425275A0A00EF8898 /* OCPADataModel.m */, 146 | B099C51B25275A7E00EF8898 /* OCPAItem.h */, 147 | B099C51C25275A7E00EF8898 /* OCPAItem.m */, 148 | ); 149 | path = "Shared Code"; 150 | sourceTree = ""; 151 | }; 152 | B099C52425275BE100EF8898 /* Frameworks */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | B099C52525275BE100EF8898 /* WidgetKit.framework */, 156 | B099C52725275BE100EF8898 /* SwiftUI.framework */, 157 | ); 158 | name = Frameworks; 159 | sourceTree = ""; 160 | }; 161 | B099C52925275BE100EF8898 /* SwiftChildWidget */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | B099C52A25275BE100EF8898 /* SwiftChildWidget.swift */, 165 | B099C52C25275BE100EF8898 /* SwiftChildWidget.intentdefinition */, 166 | B099C53F25275C3D00EF8898 /* Swift-Bridging-Header.h */, 167 | B099C52D25275BE200EF8898 /* Assets.xcassets */, 168 | B099C52F25275BE200EF8898 /* Info.plist */, 169 | ); 170 | path = SwiftChildWidget; 171 | sourceTree = ""; 172 | }; 173 | /* End PBXGroup section */ 174 | 175 | /* Begin PBXNativeTarget section */ 176 | B099C4F4252759DD00EF8898 /* ObjCParentApp */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = B099C50E252759DE00EF8898 /* Build configuration list for PBXNativeTarget "ObjCParentApp" */; 179 | buildPhases = ( 180 | B099C4F1252759DD00EF8898 /* Sources */, 181 | B099C4F2252759DD00EF8898 /* Frameworks */, 182 | B099C4F3252759DD00EF8898 /* Resources */, 183 | B099C53825275BE200EF8898 /* Embed App Extensions */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | B099C53325275BE200EF8898 /* PBXTargetDependency */, 189 | ); 190 | name = ObjCParentApp; 191 | productName = ObjCParentApp; 192 | productReference = B099C4F5252759DD00EF8898 /* ObjCParentApp.app */; 193 | productType = "com.apple.product-type.application"; 194 | }; 195 | B099C52225275BE100EF8898 /* SwiftChildWidgetExtension */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = B099C53525275BE200EF8898 /* Build configuration list for PBXNativeTarget "SwiftChildWidgetExtension" */; 198 | buildPhases = ( 199 | B099C51F25275BE100EF8898 /* Sources */, 200 | B099C52025275BE100EF8898 /* Frameworks */, 201 | B099C52125275BE100EF8898 /* Resources */, 202 | ); 203 | buildRules = ( 204 | ); 205 | dependencies = ( 206 | ); 207 | name = SwiftChildWidgetExtension; 208 | productName = SwiftChildWidgetExtension; 209 | productReference = B099C52325275BE100EF8898 /* SwiftChildWidgetExtension.appex */; 210 | productType = "com.apple.product-type.app-extension"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | B099C4ED252759DD00EF8898 /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | CLASSPREFIX = OCPA; 219 | LastSwiftUpdateCheck = 1220; 220 | LastUpgradeCheck = 1220; 221 | TargetAttributes = { 222 | B099C4F4252759DD00EF8898 = { 223 | CreatedOnToolsVersion = 12.2; 224 | }; 225 | B099C52225275BE100EF8898 = { 226 | CreatedOnToolsVersion = 12.2; 227 | }; 228 | }; 229 | }; 230 | buildConfigurationList = B099C4F0252759DD00EF8898 /* Build configuration list for PBXProject "ObjCParentApp" */; 231 | compatibilityVersion = "Xcode 9.3"; 232 | developmentRegion = en; 233 | hasScannedForEncodings = 0; 234 | knownRegions = ( 235 | en, 236 | Base, 237 | ); 238 | mainGroup = B099C4EC252759DD00EF8898; 239 | productRefGroup = B099C4F6252759DD00EF8898 /* Products */; 240 | projectDirPath = ""; 241 | projectRoot = ""; 242 | targets = ( 243 | B099C4F4252759DD00EF8898 /* ObjCParentApp */, 244 | B099C52225275BE100EF8898 /* SwiftChildWidgetExtension */, 245 | ); 246 | }; 247 | /* End PBXProject section */ 248 | 249 | /* Begin PBXResourcesBuildPhase section */ 250 | B099C4F3252759DD00EF8898 /* Resources */ = { 251 | isa = PBXResourcesBuildPhase; 252 | buildActionMask = 2147483647; 253 | files = ( 254 | B099C508252759DE00EF8898 /* LaunchScreen.storyboard in Resources */, 255 | B099C505252759DE00EF8898 /* Assets.xcassets in Resources */, 256 | B099C503252759DD00EF8898 /* Main.storyboard in Resources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | B099C52125275BE100EF8898 /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | B099C52E25275BE200EF8898 /* Assets.xcassets in Resources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXResourcesBuildPhase section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | B099C4F1252759DD00EF8898 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | B099C500252759DD00EF8898 /* OCPAViewController.m in Sources */, 276 | B099C4FA252759DD00EF8898 /* OCPAAppDelegate.m in Sources */, 277 | B099C50B252759DE00EF8898 /* main.m in Sources */, 278 | B099C51525275A0A00EF8898 /* OCPADataModel.m in Sources */, 279 | B099C53125275BE200EF8898 /* SwiftChildWidget.intentdefinition in Sources */, 280 | B099C4FD252759DD00EF8898 /* OCPASceneDelegate.m in Sources */, 281 | B099C51D25275A7E00EF8898 /* OCPAItem.m in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | B099C51F25275BE100EF8898 /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | B099C53B25275C0100EF8898 /* OCPADataModel.m in Sources */, 290 | B099C52B25275BE100EF8898 /* SwiftChildWidget.swift in Sources */, 291 | B099C53025275BE200EF8898 /* SwiftChildWidget.intentdefinition in Sources */, 292 | B099C53C25275C0100EF8898 /* OCPAItem.m in Sources */, 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | /* End PBXSourcesBuildPhase section */ 297 | 298 | /* Begin PBXTargetDependency section */ 299 | B099C53325275BE200EF8898 /* PBXTargetDependency */ = { 300 | isa = PBXTargetDependency; 301 | target = B099C52225275BE100EF8898 /* SwiftChildWidgetExtension */; 302 | targetProxy = B099C53225275BE200EF8898 /* PBXContainerItemProxy */; 303 | }; 304 | /* End PBXTargetDependency section */ 305 | 306 | /* Begin PBXVariantGroup section */ 307 | B099C501252759DD00EF8898 /* Main.storyboard */ = { 308 | isa = PBXVariantGroup; 309 | children = ( 310 | B099C502252759DD00EF8898 /* Base */, 311 | ); 312 | name = Main.storyboard; 313 | sourceTree = ""; 314 | }; 315 | B099C506252759DE00EF8898 /* LaunchScreen.storyboard */ = { 316 | isa = PBXVariantGroup; 317 | children = ( 318 | B099C507252759DE00EF8898 /* Base */, 319 | ); 320 | name = LaunchScreen.storyboard; 321 | sourceTree = ""; 322 | }; 323 | /* End PBXVariantGroup section */ 324 | 325 | /* Begin XCBuildConfiguration section */ 326 | B099C50C252759DE00EF8898 /* Debug */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_ANALYZER_NONNULL = YES; 331 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 332 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 333 | CLANG_CXX_LIBRARY = "libc++"; 334 | CLANG_ENABLE_MODULES = YES; 335 | CLANG_ENABLE_OBJC_ARC = YES; 336 | CLANG_ENABLE_OBJC_WEAK = YES; 337 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_COMMA = YES; 340 | CLANG_WARN_CONSTANT_CONVERSION = YES; 341 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 343 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 344 | CLANG_WARN_EMPTY_BODY = YES; 345 | CLANG_WARN_ENUM_CONVERSION = YES; 346 | CLANG_WARN_INFINITE_RECURSION = YES; 347 | CLANG_WARN_INT_CONVERSION = YES; 348 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 349 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 350 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 352 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 353 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 354 | CLANG_WARN_STRICT_PROTOTYPES = YES; 355 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 356 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | COPY_PHASE_STRIP = NO; 360 | DEBUG_INFORMATION_FORMAT = dwarf; 361 | ENABLE_STRICT_OBJC_MSGSEND = YES; 362 | ENABLE_TESTABILITY = YES; 363 | GCC_C_LANGUAGE_STANDARD = gnu11; 364 | GCC_DYNAMIC_NO_PIC = NO; 365 | GCC_NO_COMMON_BLOCKS = YES; 366 | GCC_OPTIMIZATION_LEVEL = 0; 367 | GCC_PREPROCESSOR_DEFINITIONS = ( 368 | "DEBUG=1", 369 | "$(inherited)", 370 | ); 371 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 372 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 373 | GCC_WARN_UNDECLARED_SELECTOR = YES; 374 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 375 | GCC_WARN_UNUSED_FUNCTION = YES; 376 | GCC_WARN_UNUSED_VARIABLE = YES; 377 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 378 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 379 | MTL_FAST_MATH = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | }; 383 | name = Debug; 384 | }; 385 | B099C50D252759DE00EF8898 /* Release */ = { 386 | isa = XCBuildConfiguration; 387 | buildSettings = { 388 | ALWAYS_SEARCH_USER_PATHS = NO; 389 | CLANG_ANALYZER_NONNULL = YES; 390 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 391 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 392 | CLANG_CXX_LIBRARY = "libc++"; 393 | CLANG_ENABLE_MODULES = YES; 394 | CLANG_ENABLE_OBJC_ARC = YES; 395 | CLANG_ENABLE_OBJC_WEAK = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 401 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 402 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 403 | CLANG_WARN_EMPTY_BODY = YES; 404 | CLANG_WARN_ENUM_CONVERSION = YES; 405 | CLANG_WARN_INFINITE_RECURSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 408 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 409 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 411 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu11; 423 | GCC_NO_COMMON_BLOCKS = YES; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 431 | MTL_ENABLE_DEBUG_INFO = NO; 432 | MTL_FAST_MATH = YES; 433 | SDKROOT = iphoneos; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | B099C50F252759DE00EF8898 /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 443 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 444 | CODE_SIGN_STYLE = Automatic; 445 | DEVELOPMENT_TEAM = 2ZDN69KUUV; 446 | INFOPLIST_FILE = ObjCParentApp/Info.plist; 447 | LD_RUNPATH_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "@executable_path/Frameworks", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = com.highcaffeinecontent.ObjCParentApp; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | TARGETED_DEVICE_FAMILY = "1,2"; 454 | }; 455 | name = Debug; 456 | }; 457 | B099C510252759DE00EF8898 /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 461 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 462 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 463 | CODE_SIGN_STYLE = Automatic; 464 | DEVELOPMENT_TEAM = 2ZDN69KUUV; 465 | INFOPLIST_FILE = ObjCParentApp/Info.plist; 466 | LD_RUNPATH_SEARCH_PATHS = ( 467 | "$(inherited)", 468 | "@executable_path/Frameworks", 469 | ); 470 | PRODUCT_BUNDLE_IDENTIFIER = com.highcaffeinecontent.ObjCParentApp; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | TARGETED_DEVICE_FAMILY = "1,2"; 473 | }; 474 | name = Release; 475 | }; 476 | B099C53625275BE200EF8898 /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 480 | ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; 481 | CODE_SIGN_STYLE = Automatic; 482 | DEVELOPMENT_TEAM = 2ZDN69KUUV; 483 | INFOPLIST_FILE = SwiftChildWidget/Info.plist; 484 | LD_RUNPATH_SEARCH_PATHS = ( 485 | "$(inherited)", 486 | "@executable_path/Frameworks", 487 | "@executable_path/../../Frameworks", 488 | ); 489 | PRODUCT_BUNDLE_IDENTIFIER = com.highcaffeinecontent.ObjCParentApp.SwiftChildWidget; 490 | PRODUCT_NAME = "$(TARGET_NAME)"; 491 | SKIP_INSTALL = YES; 492 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 493 | SWIFT_OBJC_BRIDGING_HEADER = "SwiftChildWidget/Swift-Bridging-Header.h"; 494 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 495 | SWIFT_VERSION = 5.0; 496 | TARGETED_DEVICE_FAMILY = "1,2"; 497 | }; 498 | name = Debug; 499 | }; 500 | B099C53725275BE200EF8898 /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 504 | ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; 505 | CODE_SIGN_STYLE = Automatic; 506 | DEVELOPMENT_TEAM = 2ZDN69KUUV; 507 | INFOPLIST_FILE = SwiftChildWidget/Info.plist; 508 | LD_RUNPATH_SEARCH_PATHS = ( 509 | "$(inherited)", 510 | "@executable_path/Frameworks", 511 | "@executable_path/../../Frameworks", 512 | ); 513 | PRODUCT_BUNDLE_IDENTIFIER = com.highcaffeinecontent.ObjCParentApp.SwiftChildWidget; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | SKIP_INSTALL = YES; 516 | SWIFT_COMPILATION_MODE = wholemodule; 517 | SWIFT_OBJC_BRIDGING_HEADER = "SwiftChildWidget/Swift-Bridging-Header.h"; 518 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 519 | SWIFT_VERSION = 5.0; 520 | TARGETED_DEVICE_FAMILY = "1,2"; 521 | }; 522 | name = Release; 523 | }; 524 | /* End XCBuildConfiguration section */ 525 | 526 | /* Begin XCConfigurationList section */ 527 | B099C4F0252759DD00EF8898 /* Build configuration list for PBXProject "ObjCParentApp" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | B099C50C252759DE00EF8898 /* Debug */, 531 | B099C50D252759DE00EF8898 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | B099C50E252759DE00EF8898 /* Build configuration list for PBXNativeTarget "ObjCParentApp" */ = { 537 | isa = XCConfigurationList; 538 | buildConfigurations = ( 539 | B099C50F252759DE00EF8898 /* Debug */, 540 | B099C510252759DE00EF8898 /* Release */, 541 | ); 542 | defaultConfigurationIsVisible = 0; 543 | defaultConfigurationName = Release; 544 | }; 545 | B099C53525275BE200EF8898 /* Build configuration list for PBXNativeTarget "SwiftChildWidgetExtension" */ = { 546 | isa = XCConfigurationList; 547 | buildConfigurations = ( 548 | B099C53625275BE200EF8898 /* Debug */, 549 | B099C53725275BE200EF8898 /* Release */, 550 | ); 551 | defaultConfigurationIsVisible = 0; 552 | defaultConfigurationName = Release; 553 | }; 554 | /* End XCConfigurationList section */ 555 | }; 556 | rootObject = B099C4ED252759DD00EF8898 /* Project object */; 557 | } 558 | --------------------------------------------------------------------------------