Difference between revisions of "SBSyncController"

From iPhone Development Wiki
Jump to: navigation, search
(Created page with "# Kill all applications in switcher <code lang=objc"> [(SBSyncController *)[NSClassFromString(@"SBSyncController") sharedInstance] _killApplications]; //remove the ide...")
 
m (Added Navbox)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
# Kill all applications in switcher
+
= Kill all applications in switcher =
<code lang=objc">
+
 
    [(SBSyncController *)[NSClassFromString(@"SBSyncController") sharedInstance] _killApplications];
+
1. First kill all the applications
    //remove the identifiers from sbappswitchermodel
+
 
    if (IS_OS_7_OR_UNDER) {
+
<source lang="objc">[(SBSyncController *)[NSClassFromString(@"SBSyncController") sharedInstance] _killApplications];</source>
      [[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayIdentifiers"] removeAllObjects];
+
 
    }
+
2. Then remove the applications from the switcher
    else { //iOS 8
+
 
      [[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayLayouts"] removeAllObjects];
+
iOS 7
    }
+
<source lang="objc">[[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayIdentifiers"] removeAllObjects];</source>
</code>
+
 
 +
iOS 8
 +
<source lang="objc">[[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayLayouts"] removeAllObjects];</source>
 +
 
 +
{{occlass|library=SpringBoard.app|navbox=1}}

Latest revision as of 13:59, 11 August 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 7

[[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayIdentifiers"] removeAllObjects];

iOS 8

[[[NSClassFromString(@"SBAppSwitcherModel") sharedInstance] valueForKey:@"_recentDisplayLayouts"] removeAllObjects];