This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| extension UIImage { | |
| convenience init?(color: UIColor, size: CGSize = CGSizeMake(1, 1)) { | |
| let rect = CGRectMake(0, 0, size.width, size.height) | |
| UIGraphicsBeginImageContextWithOptions(rect.size, false, 0) | |
| let context = UIGraphicsGetCurrentContext() | |
| CGContextSetFillColorWithColor(context, color.CGColor) | |
| CGContextFillRect(context, rect) | |
| self.init(CGImage: UIGraphicsGetImageFromCurrentImageContext().CGImage!) | |
| UIGraphicsEndImageContext() |
| // | |
| // String 1.0 | |
| // Created by Caleb Hess on 2/22/16. | |
| // | |
| public extension String { | |
| public var count: Int { | |
| return self.characters.count | |
| } |
| // | |
| // Swift-KVO | |
| // | |
| // Created by Jim Correia on 6/5/14. | |
| // Copyright (c) 2014-2015 Jim Correia. All rights reserved. | |
| // | |
| // Update: 6/17/2014 | |
| // | |
| // KVOContext has gone away; use the same idiom you'd use from Objective-C for the context | |
| // |
| // | |
| // Storage.swift | |
| // | |
| // Created by Grigory Avdyushin on 30.06.16. | |
| // Copyright © 2016 Grigory Avdyushin. All rights reserved. | |
| // | |
| import UIKit | |
| import CoreData |
| #!/bin/sh | |
| if [ -z $1 ]; then | |
| echo "Usage: ${0} file" | |
| exit -1 | |
| fi | |
| cat $1 | \ | |
| grep .pf- | \ | |
| sed -e 's/.pf-//g' | \ |
| // | |
| // AsyncTests.swift | |
| // | |
| import XCTest | |
| // MARK: Async Helper Extension | |
| extension XCTestCase { | |
| #!/usr/bin/python | |
| # coding: utf8 | |
| import io | |
| import re | |
| import time | |
| import shutil | |
| import os.path | |
| import hashlib | |
| import argparse |
| let string = "www." | |
| func hasPrefix(_ prefix: String) -> (String) -> Bool { | |
| return { value in value.hasPrefix(prefix) } | |
| } | |
| func ~=(block: (String) -> Bool, string: String) -> Bool { | |
| return block(string) | |
| } |
| class Tests: XCTestCase { | |
| override func setUp() { | |
| super.setUp() | |
| } | |
| override func tearDown() { | |
| super.tearDown() | |
| } | |
| } |