PubSub+ Messaging API For C  7.29.0.6
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ex/ios/AppDelegate.m
/*
* Copyright 2014-2024 Solace Corporation. All rights reserved.
*/
#import "AppDelegate.h"
#import "AppTransitionsExample.h"
#import "Example.h"
#import "LogViewController.h"
@implementation AppDelegate
- (void)applicationWillResignActive:(UIApplication *)application {
// Attempt to suspend an example that is currently running when the app is
// moving to an inactive state
UIViewController *currentViewController =
((UINavigationController *)self.window.rootViewController)
.visibleViewController;
if (currentViewController.class == LogViewController.class) {
LogViewController *controller =
(LogViewController *)currentViewController;
// Note that this only applies to the AppStateTransitionsExample, which
// is designed to demonstrate application state changes
if (controller.example.class == AppTransitionsExample.class) {
AppTransitionsExample *example =
(AppTransitionsExample *)controller.example;
[example suspend];
}
}
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Attempt to resume an example that was running when the app moved to an
// inactive state
UIViewController *currentViewController =
((UINavigationController *)self.window.rootViewController)
.visibleViewController;
if (currentViewController.class == LogViewController.class) {
LogViewController *controller =
(LogViewController *)currentViewController;
// Note that this only applies to the AppStateTransitionsExample, which
// is designed to demonstrate application state changes
if (controller.example.class == AppTransitionsExample.class) {
AppTransitionsExample *example =
(AppTransitionsExample *)controller.example;
[example resume];
}
}
}
@end