Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bending UIKit to your will

Bending UIKit to your will

My talk for UIKonf - http://uikonf.com

The video to this talk will be up soon. With just the slides, context gets lost a bit. Most of this calls are *really* just meant for development - use at your own risk.

See also: http://petersteinberger.com/blog/2012/pimping-recursivedescription/

If you're showing PDF on iOS, check out http://PSPDFKit.com

Peter Steinberger

May 07, 2013
Tweet

More Decks by Peter Steinberger

Other Decks in Programming

Transcript

  1. Bending UIKit
    to your will

    View full-size slide

  2. po [[UIWindow keyWindow] recursiveDescription]

    View full-size slide

  3. - (UIViewController *)_viewDelegate;

    View full-size slide

  4. [[UIApplication sharedApplication]
    performSelector:NSSelectorFromString(@"_performMemoryWarning")];

    View full-size slide

  5. extern void CGPathPrint(CGPathRef path, FILE* file);

    View full-size slide

  6. CGFloat PSPDFSimulatorAnimationDragCoefficient(void) {
    void *UIKit = dlopen([[[NSBundle bundleForClass:[UIApplication class]]
    executablePath] fileSystemRepresentation], RTLD_LAZY);
    CGFloat (*UIAnimationDragCoefficient)(void) =
    (CGFloat (*)(void))dlsym(UIKit, "UIAnimationDragCoefficient");
    return UIAnimationDragCoefficient? UIAnimationDragCoefficient() : 1.f;
    }

    View full-size slide

  7. [[NSNotificationCenter defaultCenter] addObserverForName:nil object:nil queue:nil
    usingBlock:^(NSNotification *note) {
    NSLog(@"Catch-All: %@", note);
    }];

    View full-size slide

  8. UIWindowFirstResponderDidChangeNotification

    View full-size slide

  9. Nocilla
    KIF
    PonyDebugger
    OHHTTPStubs

    View full-size slide

  10. Fixing Apple’s bugs

    View full-size slide

  11. [_UIPageCurl _pageCurlAnimationDidStop:withState:]:
    message sent to deallocated instance 0x14a03fe0

    View full-size slide

  12. NSClassFromString([NSString stringWithFormat:@"_%@urlState", @"UIPageC"]);

    View full-size slide

  13. UIRemoteViewController

    View full-size slide

  14. - (void)attentionClassDumpUser:(id)arg1
    yesItsUsAgain:(id)arg2
    althoughSwizzlingAndOverridingPrivateMethodsIsFun:(id)arg3
    itWasntMuchFunWhenYourAppStoppedWorking:(id)arg4
    pleaseRefrainFromDoingSoInTheFutureOkayThanksBye:(id)arg5;

    View full-size slide

  15. @interface CASpringAnimation : CABasicAnimation
    @property float damping;
    @property float mass;
    @property float stiffness;
    @property float velocity;
    @end

    View full-size slide

  16. Some subtitle or description goes here
    Here the title

    View full-size slide

  17. Technical debt

    View full-size slide

  18. - (void)addChildViewController:(id)controller;

    View full-size slide

  19. Some subtitle or description goes here
    Here the title

    View full-size slide

  20. Thanks!
    (And don’t tell Apple)
    @steipete - say Hi!

    View full-size slide