Skip to content

Commit

Permalink
Fixed an issue where KarenPrefsAnimatedExitToSpringBoard would not al…
Browse files Browse the repository at this point in the history
…ways work properly on iOS 11
  • Loading branch information
akemin-dayo committed Jul 14, 2018
1 parent 5ab0a5a commit 0b3602d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion KarenPrefsAnimatedExitToSpringBoard.m
@@ -1,4 +1,5 @@
#import "KarenPrefsAnimatedExitToSpringBoard.h"
#import <version.h>

@implementation UIApplication (KarenPrefsAnimatedExitToSpringBoard)
-(void) karenPrefsAnimatedExit {
Expand All @@ -9,7 +10,10 @@ -(void) karenPrefsAnimatedExit {
if ([self respondsToSelector:@selector(suspend)]) {
if (multitaskingSupported) {
[self beginBackgroundTaskWithExpirationHandler:^{}];
[self performSelector:@selector(exit) withObject:nil afterDelay:0.4];
// iOS 11 changed something and now delay values above 0 no longer work reliably (sometimes it will work, other times it will not)
// Setting the delay value to 0 makes it look… ugly, to say the least (the app will flash to black before animating), but it's the best we can do until I figure out a better solution.
// Note that setting a delay of 0 does not equate to instantaneous call, it still waits on the thread properly so the animation /does/ still work
[self performSelector:@selector(exit) withObject:nil afterDelay:((kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iOS_11_0) ? 0.4 : 0)];
}
[self suspend];
} else {
Expand Down
2 changes: 1 addition & 1 deletion control
@@ -1,7 +1,7 @@
Package: net.angelxwind.karenprefs
Name: KarenPrefs
Depends: preferenceloader
Version: 1.3
Version: 1.3.1
Architecture: iphoneos-arm
Description: A development library that provides various conveniences and enhancements for developers seeking to write preference bundles for their tweaks.
Homepage: https://cydia.angelxwind.net/
Expand Down

0 comments on commit 0b3602d

Please sign in to comment.