This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UIViewController (BHSContainment) | |
- (void)bhs_addChildViewController:(UIViewController *)child { | |
[self bhs_addChildViewController:child superview:self.view]; | |
} | |
// Note this potentially forces view loads on both parent and child | |
// Not a problem if used in -viewDidLoad or later | |
// Use superview parameter with care. If it's not within the parent VC's hierarchy, you deserve to lose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
@interface LBHView : NSView | |
/// This property controls whether the view can indirectly control its | |
/// backing layer's properties, specifically the following: | |
/// `affineTransform` | |
/// `anchorPoint` | |
/// | |
/// These properties cannot be modified on the layer during the time that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
protocol SomeDelegateProtocol : class { | |
func firstFunc() -> String | |
func secondFunc() -> Bool | |
func thirdFunc() -> Self | |
} | |
class MyClass { | |
weak var delegate : SomeDelegateProtocol? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Updated to Swift 1.2 and CocoaLumberjack 2.0.0-rc by Stan Serebryakov on 2015-02-16 | |
import Foundation | |
extension DDLog { | |
private struct State { | |
static var logLevel: DDLogLevel = .Error | |
static var logAsync: Bool = true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |