This file contains hidden or 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 removeAllGestureRecognizers() { | |
gestureRecognizers?.forEach(self.removeGestureRecognizer) | |
} |
This file contains hidden or 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 | |
extension Array { | |
mutating func prepend(newElement: Element) { | |
self.insert(newElement, atIndex: 0) | |
} | |
} |
This file contains hidden or 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
public struct ConditionalArrayFilter <Element> { | |
let condition: (Element) -> Bool // the condition to meet | |
private var _array = Array<Element>() | |
var array: Array<Element> { | |
get { return _array } | |
} | |
init(condition: (Element) -> Bool) { self.condition = condition } | |
} | |
private extension ConditionalArrayFilter { |
NewerOlder