Skip to content

Instantly share code, notes, and snippets.

@an0
an0 / OptionalTypeCastingIssues.swift
Last active February 28, 2016 23:46
Optional Type Casting Issues
class Foo {
}
class Bar: Foo {
}
//let b: Bar? = nil
let b: Bar? = Bar()
@an0
an0 / MutateStructArray.swift
Last active February 28, 2016 23:43
Mutate structs in array
struct Foo {
var i: Int = 0
}
var arr = [Foo(), Foo()]
print(arr)
for var a in arr {
a.i = 1
}
//
// MultiDirectionAdjudicatingScrollView.swift
// Khan Academy
//
// Created by Andy Matuschak on 12/16/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
import UIKit.UIGestureRecognizerSubclass