Skip to content

Instantly share code, notes, and snippets.

@Mabdelwanis
Forked from MTACS/SwitcherTerminate.m
Created December 4, 2023 20:24
Show Gist options
  • Save Mabdelwanis/f50b8a1f8b638b8e2ede5a4e899f6f6e to your computer and use it in GitHub Desktop.
Save Mabdelwanis/f50b8a1f8b638b8e2ede5a4e899f6f6e to your computer and use it in GitHub Desktop.
Kill all running apps iOS 16+
@interface SBAppLayout : NSObject
@end
@interface SBFluidSwitcherItemContainer: UIView
@end
@interface SBFluidSwitcherViewController: UIViewController
@property (readonly, nonatomic) NSArray *appLayouts;
- (id)_itemContainerForAppLayoutIfExists:(id)arg0;
- (void)killContainer:(id)arg0 forReason:(NSInteger)arg1;
@end
%hook SBFluidSwitcherViewController
%new
- (void)terminateRunningApps {
for (SBAppLayout *item in self.appLayouts) {
SBFluidSwitcherItemContainer *container = [self _itemContainerForAppLayoutIfExists:item];
[self killContainer:container forReason:0];
}
}
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment