Yes, you can create custom UIView
or UIViewController
with interface builder and load it from inside your tweak.
To do that you need to:
- Copy *.nib file of the view into
/System/Library/CoreServices/SpringBoard.app/
. - Call
NSBundle
method-(NSArray*)loadNibNamed:(NSString*)name owner:(id)owner options:(NSDictionary*)options
.
There is nothing special about loading and presenting views or view controllers from inside a tweak. In your case - SpringBoard tweak. Think of it like you're the SpringBoard, your code is the SpringBoard's code. This means that you can use the same APIs you would use in a normal iOS application. NSBundle
to load your nib, UIViewController
to present your view controller, UIView
to add your view as a subview of another view etc. Only thing you need to do before that is to find view or view controller inside the SpringBoard that you need and copy your resources in SpringBoard's directory.
That's how I'm doing it. I have a Camera app tweak that modifies existing UI and can load custom views that I've created in Interface Builder. Nothing special about it - load nib, present and everything just works.