I hereby claim:
- I am AliSoftware on github.
- I am aligatr (https://keybase.io/aligatr) on keybase.
- I have a public key whose fingerprint is 172F 2268 1A5A BD88 4FFF D1B3 F6D2 6970 231A FBDE
To claim this, I am signing this object:
protocol Fooable { | |
static var staticBigSelf: String { get } | |
static var staticSmallSelf: String { get } | |
var instanceBigSelf: String { get } | |
var instanceSmallSelf: String { get } | |
init() | |
} | |
extension Fooable { | |
static var staticBigSelf: String { return String(Self) } |
enum Crash: ErrorType { case Key(String) } | |
func kaboom(str: String) throws -> String { | |
throw Crash.Key(str) | |
} | |
// Crash with EXC_BAD_ACCESS, not every time but quite often | |
func test1() throws -> [String:[String]] { | |
return [ | |
"foo": try [kaboom("test1a"), kaboom("test1b")] | |
] |
struct Coordinator { | |
let window: UIWindow | |
let navCtrl: UINavigationController? | |
func start() { | |
presentWelcomeScreen() | |
} | |
private func presentWelcomeScreen() { | |
let vc = WelcomeScreenViewController() // Instanciate from code, XIB, Storyboard, whatever your jam is |
I hereby claim:
To claim this, I am signing this object:
// When you are in the diff page of a GitHub PR | |
// And want to hide all the Pods/* files in that diff page, use this: | |
// Paste that in your Web Inspector's console | |
var nodes = document.evaluate("//div[@class='file-header' and starts-with(@data-path,'Pods/')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); | |
for(i=0; i<nodes.snapshotLength; ++i) { | |
nodes.snapshotItem(i).parentNode.hidden = true | |
} | |
// Or even better, create a bookmark with this code for easy quick access: |
This is a reference of all the useful links to follow my UIKonf'17 talk on Code Generation in Swift
This proposal enhances protocol safety at compile time by incorporating role keywords to discourage two categories of potential user errors. This proposal can be phased in first over time and language release.
#!/bin/bash | |
##### | |
# | |
# git-gerrit v1.1 | |
# O. Halligon, 2017.08.18 | |
# | |
##### | |
# | |
# Usage: | |
# |
import UIKit | |
import PlaygroundSupport | |
// Create a view to display the result in playground | |
let view = UIView(frame: CGRect(x: 0, y: 0, width: 500, height: 500)) | |
view.backgroundColor = .white | |
PlaygroundPage.current.liveView = view; |
import Foundation | |
//: Swift type-safe protocol versions of (Mutable)Copying | |
protocol SwiftCopying { | |
associatedtype NonMutableType = Self | |
func clone() -> NonMutableType | |
} | |
extension SwiftCopying where Self: NSCopying { | |
func clone() -> NonMutableType { | |
return self.copy() as! NonMutableType |