SBSyncController: Difference between revisions

From iPhone Development Wiki
No edit summary
No edit summary
Line 1: Line 1:
= Kill all applications in switcher =
= Kill all applications in switcher =
<code lang=objc">
1. First kill all the applications 
    [(SBSyncController *)[NSClassFromString(@"SBSyncController") sharedInstance] _killApplications];
<code lang="objc">[(SBSyncController *)[NSClassFromString(@"SBSyncController") sharedInstance] _killApplications];</code>
    //remove the identifiers from sbappswitchermodel
    if (IS_OS_7_OR_UNDER) {
2. then remove the applications from the switcher
      [[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayIdentifiers"] removeAllObjects];
iOS 8
    }
<code lang="objc">[[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayLayouts"] removeAllObjects];</code>
    else { //iOS 8
iOS 7
      [[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayLayouts"] removeAllObjects];
<code lang="objc">[[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayIdentifiers"] removeAllObjects];</code>
    }
</code>

Revision as of 15:33, 27 February 2015

Kill all applications in switcher

1. First kill all the applications [(SBSyncController *)[NSClassFromString(@"SBSyncController") sharedInstance] _killApplications];

2. then remove the applications from the switcher iOS 8 [[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayLayouts"] removeAllObjects]; iOS 7 [[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayIdentifiers"] removeAllObjects];