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
var endpoint = sockaddr_in() | |
let f = UnsafeRawPointer(UnsafeMutableRawPointer(&endpoint)).bindMemory(to: sockaddr.self, capacity: 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
//: Playground - noun: a place where people can play | |
import UIKit | |
class Test { | |
let handler: () -> () | |
deinit { | |
print("dealloc'd") |
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
extension BCTextViewCell { | |
func configure(row: Row) { | |
self.textView.text = row.text | |
} | |
} | |
extension BCTextFieldCell { | |
func configure(row: Row) { | |
self.textField.placeholder = row.text | |
} |
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 Section { | |
let info: String | |
} | |
struct Row { | |
let text: String | |
} | |
class BaseClass: NSObject {} | |
class SubclassUno: BaseClass {} |
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
func curry <A, B, C> (f: (A, B) -> C) -> A -> (B -> C) { | |
return { (a: A) -> (B -> C) in | |
return { (b: B) -> C in | |
return f(a,b) | |
} | |
} | |
} | |
func uncurry <A, B, C> (f: A -> B -> C) -> (A, B) -> C { | |
return { (a: A, b: B) -> C in |