Script:
cd ${SRCROOT}
if [ -e "Pods" ]
then
pod install
else
touch Pods
public class ArrayDataSource<CellType: UIView, ItemType> { | |
private var items: [ItemType] | |
private var cellReuseIdentifier: String | |
private var configureClosure: (CellType, ItemType) -> Void | |
private var proxy: DataSourceProxy! | |
private unowned var view: UIView | |
public init(view: UIView, items: [ItemType], cellReuseIdentifier: String, configureClosure: (CellType, ItemType) -> Void) { | |
self.items = items | |
self.cellReuseIdentifier = cellReuseIdentifier |
import Foundation | |
let config = NSURLSessionConfiguration.defaultSessionConfiguration() | |
let userPasswordString = "[email protected]:password" | |
let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding) | |
let base64EncodedCredential = userPasswordData!.base64EncodedStringWithOptions(nil) | |
let authString = "Basic \(base64EncodedCredential)" | |
config.HTTPAdditionalHeaders = ["Authorization" : authString] | |
let session = NSURLSession(configuration: config) |
#!/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'." |
// Overriding NSLocalizedString to use NSLocalizedStringFromTableInBundle instead | |
#define currentLanguageBundle [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[[NSLocale preferredLanguages] objectAtIndex:0] ofType:@"lproj"]] | |
#ifdef NSLocalizedString | |
#undef NSLocalizedString | |
#endif | |
#define NSLocalizedString(key, comment) NSLocalizedStringFromTableInBundle(key, nil, currentLanguageBundle, comment) |
# Valid and working as of 04/21/2014 | |
# Xcode 5.0.1, XCode Server | |
# | |
#Settings | |
API_TOKEN="This can be found here: https://rink.hockeyapp.net/manage/auth_tokens" | |
DISTRIBUTION_LISTS="This is a comma seperated list of tags found under App -> Users -> " | |
PROVISIONING_PROFILE="You will have to manually copy your profile to /Library/Server/Xcode/Data/ProvisioningProfiles/<profile>.mobileprovision" | |
#EXAMPLE:"/Library/Server/Xcode/Data/ProvisioningProfiles/DocLink_InHouse_2013.mobileprovision" | |
NOTIFY="1" |
#!/usr/bin/python | |
import Image | |
import base64, zlib | |
# Jay Parlar convinced me to turn this data structure | |
# from a dictionary into an object. | |
class PackedImage(object): | |
def __init__(self, mode, size, data): | |
self.mode = mode |
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
#import <objc/runtime.h> | |
#import <objc/message.h> |
// Defines a yet undocumented method to add a warning if super isn't called. | |
#ifndef NS_REQUIRES_SUPER | |
#if __has_attribute(objc_requires_super) | |
#define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
#else | |
#define NS_REQUIRES_SUPER | |
#endif | |
#endif | |
@interface UIViewController (SubclassingWarnings) |
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |