[Help] Drawing Directly to SpringBoard

Discussion in 'iOS Development' started by Cutch, Aug 30, 2010.

  1. Cutch

    Cutch New Member

    Joined:
    Aug 18, 2010
    Messages:
    4
    Likes Received:
    0
    I'm trying to draw a custom volume display, basically an image and rectangles, directly on screen. Its not an app but a dynamic library to draw direct to SpringBoard.

    I've looked at many sources, sample, and tutorials, but still cant figure it out. Since this is SpringBoard im guess i cant use CoreGraphics since UIKit is what SpringBoards based on.

    So do i need to hook a function if so which one, and what code do i use to draw.
  2. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    You can use CoreGraphics, just import it in the file. As for the methods, try looking for the method that draws the background (I'm not sure there is one, just a guess).
  3. Cutch

    Cutch New Member

    Joined:
    Aug 18, 2010
    Messages:
    4
    Likes Received:
    0
    All right i guess that makes sense but i guess that doesn't matter if either can draw, and i'm not doing anything fancy.

    Im more interested in the drawing part, do i have to grab a view from SpringBoard. Im able to grab the window from VolumeControlView can i work with that. Or can i somehow layer a view over SpringBoard.
  4. Freerunnering

    Freerunnering Member

    Joined:
    Sep 1, 2009
    Messages:
    296
    Likes Received:
    0
    Device:
    4G iPod touch
    If you can override the default vulome display window i'd try working on drawing into that?
  5. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    You can use the volume display, if not, add your own subview and draw on that.
  6. Cutch

    Cutch New Member

    Joined:
    Aug 18, 2010
    Messages:
    4
    Likes Received:
    0
    Thx for all the help really cleared some stuff up.

    After having some problem with loading images from paths i figured this out:
    Code:
    image = [[UIImage imageWithContentsOfFile:@"path"] retain];
    And ended up adding an imageview as a subview to _contentLayer from SBUIController.
    Code:
    MSHook(id, overrideinit, SBUIController *self, SEL sel) {
        self = _init(self, sel);
        if (self != nil)
            UIView *&_contentLayer(MSHookIvar<UIView *>(self, "_contentLayer"));
    Problem Solved

    Please Register or Log in to view images

  7. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Are you releasing that image at all? If not, then you are leaking like crazy. You should try to avoid retaining any variables when making SpringBoard plugins.
  8. Cutch

    Cutch New Member

    Joined:
    Aug 18, 2010
    Messages:
    4
    Likes Received:
    0
    Ya i am, the image is in constant use anyways, so i don't think leaking will be a problem

Share This Page