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
// Creates a UIColor from a Hex string. | |
func colorWithHexInString(hex : String) -> UIColor { | |
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString | |
if (cString.hasPrefix("#")) { | |
cString = cString.substringFromIndex(advance(cString.startIndex, 1)) | |
} | |
if (countElements(cString) != 6) { |
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
// Creates a UIColor from a Hex string. | |
func colorWithHexInString(hex : String) -> UIColor { | |
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString | |
if (cString.hasPrefix("#")) { | |
cString = cString.substringFromIndex(advance(cString.startIndex, 1)) | |
} | |
if (countElements(cString) != 6) { |
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
// | |
// InputView.swift | |
// abcdapp | |
// | |
// Created by Antoine Barrault on 21/08/2014. | |
// Copyright (c) 2014 Citrus Lab. All rights reserved. | |
// | |
import UIKit |
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 Env { | |
private static let production : Bool = { | |
#if DEBUG | |
print("DEBUG") | |
return false | |
#elseif ADHOC | |
print("ADHOC") | |
return false | |
#else |
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 Env { | |
private static let production : Bool = { | |
#if DEBUG | |
print("DEBUG") | |
let dic = ProcessInfo.processInfo.environment | |
if let forceProduction = dic["forceProduction"] , forceProduction == "true" { | |
return true | |
} | |
return false |
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
# Sometimes it's a README fix, or something like that - which isn't relevant for | |
# including in a project's CHANGELOG for example | |
declared_trivial = github.pr_title.include? "#trivial" | |
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet | |
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]" | |
# Warn when there is a big PR | |
warn("Big PR") if git.lines_of_code > 500 |
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
# Sometimes it's a README fix, or something like that - which isn't relevant for | |
# including in a project's CHANGELOG for example | |
declared_trivial = github.pr_title.include? "#trivial" | |
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet | |
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]" | |
# Warn when there is a big PR | |
warn("Big PR") if git.lines_of_code > 500 |
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 MyProtocol<NSObject> | |
@optional | |
- (void)anOptionalMethod; | |
@end |
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
@objc protocol MyProtocol { | |
@objc optional func anOptionalMethod() | |
} |
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 MyProtocol { | |
func anOptionalMethod() | |
func aNotOptionalMethod() | |
} | |
extension MyProtocol { | |
func anOptionalMethod() { | |
//this is a empty implementation to allow this method to be optional | |
} |
OlderNewer