-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from ruslanskorb/develop
Version bump (1.1.2)
- Loading branch information
Showing
6 changed files
with
81 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// UIApplication+RSKImageCropper.h | ||
// RSKImageCropperExample | ||
// | ||
// Created by Ruslan Skorb on 3/28/15. | ||
// Copyright (c) 2015 Ruslan Skorb. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
/** | ||
The category `RSKImageCropper` of the class `UIApplication` provides the method `rsk_sharedApplication` which returns `nil` in an application extension, otherwise it returns the singleton app instance. | ||
*/ | ||
@interface UIApplication (RSKImageCropper) | ||
|
||
/** | ||
Returns `nil` in an application extension, otherwise returns the singleton app instance. | ||
@return `nil` in an application extension, otherwise the app instance is created in the `UIApplicationMain` function. | ||
*/ | ||
+ (UIApplication *)rsk_sharedApplication; | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// UIApplication+RSKImageCropper.m | ||
// RSKImageCropperExample | ||
// | ||
// Created by Ruslan Skorb on 3/28/15. | ||
// Copyright (c) 2015 Ruslan Skorb. All rights reserved. | ||
// | ||
|
||
#import "UIApplication+RSKImageCropper.h" | ||
#import <objc/runtime.h> | ||
|
||
@implementation UIApplication (RSKImageCropper) | ||
|
||
+ (void)load | ||
{ | ||
// When you build an extension based on an Xcode template, you get an extension bundle that ends in .appex. | ||
// https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionCreation.html | ||
if (![[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"]) { | ||
Method sharedApplicationMethod = class_getClassMethod([UIApplication class], @selector(sharedApplication)); | ||
if (sharedApplicationMethod != NULL) { | ||
IMP sharedApplicationMethodImplementation = method_getImplementation(sharedApplicationMethod); | ||
Method rsk_sharedApplicationMethod = class_getClassMethod([UIApplication class], @selector(rsk_sharedApplication)); | ||
method_setImplementation(rsk_sharedApplicationMethod, sharedApplicationMethodImplementation); | ||
} | ||
} | ||
} | ||
|
||
+ (UIApplication *)rsk_sharedApplication | ||
{ | ||
return nil; | ||
} | ||
|
||
@end |