├── .swift-version ├── LICENSE ├── README.md ├── Sources ├── Helpers.swift └── WagnerFischer.swift ├── Support ├── Info.plist └── WagnerFischer.h ├── Tests ├── Info.plist └── WagnerFischerTests.swift └── WagnerFischer.xcodeproj ├── project.pbxproj └── xcshareddata └── xcschemes ├── WagnerFischer-iOS.xcscheme └── WagnerFischer-macOS.xcscheme /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0.1 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Caleb Davenport. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WagnerFischer 2 | 3 | [![Version](https://img.shields.io/github/release/calebd/WagnerFischer.svg)](https://github.com/calebd/WagnerFischer/releases) 4 | ![Swift Version](https://img.shields.io/badge/swift-3.0.1-orange.svg) 5 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 6 | 7 | An implementation of [Wagner-Fischer](https://en.wikipedia.org/wiki/Wagner–Fischer_algorithm) in pure Swift. Insipired by [Dave Delong](http://davedelong.tumblr.com/post/134367865668/edit-distance-and-edit-steps). 8 | 9 | 10 | ## Usage 11 | 12 | “Edit steps” defines the smallest set of steps needed to go from one array of elements to another. These steps can be used to drive animated transitions between sets of data. 13 | 14 | `editSteps("Caleb Davenport", "Sam Soffes")` will return the following: 15 | 16 | - substitute(0, S) 17 | - delete(2) 18 | - delete(3) 19 | - substitute(2, m) 20 | - delete(6) 21 | - delete(7) 22 | - delete(8) 23 | - substitute(4, S) 24 | - substitute(5, o) 25 | - substitute(6, f) 26 | - substitute(7, f) 27 | - substitute(8, e) 28 | - substitute(9, s) 29 | 30 | “Edit distance” defines the smallest number of steps needed to go from one collection of elements to another. 31 | 32 | `editDistance("Caleb Davenport", "Sam Soffes")` will return `13`. 33 | 34 | These examples use strings but `WagnerFischer` defines functions that can take any `[T]`. 35 | -------------------------------------------------------------------------------- /Sources/Helpers.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Helpers.swift 3 | // WagnerFischer 4 | // 5 | // Created by Caleb Davenport on 2/22/16. 6 | // Copyright © 2016 Caleb Davenport. All rights reserved. 7 | // 8 | 9 | /// A two dimensional data structure. 10 | struct Matrix { 11 | 12 | // MARK: - Properties 13 | 14 | private var array: [[Element]] 15 | 16 | 17 | // MARK: - Initializers 18 | 19 | init(rows: Int, columns: Int, repeatedValue: Element) { 20 | array = Array(repeating: Array(repeating: repeatedValue, count: columns), count: rows) 21 | } 22 | 23 | 24 | // MARK: - Public 25 | 26 | subscript(row: Int, column: Int) -> Element { 27 | get { 28 | return array[row][column] 29 | } 30 | set { 31 | array[row][column] = newValue 32 | } 33 | } 34 | } 35 | 36 | /// Returns the array with the least elements. 37 | func shortest(_ a: [T], _ b: [T], _ rest: [T]...) -> [T] { 38 | return ([ b ] + rest).reduce(a, { 39 | $0.count < $1.count ? $0 : $1 40 | }) 41 | } 42 | -------------------------------------------------------------------------------- /Sources/WagnerFischer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WagnerFischer.swift 3 | // WagnerFischer 4 | // 5 | // Created by Caleb Davenport on 2/22/16. 6 | // Copyright © 2016 Caleb Davenport. All rights reserved. 7 | // 8 | 9 | /// A single edit step. 10 | public enum EditStep { 11 | case insert(location: Int, value: Value) 12 | case substitute(location: Int, value: Value) 13 | case delete(location: Int) 14 | 15 | public var location: Int { 16 | switch self { 17 | case .insert(let location, _): return location 18 | case .substitute(let location, _): return location 19 | case .delete(let location): return location 20 | } 21 | } 22 | } 23 | 24 | extension EditStep: CustomDebugStringConvertible { 25 | public var debugDescription: String { 26 | switch self { 27 | case .insert(let index, let value): 28 | return "Insert(\(index), \(value))" 29 | case .substitute(let index, let value): 30 | return "Substitute(\(index), \(value))" 31 | case .delete(let index): 32 | return "Delete(\(index))" 33 | } 34 | } 35 | } 36 | 37 | public func editSteps(_ source: [T], _ destination: [T], compare: (T, T) -> Bool) -> [EditStep] { 38 | 39 | // Return all insertions if the source is empty. 40 | if source.isEmpty { 41 | return destination.enumerated().map(EditStep.insert) 42 | } 43 | 44 | // Return all deletions if the destination is empty. 45 | if destination.isEmpty { 46 | return (0..]>( 50 | rows: source.count + 1, 51 | columns: destination.count + 1, 52 | repeatedValue: []) 53 | 54 | for i in 1...source.count { 55 | matrix[i, 0] = (0...i).map(EditStep.delete) 56 | } 57 | 58 | for j in 1...destination.count { 59 | matrix[0, j] = (1...j).lazy.map({ $0 - 1 }).map({ 60 | let destinationValue = destination[$0] 61 | return EditStep.insert(location: $0, value: destinationValue) 62 | }) 63 | } 64 | 65 | for i in 1...source.count { 66 | for j in 1...destination.count { 67 | let destinationValue = destination[j - 1] 68 | if compare(source[i - 1], destinationValue) { 69 | matrix[i, j] = matrix[i - 1, j - 1] 70 | } 71 | else { 72 | let a = matrix[i - 1, j] + CollectionOfOne(.delete(location: i - 1)) 73 | let b = matrix[i, j - 1] + CollectionOfOne(.insert(location: j - 1, value: destinationValue)) 74 | let c = matrix[i - 1, j - 1] + CollectionOfOne(.substitute(location: j - 1, value: destinationValue)) 75 | matrix[i, j] = shortest(a, b, c) 76 | } 77 | } 78 | } 79 | 80 | return matrix[source.count, destination.count] 81 | } 82 | 83 | public func editSteps(_ source: [T], _ destination: [T]) -> [EditStep] { 84 | return editSteps(source, destination, compare: ==) 85 | } 86 | 87 | public func editSteps(_ source: String, _ destination: String) -> [EditStep] { 88 | return editSteps(Array(source.characters), Array(destination.characters)) 89 | } 90 | 91 | public func editDistance(_ source: [T], _ destination: [T], compare: (T, T) -> Bool) -> Int { 92 | return editSteps(source, destination, compare: compare).count 93 | } 94 | 95 | public func editDistance(_ source: [T], _ destination: [T]) -> Int { 96 | return editSteps(source, destination).count 97 | } 98 | 99 | public func editDistance(_ source: String, _ destination: String) -> Int { 100 | return editSteps(source, destination).count 101 | } 102 | 103 | public func apply(editSteps: [EditStep], to source: [T]) -> [T]? { 104 | var destination = source 105 | 106 | for step in editSteps { 107 | switch step { 108 | case .insert(let location, let value): 109 | guard location <= destination.count else { return nil } 110 | destination.insert(value, at: location) 111 | case .delete(let location): 112 | guard location < destination.count else { return nil } 113 | destination.remove(at: location) 114 | case .substitute(let location, let value): 115 | guard location < destination.count else { return nil } 116 | destination.remove(at: location) 117 | destination.insert(value, at: location) 118 | } 119 | } 120 | 121 | return destination 122 | } 123 | 124 | public func apply(editSteps: [EditStep], to source: String) -> String? { 125 | guard let characters = apply(editSteps: editSteps, to: Array(source.characters)) else { return nil } 126 | return String(characters) 127 | } 128 | -------------------------------------------------------------------------------- /Support/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Support/WagnerFischer.h: -------------------------------------------------------------------------------- 1 | // 2 | // WagnerFischer.h 3 | // WagnerFischer 4 | // 5 | // Created by Caleb Davenport on 2/22/16. 6 | // Copyright © 2016 Caleb Davenport. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | 11 | FOUNDATION_EXPORT double WagnerFischerVersionNumber; 12 | FOUNDATION_EXPORT const unsigned char WagnerFischerVersionString[]; 13 | -------------------------------------------------------------------------------- /Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/WagnerFischerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WagnerFischerTests.swift 3 | // WagnerFischerTests 4 | // 5 | // Created by Sam Soffes on 2/22/16. 6 | // Copyright © 2016 Caleb Davenport. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import WagnerFischer 11 | 12 | final class WagnerFischerTests: XCTestCase { 13 | func testStringEditSteps() { 14 | let source = "Caleb Davenport" 15 | let destination = "Sam Soffes" 16 | 17 | let steps = editSteps(source, destination) 18 | XCTAssertEqual(apply(editSteps: steps, to: source)!, destination) 19 | } 20 | 21 | func testEmptySource() { 22 | let source = "" 23 | let destination = "Sam Soffes" 24 | 25 | let steps = editSteps(source, destination) 26 | XCTAssertEqual(apply(editSteps: steps, to: source)!, destination) 27 | } 28 | 29 | func testEmptyDestination() { 30 | let source = "Caleb Davenport" 31 | let destination = "" 32 | 33 | let steps = editSteps(source, destination) 34 | XCTAssertEqual(apply(editSteps: steps, to: source)!, destination) 35 | } 36 | 37 | func testInvalidEditSteps() { 38 | let source = "Caleb Davenport" 39 | let destination = "Sam Soffes" 40 | 41 | let steps = editSteps(source, destination) 42 | XCTAssertNil(apply(editSteps: steps, to: "")) 43 | 44 | XCTAssertNil(apply(editSteps: [.delete(location: 0)], to: "")) 45 | XCTAssertNil(apply(editSteps: [.delete(location: 1)], to: "")) 46 | } 47 | 48 | func testApplyToEmptySource() { 49 | XCTAssertEqual(apply(editSteps: [.insert(location: 0, value: "S".characters.first!)], to: ""), "S") 50 | } 51 | 52 | func testApplyToEmptyDestination() { 53 | XCTAssertEqual(apply(editSteps: [.delete(location: 0)], to: "S"), "") 54 | } 55 | 56 | func testPerformance() { 57 | let source = "Food truck actually man braid, letterpress XOXO quinoa sartorial. Narwhal before they sold out mixtape next level, freegan yuccie stumptown pour-over try-hard lomo keffiyeh waistcoat sriracha selvage. Truffaut cray venmo ethical deep v freegan. Hashtag offal normcore schlitz cold-pressed, food truck" 58 | let destination = "Bicycle rights paleo godard, tofu man braid green juice umami keffiyeh tattooed brunch hella. Williamsburg chartreuse butcher vinyl. Freegan thundercats quinoa roof party tote bag, actually schlitz +1 brooklyn yuccie vinyl. Listicle mumblecore occupy banh mi asymmetrical polaroid. Four loko viral pug" 59 | 60 | measure { 61 | _ = editSteps(source, destination) 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /WagnerFischer.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 217F62611DD2631900D25CFE /* WagnerFischer.h in Headers */ = {isa = PBXBuildFile; fileRef = 217F625F1DD2631900D25CFE /* WagnerFischer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 217F62621DD2632100D25CFE /* WagnerFischer.h in Headers */ = {isa = PBXBuildFile; fileRef = 217F625F1DD2631900D25CFE /* WagnerFischer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 21B891EE1C7B98B000D0C155 /* WagnerFischer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21B891E41C7B98B000D0C155 /* WagnerFischer.framework */; }; 13 | 21B891FB1C7B98D600D0C155 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A72F0E51C7B968B00F6BCA7 /* Helpers.swift */; }; 14 | 21B891FC1C7B98D600D0C155 /* WagnerFischer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A72F0E71C7B969900F6BCA7 /* WagnerFischer.swift */; }; 15 | 21B892031C7B995700D0C155 /* WagnerFischerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21B892001C7B994100D0C155 /* WagnerFischerTests.swift */; }; 16 | 3A72F0E61C7B968B00F6BCA7 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A72F0E51C7B968B00F6BCA7 /* Helpers.swift */; }; 17 | 3A72F0E81C7B969900F6BCA7 /* WagnerFischer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A72F0E71C7B969900F6BCA7 /* WagnerFischer.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 21B891EF1C7B98B000D0C155 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 3A72F0D01C7B963300F6BCA7 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 21B891E31C7B98B000D0C155; 26 | remoteInfo = "WagnerFischer-OSX"; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 217F625E1DD2631900D25CFE /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 217F625F1DD2631900D25CFE /* WagnerFischer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WagnerFischer.h; sourceTree = ""; }; 33 | 21B891E41C7B98B000D0C155 /* WagnerFischer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WagnerFischer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 21B891ED1C7B98B000D0C155 /* WagnerFischerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WagnerFischerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 21B891FF1C7B994100D0C155 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 21B892001C7B994100D0C155 /* WagnerFischerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WagnerFischerTests.swift; sourceTree = ""; }; 37 | 3A72F0D91C7B963300F6BCA7 /* WagnerFischer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WagnerFischer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 3A72F0E51C7B968B00F6BCA7 /* Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = ""; }; 39 | 3A72F0E71C7B969900F6BCA7 /* WagnerFischer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WagnerFischer.swift; sourceTree = ""; }; 40 | /* End PBXFileReference section */ 41 | 42 | /* Begin PBXFrameworksBuildPhase section */ 43 | 21B891E01C7B98B000D0C155 /* Frameworks */ = { 44 | isa = PBXFrameworksBuildPhase; 45 | buildActionMask = 2147483647; 46 | files = ( 47 | ); 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | 21B891EA1C7B98B000D0C155 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | 21B891EE1C7B98B000D0C155 /* WagnerFischer.framework in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 3A72F0D51C7B963300F6BCA7 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 217F625D1DD2631900D25CFE /* Support */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 217F625F1DD2631900D25CFE /* WagnerFischer.h */, 72 | 217F625E1DD2631900D25CFE /* Info.plist */, 73 | ); 74 | path = Support; 75 | sourceTree = ""; 76 | }; 77 | 21B891FE1C7B994100D0C155 /* Tests */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 21B892001C7B994100D0C155 /* WagnerFischerTests.swift */, 81 | 21B891FF1C7B994100D0C155 /* Info.plist */, 82 | ); 83 | path = Tests; 84 | sourceTree = ""; 85 | }; 86 | 3A72F0CF1C7B963300F6BCA7 = { 87 | isa = PBXGroup; 88 | children = ( 89 | 3A72F0E41C7B968B00F6BCA7 /* Sources */, 90 | 217F625D1DD2631900D25CFE /* Support */, 91 | 21B891FE1C7B994100D0C155 /* Tests */, 92 | 3A72F0DA1C7B963300F6BCA7 /* Products */, 93 | ); 94 | sourceTree = ""; 95 | usesTabs = 0; 96 | }; 97 | 3A72F0DA1C7B963300F6BCA7 /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 3A72F0D91C7B963300F6BCA7 /* WagnerFischer.framework */, 101 | 21B891E41C7B98B000D0C155 /* WagnerFischer.framework */, 102 | 21B891ED1C7B98B000D0C155 /* WagnerFischerTests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 3A72F0E41C7B968B00F6BCA7 /* Sources */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 3A72F0E71C7B969900F6BCA7 /* WagnerFischer.swift */, 111 | 3A72F0E51C7B968B00F6BCA7 /* Helpers.swift */, 112 | ); 113 | path = Sources; 114 | sourceTree = ""; 115 | }; 116 | /* End PBXGroup section */ 117 | 118 | /* Begin PBXHeadersBuildPhase section */ 119 | 21B891E11C7B98B000D0C155 /* Headers */ = { 120 | isa = PBXHeadersBuildPhase; 121 | buildActionMask = 2147483647; 122 | files = ( 123 | 217F62621DD2632100D25CFE /* WagnerFischer.h in Headers */, 124 | ); 125 | runOnlyForDeploymentPostprocessing = 0; 126 | }; 127 | 3A72F0D61C7B963300F6BCA7 /* Headers */ = { 128 | isa = PBXHeadersBuildPhase; 129 | buildActionMask = 2147483647; 130 | files = ( 131 | 217F62611DD2631900D25CFE /* WagnerFischer.h in Headers */, 132 | ); 133 | runOnlyForDeploymentPostprocessing = 0; 134 | }; 135 | /* End PBXHeadersBuildPhase section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | 21B891E31C7B98B000D0C155 /* WagnerFischer-macOS */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = 21B891F51C7B98B000D0C155 /* Build configuration list for PBXNativeTarget "WagnerFischer-macOS" */; 141 | buildPhases = ( 142 | 21B891DF1C7B98B000D0C155 /* Sources */, 143 | 21B891E01C7B98B000D0C155 /* Frameworks */, 144 | 21B891E11C7B98B000D0C155 /* Headers */, 145 | 21B891E21C7B98B000D0C155 /* Resources */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | ); 151 | name = "WagnerFischer-macOS"; 152 | productName = "WagnerFischer-OSX"; 153 | productReference = 21B891E41C7B98B000D0C155 /* WagnerFischer.framework */; 154 | productType = "com.apple.product-type.framework"; 155 | }; 156 | 21B891EC1C7B98B000D0C155 /* WagnerFischerTests-macOS */ = { 157 | isa = PBXNativeTarget; 158 | buildConfigurationList = 21B891F81C7B98B000D0C155 /* Build configuration list for PBXNativeTarget "WagnerFischerTests-macOS" */; 159 | buildPhases = ( 160 | 21B891E91C7B98B000D0C155 /* Sources */, 161 | 21B891EA1C7B98B000D0C155 /* Frameworks */, 162 | 21B891EB1C7B98B000D0C155 /* Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | 21B891F01C7B98B000D0C155 /* PBXTargetDependency */, 168 | ); 169 | name = "WagnerFischerTests-macOS"; 170 | productName = "WagnerFischer-OSXTests"; 171 | productReference = 21B891ED1C7B98B000D0C155 /* WagnerFischerTests.xctest */; 172 | productType = "com.apple.product-type.bundle.unit-test"; 173 | }; 174 | 3A72F0D81C7B963300F6BCA7 /* WagnerFischer-iOS */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = 3A72F0E11C7B963300F6BCA7 /* Build configuration list for PBXNativeTarget "WagnerFischer-iOS" */; 177 | buildPhases = ( 178 | 3A72F0D41C7B963300F6BCA7 /* Sources */, 179 | 3A72F0D51C7B963300F6BCA7 /* Frameworks */, 180 | 3A72F0D61C7B963300F6BCA7 /* Headers */, 181 | 3A72F0D71C7B963300F6BCA7 /* Resources */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | ); 187 | name = "WagnerFischer-iOS"; 188 | productName = WagnerFischer; 189 | productReference = 3A72F0D91C7B963300F6BCA7 /* WagnerFischer.framework */; 190 | productType = "com.apple.product-type.framework"; 191 | }; 192 | /* End PBXNativeTarget section */ 193 | 194 | /* Begin PBXProject section */ 195 | 3A72F0D01C7B963300F6BCA7 /* Project object */ = { 196 | isa = PBXProject; 197 | attributes = { 198 | LastSwiftUpdateCheck = 0730; 199 | LastUpgradeCheck = 0820; 200 | ORGANIZATIONNAME = "Caleb Davenport"; 201 | TargetAttributes = { 202 | 21B891E31C7B98B000D0C155 = { 203 | CreatedOnToolsVersion = 7.3; 204 | }; 205 | 21B891EC1C7B98B000D0C155 = { 206 | CreatedOnToolsVersion = 7.3; 207 | }; 208 | 3A72F0D81C7B963300F6BCA7 = { 209 | CreatedOnToolsVersion = 7.2.1; 210 | LastSwiftMigration = 0820; 211 | }; 212 | }; 213 | }; 214 | buildConfigurationList = 3A72F0D31C7B963300F6BCA7 /* Build configuration list for PBXProject "WagnerFischer" */; 215 | compatibilityVersion = "Xcode 3.2"; 216 | developmentRegion = English; 217 | hasScannedForEncodings = 0; 218 | knownRegions = ( 219 | en, 220 | ); 221 | mainGroup = 3A72F0CF1C7B963300F6BCA7; 222 | productRefGroup = 3A72F0DA1C7B963300F6BCA7 /* Products */; 223 | projectDirPath = ""; 224 | projectRoot = ""; 225 | targets = ( 226 | 3A72F0D81C7B963300F6BCA7 /* WagnerFischer-iOS */, 227 | 21B891E31C7B98B000D0C155 /* WagnerFischer-macOS */, 228 | 21B891EC1C7B98B000D0C155 /* WagnerFischerTests-macOS */, 229 | ); 230 | }; 231 | /* End PBXProject section */ 232 | 233 | /* Begin PBXResourcesBuildPhase section */ 234 | 21B891E21C7B98B000D0C155 /* Resources */ = { 235 | isa = PBXResourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | 21B891EB1C7B98B000D0C155 /* Resources */ = { 242 | isa = PBXResourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | 3A72F0D71C7B963300F6BCA7 /* Resources */ = { 249 | isa = PBXResourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | /* End PBXResourcesBuildPhase section */ 256 | 257 | /* Begin PBXSourcesBuildPhase section */ 258 | 21B891DF1C7B98B000D0C155 /* Sources */ = { 259 | isa = PBXSourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 21B891FC1C7B98D600D0C155 /* WagnerFischer.swift in Sources */, 263 | 21B891FB1C7B98D600D0C155 /* Helpers.swift in Sources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | 21B891E91C7B98B000D0C155 /* Sources */ = { 268 | isa = PBXSourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 21B892031C7B995700D0C155 /* WagnerFischerTests.swift in Sources */, 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | 3A72F0D41C7B963300F6BCA7 /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 3A72F0E81C7B969900F6BCA7 /* WagnerFischer.swift in Sources */, 280 | 3A72F0E61C7B968B00F6BCA7 /* Helpers.swift in Sources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXSourcesBuildPhase section */ 285 | 286 | /* Begin PBXTargetDependency section */ 287 | 21B891F01C7B98B000D0C155 /* PBXTargetDependency */ = { 288 | isa = PBXTargetDependency; 289 | target = 21B891E31C7B98B000D0C155 /* WagnerFischer-macOS */; 290 | targetProxy = 21B891EF1C7B98B000D0C155 /* PBXContainerItemProxy */; 291 | }; 292 | /* End PBXTargetDependency section */ 293 | 294 | /* Begin XCBuildConfiguration section */ 295 | 21B891F61C7B98B000D0C155 /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | CLANG_ANALYZER_NONNULL = YES; 299 | CODE_SIGN_IDENTITY = "-"; 300 | COMBINE_HIDPI_IMAGES = YES; 301 | DEFINES_MODULE = YES; 302 | DYLIB_COMPATIBILITY_VERSION = 1; 303 | DYLIB_CURRENT_VERSION = 1; 304 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 305 | FRAMEWORK_VERSION = A; 306 | INFOPLIST_FILE = "$(SRCROOT)/Support/Info.plist"; 307 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 308 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 309 | PRODUCT_BUNDLE_IDENTIFIER = com.calebd.WagnerFischer; 310 | PRODUCT_NAME = WagnerFischer; 311 | SDKROOT = macosx; 312 | SKIP_INSTALL = YES; 313 | }; 314 | name = Debug; 315 | }; 316 | 21B891F71C7B98B000D0C155 /* Release */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | CLANG_ANALYZER_NONNULL = YES; 320 | CODE_SIGN_IDENTITY = "-"; 321 | COMBINE_HIDPI_IMAGES = YES; 322 | DEFINES_MODULE = YES; 323 | DYLIB_COMPATIBILITY_VERSION = 1; 324 | DYLIB_CURRENT_VERSION = 1; 325 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 326 | FRAMEWORK_VERSION = A; 327 | INFOPLIST_FILE = "$(SRCROOT)/Support/Info.plist"; 328 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 329 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 330 | PRODUCT_BUNDLE_IDENTIFIER = com.calebd.WagnerFischer; 331 | PRODUCT_NAME = WagnerFischer; 332 | SDKROOT = macosx; 333 | SKIP_INSTALL = YES; 334 | }; 335 | name = Release; 336 | }; 337 | 21B891F91C7B98B000D0C155 /* Debug */ = { 338 | isa = XCBuildConfiguration; 339 | buildSettings = { 340 | APPLICATION_EXTENSION_API_ONLY = NO; 341 | CLANG_ANALYZER_NONNULL = YES; 342 | CODE_SIGN_IDENTITY = "-"; 343 | COMBINE_HIDPI_IMAGES = YES; 344 | INFOPLIST_FILE = Tests/Info.plist; 345 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 346 | MACOSX_DEPLOYMENT_TARGET = 10.11; 347 | PRODUCT_BUNDLE_IDENTIFIER = com.calebd.WagnerFischer.Tests; 348 | PRODUCT_NAME = WagnerFischerTests; 349 | SDKROOT = macosx; 350 | }; 351 | name = Debug; 352 | }; 353 | 21B891FA1C7B98B000D0C155 /* Release */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | APPLICATION_EXTENSION_API_ONLY = NO; 357 | CLANG_ANALYZER_NONNULL = YES; 358 | CODE_SIGN_IDENTITY = "-"; 359 | COMBINE_HIDPI_IMAGES = YES; 360 | INFOPLIST_FILE = Tests/Info.plist; 361 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 362 | MACOSX_DEPLOYMENT_TARGET = 10.11; 363 | PRODUCT_BUNDLE_IDENTIFIER = com.calebd.WagnerFischer.Tests; 364 | PRODUCT_NAME = WagnerFischerTests; 365 | SDKROOT = macosx; 366 | }; 367 | name = Release; 368 | }; 369 | 3A72F0DF1C7B963300F6BCA7 /* Debug */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | ALWAYS_SEARCH_USER_PATHS = NO; 373 | APPLICATION_EXTENSION_API_ONLY = YES; 374 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 375 | CLANG_CXX_LIBRARY = "libc++"; 376 | CLANG_ENABLE_MODULES = YES; 377 | CLANG_ENABLE_OBJC_ARC = YES; 378 | CLANG_WARN_BOOL_CONVERSION = YES; 379 | CLANG_WARN_CONSTANT_CONVERSION = YES; 380 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 381 | CLANG_WARN_EMPTY_BODY = YES; 382 | CLANG_WARN_ENUM_CONVERSION = YES; 383 | CLANG_WARN_INFINITE_RECURSION = YES; 384 | CLANG_WARN_INT_CONVERSION = YES; 385 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 386 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 387 | CLANG_WARN_UNREACHABLE_CODE = YES; 388 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 389 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 390 | COPY_PHASE_STRIP = NO; 391 | CURRENT_PROJECT_VERSION = 1; 392 | DEBUG_INFORMATION_FORMAT = dwarf; 393 | ENABLE_STRICT_OBJC_MSGSEND = YES; 394 | ENABLE_TESTABILITY = YES; 395 | GCC_C_LANGUAGE_STANDARD = gnu99; 396 | GCC_DYNAMIC_NO_PIC = NO; 397 | GCC_NO_COMMON_BLOCKS = YES; 398 | GCC_OPTIMIZATION_LEVEL = 0; 399 | GCC_PREPROCESSOR_DEFINITIONS = ( 400 | "DEBUG=1", 401 | "$(inherited)", 402 | ); 403 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 404 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 405 | GCC_WARN_UNDECLARED_SELECTOR = YES; 406 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 407 | GCC_WARN_UNUSED_FUNCTION = YES; 408 | GCC_WARN_UNUSED_VARIABLE = YES; 409 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 410 | MACOSX_DEPLOYMENT_TARGET = 10.10; 411 | MTL_ENABLE_DEBUG_INFO = YES; 412 | ONLY_ACTIVE_ARCH = YES; 413 | SDKROOT = iphoneos; 414 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 415 | SWIFT_VERSION = 3.0.1; 416 | TARGETED_DEVICE_FAMILY = "1,2"; 417 | VERSIONING_SYSTEM = "apple-generic"; 418 | VERSION_INFO_PREFIX = ""; 419 | }; 420 | name = Debug; 421 | }; 422 | 3A72F0E01C7B963300F6BCA7 /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | ALWAYS_SEARCH_USER_PATHS = NO; 426 | APPLICATION_EXTENSION_API_ONLY = YES; 427 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 428 | CLANG_CXX_LIBRARY = "libc++"; 429 | CLANG_ENABLE_MODULES = YES; 430 | CLANG_ENABLE_OBJC_ARC = YES; 431 | CLANG_WARN_BOOL_CONVERSION = YES; 432 | CLANG_WARN_CONSTANT_CONVERSION = YES; 433 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 434 | CLANG_WARN_EMPTY_BODY = YES; 435 | CLANG_WARN_ENUM_CONVERSION = YES; 436 | CLANG_WARN_INFINITE_RECURSION = YES; 437 | CLANG_WARN_INT_CONVERSION = YES; 438 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 439 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 440 | CLANG_WARN_UNREACHABLE_CODE = YES; 441 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 442 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 443 | COPY_PHASE_STRIP = NO; 444 | CURRENT_PROJECT_VERSION = 1; 445 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 446 | ENABLE_NS_ASSERTIONS = NO; 447 | ENABLE_STRICT_OBJC_MSGSEND = YES; 448 | GCC_C_LANGUAGE_STANDARD = gnu99; 449 | GCC_NO_COMMON_BLOCKS = YES; 450 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 451 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 452 | GCC_WARN_UNDECLARED_SELECTOR = YES; 453 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 454 | GCC_WARN_UNUSED_FUNCTION = YES; 455 | GCC_WARN_UNUSED_VARIABLE = YES; 456 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 457 | MACOSX_DEPLOYMENT_TARGET = 10.10; 458 | MTL_ENABLE_DEBUG_INFO = NO; 459 | SDKROOT = iphoneos; 460 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 461 | SWIFT_VERSION = 3.0.1; 462 | TARGETED_DEVICE_FAMILY = "1,2"; 463 | VALIDATE_PRODUCT = YES; 464 | VERSIONING_SYSTEM = "apple-generic"; 465 | VERSION_INFO_PREFIX = ""; 466 | }; 467 | name = Release; 468 | }; 469 | 3A72F0E21C7B963300F6BCA7 /* Debug */ = { 470 | isa = XCBuildConfiguration; 471 | buildSettings = { 472 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 473 | DEFINES_MODULE = YES; 474 | DYLIB_COMPATIBILITY_VERSION = 1; 475 | DYLIB_CURRENT_VERSION = 1; 476 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 477 | INFOPLIST_FILE = "$(SRCROOT)/Support/Info.plist"; 478 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 480 | PRODUCT_BUNDLE_IDENTIFIER = com.calebd.WagnerFischer; 481 | PRODUCT_NAME = WagnerFischer; 482 | SKIP_INSTALL = YES; 483 | }; 484 | name = Debug; 485 | }; 486 | 3A72F0E31C7B963300F6BCA7 /* Release */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 490 | DEFINES_MODULE = YES; 491 | DYLIB_COMPATIBILITY_VERSION = 1; 492 | DYLIB_CURRENT_VERSION = 1; 493 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 494 | INFOPLIST_FILE = "$(SRCROOT)/Support/Info.plist"; 495 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 496 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 497 | PRODUCT_BUNDLE_IDENTIFIER = com.calebd.WagnerFischer; 498 | PRODUCT_NAME = WagnerFischer; 499 | SKIP_INSTALL = YES; 500 | }; 501 | name = Release; 502 | }; 503 | /* End XCBuildConfiguration section */ 504 | 505 | /* Begin XCConfigurationList section */ 506 | 21B891F51C7B98B000D0C155 /* Build configuration list for PBXNativeTarget "WagnerFischer-macOS" */ = { 507 | isa = XCConfigurationList; 508 | buildConfigurations = ( 509 | 21B891F61C7B98B000D0C155 /* Debug */, 510 | 21B891F71C7B98B000D0C155 /* Release */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | 21B891F81C7B98B000D0C155 /* Build configuration list for PBXNativeTarget "WagnerFischerTests-macOS" */ = { 516 | isa = XCConfigurationList; 517 | buildConfigurations = ( 518 | 21B891F91C7B98B000D0C155 /* Debug */, 519 | 21B891FA1C7B98B000D0C155 /* Release */, 520 | ); 521 | defaultConfigurationIsVisible = 0; 522 | defaultConfigurationName = Release; 523 | }; 524 | 3A72F0D31C7B963300F6BCA7 /* Build configuration list for PBXProject "WagnerFischer" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | 3A72F0DF1C7B963300F6BCA7 /* Debug */, 528 | 3A72F0E01C7B963300F6BCA7 /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | 3A72F0E11C7B963300F6BCA7 /* Build configuration list for PBXNativeTarget "WagnerFischer-iOS" */ = { 534 | isa = XCConfigurationList; 535 | buildConfigurations = ( 536 | 3A72F0E21C7B963300F6BCA7 /* Debug */, 537 | 3A72F0E31C7B963300F6BCA7 /* Release */, 538 | ); 539 | defaultConfigurationIsVisible = 0; 540 | defaultConfigurationName = Release; 541 | }; 542 | /* End XCConfigurationList section */ 543 | }; 544 | rootObject = 3A72F0D01C7B963300F6BCA7 /* Project object */; 545 | } 546 | -------------------------------------------------------------------------------- /WagnerFischer.xcodeproj/xcshareddata/xcschemes/WagnerFischer-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /WagnerFischer.xcodeproj/xcshareddata/xcschemes/WagnerFischer-macOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | --------------------------------------------------------------------------------