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
class MonolithViewController: UIViewController { | |
enum InnerSegueType { | |
case WebView | |
case Inspector | |
init?(segue: UIStoryboardSegue) { | |
if segue.identifier == "WebView" { | |
self = .WebView | |
} else if segue.identifier == "Inspector" { | |
self = .Inspector |
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
struct User { | |
let id: Int | |
let name: String | |
let email: String? | |
} | |
extension User: JSONDecodable { | |
static func create(id: Int, name: String, email: String?) -> User { | |
return User(id: id, name: name, email: email) | |
} |
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 NSString (JSRemoveIrrelevantTags) | |
- (NSString *)js_stringByRemovingIrrelevantTags | |
{ | |
NSMutableString *filteredString = [NSMutableString string]; | |
NSSet *filteredLinguisticTags = [NSSet setWithArray:@[NSLinguisticTagDeterminer, NSLinguisticTagPreposition]]; | |
[self enumerateLinguisticTagsInRange:NSMakeRange(0, self.length) | |
scheme:NSLinguisticTagSchemeLexicalClass |