I hereby claim:
- I am romainmenke on github.
- I am flat (https://keybase.io/flat) on keybase.
- I have a public key whose fingerprint is 1DBF 4098 83D6 1915 E59E 71DC 2AB4 D1C5 BB59 BFCD
To claim this, I am signing this object:
import Foundation | |
protocol MirrorDescribable : CustomStringConvertible {} | |
extension MirrorDescribable { | |
var description : String { | |
return mirrorDescription | |
} | |
I hereby claim:
To claim this, I am signing this object:
class FloaterContainerLayer:CALayer { | |
var maxFloaters = 9 | |
var image:String? | |
var velocity:CGFloat = 50.0 | |
var gravity : Gravity = "FloaterContainerLayer" // just so that the initialiser doesnt complain | |
} | |
class SomeViewController : UIViewController { |
// something simple with an op at the return line | |
func foo() -> Int { | |
return 4 + 1 | |
} | |
// something verbose to get a print() of the return value | |
func foos() -> Int { | |
let value = 4 + 1 | |
print(value) | |
return value |
protocol Executable { | |
typealias Input | |
typealias Output | |
var capture : Input? { get set } | |
var block : Input -> Output { get set } | |
} | |
extension Executable { | |
struct RMMatrix<Element> { | |
private var values : [[Element]] = [] | |
var rows : [[Element]] { | |
get { | |
return values | |
} | |
set(value) { | |
values = value |
public struct OtherFloat { | |
public var value: Float | |
/// Create an instance initialized to zero. | |
public init() { | |
self.value = 0 | |
} | |
/// Create an instance initialized to `value`. | |
public init(_ value: Float) { | |
self.value = value | |
} |
import UIKit | |
import XCPlayground | |
extension UIView { | |
var diagonal : CGFloat { | |
return sqrt(pow(self.frame.width, 2) + pow(self.frame.height, 2)) | |
} | |
var radius : CGFloat { |
import CoreData | |
import UIKit | |
class ViewController: UIViewController { | |
var appDelegate : AppDelegate? | |
var managedContext : NSManagedObjectContext? | |
override func viewDidLoad() { | |
super.viewDidLoad() |
class Singleton { | |
// singelton pattern | |
private static var privateShared : Singleton? | |
class func shared() -> Singleton { | |
// make sure we get an instance from the singleton queue | |
guard let uwShared = read(privateShared) else { | |
privateShared = Singleton() | |
return privateShared! |