0

I am making an iPhone tweak that will place a respring slider below the power off one. I have found the proper class, I have overridden it and I managed to insert a button that resprings the device when clicked. However, I need to substitute that button with a "Slide to respring" bar, just like the "Slide to power off" above it. How can I do that? Thanks in advance! :)

EDIT: Here's my source code:

#import "substrate.h"
#import <UIKit/UIKit.h>

@interface MultiBar
-(void)action;
@end

static UIButton *button;
static UIView *lockView;

%hook SBPowerDownView

-(void)finishedAnimatingIn
{

      lockView = MSHookIvar<UIView *>(self, "_dimView");
      button = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
      [button addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside];
      [button setTitle:@"Respring" forState:UIControlStateNormal];
      button.frame = CGRectMake(80,100,160,40);
      [lockView addSubview:button];
      [button release];

    %orig;
 }

%new(v@:)

-(void)action
{
    [[UIApplication sharedApplication] relaunchSpringBoard];
}
%end
  • 1
    Seems you have the ingredients and receipt and want us to make you the cake. – Malloc Apr 30 '13 at 14:20
  • Added my source code. Also, I do not know where to find the actual "Slide to unlock bar". Plus, I need to make it call a method when it's unlocked. Please give me some pointers at least. :) – Nick Aliferopoulos Apr 30 '13 at 14:24

2 Answers2

0

A Google search for "ios slide to unlock" will return multiple sites with links to custom made sliders. Also if you wish to use the built in slider I suggest you look at cycript (iphonedevwiki.net/index.php/Cycript_Tricks). You can use it to help you figure out the view hierarchy of an app, among many other things. The rest I will leave up to you as Malloc's point is very true. Good luck :)

0

If you are just looking for the classes:

TPTopLockBar and TPBottomLockBar in TelephonyUI.framework