VOOZH about

URL: https://theapplewiki.com/wiki/Dev:ControlCenterUI.framework

⇱ Dev:ControlCenterUI.framework - The Apple Wiki


ControlCenterUI.framework
Private Framework
com.apple.ControlCenterUI
Available10.0 – present
Class PrefixCCUI

ControlCenterUI is a private framework that was introduced in iOS 10 to handle the UI present in the ControlCenter, something that previously included within SpringBoard.

Custom 3D Touch Actions

Custom 3D Touch actions can be added to toggles/button in the Control Center really easily starting with iOS 10, the example code below will show you how to add a custom 3D Touch action to the Wi-Fi Toggle.

@interface SBUIAction : NSObject
- (id)initWithTitle:(id)arg1handler:(id/* block */)arg2;
- (id)initWithTitle:(id)arg1subtitle:(id)arg2handler:(id/* block */)arg3;
- (id)initWithTitle:(id)arg1subtitle:(id)arg2image:(id)arg3badgeView:(id)arg4handler:(id/* block */)arg5;
- (id)initWithTitle:(id)arg1subtitle:(id)arg2image:(id)arg3handler:(id/* block */)arg4;
@end

@protocol CCUIButtonModuleDelegate <NSObject>
@required
-(void)buttonModule:(id)arg1willExecuteSecondaryActionWithCompletionHandler:(id/* block */)arg2;
@end

@interface CCUIButtonModule : NSObject
- (id<CCUIButtonModuleDelegate>)delegate;
@end

@interface CCUIWiFiSetting : CCUIButtonModule
@end

%hookBSPlatform
-(BOOL)hasOrbCapability{
returnYES;// To support 3D touch emulating tweaks like Peek-a-boo
}
%end

%hookCCUIWiFiSetting
-(int)orbBehavior{
return2;// returning 2 allows the 3D touch to be enabled and also tells it where to pull the options from.
}

-(NSArray*)buttonActions{
NSMutableArray*actions=[NSMutableArraynew];

// SBUIAction can be thought of as an UIApplicationShortcutItem
SBUIAction*network=[[NSClassFromString(@"SBUIAction")alloc]initWithTitle:@"Network"subtitle:@"disconnected"handler:^(void){
NSLog(@"Connected to Network");
[[selfdelegate]buttonModule:selfwillExecuteSecondaryActionWithCompletionHandler:nil];// this must be called to dismiss the 3D Touch Menu
}];
[actionsaddObject:network];

return[actionscopy];
}
%end