View ProtocolInitializers Fix.swift
import Foundation | |
class Animal: NSObject { | |
} | |
protocol Named { | |
init(name: String) | |
} | |
protocol AnimalSpecification { |
View SynchronizedValueContaining.swift
public protocol SynchronizedValueContaining: class { | |
typealias SynchronizedValueType | |
var _valueAccessorSerialQueue: dispatch_queue_t { get } | |
var _privateValue: SynchronizedValueType { get set } | |
} | |
public extension SynchronizedValueContaining { | |
var synchronizedValue: SynchronizedValueType { | |
get { | |
var v: SynchronizedValueType! |
View build-libevent-tvOS.sh
#!/bin/bash | |
# Builds libevent for tvOS targets: | |
# AppleTVSimulator-x86_64, AppleTVOS-arm64. | |
# | |
# Copyright 2015 Niels van Hoorn <nvh@nvh.io> | |
# | |
# Based on work by Mike Tigas | |
# Copyright 2012 Mike Tigas <mike@tig.as> | |
# | |
# Based on work by Felix Schulze on 16.12.10. |
View optionals.swift
extension Dictionary { | |
func test() { | |
for (key,value) in self { | |
//Works | |
if value is Int { | |
println("int") | |
} | |
//Throws compiler error: cannot downcast from 'Value' to a more optional type 'Int?' | |
if value is Int? { | |
println("optional int") |
View log.crash
{"app_name":"TransIP","app_version":"","bundleID":"nl.transip.TransIP","adam_id":325181784,"os_version":"iPhone OS 8.1.3 (12B466)","slice_uuid":"0d9c547d-3c8d-3eb0-b948-c1b5b26f47de","share_with_app_devs":true,"build_version":"2.2.1","is_first_party":false,"bug_type":"109","name":"TransIP"} | |
Incident Identifier: 1688A02F-A828-4E9D-80E4-D2825E4AA86E | |
CrashReporter Key: a80feeff082bd894f4b469f6e473ccaa67072c82 | |
Hardware Model: iPhone7,1 | |
Process: TransIP [7660] | |
Path: /private/var/mobile/Containers/Bundle/Application/685D85BB-B84F-4BD7-ACC1-EE1245308744/TransIP.app/TransIP | |
Identifier: nl.transip.TransIP | |
Version: 2.2.1 | |
Code Type: ARM (Native) | |
Parent Process: launchd [1] |
View DataSourceState.swift
enum DataSourceState<D,E> { | |
case Empty | |
case Loading(Box<D?>) | |
case Ready(Box<D>) | |
case Error(Box<E>,Box<D?>) | |
func toLoading() -> DataSourceState { | |
switch self { | |
case .Ready(let oldData): | |
let value: D? = oldData.value |
View Examples.swift
//MARK: examples | |
extension JSONValue { | |
static func url(value: JSONType) -> JSONResult<NSURL> { | |
return cast(value).map({NSURL(string: $0)}) | |
} | |
} | |
extension JSONValue { |
View example_root.js.coffee
class App.Root extends Spine.Stack | |
controllers: | |
resources: App.Resources | |
users: App.Users | |
routes: | |
'/resources' : 'resources' | |
'/users' : 'users' | |
default: 'users' |