Skip to content

Instantly share code, notes, and snippets.

@seivan
seivan / ConfuciusControlState.swift
Created May 31, 2016 06:48
Agnostic Control State
public protocol ControlStateProtocol : Hashable {}
public enum ConfuciusControlState : OptionSetType {
#if os(iOS) || os(watchOS) || os(tvOS)
public typealias RawValue = UIControlState
#else
public typealias RawValue = Int
#endif
protocol Transformer {
associatedtype ValueType
associatedtype ReverseValueType
static func transform(value:ValueType) -> ReverseValueType
static func reverseTransform(value:ReverseValueType) -> ValueType?
}
@seivan
seivan / gist:0a38c293ecf9a03eaf59c9034f9c6b06
Last active May 25, 2016 15:12 — forked from alexandreraulin/gist:f4b1504aec9d25f5af08
Script for iOS Universal Framework compilation with Xcode 6
# 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
@seivan
seivan / sample.sh
Created May 25, 2016 14:34
fat framework sample
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@seivan
seivan / build-universal-framework.sh
Last active May 25, 2016 14:30 — forked from ulhas/build-universal-framework.sh
Script for building universal framework used in HyperTrack iOS SDK
#!/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
@seivan
seivan / package_framework.rb
Created May 25, 2016 14:29 — forked from ulhas/package_framework.rb
Fastlane - private lane for 'package_framework`
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
@seivan
seivan / deploy_framework.rb
Created May 25, 2016 14:29 — forked from ulhas/deploy_framework.rb
Fastlane - private lane for 'deploying framework'
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
@seivan
seivan / fastfile
Created May 25, 2016 14:29 — forked from ulhas/fastfile
Fastfile for HyperTrack iOS SDKs
fastlane_version "1.57.0"
require 'fileutils'
default_platform :ios
platform :ios do
desc "Increment framework version"
private_lane :increment_framework_version do |lane|
public typealias LazyMappedResults = LazyMapCollection<Self.Elements, Style<ValueType>>
public typealias LazyFilteredResults = LazyFilterCollection<LazyMappedResults>
public typealias LazyFlatMappedErrors = LazyMapCollection<LazyFilterCollection<LazyMapCollection<Self.Elements, ErrorType?>>, ErrorType>
Playground execution failed: Anhui.playground:192:8: error: binary operator '==' cannot be applied to operands of type 'LazyMapCollection<LazyFilterCollection<LazyMapCollection<LazyMapCollection<[SampleValidator<String>], ValidationResult<String>>, ErrorType?>>, ErrorType>' (aka 'LazyMapCollection<LazyFilterCollection<LazyMapCollection<LazyMapCollection<Array<SampleValidator<String>>, ValidationResult<String>>, Optional<ErrorType>>>, ErrorType>') and 'LazyMapCollection<LazyFilterCollection<LazyMapCollection<LazyMapCollection<LazyMapCollection<[SampleValidator<String>], ValidationResult<String>>, ValidationResult<String>>, ErrorType?>>, ErrorType>' (aka 'LazyMapCollection<LazyFilterCollection<LazyMapCollection<LazyMapCollection<LazyMapCollection<Array<SampleValidator<String>>, ValidationResult<String>>, ValidationResult<String>>, Optional<ErrorType>>>, ErrorType>')
errors == otherErrors
~~~~~~ ^ ~~~~~~~~~~~
Anhui.playground:192:8: note: overloads for '==' exist with these partially matching parameter lists: (