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 | |
/// Find first differing character between two strings | |
/// | |
/// :param: s1 First String | |
/// :param: s2 Second String | |
/// | |
/// :returns: .DifferenceAtIndex(i) or .NoDifference | |
public func firstDifferenceBetweenStrings(s1: NSString, s2: NSString) -> FirstDifferenceResult { |
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 | |
struct Stream { | |
let string: NSString | |
var position: Int | |
var matchingRange: NSRange { | |
return NSRange(location: position, length: string.length - position) | |
} | |
} |
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
//: Responder chain in Swift using enums | |
protocol CommandProtocol {} | |
protocol Responder: class { | |
var nextResponder: Responder? { get } | |
func performerForCommand | |
<Command : CommandProtocol> | |
(command: Command) -> (() -> ())? |
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
# This script is based on Jacob Van Order's answer on apple dev forums https://devforums.apple.com/message/971277 | |
# See also http://spin.atomicobject.com/2011/12/13/building-a-universal-framework-for-ios/ for the start | |
# To get this to work with a Xcode 6 Cocoa Touch Framework, create Framework | |
# Then create a new Aggregate Target. Throw this script into a Build Script Phrase on the Aggregate | |
###################### | |
# Options |
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
#!/bin/sh | |
UNIVERSAL_OUTPUTFOLDER=../build/ | |
# make the output directory and delete the framework directory | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
rm -rf "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" | |
# Step 1. Build Device and Simulator versions | |
set -o pipefail && xctool -workspace "../${WORKSPACE_NAME}" -scheme "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | xcpretty |
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
desc "Zip and copy to right folder" | |
private_lane :package_framework do |lane| | |
if !lane[:framework] | |
raise "No framework specified!".red | |
end | |
if !lane[:version] | |
raise "No version specified!".red | |
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
desc "Deploy/upload framework" | |
private_lane :deploy_framework do |lane| | |
if !lane[:framework] | |
raise "No framework specified!".red | |
end | |
if !lane[:version] | |
raise "No version specified!".red | |
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
fastlane_version "1.57.0" | |
require 'fileutils' | |
default_platform :ios | |
platform :ios do | |
desc "Increment framework version" | |
private_lane :increment_framework_version do |lane| |
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
/** @jsx React.DOM */ | |
var SVGComponent = React.createClass({ | |
render: function() { | |
return this.transferPropsTo( | |
<svg>{this.props.children}</svg> | |
); | |
} | |
}); |
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/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@interface KurdStyle : NSObject | |
// Colors | |
+ (UIColor*)mainColor; | |
+ (UIColor*)shadowColor; |