- Download the docset index XML.
- Find the docset you want (there are some with URL https://apple.com/none.dmg; ignore them - you will find them again further down the file with a working URL).
- Download the dmg. It's probably around a gigabyte or so.
- "Install" the .pkg file somewhere on your disk. If you don't trust the installer, do it manually:
- Find the largest file, named Payload, and extract it using The Unarchiver.
- This creates a new, even larger file, probably named Payload-1.
- Extract Payload-1 using The Unarchiver.
- After many minutes of extracting, we have our .docset file.
#define PSPDF_KEYPATH(object, property) (^{ \ | |
_Pragma("clang diagnostic push") \ | |
_Pragma("clang diagnostic ignored \"-Wunreachable-code\"") \ | |
_Pragma("clang diagnostic ignored \"-Wimplicit-retain-self\"") \ | |
return ((void)(NO && ((void)object.property, NO)), @#property); \ | |
_Pragma("clang diagnostic pop") \ | |
}()) |
// | |
// DraggingStackView.swift | |
// Analysis | |
// | |
// Created by Mark Onyschuk on 2017-02-02. | |
// Copyright © 2017 Mark Onyschuk. All rights reserved. | |
// | |
import Cocoa |
// | |
// JTSSwiftTweener.swift | |
// JTSSwiftTweener | |
// | |
// Created by Joshua Sullivan on 12/10/16. | |
// Copyright © 2016 Josh Sullivan. All rights reserved. | |
// | |
import UIKit |
import UIKit | |
import MobileCoreServices | |
import ImageIO | |
let sourceOptions: [String: AnyObject] = [kCGImageSourceTypeIdentifierHint as String: kUTTypeJPEG] | |
let cfSourceOptions = sourceOptions as CFDictionary | |
let image = UIImage(named: "input.jpg")! | |
let data = UIImageJPEGRepresentation(image, 1.0) |
// | |
// UIResponder+FTAdditions.h | |
// Streets | |
// | |
// Created by Ortwin Gentz on 09.05.16. | |
// Copyright © 2016 FutureTap. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
import UIKit | |
/// Fast, concrete text storage intended to be subclassed. | |
class BaseTextStorage: NSTextStorage { | |
// MARK: - Properties | |
private let storage = NSMutableAttributedString() | |
// MARK: - NSTextStorage |
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
// | |
// NSStackView+Animations.swift | |
// | |
// Created by Martin Höller on 18.06.16. | |
// Copyright © 2016 blue banana software. All rights reserved. | |
// | |
// Based on http://prod.lists.apple.com/archives/cocoa-dev/2015/Jan/msg00314.html | |
import Cocoa |
// @discardableResult to be added | |
// @noescape needs to move to type annotation | |
// needs to add _ for item | |
public func with<T>(item: T, @noescape update: (inout T) throws -> Void) rethrows -> T { | |
var this = item; try update(&this); return this | |
} |