Browse Source

iOS / macOS AppDelegate added.

Hongtae Kim 7 years ago
parent
commit
3a82ea003c

+ 2
- 1
TestApp1/TestApp1.cpp View File

@@ -48,7 +48,7 @@ public:
48 48
 			{
49 49
 				DKLog("Terminate!!");
50 50
 				DKApplication::Instance()->Terminate(0);
51
-			})->Invocation(), 6);
51
+			})->Invocation(), 10);
52 52
 
53 53
 		})->Invocation());
54 54
 	}
@@ -71,5 +71,6 @@ int main(int argc, const char * argv[])
71 71
 #endif
72 72
 {
73 73
 	TestApp1 app;
74
+	DKPropertySet::SystemConfig().SetValue("AppDelegate", "AppDelegate");
74 75
 	return app.Run();
75 76
 }

+ 12
- 0
TestApp1/TestApp1.xcodeproj/project.pbxproj View File

@@ -15,6 +15,8 @@
15 15
 		840D5D931DDA08CA009DA369 /* libDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 840D5D871DDA0890009DA369 /* libDK.a */; };
16 16
 		840D5DEC1DDA233E009DA369 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 840D5DEB1DDA233E009DA369 /* UIKit.framework */; };
17 17
 		840D5DF01DDA23BD009DA369 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 840D5DEF1DDA23BD009DA369 /* Foundation.framework */; };
18
+		841948EB1DDCBE6000E039F0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 841948E91DDCBE5000E039F0 /* AppDelegate.m */; };
19
+		841948EF1DDCBE7B00E039F0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 841948ED1DDCBE7500E039F0 /* AppDelegate.m */; };
18 20
 		844A9A851DD0C080007DCC89 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 844A9A781DD0C080007DCC89 /* Assets.xcassets */; };
19 21
 		844A9A871DD0C080007DCC89 /* small.ico in Resources */ = {isa = PBXBuildFile; fileRef = 844A9A7C1DD0C080007DCC89 /* small.ico */; };
20 22
 		844A9A881DD0C080007DCC89 /* TestApp1.ico in Resources */ = {isa = PBXBuildFile; fileRef = 844A9A7E1DD0C080007DCC89 /* TestApp1.ico */; };
