Skip to content

Instantly share code, notes, and snippets.

@iCarambaa
iCarambaa / UIApplication+Reachability.h
Created January 4, 2017 11:23
Manually deactivate reachability
@interface UIApplication(Reachability)
// This private method is used to push the view controller back up after
// double tapping the home button
- (void)_deactivateReachability;
@end
@iCarambaa
iCarambaa / setNeedsDisplayRadar.playground
Last active March 17, 2017 13:08
setNeedsDisplay grows linear with drawRect:, rdar://31113056
import UIKit
import PlaygroundSupport
// This playground compares the time spend in `setNeedsDisplay` to the time spend in `draw(rect:)`
// From the documentation, `setNeedsDisplay` should return in constant time but as you see here
// it grows linear with the time needed in `draw(rect)`.
// to compare for yourself, observe the variables `timeInSetNeedsDisplay` and `timeInDrawRect` and start drawing points by panning in
// the live view
final class PointView: UIView {