This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface AppLaunchCounter : NSObject | |
+ (BOOL)isFirstLaunch; | |
+ (NSUInteger)numberOfLaunches; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIApplication { | |
private struct AssociatedObjectsKeys { | |
static var visibleViewControllersPointers = "UIApplication_visibleViewControllersPointers" | |
} | |
fileprivate var visibleViewControllersPointers: NSPointerArray { | |
var pointers = objc_getAssociatedObject(self, &AssociatedObjectsKeys.visibleViewControllersPointers) as! NSPointerArray? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UIApplication (VisibleViewControllers) | |
@property (nonatomic, readonly) NSArray<__kindof UIViewController *> *visibleViewControllers; | |
@end |