Skip to content

Instantly share code, notes, and snippets.

@michaelcontento
Created October 5, 2013 10:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelcontento/6839251 to your computer and use it in GitHub Desktop.
Save michaelcontento/6839251 to your computer and use it in GitHub Desktop.
diff --git template/multi-platform-cpp/proj.ios_mac/ios/AppController.h template/multi-platform-cpp/proj.ios_mac/ios/AppController.h
index 0c73d6a..e155cc9 100644
--- template/multi-platform-cpp/proj.ios_mac/ios/AppController.h
+++ template/multi-platform-cpp/proj.ios_mac/ios/AppController.h
@@ -4,7 +4,7 @@
@interface AppController : NSObject <UIApplicationDelegate> {
UIWindow *window;
- RootViewController *viewController;
+ @public RootViewController *viewController;
}
@end
diff --git template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.h template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.h
index 25f728b..9c8911c 100644
--- template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.h
+++ template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.h
@@ -1,7 +1,7 @@
#import <UIKit/UIKit.h>
+#import <GameKit/GameKit.h>
-
-@interface RootViewController : UIViewController {
+@interface RootViewController : UIViewController <GKAchievementViewControllerDelegate, GKLeaderboardViewControllerDelegate> {
}
- (BOOL) prefersStatusBarHidden;
diff --git template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.mm template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.mm
index 906aeaf..2af11dd 100644
--- template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.mm
+++ template/multi-platform-cpp/proj.ios_mac/ios/RootViewController.mm
@@ -3,6 +3,18 @@
@implementation RootViewController
+// GKLeaderboardViewControllerのDelegate
+-(void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController
+{
+ [self dismissViewControllerAnimated:YES completion:nil];
+}
+
+// GKAchievementViewControllerのDelegate
+-(void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController
+{
+ [self dismissViewControllerAnimated:YES completion:nil];
+}
+
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment