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
@IBDesignable | |
class IconButton: UIControl { | |
@IBInspectable var iconImage: UIImage? | |
override func drawRect(rect: CGRect) { | |
if let iconImage = self.iconImage { | |
iconImage.drawInRect(self.bounds) |
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
@IBDesignable | |
class IconButton: UIControl { | |
@IBInspectable var iconImage: UIImage? | |
override func drawRect(rect: CGRect) { | |
if let iconImage = self.iconImage { | |
iconImage.drawInRect(self.bounds) |
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
$ diskutil list |
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 swizzle() { | |
var dict = ["This is Key.": "This is value."] as NSDictionary | |
var method: Method = class_getInstanceMethod(object_getClass(dict), "description") | |
var swizzledMethod: Method = class_getInstanceMethod(object_getClass(dict), "myDescription") | |
method_exchangeImplementations(method, swizzledMethod) | |
println(dict.description) | |
} |
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 UIKit | |
class HollowView: UIView { | |
var hollowRadius = 60.0 as CGFloat | |
lazy var hollowPoint: CGPoint = { | |
return CGPoint( | |
x: CGRectGetWidth(self.bounds) / 2.0, | |
y: CGRectGetHeight(self.bounds) / 2.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
var engine = new Bloodhound({ | |
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
prefetch: { | |
url: "stations.json", | |
cacheKey: "change here!" | |
} | |
}); |
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
$ carthage build --no-skip-current | |
*** xcodebuild output can be found in /var/folders/j9/s8z2l0l93jb3xz9y4_jx934h0000gn/T/carthage-xcodebuild.z1A534.log | |
*** Building scheme "CarthageSample" in CarthageSample.xcworkspace | |
A shell task failed with exit code 65: | |
2015-05-10 21:24:02.422 xcodebuild[72041:3409756] [MT] iPhoneSimulator: SimVerifier returned: Error Domain=NSPOSIXErrorDomain Code=53 "Simulator verification failed." UserInfo=0x7f8c15a7af50 {NSLocalizedFailureReason=A connection to the simulator verification service could not be established., NSLocalizedRecoverySuggestion=Ensure that Xcode.app is installed on a volume with ownership enabled., NSLocalizedDescription=Simulator verification failed.} | |
** BUILD FAILED ** | |
The following build commands failed: | |
CompileSwift normal arm64 /Users/***/Desktop/CarthageSample/CarthageSample/Sample.swift |
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
TouchVisualizer.start() |
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
// | |
// FileUploader.swift | |
// ERAssistant | |
// | |
// Created by Narciso Cerezo Jiménez on 27/5/15. | |
// Copyright (c) 2015 Closure Software. All rights reserved. | |
// | |
import Foundation | |
import Alamofire |
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
protocol InstantiateFromNibable { | |
typealias Instance | |
static func instantiateFromNib() -> Instance | |
} |