- 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.
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
/* | |
Change the opacity of a CIFilter. | |
*/ | |
func changeOpacity(to opacity: CGFloat, on filter: CIFilter, original image: UIImage) -> CIImage? { | |
guard let backgroundImage: CIImage = CIImage(image: image) else { fatalError() } | |
// The CIColorMatrix filter, will contain the requested filter and control its opacity | |
guard let overlayFilter: CIFilter = CIFilter(name: "CIColorMatrix") else { fatalError() } | |
let overlayRgba: [CGFloat] = [0, 0, 0, opacity] | |
let alphaVector: CIVector = CIVector(values: overlayRgba, count: 4) |
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
#!/usr/bin/env swift | |
// | |
// faceExtraction.swift | |
// FaceITDetection | |
// | |
// Extracts faces detected in images | |
// | |
// Created by NovaTec GmbH on 16.08.17. | |
// Copyright © 2017 NovaTec GmbH. All rights reserved. | |
// |
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
// | |
// Created by はるふ on 2017/12/11. | |
// Copyright © 2017年 ha1f. All rights reserved. | |
// | |
import Foundation | |
import CoreImage | |
import AVFoundation | |
extension CIFilter { |
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 UIKit | |
import MobileCoreServices | |
let image = UIImage() // your actual image | |
let itemProvider = NSItemProvider() | |
itemProvider.registerDataRepresentation(forTypeIdentifier: kUTTypeJPEG as String, visibility: .all) { (completionBlock) -> Progress? in | |
let unitsOfWork = 10 + Int64(arc4random_uniform(UInt32(10))) // 10 - 19 units | |
let progress = Progress.discreteProgress(totalUnitCount: unitsOfWork) |
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
/* | |
Erica Sadun, http://ericasadun.com | |
Cross Platform Defines | |
Apple Platforms Only | |
Will update to #if canImport() when available | |
*/ |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import SpriteKit | |
import GameplayKit | |
enum NoiseTileType: CustomStringConvertible { | |
case ocean | |
case grass | |
case mountain |
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
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1 | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
if [ "true" == ${ALREADYINVOKED:-false} ] | |
then | |
echo "RECURSION: Detected, stopping" | |
else | |
export ALREADYINVOKED="true" |
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
@IBAction func fontFaceChanged(sender: NSPopUpButton) { | |
let newIDX = sender.indexOfSelectedItem | |
if let currentFont = textView?.typingAttributes[NSFontAttributeName] as? NSFont { | |
let newFaceName = fontFaceNames[newIDX] | |
if let newFont = NSFontManager.sharedFontManager().convertFont(currentFont, toFace: newFaceName) { | |
applyNewAttributes([NSFontAttributeName: newFont]) | |
} | |
} | |
} |
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
struct LowPassFilterSignal { | |
/// Current signal value | |
var value: Double | |
/// A scaling factor in the range 0.0..<1.0 that determines | |
/// how resistant the value is to change | |
let filterFactor: Double | |
/// Update the value, using filterFactor to attenuate changes | |
mutating func update(newValue: Double) { |