@@ -76,6 +78,10 @@
76 78
 		840D5D3A1DDA07B2009DA369 /* DK.xcodeproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "wrapper.pb-project"; name = DK.xcodeproj; path = ../DK/DK.xcodeproj; sourceTree = "<group>"; };
77 79
 		840D5DEB1DDA233E009DA369 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
78 80
 		840D5DEF1DDA23BD009DA369 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
81
+		841948E81DDCBE5000E039F0 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
82
+		841948E91DDCBE5000E039F0 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
83
+		841948EC1DDCBE7500E039F0 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
84
+		841948ED1DDCBE7500E039F0 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
79 85
 		844A9A441DD0BCFD007DCC89 /* TestApp1_macOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestApp1_macOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
80 86
 		844A9A5C1DD0BEDD007DCC89 /* TestApp1_iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestApp1_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
81 87
 		844A9A741DD0C080007DCC89 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -171,6 +177,8 @@
171 177
 		844A9A731DD0C080007DCC89 /* iOS */ = {
172 178
 			isa = PBXGroup;
173 179
 			children = (
180
+				841948E81DDCBE5000E039F0 /* AppDelegate.h */,
181
+				841948E91DDCBE5000E039F0 /* AppDelegate.m */,
174 182
 				844A9A741DD0C080007DCC89 /* Assets.xcassets */,
175 183
 				844A9A751DD0C080007DCC89 /* Info.plist */,
176 184
 				844A9A761DD0C080007DCC89 /* LaunchScreen.storyboard */,
@@ -181,6 +189,8 @@
181 189
 		844A9A771DD0C080007DCC89 /* macOS */ = {
182 190
 			isa = PBXGroup;
183 191
 			children = (
192
+				841948EC1DDCBE7500E039F0 /* AppDelegate.h */,
193
+				841948ED1DDCBE7500E039F0 /* AppDelegate.m */,
184 194
 				844A9A781DD0C080007DCC89 /* Assets.xcassets */,
185 195
 				844A9A791DD0C080007DCC89 /* Info.plist */,
186 196
 			);
@@ -343,6 +353,7 @@
343 353
 			isa = PBXSourcesBuildPhase;
344 354
 			buildActionMask = 2147483647;
345 355
 			files = (
356
+				841948EF1DDCBE7B00E039F0 /* AppDelegate.m in Sources */,
346 357
 				66DA89941DD3117F00338015 /* TestApp1.cpp in Sources */,
347 358
 			);
348 359
 			runOnlyForDeploymentPostprocessing = 0;
@@ -351,6 +362,7 @@
351 362
 			isa = PBXSourcesBuildPhase;
352 363
 			buildActionMask = 2147483647;
353 364
 			files = (
365
+				841948EB1DDCBE6000E039F0 /* AppDelegate.m in Sources */,
354 366
 				66DA89971DD3118000338015 /* TestApp1.cpp in Sources */,
355 367
 			);
356 368
 			runOnlyForDeploymentPostprocessing = 0;

+ 17
- 0
TestApp1/iOS/AppDelegate.h View File

@@ -0,0 +1,17 @@
1
+//
2
+//  AppDelegate.h
3
+//  iOS_Test
4
+//
5
+//  Created by tiff on 11/17/16.
6
+//  Copyright © 2016 icondb. All rights reserved.
7
+//
8
+
9
+#import <UIKit/UIKit.h>
10
+
11
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
12
+
13
+@property (strong, nonatomic) UIWindow *window;
14
+
15
+
16
+@end
17
+

+ 73
- 0
TestApp1/iOS/AppDelegate.m View File

@@ -0,0 +1,73 @@
1
+//
2
+//  AppDelegate.m
3
+//  iOS_Test
4
+//
5
+//  Created by tiff on 11/17/16.
6
+//  Copyright © 2016 icondb. All rights reserved.
7
+//
8
+
9
+#import "AppDelegate.h"
10
+
11
+@interface AppDelegate ()
12
+
13
+@end
14
+
15
+@implementation AppDelegate
16
+
17
+
18
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19
+	// Override point for customization after application launch.
20
+	NSLog(@"%s", __PRETTY_FUNCTION__);
21
+	return YES;
22
+}
23
+
24
+
25
+- (void)applicationWillResignActive:(UIApplication *)application {
26
+	// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
27
+	// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
28
+	NSLog(@"%s", __PRETTY_FUNCTION__);
29
+}
30
+
31
+
32
+- (void)applicationDidEnterBackground:(UIApplication *)application {
33
+	// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
34
+	// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
35
+	NSLog(@"%s", __PRETTY_FUNCTION__);
36
+}
37
+
38
+
39
+- (void)applicationWillEnterForeground:(UIApplication *)application {
40
+	// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
41
+	NSLog(@"%s", __PRETTY_FUNCTION__);
42
+}
43
+
44
+
45
+- (void)applicationDidBecomeActive:(UIApplication *)application {
46
+	// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
47
+	NSLog(@"%s", __PRETTY_FUNCTION__);
48
+}
49
+
50
+
51
+- (void)applicationWillTerminate:(UIApplication *)application {
52
+	// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
53
+	NSLog(@"%s", __PRETTY_FUNCTION__);
54
+}
55
+
56
+- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
57
+{
58
+	NSLog(@"%s", __PRETTY_FUNCTION__);
59
+}
60
+
61
+- (instancetype)init
62
+{
63
+	NSLog(@"%s", __PRETTY_FUNCTION__);
64
+	self = [super init];
65
+	return self;
66
+}
67
+
68
+- (void)dealloc
69
+{
70
+	NSLog(@"%s", __PRETTY_FUNCTION__);
71
+}
72
+
73
+@end

+ 15
- 0
TestApp1/macOS/AppDelegate.h View File

@@ -0,0 +1,15 @@
1
+//
2
+//  AppDelegate.h
3
+//  CocoaTest
4
+//
5
+//  Created by tiff on 11/17/16.
6
+//  Copyright © 2016 icondb. All rights reserved.
7
+//
8
+
9
+#import <Cocoa/Cocoa.h>
10
+
11
+@interface AppDelegate : NSObject <NSApplicationDelegate>
12
+
13
+
14
+@end
15
+

+ 41
- 0
TestApp1/macOS/AppDelegate.m View File

@@ -0,0 +1,41 @@
1
+//
2
+//  AppDelegate.m
3
+//  CocoaTest
4
+//
5
+//  Created by tiff on 11/17/16.
6
+//  Copyright © 2016 icondb. All rights reserved.
7
+//
8
+
9
+#import "AppDelegate.h"
10
+
11
+@interface AppDelegate ()
12
+
13
+@property (weak) IBOutlet NSWindow *window;
14
+@end
15
+
16
+@implementation AppDelegate
17
+
18
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
19
+	// Insert code here to initialize your application
20
+	NSLog(@"%s", __PRETTY_FUNCTION__);
21
+}
22
+
23
+
24
+- (void)applicationWillTerminate:(NSNotification *)aNotification {
25
+	// Insert code here to tear down your application
26
+	NSLog(@"%s", __PRETTY_FUNCTION__);
27
+}
28
+
29
+- (instancetype)init
30
+{
31
+	NSLog(@"%s", __PRETTY_FUNCTION__);
32
+	self = [super init];
33
+	return self;
34
+}
35
+
36
+- (void)dealloc
37
+{
38
+	NSLog(@"%s", __PRETTY_FUNCTION__);
39
+}
40
+
41
+@end