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 | |
public typealias JSON = AnyObject | |
public func JSONWithData(data: NSData) -> JSON? { | |
do { | |
let j = try NSJSONSerialization.JSONObjectWithData(data, options: []) | |
return j | |
} catch _ { | |
return nil |
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 Person: NSObject { | |
@objc var name: String? { | |
get { | |
return NSUserDefaults.standardUserDefaults().objectForKey(NSStringFromSelector(#selector(Person.name))) as? String | |
} | |
set(name) { | |
NSUserDefaults.standardUserDefaults().setObject(name, forKey: NSStringFromSelector(#selector(Person.name))) | |
NSUserDefaults.standardUserDefaults().synchronize() | |
} | |
} |
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
// | |
// AppDelegate.m | |
// StatusBarWindow | |
// | |
// Created by Adam Bell on 7/9/16. | |
// Copyright © 2016 Adam Bell. All rights reserved. | |
// | |
#import "AppDelegate.h" |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
protocol Item { | |
var title: String? { get set } | |
var value: String? { get set } | |
} |
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
// | |
// AppDelegate.swift | |
// AVSpeechSynthesizerTest | |
// | |
// Created by Adam Bell on 12/30/16. | |
// Copyright © 2016 Adam Bell. All rights reserved. | |
// | |
import AVFoundation | |
import UIKit |
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
// Preheat the UIActivityViewController because it's crazy slow. | |
let activityViewController = UIActivityViewController(activityItems: [ UIImage(named: "Halo.jpg")! ], applicationActivities: nil) | |
activityViewController.view.alpha = 0.0 | |
let fakeViewController = UIViewController() | |
fakeViewController.present(activityViewController, animated: false) { | |
activityViewController.dismiss(animated: false, completion: nil) | |
} |
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
RubyGems Environment: | |
- RUBYGEMS VERSION: 2.6.8 | |
- RUBY VERSION: 2.4.0 (2016-12-24 patchlevel 0) [x86_64-darwin16] | |
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.4.0 | |
- USER INSTALLATION DIRECTORY: /Users/b3ll/.gem/ruby/2.4.0 | |
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby | |
- EXECUTABLE DIRECTORY: /usr/local/bin | |
- SPEC CACHE DIRECTORY: /Users/b3ll/.gem/specs | |
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.4.0/etc | |
- RUBYGEMS PLATFORMS: |
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
// | |
// ContentView.swift | |
// CircleLine | |
// | |
// Created by Adam Bell on 6/5/19. | |
// Copyright © 2019 Adam Bell. All rights reserved. | |
// | |
import SwiftUI |
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
// | |
// UIUndoGestureRecognizerFixes.m | |
// no u | |
// | |
// Created by Adam Bell on 8/22/19. | |
// Copyright © 2019 Adam Bell. All rights reserved. | |
// | |
#import "UIUndoGestureRecognizerFixes.h" |