- List your dependencies in a Cartfile. Refer to the Carthage documentation for details.
- Run
carthage bootstrap --no-build --use-submodules
- Create a new workspace.
- Drag your existing App project into the workspace.
- Drag framework dependency projects from ./Carthage/Checkouts into the workspace.
- Go to the General tab of your target properties.
- Add framework dependencies to Linked Frameworks and Libraries. They will show up as Workspace frameworks.
- Add the same frameworks to Embedded Binaries.
- Note, the previous step will probably create duplicates in Linked Frameworks and Libraries. Delete the duplicates.
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 UIKit | |
/// A validation rule for text input. | |
public enum TextValidationRule { | |
/// Any input is valid, including an empty string. | |
case noRestriction | |
/// The input must not be empty. | |
case nonEmpty | |
/// The enitre input must match a regular expression. A matching substring is not enough. | |
case regularExpression(NSRegularExpression) |
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 | |
### | |
# Version: $Major.$Minor.$Commit | |
# | |
# How it works: | |
# 1. To roll minor number, tag each App Store release with a message. | |
# 2. To roll major number, create an additional tag on the last App Store | |
# release (e.g. "2.17.9") with new major number (e.g. "3"). | |
# 3. `Release` builds require a clean working directory. |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
enum JSONError : ErrorType { | |
case NoValueForKey(String) | |
case TypeMismatch | |
} | |
public class JSONObject { |
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
// NSArray and NSDictionary have methods to write to files using the .plist format | |
// If your array/dictionary only contains NSNumber, NSDate, NSData or NSString objects, this works like a charm! | |
NSArray *strings = @[@"stringOne", @"stringTwo"]; | |
NSString *filePath = @"/Path/To/Documents/data.plist"; | |
BOOL successfullyWroteFile = [strings writeToFile:filePath atomically:YES]; | |
// For error handling, you can check the successfullWroteFile variable |
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
/* | |
"WatchKit ignores attempts to set values of interface objects | |
while your interface is inactive.... Modifications can be made | |
only during initialization of your interface controller and | |
between calls to willActivate and [didDeactivate]." | |
*/ | |
class MyWKInterfaceController: WKInterfaceController { | |
private var isActive:Bool = true |
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
// | |
// Stack.m | |
// | |
// Created by Joshua Howland on 6/12/14. | |
// Copyright (c) 2014 DevMountain. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@import CoreData; |
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/bash | |
# update_build_number.sh | |
# Usage: `update_build_number.sh [branch]` | |
# Run this script after the 'Copy Bundle Resources' build phase | |
# Ref: http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode/ | |
branch=${1:-'master'} | |
buildNumber=$(expr $(git rev-list $branch --count) - $(git rev-list HEAD..$branch --count)) | |
echo "Updating build number to $buildNumber using branch '$branch'." |