Skip to content

Instantly share code, notes, and snippets.

View slazyk's full-sized avatar

Leszek Ślażyński slazyk

View GitHub Profile
@slazyk
slazyk / Ranges.swift
Last active August 29, 2015 14:03
Ranges in Swift
// <a..b> <a..b| |a..b> |a..b|
operator prefix | { }
operator postfix | { }
operator prefix < { }
operator postfix > { }
enum Bound<T: ForwardIndex> {
case Closed (@auto_closure () -> T)
case Open (@auto_closure () -> T)
@slazyk
slazyk / gcd.swift
Created June 5, 2014 13:59
Fun with Swift
import Foundation
class VoidTask {
let group : dispatch_group_t
func waitUntilDone () -> () {
dispatch_group_wait(group, DISPATCH_TIME_FOREVER)
}
@slazyk
slazyk / weak_import xcode warnings
Created April 28, 2014 08:04
Put this macro at the top of prefix header to get warnings about APIs introduced later than Deployment Target (weak imports)
#define weak_import weak_import,deprecated("weak import")