This file contains hidden or 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
| /** | |
| IntExtensions.swift | |
| Convert an arbitrary length byte array into a Swift Int | |
| <https://gist.github.com/tannernelson/e720877bf7700138eb99> | |
| */ | |
| extension Int { | |
| static func fromByteArray(bytes: [UInt8]) -> Int { |
This file contains hidden or 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
| // Returns `URL?` | |
| public enum SocketEndPoint: String { | |
| case eventSocket = "http://nowhere.com/events" | |
| case liveSocket = "http://nowhere.com/live" | |
| public var url: URL? { | |
| return URL(string: self.rawValue) | |
| } | |
| } |
This file contains hidden or 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
| // Copyright © 2016 Envoy. All rights reserved. | |
| /* | |
| Write a Swift playground that takes an n x n grid of integers. Each integer can be either 1 or 0. | |
| The playground then outputs an n x n grid where each block indicates the number of 1's around that block, (excluding the block itself) . For Block 0 on row 0, surrounding blocks are (0,1) (1,0) and (1,1). Similary for block (1,1) all the blocks around it are to be counted as surrounding blocks. | |
| Requirements: |
This file contains hidden or 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 | |
| function show_code { | |
| ERROR_LOCATION=$(grep -Ron "\[UIImage imageNamed:\s*@\"$1\"\s*\]" $PROJECT_NAME) | |
| if [[ -z $ERROR_LOCATION ]]; then | |
| ERROR_LOCATION=$(grep -Ron "UIImage(named\:\s*\"$1\"\s*)" $PROJECT_NAME) | |
| fi | |
| ERROR_LOCATION=$(echo $ERROR_LOCATION | cut -d ':' -f 1,2) | |
| echo "$ERROR_LOCATION: error: Missing imageset with name $1" | |
| } |
This file contains hidden or 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
| require 'find' | |
| require 'pp' | |
| swift_file_paths = [] | |
| Find.find('./') do |path| | |
| if path =~ /.*\.swift$/ and !path.start_with? "./Carthage" | |
| swift_file_paths << path | |
| cmd = "xcrun swift-update -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -target arm64-apple-ios9 #{path} > convert.swift" | |
| system cmd |
This file contains hidden or 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
| ACTION = build | |
| AD_HOC_CODE_SIGNING_ALLOWED = NO | |
| ALTERNATE_GROUP = staff | |
| ALTERNATE_MODE = u+w,go-w,a+rX | |
| ALTERNATE_OWNER = grantdavis | |
| ALWAYS_SEARCH_USER_PATHS = NO | |
| ALWAYS_USE_SEPARATE_HEADERMAPS = YES | |
| APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer | |
| APPLE_INTERNAL_DIR = /AppleInternal | |
| APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation |
This file contains hidden or 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 | |
| import XCTest | |
| ////////////////////////////////////////////////////////////////////// | |
| // Preferences | |
| protocol UserDefaults { | |
| func stringForKey(key: String) -> String | |
| } |
This file contains hidden or 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 CoreData | |
| import UIKit | |
| struct Photo {} | |
| class PhotoDetailViewController: UIViewController { | |
| var photo: Photo! | |
| var context: NSManagedObjectContext! | |
| } |
This file contains hidden or 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
| // | |
| // DataProviding.swift | |
| // GenericsDataSource | |
| // | |
| // Created by Frank Courville on 2019-05-09. | |
| // Copyright © 2019 iOS Coach Frank. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or 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
| # Building FAT librares for XCode 10 | |
| set -e | |
| # If we're already inside this script then die | |
| if [ -n "$MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then | |
| exit 0 | |
| fi | |
| export MULTIPLATFORM_BUILD_IN_PROGRESS=1 |