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

832ece085bfe2c7c5b0ed6be62d7e675?s=128

Peter Steinberger

May 07, 2013
Tweet

Transcript

  1. Bending UIKit to your will

  2. @steipete

  3. None
  4. None
  5. Private API

  6. None
  7. Development

  8. po [[UIWindow keyWindow] recursiveDescription]

  9. - (UIViewController *)_viewDelegate;

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

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

  12. 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; }
  13. [[NSNotificationCenter defaultCenter] addObserverForName:nil object:nil queue:nil usingBlock:^(NSNotification *note) { NSLog(@"Catch-All: %@",

    note); }];
  14. UIWindowFirstResponderDidChangeNotification

  15. Testing

  16. Nocilla KIF PonyDebugger OHHTTPStubs

  17. Fixing Apple’s bugs

  18. None
  19. None
  20. [_UIPageCurl _pageCurlAnimationDidStop:withState:]: message sent to deallocated instance 0x14a03fe0

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

  23. None
  24. Fun

  25. Fun

  26. UIRemoteViewController

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

  29. None
  30. None
  31. @interface CASpringAnimation : CABasicAnimation @property float damping; @property float mass;

    @property float stiffness; @property float velocity; @end
  32. Some subtitle or description goes here Here the title

  33. Technical debt

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

  35. Improve UI

  36. Some subtitle or description goes here Here the title

  37. Demo time

  38. None
  39. Hopper

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