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 "UINavigationController+RACSignalSupport.h" | |
#import <ReactiveCocoa/ReactiveCocoa.h> | |
#import <ReactiveCocoa/RACDelegateProxy.h> | |
#import <ReactiveCocoa/NSObject+RACDescription.h> | |
#import <objc/runtime.h> | |
@implementation UIImagePickerController (RACSignalSupport) |
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
-(BOOL)testItem:( id )item_ | |
withError:( NSError** )error_ | |
{ | |
if ([item_ isEqual: @(3)]) | |
{ | |
*error_ = [[NSError alloc] initWithDomain: @"MyErrorDomain" code: 1 userInfo: nil]; | |
return NO; | |
} | |
return YES; | |
} |
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
countElements("🇬🇧🇬🇧🇬🇧🇬🇧🇬🇧🇬🇧🇬🇧🇬🇧🇬🇧🇮🇹🇯🇵") == 1 |
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
<html> | |
<head> | |
<meta property="al:ios:url" content="shout://" /> | |
<meta property="al:ios:app_store_id" content="951847606" /> | |
<meta property="al:ios:app_name" content="Shout" /> | |
<meta property="og:title" content="Shout" /> | |
<meta property="og:type" content="website" /> | |
</head> | |
</html> |
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
protocol AbbreviatedNumber { | |
var doubleValue: Double { get } | |
} | |
extension Int: AbbreviatedNumber { | |
var doubleValue: Double { | |
return Double(self) | |
} | |
} |
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 | |
extension UIColor { | |
convenience init(rgbaValue: UInt32) { | |
let red = CGFloat((rgbaValue >> 24) & 0xff) / 255.0 | |
let green = CGFloat((rgbaValue >> 16) & 0xff) / 255.0 | |
let blue = CGFloat((rgbaValue >> 8) & 0xff) / 255.0 | |
let alpha = CGFloat((rgbaValue ) & 0xff) / 255.0 | |
self.init(red: red, green: green, blue: blue, alpha: alpha) |
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 | |
enum {{enumName}} { | |
{% for string in strings %} | |
case {{string.key|swift_Identifier}}{% if string.params %}({{string.params.types|join}}){% endif %} | |
{% endfor %} | |
} | |
extension {{enumName}} : CustomStringConvertible { | |
var description : String { return self.string } |
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 | |
protocol ReusableView: class { | |
static var viewIdentifier: String { get } | |
} | |
extension ReusableView { | |
static var viewIdentifier: String { | |
return String(Self) | |
} |
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
enum Choice { | |
case A | |
case B | |
case C | |
} | |
func printChoice(choice: Choice, flag: Bool) { | |
switch choice { | |
case .A, .B, .C where flag: | |
print("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
protocol CDelegate: class { | |
func f() | |
} | |
class C { | |
weak var delegate: CDelegate? | |
func g() { | |
self.delegate?.f() | |
} |
OlderNewer