Skip to content

Commit

Permalink
I was editing the wrong version of the file, the implementation was d…
Browse files Browse the repository at this point in the history
…uplicated!
  • Loading branch information
JaviSoto committed Sep 16, 2013
1 parent 288d34a commit ddb58e8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 402 deletions.
15 changes: 3 additions & 12 deletions JSDecoupledAppDelegate/JSDecoupledAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

@protocol JSApplicationStateDelegate;
@protocol JSApplicationDefaultOrientationDelegate;
@protocol JSApplicationBackgroundFetchDelegate;
@protocol JSApplicationRemoteNotificationsDelegate;
@protocol JSApplicationLocalNotificationsDelegate;
@protocol JSApplicationStateRestorationDelegate;
Expand All @@ -27,12 +26,8 @@

@property (strong, nonatomic) UIWindow *window;

// Required
@property (strong, nonatomic) id<JSApplicationStateDelegate> appStateDelegate;

// Optional
@property (strong, nonatomic) id<JSApplicationDefaultOrientationDelegate> appDefaultOrientationDelegate;
@property (strong, nonatomic) id<JSApplicationBackgroundFetchDelegate> backgroundFetchDelegate;
@property (strong, nonatomic) id<JSApplicationRemoteNotificationsDelegate> remoteNotificationsDelegate;
@property (strong, nonatomic) id<JSApplicationLocalNotificationsDelegate> localNotificationsDelegate;
@property (strong, nonatomic) id<JSApplicationStateRestorationDelegate> stateRestorationDelegate;
Expand Down Expand Up @@ -66,19 +61,13 @@

@end

@protocol JSApplicationBackgroundFetchDelegate <NSObject>

- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;

@end

@protocol JSApplicationRemoteNotificationsDelegate <NSObject>

@optional
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;

@end

Expand All @@ -90,6 +79,7 @@

@protocol JSApplicationStateRestorationDelegate <NSObject>

@optional
- (UIViewController *)application:(UIApplication *)application viewControllerWithRestorationIdentifierPath:(NSArray *)identifierComponents coder:(NSCoder *)coder;
- (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder;
- (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder;
Expand All @@ -106,6 +96,7 @@

@protocol JSApplicationProtectedDataDelegate <NSObject>

@optional
- (void)applicationProtectedDataWillBecomeUnavailable:(UIApplication *)application;
- (void)applicationProtectedDataDidBecomeAvailable:(UIApplication *)application;

Expand Down
17 changes: 0 additions & 17 deletions JSDecoupledAppDelegate/JSDecoupledAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
properties = @[
NSStringFromSelector(@selector(appStateDelegate)),
NSStringFromSelector(@selector(appDefaultOrientationDelegate)),
NSStringFromSelector(@selector(backgroundFetchDelegate)),
NSStringFromSelector(@selector(remoteNotificationsDelegate)),
NSStringFromSelector(@selector(localNotificationsDelegate)),
NSStringFromSelector(@selector(stateRestorationDelegate)),
Expand All @@ -65,7 +64,6 @@
protocols = @[
NSStringFromProtocol(@protocol(JSApplicationStateDelegate)),
NSStringFromProtocol(@protocol(JSApplicationDefaultOrientationDelegate)),
NSStringFromProtocol(@protocol(JSApplicationBackgroundFetchDelegate)),
NSStringFromProtocol(@protocol(JSApplicationRemoteNotificationsDelegate)),
NSStringFromProtocol(@protocol(JSApplicationLocalNotificationsDelegate)),
NSStringFromProtocol(@protocol(JSApplicationStateRestorationDelegate)),
Expand Down Expand Up @@ -154,9 +152,6 @@ - (id)init

- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Required
NSParameterAssert(self.appStateDelegate);

return [self.appStateDelegate application:application willFinishLaunchingWithOptions:launchOptions];
}

Expand Down Expand Up @@ -202,13 +197,6 @@ - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrienta
return [self.appDefaultOrientationDelegate application:application supportedInterfaceOrientationsForWindow:window];
}

#pragma mark - JSApplicationBackgroundFetchDelegate

- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
{
[self.backgroundFetchDelegate application:application performFetchWithCompletionHandler:completionHandler];
}

#pragma mark - JSApplicationRemoteNotificationsDelegate

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
Expand All @@ -226,11 +214,6 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
[self.remoteNotificationsDelegate application:application didReceiveRemoteNotification:userInfo];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
{
[self.remoteNotificationsDelegate application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

#pragma mark - JSApplicationLocalNotificationsDelegate

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
Expand Down
103 changes: 0 additions & 103 deletions JSDecoupledAppDelegate_SampleApp/JSDecoupledAppDelegate.h

This file was deleted.

Loading

0 comments on commit ddb58e8

Please sign in to comment.