From 9a92ce9321d081d0ceba3009d2a8d09beded7b66 Mon Sep 17 00:00:00 2001 From: Hongyan Jiang Date: Tue, 2 Jan 2024 17:28:34 -0800 Subject: [PATCH] Add target ObjectiveCAppExample to InstanaAgentExample to demonstrate how to integrate iOSAgent with Objective-C app --- Changelog.md | 1 + .../project.pbxproj | 190 ++++++++++++++++++ Dev/ObjectiveCAppExample/AppDelegate.h | 14 ++ Dev/ObjectiveCAppExample/AppDelegate.m | 56 ++++++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 13 ++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 +++ .../Base.lproj/Main.storyboard | 24 +++ Dev/ObjectiveCAppExample/Info.plist | 25 +++ Dev/ObjectiveCAppExample/SceneDelegate.h | 15 ++ Dev/ObjectiveCAppExample/SceneDelegate.m | 57 ++++++ Dev/ObjectiveCAppExample/ViewController.h | 14 ++ Dev/ObjectiveCAppExample/ViewController.m | 22 ++ Dev/ObjectiveCAppExample/main.m | 18 ++ 15 files changed, 491 insertions(+) create mode 100644 Dev/ObjectiveCAppExample/AppDelegate.h create mode 100644 Dev/ObjectiveCAppExample/AppDelegate.m create mode 100644 Dev/ObjectiveCAppExample/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Dev/ObjectiveCAppExample/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Dev/ObjectiveCAppExample/Assets.xcassets/Contents.json create mode 100644 Dev/ObjectiveCAppExample/Base.lproj/LaunchScreen.storyboard create mode 100644 Dev/ObjectiveCAppExample/Base.lproj/Main.storyboard create mode 100644 Dev/ObjectiveCAppExample/Info.plist create mode 100644 Dev/ObjectiveCAppExample/SceneDelegate.h create mode 100644 Dev/ObjectiveCAppExample/SceneDelegate.m create mode 100644 Dev/ObjectiveCAppExample/ViewController.h create mode 100644 Dev/ObjectiveCAppExample/ViewController.m create mode 100644 Dev/ObjectiveCAppExample/main.m diff --git a/Changelog.md b/Changelog.md index fcb61e9b..438de13c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,7 @@ - Add more meta data to crash beacon - Add more exceptionType processing to crash beacon - Display crash terminationReason as meta data rather than error message +- Add Objective-C target ObjectiveCAppExample to InstanaAgentExample ## 1.6.7 - Add more raw crash payload info to stackTrace diff --git a/Dev/InstanaAgentExample.xcodeproj/project.pbxproj b/Dev/InstanaAgentExample.xcodeproj/project.pbxproj index 70592e4b..ba3514b0 100644 --- a/Dev/InstanaAgentExample.xcodeproj/project.pbxproj +++ b/Dev/InstanaAgentExample.xcodeproj/project.pbxproj @@ -29,6 +29,14 @@ 72976A9A2681C45800A284F6 /* Webserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72976A992681C45800A284F6 /* Webserver.swift */; }; 729C88B5270DE98200492486 /* AFNetworking in Frameworks */ = {isa = PBXBuildFile; productRef = 729C88B4270DE98200492486 /* AFNetworking */; }; 729C88B8270DF13700492486 /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 729C88B7270DF13700492486 /* Alamofire */; }; + A46F87782B44DE8D00302343 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F87772B44DE8D00302343 /* AppDelegate.m */; }; + A46F877B2B44DE8D00302343 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F877A2B44DE8D00302343 /* SceneDelegate.m */; }; + A46F877E2B44DE8D00302343 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F877D2B44DE8D00302343 /* ViewController.m */; }; + A46F87812B44DE8D00302343 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A46F877F2B44DE8D00302343 /* Main.storyboard */; }; + A46F87832B44DE8E00302343 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A46F87822B44DE8E00302343 /* Assets.xcassets */; }; + A46F87862B44DE8E00302343 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A46F87842B44DE8E00302343 /* LaunchScreen.storyboard */; }; + A46F87892B44DE8E00302343 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F87882B44DE8E00302343 /* main.m */; }; + A46F87912B44E79600302343 /* InstanaAgent in Frameworks */ = {isa = PBXBuildFile; productRef = A46F87902B44E79600302343 /* InstanaAgent */; }; A4EFD6A12A9983FB00B9A9A3 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A4EFD6A02A9983FB00B9A9A3 /* WebKit.framework */; }; CE322E492A6E3CEF00414F37 /* TopRatedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE322E482A6E3CEF00414F37 /* TopRatedViewController.swift */; }; /* End PBXBuildFile section */ @@ -70,6 +78,18 @@ 727AF73A263AA0FA00B9C59B /* EventListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventListViewController.swift; sourceTree = ""; }; 72976A992681C45800A284F6 /* Webserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Webserver.swift; path = "../../Tests/InstanaAgentTests/Test helpers/Webserver.swift"; sourceTree = ""; }; 72FBE8A7263AACDB00CF2CDE /* InstanaAgentExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = InstanaAgentExample.entitlements; sourceTree = ""; }; + A46F87742B44DE8D00302343 /* ObjectiveCAppExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ObjectiveCAppExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A46F87762B44DE8D00302343 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + A46F87772B44DE8D00302343 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + A46F87792B44DE8D00302343 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; + A46F877A2B44DE8D00302343 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; + A46F877C2B44DE8D00302343 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + A46F877D2B44DE8D00302343 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + A46F87802B44DE8D00302343 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A46F87822B44DE8E00302343 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A46F87852B44DE8E00302343 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A46F87872B44DE8E00302343 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A46F87882B44DE8E00302343 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; A4EFD6A02A9983FB00B9A9A3 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/iOSSupport/System/Library/PrivateFrameworks/WebKit.framework; sourceTree = DEVELOPER_DIR; }; CE322E482A6E3CEF00414F37 /* TopRatedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopRatedViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -101,6 +121,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A46F87712B44DE8D00302343 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A46F87912B44E79600302343 /* InstanaAgent in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -124,6 +152,7 @@ 727AF687263A9EBD00B9C59B /* InstanaAgentExample */, 727AF71A263AA09C00B9C59B /* iOSAgentUITests */, 725029D0263AB32300302532 /* macAgentExample */, + A46F87752B44DE8D00302343 /* ObjectiveCAppExample */, 727AF686263A9EBD00B9C59B /* Products */, 727AF710263A9FC800B9C59B /* Frameworks */, ); @@ -135,6 +164,7 @@ 727AF685263A9EBD00B9C59B /* InstanaAgentExample.app */, 727AF719263AA09C00B9C59B /* iOSAgentUITests.xctest */, 725029CF263AB32300302532 /* macAgentExample.app */, + A46F87742B44DE8D00302343 /* ObjectiveCAppExample.app */, ); name = Products; sourceTree = ""; @@ -178,6 +208,24 @@ path = iOSAgentUITests; sourceTree = ""; }; + A46F87752B44DE8D00302343 /* ObjectiveCAppExample */ = { + isa = PBXGroup; + children = ( + A46F87762B44DE8D00302343 /* AppDelegate.h */, + A46F87772B44DE8D00302343 /* AppDelegate.m */, + A46F87792B44DE8D00302343 /* SceneDelegate.h */, + A46F877A2B44DE8D00302343 /* SceneDelegate.m */, + A46F877C2B44DE8D00302343 /* ViewController.h */, + A46F877D2B44DE8D00302343 /* ViewController.m */, + A46F877F2B44DE8D00302343 /* Main.storyboard */, + A46F87822B44DE8E00302343 /* Assets.xcassets */, + A46F87842B44DE8E00302343 /* LaunchScreen.storyboard */, + A46F87872B44DE8E00302343 /* Info.plist */, + A46F87882B44DE8E00302343 /* main.m */, + ); + path = ObjectiveCAppExample; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -246,6 +294,26 @@ productReference = 727AF719263AA09C00B9C59B /* iOSAgentUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; + A46F87732B44DE8D00302343 /* ObjectiveCAppExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = A46F878C2B44DE8E00302343 /* Build configuration list for PBXNativeTarget "ObjectiveCAppExample" */; + buildPhases = ( + A46F87702B44DE8D00302343 /* Sources */, + A46F87712B44DE8D00302343 /* Frameworks */, + A46F87722B44DE8D00302343 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ObjectiveCAppExample; + packageProductDependencies = ( + A46F87902B44E79600302343 /* InstanaAgent */, + ); + productName = ObjectiveCAppExample; + productReference = A46F87742B44DE8D00302343 /* ObjectiveCAppExample.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -265,6 +333,9 @@ CreatedOnToolsVersion = 12.4; TestTargetID = 727AF684263A9EBD00B9C59B; }; + A46F87732B44DE8D00302343 = { + CreatedOnToolsVersion = 15.0; + }; }; }; buildConfigurationList = 727AF680263A9EBD00B9C59B /* Build configuration list for PBXProject "InstanaAgentExample" */; @@ -287,6 +358,7 @@ 727AF684263A9EBD00B9C59B /* InstanaAgentExample */, 727AF718263AA09C00B9C59B /* iOSAgentUITests */, 725029CE263AB32300302532 /* macAgentExample */, + A46F87732B44DE8D00302343 /* ObjectiveCAppExample */, ); }; /* End PBXProject section */ @@ -318,6 +390,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A46F87722B44DE8D00302343 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A46F87862B44DE8E00302343 /* LaunchScreen.storyboard in Resources */, + A46F87832B44DE8E00302343 /* Assets.xcassets in Resources */, + A46F87812B44DE8D00302343 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -452,6 +534,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A46F87702B44DE8D00302343 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A46F877E2B44DE8D00302343 /* ViewController.m in Sources */, + A46F87782B44DE8D00302343 /* AppDelegate.m in Sources */, + A46F87892B44DE8E00302343 /* main.m in Sources */, + A46F877B2B44DE8D00302343 /* SceneDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -487,6 +580,22 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; + A46F877F2B44DE8D00302343 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A46F87802B44DE8D00302343 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A46F87842B44DE8E00302343 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A46F87852B44DE8E00302343 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -732,6 +841,74 @@ }; name = Release; }; + A46F878A2B44DE8E00302343 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ObjectiveCAppExample/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.instana.ios.ObjectiveCAppExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A46F878B2B44DE8E00302343 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ObjectiveCAppExample/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.instana.ios.ObjectiveCAppExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -771,6 +948,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + A46F878C2B44DE8E00302343 /* Build configuration list for PBXNativeTarget "ObjectiveCAppExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A46F878A2B44DE8E00302343 /* Debug */, + A46F878B2B44DE8E00302343 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ @@ -811,6 +997,10 @@ package = 729C88B6270DF13700492486 /* XCRemoteSwiftPackageReference "Alamofire" */; productName = Alamofire; }; + A46F87902B44E79600302343 /* InstanaAgent */ = { + isa = XCSwiftPackageProductDependency; + productName = InstanaAgent; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 727AF67D263A9EBD00B9C59B /* Project object */; diff --git a/Dev/ObjectiveCAppExample/AppDelegate.h b/Dev/ObjectiveCAppExample/AppDelegate.h new file mode 100644 index 00000000..6bfdddbf --- /dev/null +++ b/Dev/ObjectiveCAppExample/AppDelegate.h @@ -0,0 +1,14 @@ +// +// AppDelegate.h +// ObjectiveCAppExample +// +// Created by Helen Jiang on 1/2/24. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/Dev/ObjectiveCAppExample/AppDelegate.m b/Dev/ObjectiveCAppExample/AppDelegate.m new file mode 100644 index 00000000..261ede4a --- /dev/null +++ b/Dev/ObjectiveCAppExample/AppDelegate.m @@ -0,0 +1,56 @@ +// +// AppDelegate.m +// ObjectiveCAppExample +// +// Created by Helen Jiang on 1/2/24. +// + +#import "AppDelegate.h" +@import InstanaAgent; + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + //note: explicitly get user permission before set enableCrashReporting to true + InstanaSetupOptions* options = [[InstanaSetupOptions alloc] initWithHttpCaptureConfig: 0 + collectionEnabled: true + enableCrashReporting: true + suspendReportingOnLowBattery: true + suspendReportingOnCellular: false + slowSendInterval: 0.0 + usiRefreshTimeIntervalInHrs: -1]; + (void)[Instana setupWithKey: @"INSTANA_REPORTING_KEY" + reportingURL: [NSURL URLWithString: @"INSTANA_REPORTING_URL"] + options: options]; + + NSURL* url = [NSURL URLWithString: @"https://www.ibm.com/jp-ja"]; + NSURLRequest* request = [NSURLRequest requestWithURL: url]; + [[[NSURLSession sharedSession] dataTaskWithRequest: request] resume]; + + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/Dev/ObjectiveCAppExample/Assets.xcassets/AccentColor.colorset/Contents.json b/Dev/ObjectiveCAppExample/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Dev/ObjectiveCAppExample/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Dev/ObjectiveCAppExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/Dev/ObjectiveCAppExample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..13613e3e --- /dev/null +++ b/Dev/ObjectiveCAppExample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Dev/ObjectiveCAppExample/Assets.xcassets/Contents.json b/Dev/ObjectiveCAppExample/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Dev/ObjectiveCAppExample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Dev/ObjectiveCAppExample/Base.lproj/LaunchScreen.storyboard b/Dev/ObjectiveCAppExample/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/Dev/ObjectiveCAppExample/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dev/ObjectiveCAppExample/Base.lproj/Main.storyboard b/Dev/ObjectiveCAppExample/Base.lproj/Main.storyboard new file mode 100644 index 00000000..808a21ce --- /dev/null +++ b/Dev/ObjectiveCAppExample/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Dev/ObjectiveCAppExample/Info.plist b/Dev/ObjectiveCAppExample/Info.plist new file mode 100644 index 00000000..81ed29b7 --- /dev/null +++ b/Dev/ObjectiveCAppExample/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/Dev/ObjectiveCAppExample/SceneDelegate.h b/Dev/ObjectiveCAppExample/SceneDelegate.h new file mode 100644 index 00000000..5b31bc78 --- /dev/null +++ b/Dev/ObjectiveCAppExample/SceneDelegate.h @@ -0,0 +1,15 @@ +// +// SceneDelegate.h +// ObjectiveCAppExample +// +// Created by Helen Jiang on 1/2/24. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/Dev/ObjectiveCAppExample/SceneDelegate.m b/Dev/ObjectiveCAppExample/SceneDelegate.m new file mode 100644 index 00000000..0941e3d6 --- /dev/null +++ b/Dev/ObjectiveCAppExample/SceneDelegate.m @@ -0,0 +1,57 @@ +// +// SceneDelegate.m +// ObjectiveCAppExample +// +// Created by Helen Jiang on 1/2/24. +// + +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/Dev/ObjectiveCAppExample/ViewController.h b/Dev/ObjectiveCAppExample/ViewController.h new file mode 100644 index 00000000..1990a0d4 --- /dev/null +++ b/Dev/ObjectiveCAppExample/ViewController.h @@ -0,0 +1,14 @@ +// +// ViewController.h +// ObjectiveCAppExample +// +// Created by Helen Jiang on 1/2/24. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/Dev/ObjectiveCAppExample/ViewController.m b/Dev/ObjectiveCAppExample/ViewController.m new file mode 100644 index 00000000..de2c2153 --- /dev/null +++ b/Dev/ObjectiveCAppExample/ViewController.m @@ -0,0 +1,22 @@ +// +// ViewController.m +// ObjectiveCAppExample +// +// Created by Helen Jiang on 1/2/24. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + + +@end diff --git a/Dev/ObjectiveCAppExample/main.m b/Dev/ObjectiveCAppExample/main.m new file mode 100644 index 00000000..6cf00dfb --- /dev/null +++ b/Dev/ObjectiveCAppExample/main.m @@ -0,0 +1,18 @@ +// +// main.m +// ObjectiveCAppExample +// +// Created by Helen Jiang on 1/2/24. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +}