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 UIKit | |
/// | |
///Declaration | |
/// | |
protocol UIViewBuilder: AnyObject {} | |
extension UIViewBuilder where Self: UIView { | |
init(_ build: ((Self) -> Void)) { |
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
#!/usr/bin/env ruby | |
device_types_output = `xcrun simctl list devicetypes` | |
device_types = device_types_output.scan /(.*) \((.*)\)/ | |
runtimes_output = `xcrun simctl list runtimes` | |
runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/ | |
devices_output = `xcrun simctl list devices` | |
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/ |
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
#define S(_s) @selector(application##_s:) // selector generator | |
#define N(_n) UIApplication##_n##Notification // name generator | |
#define L(X) X(WillResignActive), X(DidEnterBackground), \ | |
X(WillEnterForeground), X(DidBecomeActive), X(WillTerminate) // apply X over list | |
#define C(_a) sizeof((_a))/sizeof((_a)[0]) // array count | |
- (void)monitorAppState:(BOOL)start | |
{ | |
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; |
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
// Defines a yet undocumented method to add a warning if super isn't called. | |
#ifndef NS_REQUIRES_SUPER | |
#if __has_attribute(objc_requires_super) | |
#define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
#else | |
#define NS_REQUIRES_SUPER | |
#endif | |
#endif |