This file contains 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
#!/usr/bin/env osascript | |
on run argv | |
if count of argv < 1 then | |
logEvent("Usage: ./changeVersion iOSVersion(7.1,7.0)") | |
error number -128 | |
end | |
set iOSVersion to item 1 of argv | |
This file contains 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
#!/usr/bin/env xcrun swift -O | |
struct MyOptions: RawOptionSetType, BooleanType { | |
var boolValue: Bool { return self.rawValue != 0 } | |
var rawValue: UInt | |
init(rawValue value: UInt) { | |
self.rawValue = value | |
} | |
init(nilLiteral: Void) { |
This file contains 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
struct Foo { | |
var bar: String = "" | |
} | |
class Something { | |
var foo: Foo = Foo() { | |
didSet { | |
println("didSet called") | |
} | |
} |
This file contains 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 bezierPath(p1: CLLocationCoordinate2D, toPoint p2: CLLocationCoordinate2D, steps: Int = 100) | |
-> [CLLocationCoordinate2D] | |
{ | |
let auxiliaryPoint = self.fetchThirdPointByLocations(p1, p2: p2, angle: 90.0) | |
var targetPoints = [CLLocationCoordinate2D]() | |
let doubleSteps = Double(steps) | |
for index in 0 ... steps { | |
let t = Double(index) / doubleSteps |
This file contains 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
// | |
// Storage.swift | |
// | |
// Created by Martin Conte Mac Donell ([email protected]) | |
// | |
import Foundation | |
/** | |
This struct is the base for Storage Keys. This way we enforce all keys to be in a container to avoid typos |
This file contains 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
PLCameraView | |
PLPreviewView | |
PLCameraFocusView | |
UIImageView | |
PLCropOverlay | |
OverlayView | |
PLCropOverlayBottomBar | |
UIImageView | |
PLCropOverlayBottomBarButton | |
UIImageView |
This file contains 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
$ xcodebuild -workspace 'Test.xcworkspace' -scheme 'Test' -configuration 'Debug' -sdk iphonesimulator -destination 'name=iPhone 6' build | |
Build settings from command line: | |
SDKROOT = iphonesimulator8.3 | |
2015-02-10 09:54:05.827 xcodebuild[42416:3126221] DVTAssertions: Warning in /SourceCache/DVTiOSFrameworks/DVTiOSFrameworks-7514.1/DTDeviceKitBase/DTDKRemoteDeviceDataListener.m:79 | |
Details: Running against an old version of MobileDevice; some interaction with proxied devices may be unavailable. | |
Object: <DTDKRemoteDeviceDataListener: 0x7fcf5cf10c90> | |
Method: -listenerThreadImplementation | |
Thread: <NSThread: 0x7fcf5cf09990>{number = 2, name = (null)} | |
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide. |
This file contains 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 test<T>(#something: T) -> T { | |
return ("abc" as? T) ?? something | |
} | |
let str: String? = "abc" | |
println(test(something: "") == str) // false | |
println(test(something: "")) // "abc" |
This file contains 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
protocol SomeProtocol { | |
var a: Int { get } | |
} | |
struct SomeStruct: SomeProtocol { | |
var a = 0 | |
} | |
class SomeClass { | |
var value: SomeProtocol = SomeStruct() { |
This file contains 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 | |
let pixels: [[UInt8]] = [ | |
[ | |
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | |
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, | |
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, | |
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, | |
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, | |
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, |
OlderNewer