Skip to content

Instantly share code, notes, and snippets.

View jordanekay's full-sized avatar
🟢
Currently available for new projects

Jordan Kay jordanekay

🟢
Currently available for new projects
View GitHub Profile
@jordanekay
jordanekay / MonolithViewController.swift
Last active September 12, 2015 04:02 — forked from asmallteapot/MonolithViewController.swift
Handling storyboard segues with enumerations in Swift
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
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)
}
@implementation NSString (JSRemoveIrrelevantTags)
- (NSString *)js_stringByRemovingIrrelevantTags
{
NSMutableString *filteredString = [NSMutableString string];
NSSet *filteredLinguisticTags = [NSSet setWithArray:@[NSLinguisticTagDeterminer, NSLinguisticTagPreposition]];
[self enumerateLinguisticTagsInRange:NSMakeRange(0, self.length)
scheme:NSLinguisticTagSchemeLexicalClass