1

I created a custom UIView programmatically. Does anyone know what class and what method I would use to display this on the springboard? I want my UIView to display on the springboard, and when a user opens an app I want it to show up there too. I have been searching through the private headers for some time and I can't seem to find what I'm looking for. I am developing a jailbreak tweak with iosopendev. Also could you tell me if the class is a viewcontroller or just a view?

2 Answers2

2

If you want the UIView to show anywhere (on SpringBoard and in apps), you should create a new UIWindow above the others and show your view in it like this :

UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.windowLevel = UIWindowLevelAlert + 2;
[window setHidden:NO];
[window setAlpha:1.0];
[window setBackgroundColor:[UIColor clearColor]];
[window addSubview:yourView];
Cl3ment
  • 155
  • 4
  • Thanks for your answer! I completely did not think of using a UIWindow.. Do you know what class I should hook and what method? I think the launch method is good for the springboard. – taysamjiggly May 07 '14 at 19:24
  • `-(void)applicationDidFinishLaunching:(id)application;`, within SpringBoard, is probably the method you want. (note that this may show the UIWindow on Lockscreen too, depending on `windowLevel`'s value). When an app is opened, the window will still be displayed – Cl3ment May 10 '14 at 19:30
0

You can hook some methods of SpringBoard such as :

- (void)applicationDidFinishLaunching:(id)arg1

And then, your code should be like this :

- (void)applicationDidFinishLaunching:(id)arg1
{
    %orig;
    NSLog(@"----- applicationDidFinishLaunching -----");
    UIWindow *_uiwindow = [[UIWindow alloc] initWithFrame:CGRectMake(100,100,120,100)];
    _uiwindow.windowLevel = UIWindowLevelStatusBar;
    _uiwindow.hidden = NO;
    [_uiwindow setBackgroundColor:[UIColor redColor]];
}

To add more custom views,just add subview to _uiwindow. Hope that will help you.