├── .gitignore ├── .travis.yml ├── .xctool-args ├── LICENSE.md ├── Podfile ├── Podfile.lock ├── Pods ├── Funky │ ├── LICENSE.md │ ├── README.md │ └── src │ │ ├── ErrorIO.swift │ │ ├── Functions.ErrorIO.swift │ │ ├── Functions.File.swift │ │ ├── Functions.Functional.swift │ │ ├── Functions.Lazy.swift │ │ ├── Functions.Math.swift │ │ ├── Functions.Result.swift │ │ ├── Functions.Strings.swift │ │ ├── NSError+Coalescing.swift │ │ ├── Operators.ErrorIO.swift │ │ ├── Operators.Misc.swift │ │ ├── Operators.apply.swift │ │ ├── Operators.bind.swift │ │ ├── Operators.compose.swift │ │ ├── Operators.fmap.swift │ │ ├── Operators.pipe.swift │ │ └── Result.swift ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── Funky.xcscheme │ │ ├── Pods-SwiftBitmask.xcscheme │ │ └── Regex.xcscheme ├── Regex │ ├── LICENSE.md │ ├── README.md │ └── src │ │ └── Regex.swift └── Target Support Files │ ├── Funky │ ├── Funky-dummy.m │ ├── Funky-prefix.pch │ ├── Funky-umbrella.h │ ├── Funky.modulemap │ ├── Funky.xcconfig │ └── Info.plist │ ├── Pods-SwiftBitmask │ ├── Info.plist │ ├── Pods-SwiftBitmask-acknowledgements.markdown │ ├── Pods-SwiftBitmask-acknowledgements.plist │ ├── Pods-SwiftBitmask-dummy.m │ ├── Pods-SwiftBitmask-frameworks.sh │ ├── Pods-SwiftBitmask-resources.sh │ ├── Pods-SwiftBitmask-umbrella.h │ ├── Pods-SwiftBitmask.debug.xcconfig │ ├── Pods-SwiftBitmask.modulemap │ └── Pods-SwiftBitmask.release.xcconfig │ └── Regex │ ├── Info.plist │ ├── Regex-dummy.m │ ├── Regex-prefix.pch │ ├── Regex-umbrella.h │ ├── Regex.modulemap │ └── Regex.xcconfig ├── README.md ├── Source ├── AutoBitmask.swift ├── Bitmask.swift └── OptionSetView.swift ├── SwiftBitmask.podspec ├── SwiftBitmask.sublime-project ├── SwiftBitmask.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── SwiftBitmask.xcscheme ├── SwiftBitmask.xcworkspace └── contents.xcworkspacedata ├── SwiftBitmask ├── Info.plist └── SwiftBitmask.h └── SwiftBitmaskTests ├── AutoBitmaskTests.swift ├── BitmaskOptionViewTests.swift ├── Info.plist └── SwiftBitmaskTests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | Gemfile.lock 2 | 3 | 4 | # Created by https://www.gitignore.io 5 | 6 | ### SublimeText ### 7 | # cache files for sublime text 8 | *.tmlanguage.cache 9 | *.tmPreferences.cache 10 | *.stTheme.cache 11 | 12 | # workspace files are user-specific 13 | *.sublime-workspace 14 | 15 | # project files should be checked into the repository, unless a significant 16 | # proportion of contributors will probably not be using SublimeText 17 | # *.sublime-project 18 | 19 | # sftp configuration file 20 | sftp-config.json 21 | 22 | 23 | ### Swift ### 24 | # Xcode 25 | # 26 | build/ 27 | *.pbxuser 28 | !default.pbxuser 29 | *.mode1v3 30 | !default.mode1v3 31 | *.mode2v3 32 | !default.mode2v3 33 | *.perspectivev3 34 | !default.perspectivev3 35 | xcuserdata 36 | *.xccheckout 37 | *.moved-aside 38 | DerivedData 39 | *.hmap 40 | *.ipa 41 | *.xcuserstate 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 48 | # 49 | # Pods/ 50 | 51 | 52 | ### Xcode ### 53 | build/ 54 | *.pbxuser 55 | !default.pbxuser 56 | *.mode1v3 57 | !default.mode1v3 58 | *.mode2v3 59 | !default.mode2v3 60 | *.perspectivev3 61 | !default.perspectivev3 62 | xcuserdata 63 | *.xccheckout 64 | *.moved-aside 65 | DerivedData 66 | *.xcuserstate 67 | 68 | 69 | ### OSX ### 70 | .DS_Store 71 | .AppleDouble 72 | .LSOverride 73 | 74 | # Icon must end with two \r 75 | Icon 76 | 77 | 78 | # Thumbnails 79 | ._* 80 | 81 | # Files that might appear on external disk 82 | .Spotlight-V100 83 | .Trashes 84 | 85 | # Directories potentially created on remote AFP share 86 | .AppleDB 87 | .AppleDesktop 88 | Network Trash Folder 89 | Temporary Items 90 | .apdisk 91 | 92 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | 2 | # foobar 3 | language: objective-c 4 | osx_image: xcode7.2 5 | script: 6 | - xctool build test GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES 7 | after_success: 8 | - bash <(curl -s https://codecov.io/bash) 9 | 10 | -------------------------------------------------------------------------------- /.xctool-args: -------------------------------------------------------------------------------- 1 | [ 2 | "-workspace", "SwiftBitmask.xcworkspace", 3 | "-scheme", "SwiftBitmask", 4 | "-configuration", "Debug" 5 | ] 6 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 bryn austin bellomy 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 | 23 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.10' 2 | use_frameworks! 3 | 4 | target 'SwiftBitmask' do 5 | pod 'Funky', '0.3.0' 6 | end 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Funky (0.3.0): 3 | - Regex (= 0.3.0) 4 | - Regex (0.3.0) 5 | 6 | DEPENDENCIES: 7 | - Funky (= 0.3.0) 8 | 9 | SPEC CHECKSUMS: 10 | Funky: ed6dbc079d41b3e5ad4e0cd87059b925b5641547 11 | Regex: 6bfb554ad7d5b1be9cfc57ab1fe2fb6cee45a344 12 | 13 | PODFILE CHECKSUM: 8d2e64a6b2ad084375feadb60b6f723a87344f87 14 | 15 | COCOAPODS: 1.0.0.beta.2 16 | -------------------------------------------------------------------------------- /Pods/Funky/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 bryn austin bellomy 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. -------------------------------------------------------------------------------- /Pods/Funky/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Funky 3 | 4 | The documentation (courtesy of [realm/jazzy](https://github.com/realm/jazzy)) is available here: 5 | 6 | Master branch is currently compatible with: **Swift 1.2** (although at the time of this writing, you have to do one quick-fix in LlamaKit's `Result.swift` due to breaking changes in 1.2). 7 | 8 | Funky is a bunch of functional programming stuff for Swift. I intend to de-jankify this README + repo in the near future, so bear with me. 9 | 10 | This is my way of learning about FP and really shouldn't be considered safe for production. I haven't finished writing tests for all of the included functions, and I would gladly welcome pull requests. 11 | 12 | README coming soon. (Honestly it's just a **shitload** of basic functions for basic types, collections (including strings), for `LlamaKit`'s `Result` type, etc. Use whatever seems useful.) 13 | 14 | # install 15 | 16 | Make sure you have the latest pre-release version of [CocoaPods](http://cocoapods.org) (`gem install cocoapods --pre`), which has Swift support. At the time of this writing, that would be `0.36.0.beta.1`. 17 | 18 | Add to your `Podfile`: 19 | 20 | ```ruby 21 | pod 'Funky' 22 | ``` 23 | 24 | And then from the shell: 25 | 26 | ```sh 27 | $ pod install 28 | ``` 29 | 30 | 31 | # contributors / authors 32 | 33 | 34 | bryn austin bellomy < > 35 | -------------------------------------------------------------------------------- /Pods/Funky/src/ErrorIO.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ErrorIO.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | private func formatError(error:ErrorType) -> String 12 | { 13 | if let errorIO = error as? ErrorIO { 14 | return errorIO.localizedDescription 15 | } 16 | else { 17 | let error = error as NSError 18 | if let file = error.userInfo["file"] as? String, line = error.userInfo["line"] as? Int { 19 | return "[\(file) : \(line)] \(error.localizedDescription)" 20 | } 21 | return "\(error.localizedDescription)" 22 | } 23 | } 24 | 25 | 26 | /** 27 | The primary purpose of `ErrorIO` (which conforms to `ErrorType`) is to attempt to standardize a 28 | method for coalescing multiple errors. For example, a task with multiple subtasks might 29 | return a `Result` the error type of which is an `ErrorIO` containing multiple errors 30 | from multiple failed subtasks. `ErrorIO` implements `SequenceType`, `CollectionType`, 31 | `ExtensibleCollectionType`, and `ArrayLiteralConvertible`. 32 | */ 33 | public class ErrorIO: ErrorType, ArrayLiteralConvertible 34 | { 35 | public struct Constants { 36 | public static let FileKey = "__file__" 37 | public static let LineKey = "__line__" 38 | } 39 | 40 | /** The default error domain for `ErrorIO` objects. */ 41 | public class var defaultDomain: String { return "com.illumntr.ErrorIO" } 42 | 43 | /** The default error code for `ErrorIO` objects. */ 44 | public class var defaultCode: Int { return 1 } 45 | 46 | /** The `Element` of `ErrorIO` when considered as a sequence/collection. */ 47 | public typealias Element = ErrorType 48 | 49 | /** The type of the underlying collection that holds the `ErrorType`s contained by this `ErrorIO`. */ 50 | public typealias UnderlyingCollection = [Element] 51 | 52 | /** The errors contained by this `ErrorIO`. */ 53 | public private(set) var errors = UnderlyingCollection() 54 | 55 | public var hasErrors: Bool { return errors.count > 0 } 56 | 57 | public var localizedDescription: String { 58 | let localizedErrors = describe(errors) { formatError($0) |> indent } 59 | return "" 60 | } 61 | 62 | public init() { 63 | } 64 | 65 | convenience required public init(arrayLiteral errors: Element...) { 66 | self.init() 67 | extend(errors) 68 | } 69 | 70 | public class func defaultError(userInfo: [NSObject: AnyObject]) -> ErrorIO { 71 | return ErrorIO() <~ NSError(domain: ErrorIO.defaultDomain, code: ErrorIO.defaultCode, userInfo: userInfo) 72 | } 73 | 74 | public class func defaultError(message message: String, file: String = __FILE__, line: Int = __LINE__) -> ErrorIO 75 | { 76 | let userInfo: [NSObject: AnyObject] = [ 77 | NSLocalizedDescriptionKey: message, 78 | Constants.FileKey: file, 79 | Constants.LineKey: line, 80 | ] 81 | return defaultError(userInfo) 82 | } 83 | 84 | public class func defaultError(file: String = __FILE__, line: Int = __LINE__) -> ErrorIO { 85 | let userInfo: [NSObject: AnyObject] = [ Constants.FileKey: file, Constants.LineKey: line, ] 86 | return defaultError(userInfo) 87 | } 88 | 89 | required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } 90 | 91 | public func asResult () -> Result { 92 | return Result.Failure(Box(self)) 93 | } 94 | } 95 | 96 | 97 | //- 98 | // MARK: - Error: SequenceType 99 | //__ 100 | 101 | extension ErrorIO: SequenceType 102 | { 103 | public func generate() -> AnyGenerator 104 | { 105 | var generator = errors.generate() 106 | return anyGenerator { return generator.next() } 107 | } 108 | } 109 | 110 | 111 | //- 112 | // MARK: - Error: CollectionType 113 | //__ 114 | 115 | extension ErrorIO: CollectionType 116 | { 117 | public typealias Index = UnderlyingCollection.Index 118 | public var startIndex : Index { return errors.startIndex } 119 | public var endIndex : Index { return errors.endIndex } 120 | 121 | /** Retrieves the `ErrorType` at the specified `index`. */ 122 | public subscript(position:Index) -> Element { 123 | return errors[position] 124 | } 125 | } 126 | 127 | 128 | //- 129 | // MARK: - Error: ExtensibleCollectionType 130 | //__ 131 | 132 | extension ErrorIO //: RangeReplaceableCollectionType 133 | { 134 | public func reserveCapacity(n: Index.Distance) { 135 | errors.reserveCapacity(n) 136 | } 137 | 138 | /** 139 | This method is simply an alias for `push()`, included for `ExtensibleCollectionType` conformance. 140 | */ 141 | public func append(newElement:Element) { 142 | errors.append(newElement) 143 | } 144 | 145 | 146 | /** 147 | Element order is [bottom, ..., top], as if one were to iterate through the sequence in forward order, calling `stack.push(element)` on each element. 148 | */ 149 | public func extend (sequence: S) { 150 | errors.appendContentsOf(sequence) 151 | } 152 | } 153 | 154 | 155 | 156 | 157 | //- 158 | -------------------------------------------------------------------------------- /Pods/Funky/src/Functions.ErrorIO.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.ErrorIO.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 14. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | public func coalesce 13 | 14 | (arr: [Result]) -> Result<[T], ErrorIO> 15 | { 16 | let failures = selectFailures(arr) 17 | if failures.count > 0 { 18 | let errorIO = failures.reduce(ErrorIO(), combine: <~) 19 | return errorIO |> asResult 20 | } 21 | else { 22 | return success(rejectFailures(arr)) 23 | } 24 | } 25 | 26 | public func coalesce2 27 | 28 | (arr: [(Result, Result)]) -> Result<[(T, U)], ErrorIO> 29 | { 30 | let errorIO = arr |> reducer(ErrorIO()) { (into, each) in 31 | let (left, right) = each 32 | 33 | if let error = left.error { into <~ error } 34 | if let error = right.error { into <~ error } 35 | return into 36 | } 37 | 38 | if errorIO.hasErrors { 39 | return errorIO.asResult() 40 | } 41 | else { 42 | return arr.map { ($0.0.value!, $0.1.value!) } |> success 43 | } 44 | } 45 | 46 | 47 | public func failure (message: String, file: String = __FILE__, line: Int = __LINE__) -> Result { 48 | // let err = ErrorIO.defaultError(message, file:file, line:line) 49 | // let res: Result = err |> asResult 50 | return ErrorIO.defaultError(message:message, file:file, line:line) 51 | .asResult() 52 | } 53 | 54 | public func failure (nserror:NSError, file: String = __FILE__, line: Int = __LINE__) -> Result { 55 | // let err = ErrorIO.defaultError(message, file:file, line:line) 56 | // let res: Result = err |> asResult 57 | let err = ErrorIO() 58 | err <~ nserror 59 | return err.asResult() 60 | } 61 | 62 | 63 | public func asResult (error:E) -> Result { 64 | return Result.Failure(Box(error)) 65 | } 66 | 67 | 68 | //public func failure (file: String = __FILE__, line: Int = __LINE__) -> Result { 69 | // return failure("", file: file, line: line) 70 | //} 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Pods/Funky/src/Functions.File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.File.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Feb 9. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | private let kPathSeparator: Character = "/" 12 | 13 | // 14 | // MARK: - File functions 15 | // 16 | 17 | /** 18 | Equivalent to the Unix `basename` command. Returns the last path component of `path`. 19 | */ 20 | public func basename(path:String) -> String { 21 | return (path as NSString).lastPathComponent 22 | } 23 | 24 | 25 | /** 26 | Equivalent to the Unix `extname` command. Returns the path extension of `path`. 27 | */ 28 | public func extname(path:String) -> String { 29 | return (path as NSString).pathExtension 30 | } 31 | 32 | 33 | /** 34 | Equivalent to the Unix `dirname` command. Returns the parent directory of the 35 | file or directory residing at `path`. 36 | */ 37 | public func dirname(path:String) -> String { 38 | return (path as NSString).stringByDeletingLastPathComponent 39 | } 40 | 41 | 42 | /** 43 | Returns an array of the individual components of `path`. The path separator is 44 | assumed to be `/`, as Swift currently only runs on OSX/iOS. 45 | */ 46 | public func pathComponents(path:String) -> [String] { 47 | return path.characters.split { $0 == kPathSeparator }.map(String.init) 48 | } 49 | 50 | 51 | /** 52 | Returns the relative path (`from` -> `to`). 53 | */ 54 | public func relativePath(from from:String, to:String) -> String 55 | { 56 | let fromParts = pathComponents(from) 57 | let toParts = pathComponents(to) 58 | 59 | // let sharedParts = zipseq(fromParts, toParts) 60 | // |> takeWhile(==) 61 | // |> mapTo(takeLeft) 62 | 63 | let relativeFromParts = Array(fromParts.suffix(Int.max)) 64 | let relativeToParts = Array(toParts.suffix(Int.max)) 65 | 66 | var relativeParts: [String] = [] 67 | for _ in relativeFromParts { 68 | relativeParts.append("..") 69 | } 70 | 71 | relativeParts.appendContentsOf(relativeToParts) 72 | 73 | return relativeParts |> joinWith("\(kPathSeparator)") 74 | } 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /Pods/Funky/src/Functions.Lazy.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// Functions.Lazy.swift 3 | //// Funky 4 | //// 5 | //// Created by bryn austin bellomy on 2015 Jun 3. 6 | //// Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | //// 8 | // 9 | //public struct Lazy 10 | //{ 11 | // public static func partition 12 | // (seq: S, predicate: S.Generator.Element -> Bool) 13 | // -> (LazySequence>, LazySequence>) 14 | // { 15 | // let pass = seq.lazy.filter { predicate($0) == true } .map { $0 } 16 | // let fail = seq.lazy.filter { predicate($0) == false } 17 | // return (AnySequence(pass).lazy, AnySequence(fail).lazy) 18 | // } 19 | // 20 | // 21 | // /** 22 | // Decomposes a `Dictionary` into a lazy sequence of key-value tuples. 23 | // */ 24 | // public static func pairs 25 | // (dict:[K: V]) -> LazySequence> 26 | // { 27 | // var gen = dict.lazy.generate() 28 | // return AnySequence(gen).lazy 29 | // } 30 | // 31 | // 32 | // public static func selectWhere 33 | // (predicate: S.Generator.Element -> Bool) (seq: S) -> LazySequence> 34 | // { 35 | // return lazy(AnySequence(lazy(seq).filter(predicate))) 36 | // } 37 | // 38 | // 39 | //} 40 | // 41 | -------------------------------------------------------------------------------- /Pods/Funky/src/Functions.Math.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.Math.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 13. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | /** 13 | Returns a random Float value between min and max (inclusive). 14 | 15 | - parameter min: 16 | - parameter max: 17 | - returns: Random number 18 | */ 19 | public func random(min: Float = 0, max: Float) -> Float 20 | { 21 | let diff = max - min 22 | let rand = Float(arc4random() % (UInt32(RAND_MAX) + 1)) 23 | return ((rand / Float(RAND_MAX)) * diff) + min 24 | } 25 | 26 | 27 | public func sum 28 | (nums: S) -> S.Generator.Element 29 | { 30 | return nums.reduce(0) { $0.0 + $0.1 } 31 | } 32 | -------------------------------------------------------------------------------- /Pods/Funky/src/Functions.Result.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.Result.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 April 18. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | /** 12 | This function simply calls `result.isSuccess()` but is more convenient in functional pipelines. 13 | */ 14 | public func isSuccess (result:Result) -> Bool { 15 | return result.isSuccess 16 | } 17 | 18 | 19 | /** 20 | This function simply calls `!result.isSuccess()` but is more convenient in functional pipelines. 21 | */ 22 | public func isFailure (result:Result) -> Bool { 23 | return !isSuccess(result) 24 | } 25 | 26 | 27 | /** 28 | This function simply calls `result.value()` but is more convenient in functional pipelines. 29 | */ 30 | public func unwrapValue (result: Result) -> T? { 31 | return result.value 32 | } 33 | 34 | 35 | /** 36 | This function simply calls `result.error()` but is more convenient in functional pipelines. 37 | */ 38 | public func unwrapError (result: Result) -> E? { 39 | return result.error 40 | } 41 | 42 | 43 | public func selectFailures 44 | 45 | (array: [Result]) -> [E] 46 | { 47 | return array |> mapFilter { $0.error } 48 | } 49 | 50 | 51 | public func rejectFailures 52 | (source: [Result]) -> [T] 53 | { 54 | return source |> rejectIf({ !$0.isSuccess }) 55 | |> mapFilter(unwrapValue) 56 | } 57 | 58 | 59 | public func rejectFailuresAndDispose 60 | (disposal:E -> Void) (source: [Result]) -> [T] 61 | { 62 | return source |> rejectIfAndDispose({ !isSuccess($0) })({ disposal($0.error!) }) 63 | |> mapFilter(unwrapValue) 64 | } 65 | 66 | -------------------------------------------------------------------------------- /Pods/Funky/src/Functions.Strings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.Strings.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 8. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Regex 11 | 12 | public func safeText (opt:Optional) -> String { 13 | switch opt { 14 | case .Some(let val): return "\(val)" 15 | case .None: return "(nil)" 16 | } 17 | } 18 | 19 | 20 | // 21 | // MARK: - String functions 22 | // 23 | 24 | /** 25 | Returns `str.characters.count` 26 | */ 27 | public func characterCount (str:String) -> Int { 28 | return str.characters.count 29 | } 30 | 31 | 32 | /** 33 | Converts its argument to a `String`. 34 | */ 35 | public func stringify (something:T) -> String { 36 | return "\(something)" 37 | } 38 | 39 | 40 | /** 41 | Argument-reversed, curried version of `split()`. 42 | */ 43 | public func splitOn 44 | 45 | (separator: String) (elements: S) -> [AnySequence] { 46 | 47 | return elements.split(separator) 48 | } 49 | 50 | 51 | /** 52 | Curried version of `join()`. 53 | */ 54 | public func joinWith 55 | 56 | (separator: String) (elements: S) -> String { 57 | 58 | return elements.joinWithSeparator(separator) 59 | } 60 | 61 | 62 | /** 63 | Splits the input string at every newline and returns the array of lines. 64 | */ 65 | public func lines (str:String) -> [String] { 66 | return str.characters.split { $0 == "\n" }.map(String.init) 67 | } 68 | 69 | 70 | /** 71 | Convenience function that calls `Swift.dump(value, &x)` and returns `x`. 72 | */ 73 | public func dumpString(value:T) -> String { 74 | var msg = "" 75 | dump(value, &msg) 76 | return msg 77 | } 78 | 79 | 80 | /** 81 | Pads the end of a string to the given length with the given padding string. 82 | 83 | - parameter string: The input string to pad. 84 | - parameter length: The length to which the string should be padded. 85 | - parameter padding: The string to use as padding. 86 | - returns: The padded `String`. 87 | */ 88 | public func pad (string:String, length:Int, padding:String) -> String { 89 | return string.stringByPaddingToLength(length, withString:padding, startingAtIndex:0) 90 | } 91 | 92 | /** 93 | Pads the beginning of a string to the given length with the given padding string. 94 | 95 | - parameter string: The input string to pad. 96 | - parameter length: The length to which the string should be padded. 97 | - parameter padding: The string to use as padding. 98 | - returns: The padded `String`. 99 | */ 100 | public func padFront (string:String, length:Int, padding:String) -> String 101 | { 102 | let disparity = length - string.characters.count 103 | if disparity <= 0 { 104 | return string 105 | } 106 | let padding = Array(count: disparity, repeatedValue: Character(padding)) 107 | return String(padding) + string 108 | } 109 | 110 | 111 | /** 112 | Pads a string to the given length using a space as the padding character. 113 | 114 | - parameter string: The input string to pad. 115 | - parameter length: The length to which the string should be padded. 116 | - returns: The padded `String`. 117 | */ 118 | public func pad (string:String, _ length:Int) -> String { 119 | return string.stringByPaddingToLength(length, withString:" ", startingAtIndex:0) 120 | } 121 | 122 | public func padx (length:Int) (string:String) -> String { 123 | return pad(string, length) 124 | } 125 | 126 | public enum Error: ErrorType { 127 | case Problem(msg: String) 128 | } 129 | 130 | /** 131 | Pads the strings in `strings` to the same length using a space as the padding character. 132 | 133 | - parameter strings: The array of strings to pad. 134 | - returns: An array containing the padded `String`s. 135 | */ 136 | public func padToSameLength (strings:S) -> [String] { 137 | guard let maxLength = strings.map(characterCount).maxElement()?.value else { 138 | // throw Error.Problem(msg: "No max element found") 139 | return strings.map(id) 140 | } 141 | return strings.map(padx(Int(maxLength))) 142 | } 143 | 144 | 145 | /** 146 | Pads the `String` keys of `strings` to the same length using a space as the padding 147 | character. This is mainly useful as a console output formatting utility. 148 | 149 | - parameter dict: The dictionary whose keys should be padded. 150 | - returns: A new dictionary with padded keys. 151 | */ 152 | public func padKeysToSameLength (dict: [String: V]) -> [String: V] { 153 | guard let maxLength = dict.map(takeLeft >>> characterCount).maxElement() else { 154 | // throw Error.Problem(msg: "No max element found") 155 | return dict 156 | } 157 | 158 | return dict |> mapKeys(padx(maxLength)) 159 | } 160 | 161 | 162 | /** 163 | Returns the substring in `string` from `index` to the last character. 164 | */ 165 | public func substringFromIndex (index:Int) (string:String) -> String { 166 | let newStart = string.startIndex.advancedBy(index) 167 | return string[newStart ..< string.endIndex] 168 | } 169 | 170 | 171 | 172 | /** 173 | Returns the substring in `string` from the first character to `index`. 174 | */ 175 | public func substringToIndex (index:Int) (string:String) -> String { 176 | let newEnd = string.startIndex.advancedBy(index) 177 | return string[string.startIndex ..< newEnd] 178 | } 179 | 180 | 181 | /** 182 | Returns a string containing a pretty-printed representation of `array`. 183 | */ 184 | public func describe (array:[T]) -> String { 185 | return describe(array) { stringify($0) } 186 | } 187 | 188 | 189 | /** 190 | Returns a string containing a pretty-printed representation of `array` created 191 | by mapping `formatElement` over its elements. 192 | */ 193 | public func describe (array:[T], formatElement:(T) -> String) -> String { 194 | return array.map(formatElement >>> indent) 195 | .joinWithSeparator(",\n") 196 | |> { "[\n\($0)\n]" } 197 | } 198 | 199 | 200 | /** 201 | Returns a string containing a pretty-printed representation of `dict`. 202 | */ 203 | public func describe (dict:[K: V]) -> String { 204 | func renderKeyValue(key:String, value:V) -> String { return "\(key) \(value)," } 205 | 206 | return (dict |> mapKeys { "\($0):" } |> padKeysToSameLength) 207 | .map(renderKeyValue >>> indent) 208 | .joinWithSeparator("\n") 209 | |> { "{\n\($0)\n}" } 210 | } 211 | 212 | 213 | /** 214 | Returns a string containing a pretty-printed representation of `dict` created 215 | by mapping `formatClosure` over its elements. 216 | */ 217 | public func describe (dict:[K: V], formatClosure:(K, V) -> String) -> String 218 | { 219 | return dict.map(formatClosure) 220 | .map(indent) 221 | .joinWithSeparator(",\n") 222 | |> { "{\n\($0)\n}" } 223 | } 224 | 225 | 226 | /** 227 | Splits `string` into lines, adds four spaces to the beginning of each line, and 228 | then joins the lines into a single string again (preserving the original newlines). 229 | */ 230 | public func indent(string:String) -> String 231 | { 232 | let spaces = " " 233 | return string.characters.split { $0 == "\n" }.map(String.init) 234 | .map { "\(spaces)\($0)" } 235 | .joinWithSeparator("\n") 236 | } 237 | 238 | 239 | /** 240 | Removes whitespace (including newlines) from the beginning and end of `str`. 241 | */ 242 | public func trim(str:String) -> String { 243 | return str.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 244 | } 245 | 246 | /** 247 | Removes whitespace (including newlines) from the beginning and end of `str`. 248 | */ 249 | public func trim 250 | 251 | (str:S) -> String { 252 | return String(str).stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 253 | } 254 | 255 | public func trimToLength (string:String, length:Int) -> String { 256 | return string.characters.count <= length 257 | ? string 258 | : (string |> substringToIndex(length)) 259 | } 260 | 261 | 262 | /** 263 | Generates an rgba tuple from a hex color string. 264 | 265 | - parameter hex: The hex color string from which to create the color object. '#' sign is optional. 266 | */ 267 | public func rgbaFromHexCode(hex:String) -> (r:UInt32, g:UInt32, b:UInt32, a:UInt32)? { 268 | let sanitized = hex.replaceRegex("[^a-fA-F0-9]", with: "") 269 | 270 | let strLen = sanitized.characters.count 271 | if strLen != 6 && strLen != 8 { 272 | return nil 273 | } 274 | 275 | let cs = sanitized.characters 276 | assert(cs.count == 6 || cs.count == 8) 277 | 278 | var groups: [String] = [] 279 | for var i = 0; i < cs.count; i += 2 { 280 | let group = String(cs[ cs.indices.startIndex.advancedBy(i) ]) + String(cs[ cs.indices.startIndex.advancedBy(i + 1) ]) 281 | groups.append(group) 282 | } 283 | 284 | if groups.count < 3 { 285 | return nil 286 | } 287 | 288 | let (red, green, blue) = (readHexInt(groups[0]), readHexInt(groups[1]), readHexInt(groups[2])) 289 | let alpha: UInt32? = groups.count >= 4 ? readHexInt(groups[3]) : nil 290 | 291 | if let (r, g, b) = all(red, two: green, three: blue) { 292 | if let a = alpha { 293 | return (r:r, g:g, b:b, a:a) 294 | } 295 | return (r:r, g:g, b:b, a:255) 296 | } 297 | 298 | return nil 299 | } 300 | 301 | 302 | /** 303 | Given a palette of `n` colors and a tuple `(r, g, b, a)` of `UInt32`s, this function 304 | will return a tuple (r/n, g/n, b/n, a/n) 305 | */ 306 | public func normalizeRGBA (colors c:UInt32) (r:UInt32, g:UInt32, b:UInt32, a:UInt32) -> (r:CGFloat, g:CGFloat, b:CGFloat, a:CGFloat) { 307 | return (r:CGFloat(r/c), g:CGFloat(g/c), b:CGFloat(b/c), a:CGFloat(a/c)) 308 | } 309 | 310 | 311 | /** 312 | Attempts to interpret `str` as a hexadecimal integer. If this succeeds, the integer 313 | is returned as a `UInt32`. 314 | */ 315 | public func readHexInt (str:String) -> UInt32? { 316 | var i: UInt32 = 0 317 | let success = NSScanner(string:str).scanHexInt(&i) 318 | return success ? i : nil 319 | } 320 | 321 | 322 | /** 323 | Attempts to interpret `string` as an rgba string of the form: `rgba(1.0, 0.2, 0.3, 0.4)`. 324 | The values are interpreted as `CGFloat`s from `0.0` to `1.0`. 325 | */ 326 | public func rgbaFromRGBAString (string:String) -> (r:CGFloat, g:CGFloat, b:CGFloat, a:CGFloat)? 327 | { 328 | let sanitized: String = Regex("[^0-9,\\.]").replaceMatchesIn(string, with:"") 329 | 330 | let parts: [CGFloat?] = sanitized.characters.split { $0 == "," } 331 | .map(trim) 332 | .map { $0.toCGFloat() } 333 | if parts.count != 4 { 334 | return nil 335 | } 336 | else if let (red, green, blue, alpha) = all(parts[0], two: parts[1], three: parts[2], four: parts[3]) { 337 | return (r:red, g:green, b:blue, a:alpha) 338 | } 339 | 340 | return nil 341 | } 342 | 343 | 344 | private extension String 345 | { 346 | func toCGFloat() -> CGFloat? { 347 | return CGFloat((self as NSString).floatValue) 348 | } 349 | } 350 | 351 | 352 | 353 | 354 | -------------------------------------------------------------------------------- /Pods/Funky/src/NSError+Coalescing.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// NSError+Coalescing.swift 3 | //// Funky 4 | //// 5 | //// Created by bryn austin bellomy on 2014 Dec 9. 6 | //// Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | //// 8 | // 9 | // 10 | //public extension NSError 11 | //{ 12 | // public class func multiError(errors:[NSError]) -> NSError 13 | // { 14 | // var errorIO = ErrorIO() 15 | // errorIO.extend(errors) 16 | // return NSError(domain:"com.illumntr.multi-error", code:1, userInfo: [Keys.IsMultiError: true, Keys.ErrorIO: errorIO]) 17 | // } 18 | // 19 | // public var errorIO: ErrorIO? { return userInfo?[Keys.ErrorIO] as? ErrorIO } 20 | // 21 | // public class func coalesce(errors:[NSError]) -> NSError 22 | // { 23 | // return errors |> reducer([NSError]()) { (var into, error) in 24 | // if let io = error.errorIO { 25 | // into.extend(io) 26 | // } 27 | // else { 28 | // into.append(error) 29 | // } 30 | // return into 31 | // } 32 | // 33 | // |> { NSError.multiError($0) } 34 | // } 35 | // 36 | // 37 | // private struct Keys { 38 | // static let IsMultiError = "is multi error" 39 | // static let ErrorIO = "ErrorIO" 40 | // } 41 | //} 42 | // 43 | // 44 | -------------------------------------------------------------------------------- /Pods/Funky/src/Operators.ErrorIO.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.ErrorIO.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 14. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | infix operator <~ { associativity left } 13 | 14 | public func <~ (lhs:ErrorIO, rhs:NSError) -> ErrorIO { 15 | lhs.append(rhs) 16 | return lhs 17 | } 18 | 19 | public func <~ (lhs:ErrorIO, rhs:String) -> ErrorIO { 20 | lhs.append(ErrorIO.defaultError(message:rhs)) 21 | return lhs 22 | } 23 | 24 | public func <~ (lhs:ErrorIO, rhs:ErrorIO) -> ErrorIO { 25 | lhs.extend(rhs) 26 | return lhs 27 | } 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Pods/Funky/src/Operators.Misc.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.misc.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | infix operator =?? { associativity left precedence 99 } 12 | infix operator ??= { associativity left precedence 99 } 13 | infix operator ?± { associativity right precedence 110 } 14 | 15 | // look, i made a face operator! 16 | // prefix operator °¿° {} 17 | 18 | 19 | /** 20 | The set-if-non-nil operator. Will only set `lhs` to `rhs` if `rhs` is non-nil. 21 | */ 22 | public func =?? (inout lhs:T, maybeRhs: T?) { 23 | if let rhs = maybeRhs { 24 | lhs = rhs 25 | } 26 | } 27 | 28 | 29 | /** 30 | The set-if-non-nil operator. Will only set `lhs` to `rhs` if `rhs` is non-nil. 31 | */ 32 | public func =?? (inout lhs:T?, maybeRhs: T?) { 33 | if let rhs = maybeRhs { 34 | lhs = rhs 35 | } 36 | } 37 | 38 | 39 | /** 40 | The set-if-non-failure operator. Will only set `lhs` to `rhs` if `rhs` is not a `Result.Failure`. 41 | */ 42 | public func =?? (inout lhs:T, result: Result) { 43 | lhs =?? result.value 44 | } 45 | 46 | 47 | /** 48 | The set-if-non-failure operator. Will only set `lhs` to `rhs` if `rhs` is not a `Result.Failure`. 49 | */ 50 | public func =?? (inout lhs:T?, result: Result) { 51 | lhs =?? result.value 52 | } 53 | 54 | 55 | /** 56 | The initialize-if-nil operator. Will only set `lhs` to `rhs` if `lhs` is nil. 57 | */ 58 | public func ??= (inout lhs:T?, @autoclosure rhs: () -> T) 59 | { 60 | if lhs == nil { 61 | lhs = rhs() 62 | } 63 | } 64 | 65 | 66 | /** 67 | The initialize-if-nil operator. Will only set `lhs` to `rhs` if `lhs` is nil. 68 | */ 69 | public func ??= (inout lhs:T?, @autoclosure rhs: () -> T?) 70 | { 71 | if lhs == nil { 72 | lhs = rhs() 73 | } 74 | } 75 | 76 | 77 | 78 | 79 | 80 | 81 | //public func |> (lhs: T -> Result, rhs: U -> Void) -> T -> Result { 82 | // return { arg in lhs(arg).map { rhs($0); return $0 } } 83 | //} 84 | 85 | 86 | 87 | 88 | 89 | 90 | /** 91 | Nil coalescing operator for `Result`. 92 | */ 93 | public func ?± 94 | (lhs: T?, @autoclosure rhs: () -> Result) -> Result 95 | { 96 | if let lhs = lhs { 97 | return success(lhs) 98 | } 99 | else { 100 | return rhs() 101 | } 102 | } 103 | 104 | public func ?± 105 | (lhs: Result, @autoclosure rhs: () -> Result) -> Result 106 | { 107 | switch lhs { 108 | case .Success: return lhs 109 | case .Failure: return rhs() 110 | } 111 | } 112 | 113 | 114 | 115 | 116 | 117 | postfix operator ‡ {} 118 | 119 | 120 | /** 121 | The reverse-args-and-curry operator (type shift+option+7). Useful in bringing the Swift stdlib collection functions into use in functional pipelines. 122 | 123 | For example: `let lowercaseStrings = someStrings |> mapTo { $0.lowercaseString }` 124 | */ 125 | 126 | //public postfix func ‡ 127 | // 128 | // (f: (T, U, V) -> R) -> V -> ((T, U) -> R) { 129 | // return { v in { t, u in f(t, u, v) }} 130 | //} 131 | 132 | 133 | public postfix func ‡ 134 | 135 | (f: (T, U) -> R) -> U -> T -> R { 136 | // @@XYZZY 137 | // return currySwap(f) 138 | return { x in { y in f(y, x) }} 139 | } 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /Pods/Funky/src/Operators.apply.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.apply.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | /** 12 | apply operator (applicative functors) ((A -> B)? <| A?) 13 | */ 14 | infix operator <*> { associativity left precedence 101 } 15 | 16 | 17 | public func <*> 18 | 19 | (f: (A -> B)?, maybeValue: A?) -> B? 20 | { 21 | switch f 22 | { 23 | case .Some(let fx): return fx <^> maybeValue 24 | case .None: return .None 25 | } 26 | } 27 | 28 | 29 | public func <*> 30 | 31 | (f: Result B, E>, values: Result) -> Result 32 | { 33 | return f.flatMap { fn in values.flatMap(fn >>> success) } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Pods/Funky/src/Operators.bind.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.bind.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | /** 12 | bind operators (A? |> A -> B?) 13 | */ 14 | infix operator >>- { associativity left precedence 150 } 15 | infix operator -<< { associativity left precedence 150 } 16 | 17 | 18 | public func >>- 19 | (maybeValue: A?, f: A -> B?) -> B? 20 | { 21 | return maybeValue.flatMap(f) 22 | } 23 | 24 | 25 | public func >>- 26 | (wrapped: [A], f: A -> [B]) -> [B] 27 | { 28 | return wrapped.map(f).reduce([], combine: +) 29 | } 30 | 31 | 32 | public func >>- 33 | 34 | (maybeValue: Result, f: A -> Result) -> Result 35 | { 36 | switch maybeValue { 37 | case .Success(let box): return f(box.unbox) 38 | case .Failure(let err): return Result.Failure(err) 39 | } 40 | } 41 | 42 | 43 | public func >>- 44 | (maybeValue: Result<(), E>, f: () -> Result<(), E>) -> Result<(), E> 45 | { 46 | switch maybeValue { 47 | case .Success: return f() 48 | case .Failure(let box): return Result.Failure(box) 49 | } 50 | } 51 | 52 | 53 | public func >>- 54 | (maybeValue: Result, f: () -> Result) -> Result 55 | { 56 | switch maybeValue { 57 | case .Success: return f() 58 | case .Failure(let err): return Result.Failure(err) 59 | } 60 | } 61 | 62 | 63 | public func -<< (f:A -> Result, maybeValue:Result) -> Result 64 | { 65 | 66 | switch maybeValue { 67 | case .Success(let box): return f(box.unbox) 68 | case .Failure(let err): return Result.Failure(err) 69 | } 70 | } 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Pods/Funky/src/Operators.compose.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.compose.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | infix operator >>> { associativity right precedence 170 } 11 | infix operator />> { associativity right precedence 170 } 12 | infix operator |>> { associativity left precedence 170 } 13 | infix operator • { associativity left } 14 | 15 | 16 | 17 | /// Returns the left-to-right composition of unary `g` on unary `f`. 18 | /// 19 | /// This is the function such that `(f >>> g)(x)` = `g(f(x))`. 20 | public func >>> (f: T -> U, g: U -> V) -> T -> V { 21 | return { g(f($0)) } 22 | } 23 | 24 | /// Returns the left-to-right composition of unary `g` on binary `f`. 25 | /// 26 | /// This is the function such that `(f >>> g)(x, y)` = `g(f(x, y))`. 27 | public func >>> (f: (T, U) -> V, g: V -> W) -> (T, U) -> W { 28 | return { g(f($0, $1)) } 29 | } 30 | 31 | /// Returns the left-to-right composition of binary `g` on unary `f`. 32 | /// 33 | /// This is the function such that `(f >>> g)(x, y)` = `g(f(x), y)`. 34 | public func >>> (f: T -> U, g: (U, V) -> W) -> (T, V) -> W { 35 | return { g(f($0), $1) } 36 | } 37 | 38 | // MARK: - Left-to-right composition 39 | public func />> 40 | 41 | (f: T -> Result, g: U -> Result) 42 | -> T -> Result 43 | { 44 | return { f($0).flatMap { x in g(x) } } 45 | } 46 | 47 | public func />> 48 | 49 | (f: T -> Result, g: Result -> V) 50 | -> T -> V 51 | { 52 | return { g(f($0)) } 53 | } 54 | 55 | public func />> 56 | 57 | (f: T -> Result, g: U -> V) 58 | -> T -> Result 59 | { 60 | return { f($0).flatMap { x in success(g(x)) } } 61 | } 62 | 63 | public func >>> 64 | 65 | (f: T -> U, g: U -> Void) 66 | -> T -> Void 67 | { 68 | return { f($0) |> g } 69 | } 70 | 71 | 72 | public func |>> 73 | 74 | (f: T -> Result, g: Result -> Void) 75 | -> T -> Void 76 | { 77 | return { f($0) |> g } 78 | } 79 | 80 | 81 | /** 82 | The function composition operator. 83 | 84 | - parameter g: The outer function, called second and passed the return value of f(x). 85 | - parameter f: The inner function, called first and passed some value x. 86 | - returns: A function that takes some argument x, calls g(f(x)), and returns the value. 87 | */ 88 | public func • 89 | 90 | (g: U -> V, f: T -> U) 91 | -> T -> V 92 | { 93 | return { x in g(f(x)) } 94 | } 95 | 96 | 97 | -------------------------------------------------------------------------------- /Pods/Funky/src/Operators.fmap.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.fmap.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | fmap operator (functors) (A -> B <^> A?) 12 | */ 13 | infix operator <^> { associativity left precedence 101 } 14 | 15 | public func <^> 16 | 17 | (f: A -> B, maybeValue: A?) -> B? 18 | { 19 | switch maybeValue 20 | { 21 | case .Some(let x): return f(x) 22 | case .None: return .None 23 | } 24 | } 25 | 26 | public func <^> 27 | 28 | (f: A -> B, values: [A]) -> [B] 29 | { 30 | return values.map(f) 31 | } 32 | 33 | 34 | public func <^> 35 | 36 | (f: A -> B, values: Result) -> Result 37 | { 38 | return values.map(f) 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /Pods/Funky/src/Operators.pipe.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.pipe.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | infix operator |> { associativity left } 12 | infix operator <| { associativity left precedence 101 } 13 | 14 | 15 | 16 | /** The pipe-forward operator. */ 17 | public func |> 18 | 19 | (t: T, f: T -> U) 20 | -> U 21 | { 22 | return f(t) 23 | } 24 | 25 | 26 | 27 | /** The pipe-backward operator. */ 28 | public func <| 29 | 30 | (f: T -> U, t: T) 31 | -> U 32 | { 33 | return f(t) 34 | } 35 | 36 | 37 | 38 | 39 | // @@TODO: figure out a different operator for this 40 | public func <| 41 | 42 | (f: (T -> U)?, t: T) 43 | -> U? 44 | { 45 | return f.map { fn in fn(t) } 46 | } 47 | 48 | 49 | // @@TODO: figure out a different operator for this 50 | public func <| 51 | 52 | (f: Result U, E>, t: T) 53 | -> Result 54 | { 55 | return f.map { fn in fn(t) } 56 | } 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Pods/Funky/src/Result.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Result 3 | /// LlamaKit 4 | /// 5 | /// Container for a successful value (T) or a failure with an NSError 6 | /// 7 | 8 | import Foundation 9 | 10 | /// A success `Result` returning `value` 11 | /// This form is preferred to `Result.Success(Box(value))` because it 12 | // does not require dealing with `Box()` 13 | public func success (value: T) -> Result { 14 | return .Success(Box(value)) 15 | } 16 | 17 | /// A failure `Result` returning `error` 18 | /// The default error is an empty one so that `failure()` is legal 19 | /// To assign this to a variable, you must explicitly give a type. 20 | /// Otherwise the compiler has no idea what `T` is. This form is preferred 21 | /// to Result.Failure(error) because it provides a useful default. 22 | /// For example: 23 | /// let fail: Result = failure() 24 | /// 25 | 26 | /// Dictionary keys for default errors 27 | public let ErrorFileKey = "LMErrorFile" 28 | public let ErrorLineKey = "LMErrorLine" 29 | 30 | private func defaultError(userInfo: [NSObject: AnyObject]) -> NSError { 31 | return NSError(domain: "", code: 0, userInfo: userInfo) 32 | } 33 | 34 | private func defaultError(message: String, file: String = __FILE__, line: Int = __LINE__) -> NSError { 35 | return defaultError([NSLocalizedDescriptionKey: message, ErrorFileKey: file, ErrorLineKey: line]) 36 | } 37 | 38 | private func defaultError(file: String = __FILE__, line: Int = __LINE__) -> NSError { 39 | return defaultError([ErrorFileKey: file, ErrorLineKey: line]) 40 | } 41 | 42 | public func failure(message: String, file: String = __FILE__, line: Int = __LINE__) -> Result { 43 | let userInfo: [NSObject : AnyObject] = [NSLocalizedDescriptionKey: message, ErrorFileKey: file, ErrorLineKey: line] 44 | return failure(defaultError(userInfo)) 45 | } 46 | 47 | //public func failure(file: String = __FILE__, line: Int = __LINE__) -> Result { 48 | // let userInfo: [NSObject : AnyObject] = [ErrorFileKey: file, ErrorLineKey: line] 49 | // return failure(defaultError(userInfo)) 50 | //} 51 | 52 | public func failure(error: E) -> Result { 53 | return .Failure(Box(error)) 54 | } 55 | 56 | /// Construct a `Result` using a block which receives an error parameter. 57 | /// Expected to return non-nil for success. 58 | 59 | public func `try`(f: (NSErrorPointer -> T?), file: String = __FILE__, line: Int = __LINE__) -> Result { 60 | var error: NSError? 61 | return f(&error).map(success) ?? failure(error ?? defaultError(file, line: line)) 62 | } 63 | 64 | public func `try`(f: (NSErrorPointer -> Bool), file: String = __FILE__, line: Int = __LINE__) -> Result<(),NSError> { 65 | var error: NSError? 66 | return f(&error) ? success(()) : failure(error ?? defaultError(file, line: line)) 67 | } 68 | 69 | /// Container for a successful value (T) or a failure with an E 70 | public enum Result { 71 | case Success(Box) 72 | case Failure(Box) 73 | 74 | /// The successful value as an Optional 75 | public var value: T? { 76 | switch self { 77 | case .Success(let box): return box.unbox 78 | case .Failure: return nil 79 | } 80 | } 81 | 82 | /// The failing error as an Optional 83 | public var error: E? { 84 | switch self { 85 | case .Success: return nil 86 | case .Failure(let err): return err.unbox 87 | } 88 | } 89 | 90 | public var isSuccess: Bool { 91 | switch self { 92 | case .Success: return true 93 | case .Failure: return false 94 | } 95 | } 96 | 97 | /// Return a new result after applying a transformation to a successful value. 98 | /// Mapping a failure returns a new failure without evaluating the transform 99 | public func map(transform: T -> U) -> Result { 100 | switch self { 101 | case Success(let box): 102 | return .Success(Box(transform(box.unbox))) 103 | case Failure(let err): 104 | return .Failure(err) 105 | } 106 | } 107 | 108 | /// Return a new result after applying a transformation (that itself 109 | /// returns a result) to a successful value. 110 | /// Calling with a failure returns a new failure without evaluating the transform 111 | public func flatMap(transform:T -> Result) -> Result { 112 | switch self { 113 | case Success(let value): return transform(value.unbox) 114 | case Failure(let error): return .Failure(error) 115 | } 116 | } 117 | } 118 | 119 | extension Result: CustomStringConvertible { 120 | public var description: String { 121 | switch self { 122 | case .Success(let box): 123 | return "Success: \(box.unbox)" 124 | case .Failure(let error): 125 | return "Failure: \(error.unbox)" 126 | } 127 | } 128 | } 129 | 130 | /// Failure coalescing 131 | /// .Success(Box(42)) ?? 0 ==> 42 132 | /// .Failure(NSError()) ?? 0 ==> 0 133 | public func ??(result: Result, @autoclosure defaultValue: () -> T) -> T { 134 | switch result { 135 | case .Success(let value): 136 | return value.unbox 137 | case .Failure: 138 | return defaultValue() 139 | } 140 | } 141 | 142 | /// Equatable 143 | /// Equality for Result is defined by the equality of the contained types 144 | public func ==(lhs: Result, rhs: Result) -> Bool { 145 | switch (lhs, rhs) { 146 | case let (.Success(l), .Success(r)): return l.unbox == r.unbox 147 | case let (.Failure(l), .Failure(r)): return l.unbox == r.unbox 148 | default: return false 149 | } 150 | } 151 | 152 | public func !=(lhs: Result, rhs: Result) -> Bool { 153 | return !(lhs == rhs) 154 | } 155 | 156 | /// Due to current swift limitations, we have to include this Box in Result. 157 | /// Swift cannot handle an enum with multiple associated data (A, NSError) where one is of unknown size (A) 158 | final public class Box { 159 | public let unbox: T 160 | public init(_ value: T) { self.unbox = value } 161 | } 162 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Funky (0.3.0): 3 | - Regex (= 0.3.0) 4 | - Regex (0.3.0) 5 | 6 | DEPENDENCIES: 7 | - Funky (= 0.3.0) 8 | 9 | SPEC CHECKSUMS: 10 | Funky: ed6dbc079d41b3e5ad4e0cd87059b925b5641547 11 | Regex: 6bfb554ad7d5b1be9cfc57ab1fe2fb6cee45a344 12 | 13 | PODFILE CHECKSUM: 8d2e64a6b2ad084375feadb60b6f723a87344f87 14 | 15 | COCOAPODS: 1.0.0.beta.2 16 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0B3A5267A0E382A3F75B9783F6178F8F /* Operators.pipe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78D72E4E4FEB0CA5B5E5FE154621F979 /* Operators.pipe.swift */; }; 11 | 158AC34C77A010AA0CDD508FB469A812 /* ErrorIO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0715F79DCDE4FF17F0C6C2B597575188 /* ErrorIO.swift */; }; 12 | 22A14F05B0E8CD5D1FC39B81D7BDEE89 /* Operators.bind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3287C6A4D2FAB611E16B38BF6A21AD9E /* Operators.bind.swift */; }; 13 | 24E3500A6ED350EB7D90A8EEEB67807D /* Operators.fmap.swift in Sources */ = {isa = PBXBuildFile; fileRef = D105DABA07F6F024FCCA1B2F093AECBE /* Operators.fmap.swift */; }; 14 | 3E14DA522978129EEBF4F6CEBAF62CD6 /* Funky-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = BE3750AAF0B941FA8FA709B9269248ED /* Funky-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 418E3588DEC8DAE1F662499ED6EF5951 /* Operators.apply.swift in Sources */ = {isa = PBXBuildFile; fileRef = 006B4303395FECFE8E3D0360FAEE5CB8 /* Operators.apply.swift */; }; 16 | 41F1A136CA8887E738F66E3B186C5E10 /* Regex.swift in Sources */ = {isa = PBXBuildFile; fileRef = D424C2C612A684D8A5F7D2492B913122 /* Regex.swift */; }; 17 | 489DA7C153720F022F8D7200AEC75ECF /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC92FFA537B9E14EFBE9FF7292DAB14E /* Result.swift */; }; 18 | 501760A0661EA43B6BC45EC284F8474D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBD00618D4676C6F79D30F18F454FBF7 /* Cocoa.framework */; }; 19 | 56DFC62E9F9668E977C02705FD6A0DA9 /* Functions.ErrorIO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18F9E9657BD62D183810C5D59395E4FC /* Functions.ErrorIO.swift */; }; 20 | 5A6045300329A2461A09FD5F5D4C63B3 /* Regex-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3406198A6D1A9ECCE329D0991BDDFA8C /* Regex-dummy.m */; }; 21 | 60DD3EF78AB4E08B37B3B39BD73FE592 /* Regex-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 04859F8FB8BB14EE534AC4EB7CD03BC6 /* Regex-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | 62412FF28A17C91F43617250DE82A841 /* Regex.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4AD1A327F9C1C2B3386694E72951A48E /* Regex.framework */; }; 23 | 66A9947D424AF7D6EC0026BA0A130D4E /* NSError+Coalescing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 809648AB3948112CDCB476B4750ED9E2 /* NSError+Coalescing.swift */; }; 24 | 66AC0CD2299B51D2F7818D9B43186D2A /* Pods-SwiftBitmask-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 28B23DF8D1E4DA28A25DD0953990D526 /* Pods-SwiftBitmask-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 25 | 6E529080F7B083A33D9340BE2F929125 /* Functions.File.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09D6ACBBB01ABFAAD7BC6E891B637B5 /* Functions.File.swift */; }; 26 | 7E6F2C90277C0F8EC3B59DEE279A177C /* Operators.ErrorIO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A0050235378EB8C98966C656CEC9A2 /* Operators.ErrorIO.swift */; }; 27 | 84A0E7ED48164031394F21194742788D /* Pods-SwiftBitmask-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 65738B2943C8CF3B4A84F42FC0D72543 /* Pods-SwiftBitmask-dummy.m */; }; 28 | 96988891D28D754CA327A45774EC5AC1 /* Operators.Misc.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78DDFFBC32CD697F2CACE080DA8725C /* Operators.Misc.swift */; }; 29 | 9DE556F01156DCDD67543C4E3D5ECF2F /* Functions.Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1754A7FC813114876589E59F09BB681F /* Functions.Result.swift */; }; 30 | A8BBF49C6183316BF16F9B05D77E9E8A /* Functions.Lazy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80ED86468084C165D0562DA245274DD4 /* Functions.Lazy.swift */; }; 31 | AC1FBB1C5A70C0270186EC749C879C97 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBD00618D4676C6F79D30F18F454FBF7 /* Cocoa.framework */; }; 32 | B2FC2144E49112634D7F3F24F741B388 /* Funky-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5470B477F2102FC4FA5E61C9B6B0F987 /* Funky-dummy.m */; }; 33 | BBAFF186DD350C3CD984D17AF0FEE2C9 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBD00618D4676C6F79D30F18F454FBF7 /* Cocoa.framework */; }; 34 | C5E42619A2FE165B60C14EEEF3E06868 /* Functions.Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE326D6FD8F637F720CD7AE17F80249F /* Functions.Strings.swift */; }; 35 | CEA88495085AD57F4B231148DB4E05AD /* Operators.compose.swift in Sources */ = {isa = PBXBuildFile; fileRef = 802F8DDF45BA2000F53B26BB1087997F /* Operators.compose.swift */; }; 36 | D1F909D303BDF15FA4D905AB165B1DE0 /* Functions.Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE0DD8E2FF9EBE8C198E5068AE7FE258 /* Functions.Functional.swift */; }; 37 | FD9EAA1FE61C35E15249619EE27CBB74 /* Functions.Math.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D3E7A19A4ABC230D0A5BC1ADF2FBBD /* Functions.Math.swift */; }; 38 | /* End PBXBuildFile section */ 39 | 40 | /* Begin PBXContainerItemProxy section */ 41 | 06C7DAFC6E7E084EB05F22F413660385 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 44 | proxyType = 1; 45 | remoteGlobalIDString = 9C7B7BC08CAD9903B6BEC02D220AC6CE; 46 | remoteInfo = Regex; 47 | }; 48 | B9DEE0DF0BA584A96A2942D9518C756A /* PBXContainerItemProxy */ = { 49 | isa = PBXContainerItemProxy; 50 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 51 | proxyType = 1; 52 | remoteGlobalIDString = 9C7B7BC08CAD9903B6BEC02D220AC6CE; 53 | remoteInfo = Regex; 54 | }; 55 | F1037E1B3AB04C29561D92A0181CBC66 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 58 | proxyType = 1; 59 | remoteGlobalIDString = 735BB380F245006FFA1A35E34435FA4F; 60 | remoteInfo = Funky; 61 | }; 62 | /* End PBXContainerItemProxy section */ 63 | 64 | /* Begin PBXFileReference section */ 65 | 006B4303395FECFE8E3D0360FAEE5CB8 /* Operators.apply.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Operators.apply.swift; path = src/Operators.apply.swift; sourceTree = ""; }; 66 | 04859F8FB8BB14EE534AC4EB7CD03BC6 /* Regex-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Regex-umbrella.h"; sourceTree = ""; }; 67 | 0715F79DCDE4FF17F0C6C2B597575188 /* ErrorIO.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ErrorIO.swift; path = src/ErrorIO.swift; sourceTree = ""; }; 68 | 1754A7FC813114876589E59F09BB681F /* Functions.Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functions.Result.swift; path = src/Functions.Result.swift; sourceTree = ""; }; 69 | 18F9E9657BD62D183810C5D59395E4FC /* Functions.ErrorIO.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functions.ErrorIO.swift; path = src/Functions.ErrorIO.swift; sourceTree = ""; }; 70 | 28A0050235378EB8C98966C656CEC9A2 /* Operators.ErrorIO.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Operators.ErrorIO.swift; path = src/Operators.ErrorIO.swift; sourceTree = ""; }; 71 | 28B23DF8D1E4DA28A25DD0953990D526 /* Pods-SwiftBitmask-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwiftBitmask-umbrella.h"; sourceTree = ""; }; 72 | 2F7CFD571232EF9C2CB1FA77F2AA496A /* Regex.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Regex.modulemap; sourceTree = ""; }; 73 | 3287C6A4D2FAB611E16B38BF6A21AD9E /* Operators.bind.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Operators.bind.swift; path = src/Operators.bind.swift; sourceTree = ""; }; 74 | 3406198A6D1A9ECCE329D0991BDDFA8C /* Regex-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Regex-dummy.m"; sourceTree = ""; }; 75 | 35B7FFA00499E445AB1C5BFEEF0FC003 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 76 | 4AD1A327F9C1C2B3386694E72951A48E /* Regex.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Regex.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 77 | 4B1422D8ED1074793AB9007A55A5E3D9 /* Pods-SwiftBitmask-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwiftBitmask-frameworks.sh"; sourceTree = ""; }; 78 | 4B156160486B2D013DD68DDC47C67ABB /* Pods-SwiftBitmask-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwiftBitmask-acknowledgements.plist"; sourceTree = ""; }; 79 | 4B33C23A244E8CCB73C4B071882B0174 /* Funky-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Funky-prefix.pch"; sourceTree = ""; }; 80 | 5470B477F2102FC4FA5E61C9B6B0F987 /* Funky-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Funky-dummy.m"; sourceTree = ""; }; 81 | 65738B2943C8CF3B4A84F42FC0D72543 /* Pods-SwiftBitmask-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwiftBitmask-dummy.m"; sourceTree = ""; }; 82 | 78D72E4E4FEB0CA5B5E5FE154621F979 /* Operators.pipe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Operators.pipe.swift; path = src/Operators.pipe.swift; sourceTree = ""; }; 83 | 7C62004BCB5989317C7429CC39787D45 /* Funky.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Funky.modulemap; sourceTree = ""; }; 84 | 802F8DDF45BA2000F53B26BB1087997F /* Operators.compose.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Operators.compose.swift; path = src/Operators.compose.swift; sourceTree = ""; }; 85 | 809648AB3948112CDCB476B4750ED9E2 /* NSError+Coalescing.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSError+Coalescing.swift"; path = "src/NSError+Coalescing.swift"; sourceTree = ""; }; 86 | 80ED86468084C165D0562DA245274DD4 /* Functions.Lazy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functions.Lazy.swift; path = src/Functions.Lazy.swift; sourceTree = ""; }; 87 | A9FE56E1F64383C637DDB9A24EB897E0 /* Regex-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Regex-prefix.pch"; sourceTree = ""; }; 88 | AC3273C69BAA9D6BD7C70E98B9A6D8BC /* Pods-SwiftBitmask.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwiftBitmask.debug.xcconfig"; sourceTree = ""; }; 89 | B09D6ACBBB01ABFAAD7BC6E891B637B5 /* Functions.File.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functions.File.swift; path = src/Functions.File.swift; sourceTree = ""; }; 90 | B38A21459D72D7496B438F77FB2B8080 /* Pods-SwiftBitmask.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwiftBitmask.release.xcconfig"; sourceTree = ""; }; 91 | BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 92 | BAA2F3FCC523894D38841799D7E17CEF /* Funky.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Funky.xcconfig; sourceTree = ""; }; 93 | BE0DD8E2FF9EBE8C198E5068AE7FE258 /* Functions.Functional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functions.Functional.swift; path = src/Functions.Functional.swift; sourceTree = ""; }; 94 | BE326D6FD8F637F720CD7AE17F80249F /* Functions.Strings.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functions.Strings.swift; path = src/Functions.Strings.swift; sourceTree = ""; }; 95 | BE3750AAF0B941FA8FA709B9269248ED /* Funky-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Funky-umbrella.h"; sourceTree = ""; }; 96 | C78DDFFBC32CD697F2CACE080DA8725C /* Operators.Misc.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Operators.Misc.swift; path = src/Operators.Misc.swift; sourceTree = ""; }; 97 | C7A94BE16754B850999B79CB5F5290F0 /* Regex.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Regex.xcconfig; sourceTree = ""; }; 98 | CBD00618D4676C6F79D30F18F454FBF7 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; 99 | CC5FE98F30B0411E03134D21BF629A17 /* Pods_SwiftBitmask.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftBitmask.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 100 | CC92FFA537B9E14EFBE9FF7292DAB14E /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = src/Result.swift; sourceTree = ""; }; 101 | CEE6A555CF5D45365E3E4560CEE8F390 /* Pods-SwiftBitmask-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwiftBitmask-acknowledgements.markdown"; sourceTree = ""; }; 102 | D105DABA07F6F024FCCA1B2F093AECBE /* Operators.fmap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Operators.fmap.swift; path = src/Operators.fmap.swift; sourceTree = ""; }; 103 | D14A537E24772B143D686AFD0D65C6FE /* Pods-SwiftBitmask.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-SwiftBitmask.modulemap"; sourceTree = ""; }; 104 | D424C2C612A684D8A5F7D2492B913122 /* Regex.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Regex.swift; path = src/Regex.swift; sourceTree = ""; }; 105 | E5205A35C0D41A643939AA23E148392C /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 106 | EB41E9EFC4FF2F6C840B99549D41337D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 107 | EC3EDA99E40504C1621334D41B7A1FE7 /* Pods-SwiftBitmask-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwiftBitmask-resources.sh"; sourceTree = ""; }; 108 | F3D3E7A19A4ABC230D0A5BC1ADF2FBBD /* Functions.Math.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functions.Math.swift; path = src/Functions.Math.swift; sourceTree = ""; }; 109 | FE7A5C99361A83D18FD251F4630A29AA /* Regex.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Regex.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 110 | FEFC26DCFD6986C926FDDCC8D9DAF65F /* Funky.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Funky.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 111 | /* End PBXFileReference section */ 112 | 113 | /* Begin PBXFrameworksBuildPhase section */ 114 | 0755D27C44303E7FC89E8299158821FF /* Frameworks */ = { 115 | isa = PBXFrameworksBuildPhase; 116 | buildActionMask = 2147483647; 117 | files = ( 118 | AC1FBB1C5A70C0270186EC749C879C97 /* Cocoa.framework in Frameworks */, 119 | ); 120 | runOnlyForDeploymentPostprocessing = 0; 121 | }; 122 | 50FEF23315F6FCABC8F919422497EBDA /* Frameworks */ = { 123 | isa = PBXFrameworksBuildPhase; 124 | buildActionMask = 2147483647; 125 | files = ( 126 | 501760A0661EA43B6BC45EC284F8474D /* Cocoa.framework in Frameworks */, 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | 8FB6E8E4EE3584952AEA2B8D750700C4 /* Frameworks */ = { 131 | isa = PBXFrameworksBuildPhase; 132 | buildActionMask = 2147483647; 133 | files = ( 134 | BBAFF186DD350C3CD984D17AF0FEE2C9 /* Cocoa.framework in Frameworks */, 135 | 62412FF28A17C91F43617250DE82A841 /* Regex.framework in Frameworks */, 136 | ); 137 | runOnlyForDeploymentPostprocessing = 0; 138 | }; 139 | /* End PBXFrameworksBuildPhase section */ 140 | 141 | /* Begin PBXGroup section */ 142 | 0BB45086E64AB913160FE6FA980D06E6 /* Regex */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | D424C2C612A684D8A5F7D2492B913122 /* Regex.swift */, 146 | 6B949E9FAA124B5F9FE2B00EBA2815F3 /* Support Files */, 147 | ); 148 | path = Regex; 149 | sourceTree = ""; 150 | }; 151 | 27409529BD67516E798281DA256FB24E /* Frameworks */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 4AD1A327F9C1C2B3386694E72951A48E /* Regex.framework */, 155 | E4C0B410E9AC6DE0214163FAFAB403AD /* OS X */, 156 | ); 157 | name = Frameworks; 158 | sourceTree = ""; 159 | }; 160 | 54179F13F3F07525E644189A0D2816A2 /* Products */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | FEFC26DCFD6986C926FDDCC8D9DAF65F /* Funky.framework */, 164 | CC5FE98F30B0411E03134D21BF629A17 /* Pods_SwiftBitmask.framework */, 165 | FE7A5C99361A83D18FD251F4630A29AA /* Regex.framework */, 166 | ); 167 | name = Products; 168 | sourceTree = ""; 169 | }; 170 | 629BDEAD01BCA5F8526F85512801BF5D /* Support Files */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 7C62004BCB5989317C7429CC39787D45 /* Funky.modulemap */, 174 | BAA2F3FCC523894D38841799D7E17CEF /* Funky.xcconfig */, 175 | 5470B477F2102FC4FA5E61C9B6B0F987 /* Funky-dummy.m */, 176 | 4B33C23A244E8CCB73C4B071882B0174 /* Funky-prefix.pch */, 177 | BE3750AAF0B941FA8FA709B9269248ED /* Funky-umbrella.h */, 178 | EB41E9EFC4FF2F6C840B99549D41337D /* Info.plist */, 179 | ); 180 | name = "Support Files"; 181 | path = "../Target Support Files/Funky"; 182 | sourceTree = ""; 183 | }; 184 | 6B949E9FAA124B5F9FE2B00EBA2815F3 /* Support Files */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 35B7FFA00499E445AB1C5BFEEF0FC003 /* Info.plist */, 188 | 2F7CFD571232EF9C2CB1FA77F2AA496A /* Regex.modulemap */, 189 | C7A94BE16754B850999B79CB5F5290F0 /* Regex.xcconfig */, 190 | 3406198A6D1A9ECCE329D0991BDDFA8C /* Regex-dummy.m */, 191 | A9FE56E1F64383C637DDB9A24EB897E0 /* Regex-prefix.pch */, 192 | 04859F8FB8BB14EE534AC4EB7CD03BC6 /* Regex-umbrella.h */, 193 | ); 194 | name = "Support Files"; 195 | path = "../Target Support Files/Regex"; 196 | sourceTree = ""; 197 | }; 198 | 7DB346D0F39D3F0E887471402A8071AB = { 199 | isa = PBXGroup; 200 | children = ( 201 | BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, 202 | 27409529BD67516E798281DA256FB24E /* Frameworks */, 203 | 9855E1B34FA74D20B105EE3321673E23 /* Pods */, 204 | 54179F13F3F07525E644189A0D2816A2 /* Products */, 205 | EEA829F38787F579C08F7A6A4D666007 /* Targets Support Files */, 206 | ); 207 | sourceTree = ""; 208 | }; 209 | 9855E1B34FA74D20B105EE3321673E23 /* Pods */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | B9AB0741D4D9AC4571E118E760129353 /* Funky */, 213 | 0BB45086E64AB913160FE6FA980D06E6 /* Regex */, 214 | ); 215 | name = Pods; 216 | sourceTree = ""; 217 | }; 218 | B9AB0741D4D9AC4571E118E760129353 /* Funky */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | 0715F79DCDE4FF17F0C6C2B597575188 /* ErrorIO.swift */, 222 | 18F9E9657BD62D183810C5D59395E4FC /* Functions.ErrorIO.swift */, 223 | B09D6ACBBB01ABFAAD7BC6E891B637B5 /* Functions.File.swift */, 224 | BE0DD8E2FF9EBE8C198E5068AE7FE258 /* Functions.Functional.swift */, 225 | 80ED86468084C165D0562DA245274DD4 /* Functions.Lazy.swift */, 226 | F3D3E7A19A4ABC230D0A5BC1ADF2FBBD /* Functions.Math.swift */, 227 | 1754A7FC813114876589E59F09BB681F /* Functions.Result.swift */, 228 | BE326D6FD8F637F720CD7AE17F80249F /* Functions.Strings.swift */, 229 | 809648AB3948112CDCB476B4750ED9E2 /* NSError+Coalescing.swift */, 230 | 006B4303395FECFE8E3D0360FAEE5CB8 /* Operators.apply.swift */, 231 | 3287C6A4D2FAB611E16B38BF6A21AD9E /* Operators.bind.swift */, 232 | 802F8DDF45BA2000F53B26BB1087997F /* Operators.compose.swift */, 233 | 28A0050235378EB8C98966C656CEC9A2 /* Operators.ErrorIO.swift */, 234 | D105DABA07F6F024FCCA1B2F093AECBE /* Operators.fmap.swift */, 235 | C78DDFFBC32CD697F2CACE080DA8725C /* Operators.Misc.swift */, 236 | 78D72E4E4FEB0CA5B5E5FE154621F979 /* Operators.pipe.swift */, 237 | CC92FFA537B9E14EFBE9FF7292DAB14E /* Result.swift */, 238 | 629BDEAD01BCA5F8526F85512801BF5D /* Support Files */, 239 | ); 240 | path = Funky; 241 | sourceTree = ""; 242 | }; 243 | DCD3274B7E10148EC099A3DFC57E251A /* Pods-SwiftBitmask */ = { 244 | isa = PBXGroup; 245 | children = ( 246 | E5205A35C0D41A643939AA23E148392C /* Info.plist */, 247 | D14A537E24772B143D686AFD0D65C6FE /* Pods-SwiftBitmask.modulemap */, 248 | CEE6A555CF5D45365E3E4560CEE8F390 /* Pods-SwiftBitmask-acknowledgements.markdown */, 249 | 4B156160486B2D013DD68DDC47C67ABB /* Pods-SwiftBitmask-acknowledgements.plist */, 250 | 65738B2943C8CF3B4A84F42FC0D72543 /* Pods-SwiftBitmask-dummy.m */, 251 | 4B1422D8ED1074793AB9007A55A5E3D9 /* Pods-SwiftBitmask-frameworks.sh */, 252 | EC3EDA99E40504C1621334D41B7A1FE7 /* Pods-SwiftBitmask-resources.sh */, 253 | 28B23DF8D1E4DA28A25DD0953990D526 /* Pods-SwiftBitmask-umbrella.h */, 254 | AC3273C69BAA9D6BD7C70E98B9A6D8BC /* Pods-SwiftBitmask.debug.xcconfig */, 255 | B38A21459D72D7496B438F77FB2B8080 /* Pods-SwiftBitmask.release.xcconfig */, 256 | ); 257 | name = "Pods-SwiftBitmask"; 258 | path = "Target Support Files/Pods-SwiftBitmask"; 259 | sourceTree = ""; 260 | }; 261 | E4C0B410E9AC6DE0214163FAFAB403AD /* OS X */ = { 262 | isa = PBXGroup; 263 | children = ( 264 | CBD00618D4676C6F79D30F18F454FBF7 /* Cocoa.framework */, 265 | ); 266 | name = "OS X"; 267 | sourceTree = ""; 268 | }; 269 | EEA829F38787F579C08F7A6A4D666007 /* Targets Support Files */ = { 270 | isa = PBXGroup; 271 | children = ( 272 | DCD3274B7E10148EC099A3DFC57E251A /* Pods-SwiftBitmask */, 273 | ); 274 | name = "Targets Support Files"; 275 | sourceTree = ""; 276 | }; 277 | /* End PBXGroup section */ 278 | 279 | /* Begin PBXHeadersBuildPhase section */ 280 | 028B911013EE1A2732E6DC6334250830 /* Headers */ = { 281 | isa = PBXHeadersBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | 3E14DA522978129EEBF4F6CEBAF62CD6 /* Funky-umbrella.h in Headers */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | 0E761CFC205F8B4C5F17D1374F96B7C1 /* Headers */ = { 289 | isa = PBXHeadersBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | 60DD3EF78AB4E08B37B3B39BD73FE592 /* Regex-umbrella.h in Headers */, 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | 943B47B2978527180D3E1A5247B97BB3 /* Headers */ = { 297 | isa = PBXHeadersBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | 66AC0CD2299B51D2F7818D9B43186D2A /* Pods-SwiftBitmask-umbrella.h in Headers */, 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | /* End PBXHeadersBuildPhase section */ 305 | 306 | /* Begin PBXNativeTarget section */ 307 | 735BB380F245006FFA1A35E34435FA4F /* Funky */ = { 308 | isa = PBXNativeTarget; 309 | buildConfigurationList = 4660C0E21C330B74FD64E9EF726A83DB /* Build configuration list for PBXNativeTarget "Funky" */; 310 | buildPhases = ( 311 | F8BEE89B3B1F66ACB1D7B4C449651C56 /* Sources */, 312 | 8FB6E8E4EE3584952AEA2B8D750700C4 /* Frameworks */, 313 | 028B911013EE1A2732E6DC6334250830 /* Headers */, 314 | ); 315 | buildRules = ( 316 | ); 317 | dependencies = ( 318 | 3CB06687C9482511BD5B026BDA5469FB /* PBXTargetDependency */, 319 | ); 320 | name = Funky; 321 | productName = Funky; 322 | productReference = FEFC26DCFD6986C926FDDCC8D9DAF65F /* Funky.framework */; 323 | productType = "com.apple.product-type.framework"; 324 | }; 325 | 8E251DC3AEE28CF99B6CBF292141668B /* Pods-SwiftBitmask */ = { 326 | isa = PBXNativeTarget; 327 | buildConfigurationList = ECEF0905277F1C1D95BBCF9BDB22014A /* Build configuration list for PBXNativeTarget "Pods-SwiftBitmask" */; 328 | buildPhases = ( 329 | F8E0F319D33051E8AEA6DCA18DB2D4DF /* Sources */, 330 | 50FEF23315F6FCABC8F919422497EBDA /* Frameworks */, 331 | 943B47B2978527180D3E1A5247B97BB3 /* Headers */, 332 | ); 333 | buildRules = ( 334 | ); 335 | dependencies = ( 336 | 1F954669E0D1EF180B17200AB834E083 /* PBXTargetDependency */, 337 | A2B6A38BBE76E036EA70554279603618 /* PBXTargetDependency */, 338 | ); 339 | name = "Pods-SwiftBitmask"; 340 | productName = "Pods-SwiftBitmask"; 341 | productReference = CC5FE98F30B0411E03134D21BF629A17 /* Pods_SwiftBitmask.framework */; 342 | productType = "com.apple.product-type.framework"; 343 | }; 344 | 9C7B7BC08CAD9903B6BEC02D220AC6CE /* Regex */ = { 345 | isa = PBXNativeTarget; 346 | buildConfigurationList = 42012A4F0A0CD844916CA6DA8A07337F /* Build configuration list for PBXNativeTarget "Regex" */; 347 | buildPhases = ( 348 | 530B1E41B10498E6D6C0941DB469F876 /* Sources */, 349 | 0755D27C44303E7FC89E8299158821FF /* Frameworks */, 350 | 0E761CFC205F8B4C5F17D1374F96B7C1 /* Headers */, 351 | ); 352 | buildRules = ( 353 | ); 354 | dependencies = ( 355 | ); 356 | name = Regex; 357 | productName = Regex; 358 | productReference = FE7A5C99361A83D18FD251F4630A29AA /* Regex.framework */; 359 | productType = "com.apple.product-type.framework"; 360 | }; 361 | /* End PBXNativeTarget section */ 362 | 363 | /* Begin PBXProject section */ 364 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 365 | isa = PBXProject; 366 | attributes = { 367 | LastSwiftUpdateCheck = 0720; 368 | LastUpgradeCheck = 0700; 369 | }; 370 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 371 | compatibilityVersion = "Xcode 3.2"; 372 | developmentRegion = English; 373 | hasScannedForEncodings = 0; 374 | knownRegions = ( 375 | en, 376 | ); 377 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 378 | productRefGroup = 54179F13F3F07525E644189A0D2816A2 /* Products */; 379 | projectDirPath = ""; 380 | projectRoot = ""; 381 | targets = ( 382 | 735BB380F245006FFA1A35E34435FA4F /* Funky */, 383 | 8E251DC3AEE28CF99B6CBF292141668B /* Pods-SwiftBitmask */, 384 | 9C7B7BC08CAD9903B6BEC02D220AC6CE /* Regex */, 385 | ); 386 | }; 387 | /* End PBXProject section */ 388 | 389 | /* Begin PBXSourcesBuildPhase section */ 390 | 530B1E41B10498E6D6C0941DB469F876 /* Sources */ = { 391 | isa = PBXSourcesBuildPhase; 392 | buildActionMask = 2147483647; 393 | files = ( 394 | 5A6045300329A2461A09FD5F5D4C63B3 /* Regex-dummy.m in Sources */, 395 | 41F1A136CA8887E738F66E3B186C5E10 /* Regex.swift in Sources */, 396 | ); 397 | runOnlyForDeploymentPostprocessing = 0; 398 | }; 399 | F8BEE89B3B1F66ACB1D7B4C449651C56 /* Sources */ = { 400 | isa = PBXSourcesBuildPhase; 401 | buildActionMask = 2147483647; 402 | files = ( 403 | 158AC34C77A010AA0CDD508FB469A812 /* ErrorIO.swift in Sources */, 404 | 56DFC62E9F9668E977C02705FD6A0DA9 /* Functions.ErrorIO.swift in Sources */, 405 | 6E529080F7B083A33D9340BE2F929125 /* Functions.File.swift in Sources */, 406 | D1F909D303BDF15FA4D905AB165B1DE0 /* Functions.Functional.swift in Sources */, 407 | A8BBF49C6183316BF16F9B05D77E9E8A /* Functions.Lazy.swift in Sources */, 408 | FD9EAA1FE61C35E15249619EE27CBB74 /* Functions.Math.swift in Sources */, 409 | 9DE556F01156DCDD67543C4E3D5ECF2F /* Functions.Result.swift in Sources */, 410 | C5E42619A2FE165B60C14EEEF3E06868 /* Functions.Strings.swift in Sources */, 411 | B2FC2144E49112634D7F3F24F741B388 /* Funky-dummy.m in Sources */, 412 | 66A9947D424AF7D6EC0026BA0A130D4E /* NSError+Coalescing.swift in Sources */, 413 | 418E3588DEC8DAE1F662499ED6EF5951 /* Operators.apply.swift in Sources */, 414 | 22A14F05B0E8CD5D1FC39B81D7BDEE89 /* Operators.bind.swift in Sources */, 415 | CEA88495085AD57F4B231148DB4E05AD /* Operators.compose.swift in Sources */, 416 | 7E6F2C90277C0F8EC3B59DEE279A177C /* Operators.ErrorIO.swift in Sources */, 417 | 24E3500A6ED350EB7D90A8EEEB67807D /* Operators.fmap.swift in Sources */, 418 | 96988891D28D754CA327A45774EC5AC1 /* Operators.Misc.swift in Sources */, 419 | 0B3A5267A0E382A3F75B9783F6178F8F /* Operators.pipe.swift in Sources */, 420 | 489DA7C153720F022F8D7200AEC75ECF /* Result.swift in Sources */, 421 | ); 422 | runOnlyForDeploymentPostprocessing = 0; 423 | }; 424 | F8E0F319D33051E8AEA6DCA18DB2D4DF /* Sources */ = { 425 | isa = PBXSourcesBuildPhase; 426 | buildActionMask = 2147483647; 427 | files = ( 428 | 84A0E7ED48164031394F21194742788D /* Pods-SwiftBitmask-dummy.m in Sources */, 429 | ); 430 | runOnlyForDeploymentPostprocessing = 0; 431 | }; 432 | /* End PBXSourcesBuildPhase section */ 433 | 434 | /* Begin PBXTargetDependency section */ 435 | 1F954669E0D1EF180B17200AB834E083 /* PBXTargetDependency */ = { 436 | isa = PBXTargetDependency; 437 | name = Funky; 438 | target = 735BB380F245006FFA1A35E34435FA4F /* Funky */; 439 | targetProxy = F1037E1B3AB04C29561D92A0181CBC66 /* PBXContainerItemProxy */; 440 | }; 441 | 3CB06687C9482511BD5B026BDA5469FB /* PBXTargetDependency */ = { 442 | isa = PBXTargetDependency; 443 | name = Regex; 444 | target = 9C7B7BC08CAD9903B6BEC02D220AC6CE /* Regex */; 445 | targetProxy = 06C7DAFC6E7E084EB05F22F413660385 /* PBXContainerItemProxy */; 446 | }; 447 | A2B6A38BBE76E036EA70554279603618 /* PBXTargetDependency */ = { 448 | isa = PBXTargetDependency; 449 | name = Regex; 450 | target = 9C7B7BC08CAD9903B6BEC02D220AC6CE /* Regex */; 451 | targetProxy = B9DEE0DF0BA584A96A2942D9518C756A /* PBXContainerItemProxy */; 452 | }; 453 | /* End PBXTargetDependency section */ 454 | 455 | /* Begin XCBuildConfiguration section */ 456 | 09A878F48567397ACD8CBF36966D65D4 /* Release */ = { 457 | isa = XCBuildConfiguration; 458 | baseConfigurationReference = C7A94BE16754B850999B79CB5F5290F0 /* Regex.xcconfig */; 459 | buildSettings = { 460 | CODE_SIGN_IDENTITY = "-"; 461 | COMBINE_HIDPI_IMAGES = YES; 462 | CURRENT_PROJECT_VERSION = 1; 463 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 464 | DEFINES_MODULE = YES; 465 | DYLIB_COMPATIBILITY_VERSION = 1; 466 | DYLIB_CURRENT_VERSION = 1; 467 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 468 | ENABLE_STRICT_OBJC_MSGSEND = YES; 469 | FRAMEWORK_VERSION = A; 470 | GCC_NO_COMMON_BLOCKS = YES; 471 | GCC_PREFIX_HEADER = "Target Support Files/Regex/Regex-prefix.pch"; 472 | INFOPLIST_FILE = "Target Support Files/Regex/Info.plist"; 473 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 475 | MACOSX_DEPLOYMENT_TARGET = 10.10; 476 | MODULEMAP_FILE = "Target Support Files/Regex/Regex.modulemap"; 477 | MTL_ENABLE_DEBUG_INFO = NO; 478 | PRODUCT_NAME = Regex; 479 | SDKROOT = macosx; 480 | SKIP_INSTALL = YES; 481 | VERSIONING_SYSTEM = "apple-generic"; 482 | VERSION_INFO_PREFIX = ""; 483 | }; 484 | name = Release; 485 | }; 486 | 193C9180A33A8D1BFA9F9C1135B197E2 /* Release */ = { 487 | isa = XCBuildConfiguration; 488 | baseConfigurationReference = B38A21459D72D7496B438F77FB2B8080 /* Pods-SwiftBitmask.release.xcconfig */; 489 | buildSettings = { 490 | CODE_SIGN_IDENTITY = "-"; 491 | COMBINE_HIDPI_IMAGES = YES; 492 | CURRENT_PROJECT_VERSION = 1; 493 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 494 | DEFINES_MODULE = YES; 495 | DYLIB_COMPATIBILITY_VERSION = 1; 496 | DYLIB_CURRENT_VERSION = 1; 497 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 498 | ENABLE_STRICT_OBJC_MSGSEND = YES; 499 | FRAMEWORK_VERSION = A; 500 | GCC_NO_COMMON_BLOCKS = YES; 501 | INFOPLIST_FILE = "Target Support Files/Pods-SwiftBitmask/Info.plist"; 502 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 503 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 504 | MACH_O_TYPE = staticlib; 505 | MACOSX_DEPLOYMENT_TARGET = 10.10; 506 | MODULEMAP_FILE = "Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask.modulemap"; 507 | MTL_ENABLE_DEBUG_INFO = NO; 508 | OTHER_LDFLAGS = ""; 509 | OTHER_LIBTOOLFLAGS = ""; 510 | PODS_ROOT = "$(SRCROOT)"; 511 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 512 | PRODUCT_NAME = Pods_SwiftBitmask; 513 | SDKROOT = macosx; 514 | SKIP_INSTALL = YES; 515 | VERSIONING_SYSTEM = "apple-generic"; 516 | VERSION_INFO_PREFIX = ""; 517 | }; 518 | name = Release; 519 | }; 520 | 200617EA0D50A7A037D4A47CB6900492 /* Release */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | ALWAYS_SEARCH_USER_PATHS = NO; 524 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 525 | CLANG_CXX_LIBRARY = "libc++"; 526 | CLANG_ENABLE_MODULES = YES; 527 | CLANG_ENABLE_OBJC_ARC = YES; 528 | CLANG_WARN_BOOL_CONVERSION = YES; 529 | CLANG_WARN_CONSTANT_CONVERSION = YES; 530 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 531 | CLANG_WARN_EMPTY_BODY = YES; 532 | CLANG_WARN_ENUM_CONVERSION = YES; 533 | CLANG_WARN_INT_CONVERSION = YES; 534 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 535 | CLANG_WARN_UNREACHABLE_CODE = YES; 536 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 537 | COPY_PHASE_STRIP = YES; 538 | ENABLE_NS_ASSERTIONS = NO; 539 | GCC_C_LANGUAGE_STANDARD = gnu99; 540 | GCC_PREPROCESSOR_DEFINITIONS = ( 541 | "POD_CONFIGURATION_RELEASE=1", 542 | "$(inherited)", 543 | ); 544 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 545 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 546 | GCC_WARN_UNDECLARED_SELECTOR = YES; 547 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 548 | GCC_WARN_UNUSED_FUNCTION = YES; 549 | GCC_WARN_UNUSED_VARIABLE = YES; 550 | MACOSX_DEPLOYMENT_TARGET = 10.10; 551 | STRIP_INSTALLED_PRODUCT = NO; 552 | SYMROOT = "${SRCROOT}/../build"; 553 | VALIDATE_PRODUCT = YES; 554 | }; 555 | name = Release; 556 | }; 557 | 42E0B13BBCEE1F71D98F0E48811FF508 /* Debug */ = { 558 | isa = XCBuildConfiguration; 559 | buildSettings = { 560 | ALWAYS_SEARCH_USER_PATHS = NO; 561 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 562 | CLANG_CXX_LIBRARY = "libc++"; 563 | CLANG_ENABLE_MODULES = YES; 564 | CLANG_ENABLE_OBJC_ARC = YES; 565 | CLANG_WARN_BOOL_CONVERSION = YES; 566 | CLANG_WARN_CONSTANT_CONVERSION = YES; 567 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 568 | CLANG_WARN_EMPTY_BODY = YES; 569 | CLANG_WARN_ENUM_CONVERSION = YES; 570 | CLANG_WARN_INT_CONVERSION = YES; 571 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 572 | CLANG_WARN_UNREACHABLE_CODE = YES; 573 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 574 | COPY_PHASE_STRIP = NO; 575 | ENABLE_TESTABILITY = YES; 576 | GCC_C_LANGUAGE_STANDARD = gnu99; 577 | GCC_DYNAMIC_NO_PIC = NO; 578 | GCC_OPTIMIZATION_LEVEL = 0; 579 | GCC_PREPROCESSOR_DEFINITIONS = ( 580 | "POD_CONFIGURATION_DEBUG=1", 581 | "DEBUG=1", 582 | "$(inherited)", 583 | ); 584 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 585 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 586 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 587 | GCC_WARN_UNDECLARED_SELECTOR = YES; 588 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 589 | GCC_WARN_UNUSED_FUNCTION = YES; 590 | GCC_WARN_UNUSED_VARIABLE = YES; 591 | MACOSX_DEPLOYMENT_TARGET = 10.10; 592 | ONLY_ACTIVE_ARCH = YES; 593 | STRIP_INSTALLED_PRODUCT = NO; 594 | SYMROOT = "${SRCROOT}/../build"; 595 | }; 596 | name = Debug; 597 | }; 598 | 7D808B18B38CA50B9FBABD6D1A5BEF91 /* Debug */ = { 599 | isa = XCBuildConfiguration; 600 | baseConfigurationReference = C7A94BE16754B850999B79CB5F5290F0 /* Regex.xcconfig */; 601 | buildSettings = { 602 | CODE_SIGN_IDENTITY = "-"; 603 | COMBINE_HIDPI_IMAGES = YES; 604 | CURRENT_PROJECT_VERSION = 1; 605 | DEBUG_INFORMATION_FORMAT = dwarf; 606 | DEFINES_MODULE = YES; 607 | DYLIB_COMPATIBILITY_VERSION = 1; 608 | DYLIB_CURRENT_VERSION = 1; 609 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 610 | ENABLE_STRICT_OBJC_MSGSEND = YES; 611 | FRAMEWORK_VERSION = A; 612 | GCC_NO_COMMON_BLOCKS = YES; 613 | GCC_PREFIX_HEADER = "Target Support Files/Regex/Regex-prefix.pch"; 614 | INFOPLIST_FILE = "Target Support Files/Regex/Info.plist"; 615 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 616 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 617 | MACOSX_DEPLOYMENT_TARGET = 10.10; 618 | MODULEMAP_FILE = "Target Support Files/Regex/Regex.modulemap"; 619 | MTL_ENABLE_DEBUG_INFO = YES; 620 | PRODUCT_NAME = Regex; 621 | SDKROOT = macosx; 622 | SKIP_INSTALL = YES; 623 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 624 | VERSIONING_SYSTEM = "apple-generic"; 625 | VERSION_INFO_PREFIX = ""; 626 | }; 627 | name = Debug; 628 | }; 629 | 9695C3E755C8AEC9099E868E7520CD34 /* Debug */ = { 630 | isa = XCBuildConfiguration; 631 | baseConfigurationReference = BAA2F3FCC523894D38841799D7E17CEF /* Funky.xcconfig */; 632 | buildSettings = { 633 | CODE_SIGN_IDENTITY = "-"; 634 | COMBINE_HIDPI_IMAGES = YES; 635 | CURRENT_PROJECT_VERSION = 1; 636 | DEBUG_INFORMATION_FORMAT = dwarf; 637 | DEFINES_MODULE = YES; 638 | DYLIB_COMPATIBILITY_VERSION = 1; 639 | DYLIB_CURRENT_VERSION = 1; 640 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 641 | ENABLE_STRICT_OBJC_MSGSEND = YES; 642 | FRAMEWORK_VERSION = A; 643 | GCC_NO_COMMON_BLOCKS = YES; 644 | GCC_PREFIX_HEADER = "Target Support Files/Funky/Funky-prefix.pch"; 645 | INFOPLIST_FILE = "Target Support Files/Funky/Info.plist"; 646 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 647 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 648 | MACOSX_DEPLOYMENT_TARGET = 10.10; 649 | MODULEMAP_FILE = "Target Support Files/Funky/Funky.modulemap"; 650 | MTL_ENABLE_DEBUG_INFO = YES; 651 | PRODUCT_NAME = Funky; 652 | SDKROOT = macosx; 653 | SKIP_INSTALL = YES; 654 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 655 | VERSIONING_SYSTEM = "apple-generic"; 656 | VERSION_INFO_PREFIX = ""; 657 | }; 658 | name = Debug; 659 | }; 660 | B1E0E3463DC7B3E8690C07F6B286B119 /* Debug */ = { 661 | isa = XCBuildConfiguration; 662 | baseConfigurationReference = AC3273C69BAA9D6BD7C70E98B9A6D8BC /* Pods-SwiftBitmask.debug.xcconfig */; 663 | buildSettings = { 664 | CODE_SIGN_IDENTITY = "-"; 665 | COMBINE_HIDPI_IMAGES = YES; 666 | CURRENT_PROJECT_VERSION = 1; 667 | DEBUG_INFORMATION_FORMAT = dwarf; 668 | DEFINES_MODULE = YES; 669 | DYLIB_COMPATIBILITY_VERSION = 1; 670 | DYLIB_CURRENT_VERSION = 1; 671 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 672 | ENABLE_STRICT_OBJC_MSGSEND = YES; 673 | FRAMEWORK_VERSION = A; 674 | GCC_NO_COMMON_BLOCKS = YES; 675 | INFOPLIST_FILE = "Target Support Files/Pods-SwiftBitmask/Info.plist"; 676 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 677 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 678 | MACH_O_TYPE = staticlib; 679 | MACOSX_DEPLOYMENT_TARGET = 10.10; 680 | MODULEMAP_FILE = "Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask.modulemap"; 681 | MTL_ENABLE_DEBUG_INFO = YES; 682 | OTHER_LDFLAGS = ""; 683 | OTHER_LIBTOOLFLAGS = ""; 684 | PODS_ROOT = "$(SRCROOT)"; 685 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 686 | PRODUCT_NAME = Pods_SwiftBitmask; 687 | SDKROOT = macosx; 688 | SKIP_INSTALL = YES; 689 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 690 | VERSIONING_SYSTEM = "apple-generic"; 691 | VERSION_INFO_PREFIX = ""; 692 | }; 693 | name = Debug; 694 | }; 695 | DF30203E1910718BF7A3025A25DB7D4B /* Release */ = { 696 | isa = XCBuildConfiguration; 697 | baseConfigurationReference = BAA2F3FCC523894D38841799D7E17CEF /* Funky.xcconfig */; 698 | buildSettings = { 699 | CODE_SIGN_IDENTITY = "-"; 700 | COMBINE_HIDPI_IMAGES = YES; 701 | CURRENT_PROJECT_VERSION = 1; 702 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 703 | DEFINES_MODULE = YES; 704 | DYLIB_COMPATIBILITY_VERSION = 1; 705 | DYLIB_CURRENT_VERSION = 1; 706 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 707 | ENABLE_STRICT_OBJC_MSGSEND = YES; 708 | FRAMEWORK_VERSION = A; 709 | GCC_NO_COMMON_BLOCKS = YES; 710 | GCC_PREFIX_HEADER = "Target Support Files/Funky/Funky-prefix.pch"; 711 | INFOPLIST_FILE = "Target Support Files/Funky/Info.plist"; 712 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 713 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 714 | MACOSX_DEPLOYMENT_TARGET = 10.10; 715 | MODULEMAP_FILE = "Target Support Files/Funky/Funky.modulemap"; 716 | MTL_ENABLE_DEBUG_INFO = NO; 717 | PRODUCT_NAME = Funky; 718 | SDKROOT = macosx; 719 | SKIP_INSTALL = YES; 720 | VERSIONING_SYSTEM = "apple-generic"; 721 | VERSION_INFO_PREFIX = ""; 722 | }; 723 | name = Release; 724 | }; 725 | /* End XCBuildConfiguration section */ 726 | 727 | /* Begin XCConfigurationList section */ 728 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 729 | isa = XCConfigurationList; 730 | buildConfigurations = ( 731 | 42E0B13BBCEE1F71D98F0E48811FF508 /* Debug */, 732 | 200617EA0D50A7A037D4A47CB6900492 /* Release */, 733 | ); 734 | defaultConfigurationIsVisible = 0; 735 | defaultConfigurationName = Release; 736 | }; 737 | 42012A4F0A0CD844916CA6DA8A07337F /* Build configuration list for PBXNativeTarget "Regex" */ = { 738 | isa = XCConfigurationList; 739 | buildConfigurations = ( 740 | 7D808B18B38CA50B9FBABD6D1A5BEF91 /* Debug */, 741 | 09A878F48567397ACD8CBF36966D65D4 /* Release */, 742 | ); 743 | defaultConfigurationIsVisible = 0; 744 | defaultConfigurationName = Release; 745 | }; 746 | 4660C0E21C330B74FD64E9EF726A83DB /* Build configuration list for PBXNativeTarget "Funky" */ = { 747 | isa = XCConfigurationList; 748 | buildConfigurations = ( 749 | 9695C3E755C8AEC9099E868E7520CD34 /* Debug */, 750 | DF30203E1910718BF7A3025A25DB7D4B /* Release */, 751 | ); 752 | defaultConfigurationIsVisible = 0; 753 | defaultConfigurationName = Release; 754 | }; 755 | ECEF0905277F1C1D95BBCF9BDB22014A /* Build configuration list for PBXNativeTarget "Pods-SwiftBitmask" */ = { 756 | isa = XCConfigurationList; 757 | buildConfigurations = ( 758 | B1E0E3463DC7B3E8690C07F6B286B119 /* Debug */, 759 | 193C9180A33A8D1BFA9F9C1135B197E2 /* Release */, 760 | ); 761 | defaultConfigurationIsVisible = 0; 762 | defaultConfigurationName = Release; 763 | }; 764 | /* End XCConfigurationList section */ 765 | }; 766 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 767 | } 768 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Funky.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 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-SwiftBitmask.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 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Regex.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 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Regex/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 bryn austin bellomy 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /Pods/Regex/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Regex.swift 3 | 4 | [![Build Status](https://travis-ci.org/brynbellomy/Regex.svg?branch=0.2.1)](https://travis-ci.org/brynbellomy/Regex) 5 | [![CocoaPods](https://img.shields.io/cocoapods/v/Regex.svg?style=flat)](http://cocoadocs.org/docsets/Regex) 6 | [![CocoaPods](https://img.shields.io/cocoapods/p/Regex.svg?style=flat)](http://cocoadocs.org/docsets/Regex) 7 | [![CocoaPods](https://img.shields.io/cocoapods/l/Regex.svg?style=flat)](http://cocoadocs.org/docsets/Regex) 8 | [![GitHub tag](https://img.shields.io/github/tag/brynbellomy/Regex.svg?style=flat)]() 9 | 10 | # install 11 | 12 | Use [CocoaPods](https://cocoapods.org/). 13 | 14 | Add to your `Podfile`: 15 | 16 | ```ruby 17 | pod 'Regex' 18 | ``` 19 | 20 | And then run `pod install` from the shell: 21 | 22 | ```sh 23 | $ pod install 24 | ``` 25 | 26 | 27 | # usage 28 | 29 | ### Simple use cases: `String` extension methods 30 | 31 | **String.grep()** 32 | 33 | This method is modeled after Javascript's `String.match()`. It returns a `Regex.MatchResult` object. The object's `captures` property is an array of `String`s much as one would expect from its Javascript equivalent. 34 | 35 | ```swift 36 | let result = "Winnie the Pooh".grep("\\s+([a-z]+)\\s+") 37 | 38 | result.searchString == "Winnie the Pooh" 39 | result.captures.count == 2 40 | result.captures[0] == " the " 41 | result.captures[1] == "the" 42 | result.boolValue == true // `boolValue` is `true` if there were more than 0 matches 43 | 44 | // You can use `grep()` in conditionals because of the `boolValue` property its result exposes 45 | let emailAddress = "bryn&typos.org" 46 | if !emailAddress.grep("@") { 47 | // that's not an email address! 48 | } 49 | ``` 50 | 51 | **String.replaceRegex()** 52 | 53 | This method is modeled after the version of Javascript's `String.replace()` that accepts a Regex parameter. 54 | 55 | ```swift 56 | let name = "Winnie the Pooh" 57 | let darkName = name.replaceRegex("Winnie the ([a-zA-Z]+)", with: "Darth $1") 58 | // darkName == "Darth Pooh" 59 | ``` 60 | 61 | 62 | ### Advanced use cases: `Regex` object and operators 63 | 64 | **operator =~** 65 | 66 | You can use the `=~` operator to search a `String` (the left operand) for a `Regex` (the right operand). It's the same as calling `theString.grep("the regex pattern")`, but might be more clear in some cases. It returns the same `Regex.MatchResult` object as `String.grep()`. 67 | 68 | ```swift 69 | "Winnie the Pooh" =~ Regex("\\s+(the)\\s+") // returns a Regex.MatchResult 70 | ``` 71 | 72 | Quickly loop over a `Regex`'s captures: 73 | 74 | ```swift 75 | for capture in ("Winnie the Pooh" =~ Regex("\\s+(the)\\s+")).captures { 76 | // capture is a String 77 | } 78 | ``` 79 | 80 | # Overriden `map()` function for substitution 81 | 82 | A more "functional programming" way of doing string replacement is possible via an override for `map()`. In keeping with the overall aim to avoid reinventing a perfectly good wheel (i.e., `NSRegularExpression`), this function simply calls through to `NSRegularExpression.replaceMatchesInString()`. 83 | 84 | ```swift 85 | func map (regexResult:Regex.MatchResult, replacementTemplate:String) -> String 86 | ``` 87 | 88 | You can use it like so: 89 | 90 | ```swift 91 | let stageName = map("Winnie the Pooh" =~ Regex("([a-zA-Z]+)\\s+(the)(.*)"), "$2 $1") 92 | // stageName == "the Winnie" 93 | ``` 94 | 95 | Or if you have some functional operators lying around (for example: ), it's a little less wordy: 96 | 97 | ```swift 98 | ("Winnie the Pooh" =~ Regex("([a-zA-Z]+)\\s+(the)(.*)")) |> map‡("$2 $1") 99 | ``` 100 | 101 | ... but you have to be as crazy as me to find that more readable than `"Winnie".replaceRegex(_:withString:)`, so no pressure. 102 | 103 | 104 | 105 | 106 | # contributors / authors 107 | 108 | - bryn austin bellomy () 109 | -------------------------------------------------------------------------------- /Pods/Regex/src/Regex.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Regex.swift 3 | // Regex 4 | // 5 | // Created by bryn austin bellomy on 2/10/2015 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | public extension String 13 | { 14 | /** 15 | Searches the receiving `String` with the regex given in `pattern`, returning the match results. 16 | */ 17 | public func grep (pattern:String) -> Regex.MatchResult { 18 | return self =~ Regex(pattern) 19 | } 20 | 21 | /** 22 | Searches the receiving string with the regex given in `pattern`, replaces the match(es) with `replacement`, and returns the resulting string. 23 | */ 24 | public func replaceRegex(pattern:String, with replacement:String) -> String { 25 | return map(self =~ Regex(pattern), replacementTemplate: replacement) 26 | } 27 | } 28 | 29 | extension String 30 | { 31 | var fullRange: Range { return startIndex ..< endIndex } 32 | var fullNSRange: NSRange { return NSRange(location:0, length:self.characters.count) } 33 | 34 | func substringWithRange (range:NSRange) -> String { 35 | return substringWithRange(convertRange(range)) 36 | } 37 | 38 | func convertRange (range: Range) -> Range { 39 | let start = self.startIndex.advancedBy(range.startIndex) 40 | let end = start.advancedBy(range.endIndex - range.startIndex) 41 | return Range(start: start, end: end) 42 | } 43 | 44 | func convertRange (nsrange:NSRange) -> Range { 45 | let start = self.startIndex.advancedBy(nsrange.location) 46 | let end = start.advancedBy(nsrange.length) 47 | return Range(start: start, end: end) 48 | } 49 | } 50 | 51 | 52 | /** 53 | A `Regex` represents a compiled regular expression that can be applied to 54 | `String` objects to search for (and replace) matched patterns. 55 | */ 56 | public struct Regex 57 | { 58 | public typealias MatchResult = RegexMatchResult 59 | 60 | private let pattern: String 61 | private let nsRegex: NSRegularExpression 62 | 63 | 64 | /** 65 | Attempts to create a `Regex` with the provided `pattern`. If this fails, a tuple `(nil, NSError)` is returned. If it succeeds, a tuple `(Regex, nil)` is returned. 66 | */ 67 | public static func create(pattern:String) -> (Regex?, NSError?) 68 | { 69 | var err: NSError? 70 | let regex: Regex? 71 | do { 72 | regex = try Regex(pattern: pattern) 73 | } catch let error as NSError { 74 | err = error 75 | regex = nil 76 | } 77 | 78 | if let err = err { return (nil, err) } 79 | else if let regex = regex { return (regex, nil) } 80 | else { return (nil, NSError(domain: "com.illumntr.Regex", code: 1, userInfo:[NSLocalizedDescriptionKey: "Unknown error."])) } 81 | } 82 | 83 | 84 | /** 85 | Creates a `Regex` with the provided `String` as its pattern. If the pattern is invalid, this 86 | function calls `fatalError()`. Hence, it is recommended that you use `Regex.create()` for more 87 | descriptive error messages. 88 | 89 | - parameter p: A string containing a regular expression pattern. 90 | */ 91 | public init(_ p:String) 92 | { 93 | pattern = p 94 | 95 | let regex: NSRegularExpression? 96 | do { 97 | regex = try NSRegularExpression(pattern: pattern, options: NSRegularExpressionOptions(rawValue: 0)) 98 | } catch _ as NSError { 99 | fatalError("Invalid regex: \(p)") 100 | } 101 | 102 | if let regex = regex { 103 | nsRegex = regex 104 | } else { 105 | fatalError("Invalid regex: \(p)") 106 | } 107 | } 108 | 109 | 110 | /** 111 | Creates a `Regex` with the provided `String` as its pattern. If the pattern is invalid, this 112 | function initializes an `NSError` into the provided `NSErrorPointer`. `Regex.create()` is recommended, 113 | as it wraps this constructor and handles the `NSErrorPointer` dance for you. 114 | 115 | - parameter p: A string containing a regular expression pattern. 116 | - parameter error: An `NSErrorPointer` that will contain an `NSError` if initialization fails. 117 | */ 118 | public init (pattern p:String) throws 119 | { 120 | var error: NSError! = NSError(domain: "Migrator", code: 0, userInfo: nil) 121 | pattern = p 122 | 123 | var err: NSError? 124 | let regex: NSRegularExpression? 125 | do { 126 | regex = try NSRegularExpression(pattern: pattern, options: NSRegularExpressionOptions(rawValue: 0)) 127 | } catch let error as NSError { 128 | err = error 129 | regex = nil 130 | } 131 | if let regex = regex { 132 | nsRegex = regex 133 | } 134 | else { 135 | nsRegex = NSRegularExpression() 136 | if let err = err { 137 | error = err 138 | } 139 | throw error 140 | } 141 | } 142 | 143 | 144 | /** 145 | Searches in `string` for the regular expression pattern represented by the receiver. 146 | 147 | - parameter string: The string in which to search for matches. 148 | */ 149 | public func match (string:String) -> MatchResult 150 | { 151 | var matches = [NSTextCheckingResult]() 152 | let all = NSRange(location: 0, length: string.characters.count) 153 | let moptions = NSMatchingOptions(rawValue: 0) 154 | 155 | nsRegex.enumerateMatchesInString(string, options:moptions, range:all) { 156 | (result: NSTextCheckingResult?, flags: NSMatchingFlags, ptr: UnsafeMutablePointer) in 157 | 158 | if let result = result { 159 | matches.append(result) 160 | } 161 | } 162 | 163 | return MatchResult(regex:nsRegex, searchString:string, items: matches) 164 | } 165 | 166 | 167 | /** 168 | Searches `string` for the regular expression pattern represented by the receiver. Any matches are replaced using 169 | the provided `replacement` string, which can contain substitution patterns like `"$1"`, etc. 170 | 171 | - parameter string: The string to search. 172 | - parameter replacement: The replacement pattern to apply to any matches. 173 | - returns: A 2-tuple containing the number of replacements made and the transformed search string. 174 | */ 175 | public func replaceMatchesIn (string:String, with replacement:String) -> (replacements:Int, string:String) 176 | { 177 | let mutableString = NSMutableString(string:string) 178 | let replacements = nsRegex.replaceMatchesInString(mutableString, options:NSMatchingOptions(rawValue: 0), range:string.fullNSRange, withTemplate:replacement) 179 | 180 | return (replacements:replacements, string:String(mutableString)) 181 | } 182 | 183 | 184 | /** 185 | Searches `string` for the regular expression pattern represented by the receiver. Any matches are replaced using 186 | the provided `replacement` string, which can contain substitution patterns like `"$1"`, etc. 187 | 188 | - parameter string: The string to search. 189 | - parameter replacement: The replacement pattern to apply to any matches. 190 | - returns: The transformed search string. 191 | */ 192 | public func replaceMatchesIn (string:String, with replacement:String) -> String { 193 | return map((string =~ self), replacementTemplate: replacement) 194 | } 195 | } 196 | 197 | 198 | infix operator =~ {} 199 | 200 | /** 201 | Searches `searchString` using `regex` and returns the resulting `Regex.MatchResult`. 202 | */ 203 | public func =~ (searchString: String, regex:Regex) -> Regex.MatchResult { 204 | return regex.match(searchString) 205 | } 206 | 207 | 208 | /** 209 | An object representing the result of searching a given `String` using a `Regex`. 210 | */ 211 | public struct RegexMatchResult: SequenceType, BooleanType 212 | { 213 | /** Returns `true` if the number of matches is greater than zero. */ 214 | public var boolValue: Bool { return items.count > 0 } 215 | 216 | public let regex: NSRegularExpression 217 | public let searchString: String 218 | public let items: [NSTextCheckingResult] 219 | 220 | /** An array of the captures as `String`s. Ordering is the same as the return value of Javascript's `String.match()` method. */ 221 | public let captures: [String] 222 | 223 | 224 | /** 225 | The designated initializer. 226 | 227 | - parameter regex: The `NSRegularExpression` that was used to create this `RegexMatchResult`. 228 | - parameter searchString: The string that was searched by `regex` to generate these results. 229 | - parameter items: The array of `NSTextCheckingResult`s generated by `regex` while searching `searchString`. 230 | */ 231 | public init (regex r:NSRegularExpression, searchString s:String, items i:[NSTextCheckingResult]) 232 | { 233 | regex = r 234 | searchString = s 235 | items = i 236 | 237 | captures = items.flatMap { result in 238 | (0 ..< result.numberOfRanges).map { i in 239 | let nsrange = result.rangeAtIndex(i) 240 | return s.substringWithRange(nsrange) 241 | } 242 | } 243 | } 244 | 245 | 246 | /** 247 | Returns the `i`th match as an `NSTextCheckingResult`. 248 | */ 249 | subscript (i: Int) -> NSTextCheckingResult { 250 | get { return items[i] } 251 | } 252 | 253 | 254 | /** 255 | Returns the captured text of the `i`th match as a `String`. 256 | */ 257 | subscript (i: Int) -> String { 258 | get { return captures[i] } 259 | } 260 | 261 | 262 | /** 263 | Returns a `Generator` that iterates over the captured matches as `NSTextCheckingResult`s. 264 | */ 265 | public func generate() -> AnyGenerator { 266 | var gen = items.generate() 267 | return anyGenerator { gen.next() } 268 | } 269 | 270 | 271 | /** 272 | Returns a `Generator` that iterates over the captured matches as `String`s. 273 | */ 274 | public func generateCaptures() -> AnyGenerator { 275 | var gen = captures.generate() 276 | return anyGenerator { gen.next() } 277 | } 278 | } 279 | 280 | 281 | /** 282 | Returns the `String` created by replacing the regular expression matches in `regexResult` using `replacementTemplate`. 283 | */ 284 | public func map (regexResult:Regex.MatchResult, replacementTemplate:String) -> String 285 | { 286 | let searchString = NSMutableString(string: regexResult.searchString) 287 | let fullRange = regexResult.searchString.fullNSRange 288 | regexResult.regex.replaceMatchesInString(searchString, options: NSMatchingOptions(rawValue: 0), range:fullRange, withTemplate:replacementTemplate) 289 | return String(searchString) 290 | } 291 | 292 | 293 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Funky/Funky-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Funky : NSObject 3 | @end 4 | @implementation PodsDummy_Funky 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Funky/Funky-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Funky/Funky-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double FunkyVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char FunkyVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Funky/Funky.modulemap: -------------------------------------------------------------------------------- 1 | framework module Funky { 2 | umbrella header "Funky-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Funky/Funky.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_ROOT = ${SRCROOT} 6 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 7 | SKIP_INSTALL = YES 8 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Funky/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.3.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/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 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Funky 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2015 bryn austin bellomy 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | 28 | ## Regex 29 | 30 | Copyright (c) 2015 bryn austin bellomy 31 | 32 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 33 | 34 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 35 | 36 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | Generated by CocoaPods - https://cocoapods.org 39 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2015 bryn austin bellomy 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | THE SOFTWARE. 38 | Title 39 | Funky 40 | Type 41 | PSGroupSpecifier 42 | 43 | 44 | FooterText 45 | Copyright (c) 2015 bryn austin bellomy 46 | 47 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 50 | 51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 52 | 53 | Title 54 | Regex 55 | Type 56 | PSGroupSpecifier 57 | 58 | 59 | FooterText 60 | Generated by CocoaPods - https://cocoapods.org 61 | Title 62 | 63 | Type 64 | PSGroupSpecifier 65 | 66 | 67 | StringsTable 68 | Acknowledgements 69 | Title 70 | Acknowledgements 71 | 72 | 73 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftBitmask : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftBitmask 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "Pods-SwiftBitmask/Funky.framework" 88 | install_framework "Pods-SwiftBitmask/Regex.framework" 89 | fi 90 | if [[ "$CONFIGURATION" == "Release" ]]; then 91 | install_framework "Pods-SwiftBitmask/Funky.framework" 92 | install_framework "Pods-SwiftBitmask/Regex.framework" 93 | fi 94 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | if [[ "$1" = /* ]] ; then 20 | RESOURCE_PATH="$1" 21 | else 22 | RESOURCE_PATH="${PODS_ROOT}/$1" 23 | fi 24 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 25 | cat << EOM 26 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 27 | EOM 28 | exit 1 29 | fi 30 | case $RESOURCE_PATH in 31 | *.storyboard) 32 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT}" 33 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" 34 | ;; 35 | *.xib) 36 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}" 37 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" 38 | ;; 39 | *.framework) 40 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 41 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | echo "rsync -av $RESOURCE_PATH ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 43 | rsync -av "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 44 | ;; 45 | *.xcdatamodel) 46 | echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 47 | xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 48 | ;; 49 | *.xcdatamodeld) 50 | echo "xcrun momc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 51 | xcrun momc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 52 | ;; 53 | *.xcmappingmodel) 54 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 55 | xcrun mapc "$RESOURCE_PATH" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 56 | ;; 57 | *.xcassets) 58 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 59 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 60 | ;; 61 | *) 62 | echo "$RESOURCE_PATH" 63 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 64 | ;; 65 | esac 66 | } 67 | 68 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 69 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 70 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 71 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 72 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 73 | fi 74 | rm -f "$RESOURCES_TO_COPY" 75 | 76 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 77 | then 78 | case "${TARGETED_DEVICE_FAMILY}" in 79 | 1,2) 80 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 81 | ;; 82 | 1) 83 | TARGET_DEVICE_ARGS="--target-device iphone" 84 | ;; 85 | 2) 86 | TARGET_DEVICE_ARGS="--target-device ipad" 87 | ;; 88 | *) 89 | TARGET_DEVICE_ARGS="--target-device mac" 90 | ;; 91 | esac 92 | 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_SwiftBitmaskVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_SwiftBitmaskVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Funky.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Regex.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Funky" -framework "Regex" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-SwiftBitmask 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftBitmask { 2 | umbrella header "Pods-SwiftBitmask-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask.release.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Funky.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Regex.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Funky" -framework "Regex" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-SwiftBitmask 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/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.3.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Regex : NSObject 3 | @end 4 | @implementation PodsDummy_Regex 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double RegexVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char RegexVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex.modulemap: -------------------------------------------------------------------------------- 1 | framework module Regex { 2 | umbrella header "Regex-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_ROOT = ${SRCROOT} 6 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 7 | SKIP_INSTALL = YES 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # a replacement for NS_OPTIONS / RawOptionSet 3 | 4 | [![Build Status](https://travis-ci.org/brynbellomy/SwiftBitmask.svg?branch=0.1.1)](https://travis-ci.org/brynbellomy/SwiftBitmask) 5 | [![CocoaPods](https://img.shields.io/cocoapods/v/SwiftBitmask.svg?style=flat)](http://cocoadocs.org/docsets/SwiftBitmask) 6 | [![CocoaPods](https://img.shields.io/cocoapods/p/SwiftBitmask.svg?style=flat)](http://cocoadocs.org/docsets/SwiftBitmask) 7 | [![CocoaPods](https://img.shields.io/cocoapods/l/SwiftBitmask.svg?style=flat)](http://cocoadocs.org/docsets/SwiftBitmask) 8 | [![GitHub tag](https://img.shields.io/github/tag/brynbellomy/SwiftBitmask.svg?style=flat)]() 9 | 10 | 11 | `Bitmask` is a quicker way to get `NS_OPTIONS`-style functionality in a Swift environment. It's intended as a replacement for Swift's `RawOptionSet`, which is so long and arduous to implement that [someone wrote a code generator for it](http://natecook.com/blog/2014/07/swift-options-bitmask-generator/). 12 | 13 | It allows you to use the simple, familiar syntax of Swift's bitwise operators (`|`, `&`, `~`, `^`, etc.) with any custom `struct`, `enum`, or `class` type by wrapping that type in a `Bitmask`. 14 | 15 | ## install 16 | 17 | Use [CocoaPods](https://cocoapods.org). 18 | 19 | In your `Podfile`: 20 | 21 | ```ruby 22 | pod 'SwiftBitmask' 23 | ``` 24 | 25 | And then from the command line: 26 | 27 | ```sh 28 | $ pod install 29 | ``` 30 | 31 | 32 | 33 | # Bitmask<T> with raw integer types 34 | 35 | The `Bitmask` class takes a generic parameter indicating the type of integer you want to use to store the bitmask's raw value. Code: 36 | 37 | ```swift 38 | let bitmask = Bitmask(1 << 2 | 1 << 5) 39 | bitmask.bitmaskValue // returns UInt16(1 << 2 | 1 << 5) 40 | ``` 41 | 42 | ```swift 43 | let bitmaskA = Bitmask(1 << 2) 44 | let bitmaskB = Bitmask(1 << 5) 45 | let allTogetherNow = bitmaskA | bitmaskB 46 | bitmask.bitmaskValue // also returns UInt16(1 << 2 | 1 << 5), just like above 47 | ``` 48 | 49 | 50 | # Bitmask<T> with any type 51 | 52 | Bitmasks can be converted back and forth between non-integer types as well. Any type implementing the `IBitmaskRepresentable` protocol gets this functionality for free. 53 | 54 | All the protocol requires is that you implement `var bitmaskValue`, ensuring that its type conforms to `BitwiseOperationsType` and `Equatable`: 55 | 56 | ```swift 57 | public protocol IBitmaskRepresentable 58 | { 59 | typealias BitmaskRawType : BitwiseOperationsType, Equatable 60 | var bitmaskValue : BitmaskRawType { get } 61 | } 62 | ``` 63 | 64 | Just use any built-in integer type and it'll work. 65 | 66 | Here's a quick example of a type that implements `IBitmaskRepresentable`: 67 | 68 | ```swift 69 | enum MonsterAttributes : UInt16, IBitmaskRepresentable 70 | { 71 | case Big = 1 72 | case Ugly = 2 73 | case Scary = 4 74 | 75 | var bitmaskValue : BitmaskRawType { return self.rawValue } 76 | 77 | init(bitmaskValue: UInt16) { 78 | self.init(rawValue:bitmaskValue) 79 | } 80 | } 81 | ``` 82 | 83 | Now you can create a `Bitmask` and use it the same way you would use a `Bitmask` with a raw integer underlying type: 84 | 85 | ```swift 86 | let b = Bitmask(.Big, .Scary) 87 | ``` 88 | 89 | 90 | # what does this get me? 91 | 92 | ## concise syntax 93 | 94 | You can write code that's almost as concise as the syntax you would use for simple, integral bitwise operations, but with the improved type safety and versatility of doing so with your own custom type. **Note that you almost never have to write Bitmask<T>**: 95 | 96 | ```swift 97 | // prefix operator initialization 98 | let bitmask = |MonsterAttributes.Scary // == Bitmask(MonsterAttributes.Scary) 99 | 100 | // implicit initialization via bitwise operators 101 | let option : MonsterAttributes = .Ugly 102 | let orWithVar = option | .Big // == Bitmask with a bitmaskValue of 1 | 2 103 | let simpleOr = MonsterAttributes.Big | .Ugly // == Bitmask with a bitmaskValue of 1 | 2 104 | 105 | // the raw bitmask value can be obtained with from the bitmaskValue property 106 | let simpleOrValue = simpleOr.bitmaskValue // == UInt16(1 | 2) 107 | let orValue = (MonsterAttributes.Big | .Ugly).bitmaskValue // == UInt16(1 | 2) 108 | ``` 109 | 110 | ## if statements 111 | 112 | `Bitmask` also implements `NilLiteralConvertible` and `BooleanType`, which allow for concise conditionals: 113 | 114 | ```swift 115 | // Bitmask implements BooleanType 116 | if simpleOr & MonsterAttributes.Scary { 117 | println("(boolean comparison) scary!") 118 | } 119 | 120 | // Bitmask implements NilLiteralConvertible 121 | if simpleOr & MonsterAttributes.Scary != nil { 122 | println("(nil literal comparison) scary!") 123 | } 124 | ``` 125 | 126 | 127 | ## pattern matching + switch 128 | 129 | `Bitmask` can tango with the pattern-matching operator (`~=`), which is basically equivalent to checking if bits are set using `&`: 130 | 131 | ```swift 132 | // Bitmask is compatible with ~=, the pattern-matching operator 133 | if simpleOr ~= MonsterAttributes.Scary { 134 | println("(pattern matching operator) scary!") 135 | } 136 | 137 | if simpleOr ~= MonsterAttributes.Scary | .Big { 138 | println("(pattern matching operator) either big or scary!") 139 | } 140 | ``` 141 | 142 | 143 | You can write switch statements with `Bitmask` too, although in my experience playing around with this code so far, it almost never seems to be the control structure that makes the most sense. If you insist upon trying it out, just be careful to add `fallthrough`s where appropriate and put your `case` statements in an order that makes sense for your application: 144 | 145 | ```swift 146 | switch simpleOr 147 | { 148 | case |MonsterAttributes.Big: 149 | println("big!") 150 | fallthrough 151 | 152 | case MonsterAttributes.Big | .Scary: 153 | println("either big or scary!") 154 | fallthrough 155 | 156 | case |MonsterAttributes.Ugly: 157 | println("ugly!") 158 | fallthrough 159 | 160 | case |MonsterAttributes.Scary: 161 | println("scary!") 162 | fallthrough 163 | 164 | default: 165 | // ... 166 | } 167 | ``` 168 | 169 | 170 | # automatic bitmask raw values for the lazy and overworked 171 | 172 | You can also have your `Bitmask` object auto-generate the bitmask values for your `IBitmaskRepresentable` type. This is useful if, say, your type is an `enum` with a non-integer raw type. 173 | 174 | For example, let's say you're reading options out of a JSON config file and they're represented as an array of strings, and you want your `enum`'s `rawValue`s to represent what's in the file. By implementing `IAutoBitmaskable`, you can use a couple of convenience functions in your type's implementation of `IBitmaskRepresentable` and escape having to write a big `switch` statement that doubles the length of your type's code. 175 | 176 | Just conform to `IAutoBitmaskable` and add `class/static var autoBitmaskValues : [Self]`, which should return all of the values of your `enum`. You can then implement `var bitmaskValue` and `init(bitmaskValue:T)` with the auto-bitmasking functions like so: 177 | 178 | 179 | ```swift 180 | enum MonsterAttributes : String, IBitmaskRepresentable, IAutoBitmaskable 181 | { 182 | case Big = "big" 183 | case Ugly = "ugly" 184 | case Scary = "scary" 185 | 186 | static var autoBitmaskValues : [MonsterAttributes] = [.Big, .Ugly, .Scary,] 187 | 188 | var bitmaskValue: UInt16 { return AutoBitmask.autoBitmaskValueFor(self) } 189 | init(bitmaskValue: UInt16) { self = AutoBitmask.autoValueFromBitmask(bitmaskValue) } 190 | } 191 | ``` 192 | 193 | 194 | If you're curious, the values in the `autoBitmaskValues` array are assigned integer bitmask values (i.e., `1 << 0`, `1 << 1`, ... `1 << n`) from left to right. 195 | 196 | 197 | # a few implementation details 198 | 199 | It's worth noting that because Bitmask stores its raw value as a basic `BitwiseOperationsType` (in other words, an integer of some kind), its memory footprint is incredibly small, especially compared with an implementation that basically functions as a wrapper over a `Set` (or some other collection type). This is particularly nice when you're using bitmasks to initialize or configure a huge number of objects at the same time. 200 | 201 | The trade-off, of course, is that any time you convert values back and forth between your `IBitmaskRepresentable` type and `Bitmask`, it incurs some processing overhead in accessing your object's `bitmaskValue` property (and, if you implemented `IAutoBitmaskable`, there's an array search operation involved as well — take a look at [AutoBitmask.swift](https://github.com/brynbellomy/SwiftBitmask/blob/master/AutoBitmask.swift) if you're concerned about that). 202 | 203 | I chose this implementation because I'm using `Bitmask` to initialize values during a load phase of a game I'm working on. Since the actual `Bitmask` objects are out of the picture as soon as loading is complete, there's very little back-and-forth between my `IBitmaskRepresentable` types and `Bitmask`, meaning there's not much processing overhead for me. I just hold onto the integer values, which is what the game engine wants anywway. 204 | 205 | However, if you have a use case that would benefit from implementing `Bitmask` as a collection wrapper, I'd be interested in hearing about it in the [issue queue](https://github.com/brynbellomy/SwiftBitmask/issues)! 206 | 207 | 208 | # license 209 | 210 | ISC 211 | 212 | 213 | # authors / contributors 214 | 215 | bryn bellomy < > 216 | 217 | 218 | 219 | -------------------------------------------------------------------------------- /Source/AutoBitmask.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AutoBitmask.swift 3 | // SwiftBitmask 4 | // 5 | // Created by bryn austin bellomy on 2014 Nov 5. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Funky 11 | 12 | 13 | public protocol IAutoBitmaskable: Equatable 14 | { 15 | static var autoBitmaskValues: [Self] { get } 16 | } 17 | 18 | 19 | /** 20 | The functions in AutoBitmask implement a simple technique allowing non-bitwise types 21 | to conform to `IBitmaskRepresentable` with only a few lines of code. Types must 22 | conform to `IAutoBitmaskable` (which inherits from `IBitmaskRepresentable`). Enums 23 | seem to work best. 24 | */ 25 | public struct AutoBitmask 26 | { 27 | public static func autoBitmaskValueFor > 28 | (autoBitmaskable:T) -> T.BitmaskRawType 29 | { 30 | if let index = T.autoBitmaskValues.indexOf(autoBitmaskable) { 31 | return T.BitmaskRawType(1 << index) 32 | } 33 | else { preconditionFailure("Attempted to call autoBitmaskValueFor(_:) with a non-bitmaskable value of T.") } 34 | } 35 | 36 | 37 | public static func autoValueFromBitmask > 38 | (bitmaskValue:T.BitmaskRawType) -> T 39 | { 40 | let index = findWhere(T.autoBitmaskValues) { $0.bitmaskValue == bitmaskValue } 41 | if let index = index { 42 | return T.autoBitmaskValues[index] 43 | } 44 | else { preconditionFailure("Attempted to call autoBitmaskValueFor(_:) with a non-bitmaskable value of T.") } 45 | } 46 | } 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Source/Bitmask.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bitmask.swift 3 | // SwiftBitmask 4 | // 5 | // Created by bryn austin bellomy on 2014 Nov 21. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Funky 11 | 12 | 13 | public protocol IBitmaskRepresentable: Equatable, Hashable 14 | { 15 | typealias BitmaskRawType: IBitmaskRawType 16 | var bitmaskValue: BitmaskRawType { get } 17 | } 18 | 19 | 20 | public protocol IBitmaskRawType: BitwiseOperationsType, Equatable, Comparable 21 | { 22 | init(_ v:Int) 23 | var integerValue: Int { get set } 24 | } 25 | 26 | 27 | public struct Bitmask : BitwiseOperationsType 28 | { 29 | public typealias BitmaskRawType = T.BitmaskRawType 30 | 31 | public private(set) var bitmaskValue: BitmaskRawType = BitmaskRawType.allZeros 32 | 33 | public var hashValue: Int { return bitmaskValue.integerValue } 34 | 35 | public static var allZeros: Bitmask { return Bitmask(T.BitmaskRawType.allZeros) } 36 | public var isAllZeros: Bool { return self == Bitmask.allZeros } 37 | 38 | public init() {} 39 | public init(_ val: T.BitmaskRawType) { setValue(val) } 40 | public init(_ val: [T]) { setValue(val) } 41 | public init(_ val: T...) { setValue(val) } 42 | public init(_ val: [T.BitmaskRawType]) { setValue(val) } 43 | public init(_ val: T.BitmaskRawType...) { setValue(val) } 44 | public init(_ val: Bitmask...) { setValue(val) } 45 | 46 | 47 | public mutating func setValue(val: T) { bitmaskValue = val.bitmaskValue } 48 | public mutating func setValue(val: T.BitmaskRawType) { bitmaskValue = val } 49 | 50 | public mutating func setValue(val: [T]) { 51 | setValue( 52 | val.map { $0.bitmaskValue } |> reducer(T.BitmaskRawType.allZeros) { $0 | $1 } 53 | ) 54 | } 55 | 56 | public mutating func setValue(val: [T.BitmaskRawType]) { 57 | setValue( 58 | val |> reducer(T.BitmaskRawType.allZeros) { $0 | $1 } 59 | ) 60 | } 61 | 62 | public mutating func setValue(val: [Bitmask]) { 63 | setValue( 64 | val.map { $0.bitmaskValue } 65 | ) 66 | } 67 | 68 | public func isSet(val:T) -> Bool { 69 | return (self & val) == val 70 | } 71 | 72 | public func areSet(options:T...) -> Bool { 73 | let otherBitmask = Bitmask(options) 74 | return (self & otherBitmask).bitmaskValue == otherBitmask.bitmaskValue 75 | } 76 | } 77 | 78 | 79 | extension Bitmask: IBitmaskRepresentable { 80 | public init (_ vals: [U]) { 81 | let arr = vals.map { $0.bitmaskValue as! T.BitmaskRawType } 82 | self.init(arr) 83 | } 84 | } 85 | 86 | 87 | 88 | // 89 | // MARK: - Bitmask: Equatable - 90 | // 91 | 92 | extension Bitmask: Equatable {} 93 | 94 | public func == (lhs:Bitmask, rhs:Bitmask) -> Bool { 95 | return lhs.bitmaskValue == rhs.bitmaskValue 96 | } 97 | 98 | public func == (lhs:Bitmask, rhs:T) -> Bool { 99 | return lhs.bitmaskValue == rhs.bitmaskValue 100 | } 101 | 102 | public func == (lhs:Bitmask, rhs:T.BitmaskRawType) -> Bool { 103 | return lhs.bitmaskValue == rhs 104 | } 105 | 106 | 107 | 108 | // 109 | // MARK: - Bitmask: Comparable - 110 | // 111 | 112 | extension Bitmask: Comparable {} 113 | 114 | public func < (lhs:Bitmask, rhs:Bitmask) -> Bool { 115 | return lhs.bitmaskValue < rhs.bitmaskValue 116 | } 117 | 118 | 119 | 120 | // 121 | // MARK: - Bitmask: NilLiteralConvertible - 122 | // 123 | 124 | extension Bitmask: NilLiteralConvertible 125 | { 126 | public init(nilLiteral: ()) 127 | { 128 | self.init(BitmaskRawType.allZeros) 129 | } 130 | } 131 | 132 | 133 | 134 | // 135 | // MARK: - Bitmask: BooleanType - 136 | // 137 | 138 | extension Bitmask: BooleanType 139 | { 140 | /** For bitmasks, `boolValue` is `true` as long as any bit is set. */ 141 | public var boolValue: Bool { return !isAllZeros } 142 | } 143 | 144 | 145 | 146 | // 147 | // MARK: - Operators - 148 | // MARK: - Quick instantiation prefix operator 149 | // 150 | 151 | prefix operator | {} 152 | 153 | public prefix func | (val:T) -> Bitmask { 154 | return Bitmask(val) 155 | } 156 | 157 | 158 | 159 | // 160 | // MARK: - Bitwise OR 161 | // 162 | 163 | public func | (lhs:Bitmask, rhs:Bitmask) -> Bitmask { return Bitmask(lhs.bitmaskValue | rhs.bitmaskValue) } 164 | public func | (lhs:Bitmask, rhs:T) -> Bitmask { return Bitmask(lhs.bitmaskValue | rhs.bitmaskValue) } 165 | public func | (lhs:T, rhs:Bitmask) -> Bitmask { return rhs | lhs } 166 | public func | (lhs:T, rhs:T) -> Bitmask { return Bitmask(lhs.bitmaskValue | rhs.bitmaskValue) } 167 | 168 | public func |= (inout lhs:Bitmask, rhs:T) { lhs.setValue(lhs.bitmaskValue | rhs.bitmaskValue) } 169 | public func |= (inout lhs:Bitmask, rhs:Bitmask) { lhs.setValue(lhs.bitmaskValue | rhs.bitmaskValue) } 170 | 171 | 172 | 173 | // 174 | // MARK: - Bitwise AND 175 | // 176 | 177 | public func & (lhs:Bitmask, rhs:Bitmask) -> Bitmask { return Bitmask(lhs.bitmaskValue & rhs.bitmaskValue) } 178 | public func & (lhs:Bitmask, rhs:T) -> Bitmask { return Bitmask(lhs.bitmaskValue & rhs.bitmaskValue) } 179 | public func & (lhs:T, rhs:Bitmask) -> Bitmask { return rhs & lhs } 180 | public func & (lhs:T, rhs:T) -> Bitmask { return Bitmask(lhs.bitmaskValue & rhs.bitmaskValue) } 181 | 182 | public func &= (inout lhs:Bitmask, rhs:T) { lhs.setValue(lhs.bitmaskValue & rhs.bitmaskValue) } 183 | public func &= (inout lhs:Bitmask, rhs:Bitmask) { lhs.setValue(lhs.bitmaskValue & rhs.bitmaskValue) } 184 | 185 | 186 | 187 | // 188 | // MARK: - Bitwise XOR 189 | // 190 | 191 | public func ^ (lhs:Bitmask, rhs:Bitmask) -> Bitmask { return Bitmask(lhs.bitmaskValue ^ rhs.bitmaskValue) } 192 | public func ^ (lhs:Bitmask, rhs:T) -> Bitmask { return Bitmask(lhs.bitmaskValue ^ rhs.bitmaskValue) } 193 | public func ^ (lhs:T, rhs:Bitmask) -> Bitmask { return rhs ^ lhs } 194 | public func ^ (lhs:T, rhs:T) -> Bitmask { return Bitmask(lhs.bitmaskValue ^ rhs.bitmaskValue) } 195 | 196 | public func ^= (inout lhs:Bitmask, rhs:T) { lhs.setValue(lhs.bitmaskValue ^ rhs.bitmaskValue) } 197 | public func ^= (inout lhs:Bitmask, rhs:Bitmask) { lhs.setValue(lhs.bitmaskValue ^ rhs.bitmaskValue) } 198 | 199 | 200 | 201 | // 202 | // MARK: - Bitwise NOT 203 | // 204 | 205 | public prefix func ~ (value:Bitmask) -> Bitmask { return Bitmask(~(value.bitmaskValue)) } 206 | public prefix func ~ (value:T) -> Bitmask { return Bitmask(~(value.bitmaskValue)) } 207 | 208 | 209 | 210 | // 211 | // MARK: - Pattern matching operator 212 | // 213 | 214 | public func ~= (pattern: Bitmask, value: Bitmask) -> Bool { return (pattern & value).boolValue } 215 | public func ~= (pattern: Bitmask, value: T) -> Bool { return (pattern & value).boolValue } 216 | public func ~= (pattern: T, value: Bitmask) -> Bool { return (pattern & value).boolValue } 217 | 218 | 219 | 220 | // 221 | // MARK: - Built-in type conformance to IBitmaskRawType 222 | // 223 | 224 | extension Int: IBitmaskRepresentable, IBitmaskRawType { 225 | public var bitmaskValue: Int { return self } 226 | public var integerValue: Int { 227 | get { return self } 228 | set { self = newValue } 229 | } 230 | } 231 | 232 | extension Int8: IBitmaskRepresentable, IBitmaskRawType { 233 | public var bitmaskValue: Int8 { return self } 234 | public var integerValue: Int { 235 | get { return numericCast(self) } 236 | set { self = numericCast(newValue) } 237 | } 238 | } 239 | extension Int16: IBitmaskRepresentable, IBitmaskRawType { 240 | public var bitmaskValue: Int16 { return self } 241 | public var integerValue: Int { 242 | get { return numericCast(self) } 243 | set { self = numericCast(newValue) } 244 | } 245 | } 246 | extension Int32: IBitmaskRepresentable, IBitmaskRawType { 247 | public var bitmaskValue: Int32 { return self } 248 | public var integerValue: Int { 249 | get { return numericCast(self) } 250 | set { self = numericCast(newValue) } 251 | } 252 | } 253 | extension Int64: IBitmaskRepresentable, IBitmaskRawType { 254 | public var bitmaskValue: Int64 { return self } 255 | public var integerValue: Int { 256 | get { return numericCast(self) } 257 | set { self = numericCast(newValue) } 258 | } 259 | } 260 | extension UInt: IBitmaskRepresentable, IBitmaskRawType { 261 | public var bitmaskValue: UInt { return self } 262 | public var integerValue: Int { 263 | get { return numericCast(self) } 264 | set { self = numericCast(newValue) } 265 | } 266 | } 267 | extension UInt8: IBitmaskRepresentable, IBitmaskRawType { 268 | public var bitmaskValue: UInt8 { return self } 269 | public var integerValue: Int { 270 | get { return numericCast(self) } 271 | set { self = numericCast(newValue) } 272 | } 273 | } 274 | extension UInt16: IBitmaskRepresentable, IBitmaskRawType { 275 | public var bitmaskValue: UInt16 { return self } 276 | public var integerValue: Int { 277 | get { return numericCast(self) } 278 | set { self = numericCast(newValue) } 279 | } 280 | } 281 | extension UInt32: IBitmaskRepresentable, IBitmaskRawType { 282 | public var bitmaskValue: UInt32 { return self } 283 | public var integerValue: Int { 284 | get { return numericCast(self) } 285 | set { self = numericCast(newValue) } 286 | } 287 | } 288 | extension UInt64: IBitmaskRepresentable, IBitmaskRawType { 289 | public var bitmaskValue: UInt64 { return self } 290 | public var integerValue: Int { 291 | get { return numericCast(self) } 292 | set { self = numericCast(newValue) } 293 | } 294 | } 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | -------------------------------------------------------------------------------- /Source/OptionSetView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OptionSetView.swift 3 | // SwiftBitmask 4 | // 5 | // Created by bryn austin bellomy on 2015 Feb 1. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Funky 11 | 12 | 13 | /// 14 | /// Curried version of the `OptionSetView` constructor. 15 | /// 16 | /// For example: `bitmask |> asOptionSet([.First, .Second, .Third])` 17 | /// 18 | public func asOptionSet 19 | (possibleOptions:Set) (bitmask:Bitmask) -> OptionSetView 20 | { 21 | return OptionSetView(bitmask:bitmask, possibleOptions:possibleOptions) 22 | } 23 | 24 | 25 | /** 26 | A representation of a finite set of options (or flags), some of which are set (flagged). 27 | A `Bitmask` can be converted to an `OptionSetView`. 28 | */ 29 | public struct OptionSetView 30 | { 31 | let bitmask: Bitmask 32 | let possibleOptions: Set 33 | let options: Set 34 | 35 | public init(bitmask b: Bitmask, possibleOptions po:Set) 36 | { 37 | bitmask = b 38 | possibleOptions = po 39 | 40 | options = possibleOptions 41 | |> selectArray { b.isSet($0) } 42 | |> toSet 43 | } 44 | 45 | public func isSet(option:T) -> Bool { 46 | return (bitmask & option).bitmaskValue == option.bitmaskValue 47 | } 48 | 49 | public func areSet(options:T...) -> Bool { 50 | let otherBitmask = Bitmask(options) 51 | return (bitmask & otherBitmask).bitmaskValue == otherBitmask.bitmaskValue 52 | } 53 | } 54 | 55 | // 56 | // MARK: - OptionSetView: SequenceType 57 | // 58 | 59 | extension OptionSetView: SequenceType 60 | { 61 | public func generate() -> AnyGenerator { 62 | var generator = options.generate() 63 | return anyGenerator { generator.next() } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /SwiftBitmask.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'SwiftBitmask' 3 | s.version = '0.2.0' 4 | s.summary = 'NS_OPTIONS for Swift (type-checked bitmask container). Basically an easier-to-implement RawOptionSet.' 5 | s.authors = { 'bryn austin bellomy' => 'bryn.bellomy@gmail.com' } 6 | s.license = { :type => 'MIT', :file => 'LICENSE.md' } 7 | s.homepage = 'https://github.com/brynbellomy/SwiftBitmask' 8 | 9 | s.ios.deployment_target = '8.0' 10 | s.osx.deployment_target = '10.10' 11 | s.source_files = 'Source/*.swift' 12 | s.requires_arc = true 13 | 14 | s.dependency 'Funky', '0.3.0' 15 | 16 | s.source = { :git => 'https://github.com/brynbellomy/SwiftBitmask.git', :tag => s.version } 17 | end 18 | -------------------------------------------------------------------------------- /SwiftBitmask.sublime-project: -------------------------------------------------------------------------------- 1 | { "folders": [ 2 | { "path": ".", 3 | "name": "SwiftBitmask" }, 4 | { "path": "./Classes", 5 | "name": "src" } 6 | ] 7 | } 8 | 9 | -------------------------------------------------------------------------------- /SwiftBitmask.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6874609D92109F50B0D56EB3 /* Pods_SwiftBitmask.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C2B6D88709CAEE03D1A309B /* Pods_SwiftBitmask.framework */; }; 11 | C55045091A3F49110057378F /* SwiftBitmask.h in Headers */ = {isa = PBXBuildFile; fileRef = C55045081A3F49110057378F /* SwiftBitmask.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | C550450F1A3F49110057378F /* SwiftBitmask.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C55045031A3F49110057378F /* SwiftBitmask.framework */; }; 13 | C55045161A3F49110057378F /* SwiftBitmaskTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55045151A3F49110057378F /* SwiftBitmaskTests.swift */; }; 14 | C55045221A3F49990057378F /* AutoBitmask.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55045201A3F49990057378F /* AutoBitmask.swift */; }; 15 | C55045231A3F49990057378F /* Bitmask.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55045211A3F49990057378F /* Bitmask.swift */; }; 16 | C55045251A3F4A530057378F /* AutoBitmaskTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55045241A3F4A530057378F /* AutoBitmaskTests.swift */; }; 17 | C5FA684A1A7F08E6001BDF09 /* OptionSetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5FA68491A7F08E6001BDF09 /* OptionSetView.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | C55045101A3F49110057378F /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = C55044FA1A3F49110057378F /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = C55045021A3F49110057378F; 26 | remoteInfo = SwiftBitmask; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 2C2B6D88709CAEE03D1A309B /* Pods_SwiftBitmask.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftBitmask.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 6AB4D02AAE851F7A70D35ABC /* Pods-SwiftBitmask.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftBitmask.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask.debug.xcconfig"; sourceTree = ""; }; 33 | 8E7E860EDC9D322BAB24E9C5 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | C34EA2522D89A1F8B56E374B /* Pods-SwiftBitmask.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftBitmask.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask.release.xcconfig"; sourceTree = ""; }; 35 | C55045031A3F49110057378F /* SwiftBitmask.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftBitmask.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | C55045071A3F49110057378F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | C55045081A3F49110057378F /* SwiftBitmask.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftBitmask.h; sourceTree = ""; }; 38 | C550450E1A3F49110057378F /* SwiftBitmaskTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftBitmaskTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | C55045141A3F49110057378F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | C55045151A3F49110057378F /* SwiftBitmaskTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftBitmaskTests.swift; sourceTree = ""; }; 41 | C55045201A3F49990057378F /* AutoBitmask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutoBitmask.swift; sourceTree = ""; }; 42 | C55045211A3F49990057378F /* Bitmask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bitmask.swift; sourceTree = ""; }; 43 | C55045241A3F4A530057378F /* AutoBitmaskTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutoBitmaskTests.swift; sourceTree = ""; }; 44 | C5FA68491A7F08E6001BDF09 /* OptionSetView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OptionSetView.swift; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | C55044FF1A3F49110057378F /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | 6874609D92109F50B0D56EB3 /* Pods_SwiftBitmask.framework in Frameworks */, 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | C550450B1A3F49110057378F /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | C550450F1A3F49110057378F /* SwiftBitmask.framework in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | 86CD8F47AC19928DD4252C57 /* Pods */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 6AB4D02AAE851F7A70D35ABC /* Pods-SwiftBitmask.debug.xcconfig */, 71 | C34EA2522D89A1F8B56E374B /* Pods-SwiftBitmask.release.xcconfig */, 72 | ); 73 | name = Pods; 74 | sourceTree = ""; 75 | }; 76 | 8A2412840B6E8D6E00785617 /* Frameworks */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 8E7E860EDC9D322BAB24E9C5 /* Pods.framework */, 80 | 2C2B6D88709CAEE03D1A309B /* Pods_SwiftBitmask.framework */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | C55044F91A3F49110057378F = { 86 | isa = PBXGroup; 87 | children = ( 88 | C550451F1A3F49990057378F /* Source */, 89 | C55045051A3F49110057378F /* SwiftBitmask */, 90 | C55045121A3F49110057378F /* SwiftBitmaskTests */, 91 | C55045041A3F49110057378F /* Products */, 92 | 86CD8F47AC19928DD4252C57 /* Pods */, 93 | 8A2412840B6E8D6E00785617 /* Frameworks */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | C55045041A3F49110057378F /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | C55045031A3F49110057378F /* SwiftBitmask.framework */, 101 | C550450E1A3F49110057378F /* SwiftBitmaskTests.xctest */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | C55045051A3F49110057378F /* SwiftBitmask */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | C55045081A3F49110057378F /* SwiftBitmask.h */, 110 | C55045061A3F49110057378F /* Supporting Files */, 111 | ); 112 | path = SwiftBitmask; 113 | sourceTree = ""; 114 | }; 115 | C55045061A3F49110057378F /* Supporting Files */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | C55045071A3F49110057378F /* Info.plist */, 119 | ); 120 | name = "Supporting Files"; 121 | sourceTree = ""; 122 | }; 123 | C55045121A3F49110057378F /* SwiftBitmaskTests */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | C55045151A3F49110057378F /* SwiftBitmaskTests.swift */, 127 | C55045241A3F4A530057378F /* AutoBitmaskTests.swift */, 128 | C55045131A3F49110057378F /* Supporting Files */, 129 | ); 130 | path = SwiftBitmaskTests; 131 | sourceTree = ""; 132 | }; 133 | C55045131A3F49110057378F /* Supporting Files */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | C55045141A3F49110057378F /* Info.plist */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | C550451F1A3F49990057378F /* Source */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | C55045201A3F49990057378F /* AutoBitmask.swift */, 145 | C55045211A3F49990057378F /* Bitmask.swift */, 146 | C5FA68491A7F08E6001BDF09 /* OptionSetView.swift */, 147 | ); 148 | path = Source; 149 | sourceTree = SOURCE_ROOT; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXHeadersBuildPhase section */ 154 | C55045001A3F49110057378F /* Headers */ = { 155 | isa = PBXHeadersBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | C55045091A3F49110057378F /* SwiftBitmask.h in Headers */, 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | /* End PBXHeadersBuildPhase section */ 163 | 164 | /* Begin PBXNativeTarget section */ 165 | C55045021A3F49110057378F /* SwiftBitmask */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = C55045191A3F49110057378F /* Build configuration list for PBXNativeTarget "SwiftBitmask" */; 168 | buildPhases = ( 169 | 3EDCD1E812D8C4CBA8D8338C /* Check Pods Manifest.lock */, 170 | C55044FE1A3F49110057378F /* Sources */, 171 | C55044FF1A3F49110057378F /* Frameworks */, 172 | C55045001A3F49110057378F /* Headers */, 173 | C55045011A3F49110057378F /* Resources */, 174 | 5624ECB8F73F70FB50A8131E /* Copy Pods Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | ); 180 | name = SwiftBitmask; 181 | productName = SwiftBitmask; 182 | productReference = C55045031A3F49110057378F /* SwiftBitmask.framework */; 183 | productType = "com.apple.product-type.framework"; 184 | }; 185 | C550450D1A3F49110057378F /* SwiftBitmaskTests */ = { 186 | isa = PBXNativeTarget; 187 | buildConfigurationList = C550451C1A3F49110057378F /* Build configuration list for PBXNativeTarget "SwiftBitmaskTests" */; 188 | buildPhases = ( 189 | C550450A1A3F49110057378F /* Sources */, 190 | C550450B1A3F49110057378F /* Frameworks */, 191 | C550450C1A3F49110057378F /* Resources */, 192 | ); 193 | buildRules = ( 194 | ); 195 | dependencies = ( 196 | C55045111A3F49110057378F /* PBXTargetDependency */, 197 | ); 198 | name = SwiftBitmaskTests; 199 | productName = SwiftBitmaskTests; 200 | productReference = C550450E1A3F49110057378F /* SwiftBitmaskTests.xctest */; 201 | productType = "com.apple.product-type.bundle.unit-test"; 202 | }; 203 | /* End PBXNativeTarget section */ 204 | 205 | /* Begin PBXProject section */ 206 | C55044FA1A3F49110057378F /* Project object */ = { 207 | isa = PBXProject; 208 | attributes = { 209 | LastSwiftMigration = 0720; 210 | LastSwiftUpdateCheck = 0710; 211 | LastUpgradeCheck = 0720; 212 | ORGANIZATIONNAME = "bryn austin bellomy"; 213 | TargetAttributes = { 214 | C55045021A3F49110057378F = { 215 | CreatedOnToolsVersion = 6.1.1; 216 | }; 217 | C550450D1A3F49110057378F = { 218 | CreatedOnToolsVersion = 6.1.1; 219 | }; 220 | }; 221 | }; 222 | buildConfigurationList = C55044FD1A3F49110057378F /* Build configuration list for PBXProject "SwiftBitmask" */; 223 | compatibilityVersion = "Xcode 3.2"; 224 | developmentRegion = English; 225 | hasScannedForEncodings = 0; 226 | knownRegions = ( 227 | en, 228 | ); 229 | mainGroup = C55044F91A3F49110057378F; 230 | productRefGroup = C55045041A3F49110057378F /* Products */; 231 | projectDirPath = ""; 232 | projectRoot = ""; 233 | targets = ( 234 | C55045021A3F49110057378F /* SwiftBitmask */, 235 | C550450D1A3F49110057378F /* SwiftBitmaskTests */, 236 | ); 237 | }; 238 | /* End PBXProject section */ 239 | 240 | /* Begin PBXResourcesBuildPhase section */ 241 | C55045011A3F49110057378F /* Resources */ = { 242 | isa = PBXResourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | C550450C1A3F49110057378F /* Resources */ = { 249 | isa = PBXResourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | /* End PBXResourcesBuildPhase section */ 256 | 257 | /* Begin PBXShellScriptBuildPhase section */ 258 | 3EDCD1E812D8C4CBA8D8338C /* Check Pods Manifest.lock */ = { 259 | isa = PBXShellScriptBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | ); 263 | inputPaths = ( 264 | ); 265 | name = "Check Pods Manifest.lock"; 266 | outputPaths = ( 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | shellPath = /bin/sh; 270 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 271 | showEnvVarsInLog = 0; 272 | }; 273 | 5624ECB8F73F70FB50A8131E /* Copy Pods Resources */ = { 274 | isa = PBXShellScriptBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | ); 278 | inputPaths = ( 279 | ); 280 | name = "Copy Pods Resources"; 281 | outputPaths = ( 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | shellPath = /bin/sh; 285 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftBitmask/Pods-SwiftBitmask-resources.sh\"\n"; 286 | showEnvVarsInLog = 0; 287 | }; 288 | /* End PBXShellScriptBuildPhase section */ 289 | 290 | /* Begin PBXSourcesBuildPhase section */ 291 | C55044FE1A3F49110057378F /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | C55045221A3F49990057378F /* AutoBitmask.swift in Sources */, 296 | C5FA684A1A7F08E6001BDF09 /* OptionSetView.swift in Sources */, 297 | C55045231A3F49990057378F /* Bitmask.swift in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | C550450A1A3F49110057378F /* Sources */ = { 302 | isa = PBXSourcesBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | C55045251A3F4A530057378F /* AutoBitmaskTests.swift in Sources */, 306 | C55045161A3F49110057378F /* SwiftBitmaskTests.swift in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | /* End PBXSourcesBuildPhase section */ 311 | 312 | /* Begin PBXTargetDependency section */ 313 | C55045111A3F49110057378F /* PBXTargetDependency */ = { 314 | isa = PBXTargetDependency; 315 | target = C55045021A3F49110057378F /* SwiftBitmask */; 316 | targetProxy = C55045101A3F49110057378F /* PBXContainerItemProxy */; 317 | }; 318 | /* End PBXTargetDependency section */ 319 | 320 | /* Begin XCBuildConfiguration section */ 321 | C55045171A3F49110057378F /* Debug */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 326 | CLANG_CXX_LIBRARY = "libc++"; 327 | CLANG_ENABLE_MODULES = YES; 328 | CLANG_ENABLE_OBJC_ARC = YES; 329 | CLANG_WARN_BOOL_CONVERSION = YES; 330 | CLANG_WARN_CONSTANT_CONVERSION = YES; 331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 332 | CLANG_WARN_EMPTY_BODY = YES; 333 | CLANG_WARN_ENUM_CONVERSION = YES; 334 | CLANG_WARN_INT_CONVERSION = YES; 335 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | COPY_PHASE_STRIP = NO; 339 | CURRENT_PROJECT_VERSION = 1; 340 | ENABLE_STRICT_OBJC_MSGSEND = YES; 341 | ENABLE_TESTABILITY = YES; 342 | GCC_C_LANGUAGE_STANDARD = gnu99; 343 | GCC_DYNAMIC_NO_PIC = NO; 344 | GCC_OPTIMIZATION_LEVEL = 0; 345 | GCC_PREPROCESSOR_DEFINITIONS = ( 346 | "DEBUG=1", 347 | "$(inherited)", 348 | ); 349 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 352 | GCC_WARN_UNDECLARED_SELECTOR = YES; 353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 354 | GCC_WARN_UNUSED_FUNCTION = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | MACOSX_DEPLOYMENT_TARGET = 10.10; 357 | MTL_ENABLE_DEBUG_INFO = YES; 358 | ONLY_ACTIVE_ARCH = YES; 359 | SDKROOT = macosx; 360 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 361 | VERSIONING_SYSTEM = "apple-generic"; 362 | VERSION_INFO_PREFIX = ""; 363 | }; 364 | name = Debug; 365 | }; 366 | C55045181A3F49110057378F /* Release */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | ALWAYS_SEARCH_USER_PATHS = NO; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BOOL_CONVERSION = YES; 375 | CLANG_WARN_CONSTANT_CONVERSION = YES; 376 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 377 | CLANG_WARN_EMPTY_BODY = YES; 378 | CLANG_WARN_ENUM_CONVERSION = YES; 379 | CLANG_WARN_INT_CONVERSION = YES; 380 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 381 | CLANG_WARN_UNREACHABLE_CODE = YES; 382 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 383 | COPY_PHASE_STRIP = YES; 384 | CURRENT_PROJECT_VERSION = 1; 385 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 386 | ENABLE_NS_ASSERTIONS = NO; 387 | ENABLE_STRICT_OBJC_MSGSEND = YES; 388 | GCC_C_LANGUAGE_STANDARD = gnu99; 389 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 390 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 391 | GCC_WARN_UNDECLARED_SELECTOR = YES; 392 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 393 | GCC_WARN_UNUSED_FUNCTION = YES; 394 | GCC_WARN_UNUSED_VARIABLE = YES; 395 | MACOSX_DEPLOYMENT_TARGET = 10.10; 396 | MTL_ENABLE_DEBUG_INFO = NO; 397 | SDKROOT = macosx; 398 | VERSIONING_SYSTEM = "apple-generic"; 399 | VERSION_INFO_PREFIX = ""; 400 | }; 401 | name = Release; 402 | }; 403 | C550451A1A3F49110057378F /* Debug */ = { 404 | isa = XCBuildConfiguration; 405 | baseConfigurationReference = 6AB4D02AAE851F7A70D35ABC /* Pods-SwiftBitmask.debug.xcconfig */; 406 | buildSettings = { 407 | COMBINE_HIDPI_IMAGES = YES; 408 | DEFINES_MODULE = YES; 409 | DYLIB_COMPATIBILITY_VERSION = 1; 410 | DYLIB_CURRENT_VERSION = 1; 411 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 412 | FRAMEWORK_VERSION = A; 413 | INFOPLIST_FILE = SwiftBitmask/Info.plist; 414 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 415 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 416 | PRODUCT_BUNDLE_IDENTIFIER = "com.illumntr.$(PRODUCT_NAME:rfc1034identifier)"; 417 | PRODUCT_NAME = "$(TARGET_NAME)"; 418 | SKIP_INSTALL = YES; 419 | }; 420 | name = Debug; 421 | }; 422 | C550451B1A3F49110057378F /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | baseConfigurationReference = C34EA2522D89A1F8B56E374B /* Pods-SwiftBitmask.release.xcconfig */; 425 | buildSettings = { 426 | COMBINE_HIDPI_IMAGES = YES; 427 | DEFINES_MODULE = YES; 428 | DYLIB_COMPATIBILITY_VERSION = 1; 429 | DYLIB_CURRENT_VERSION = 1; 430 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 431 | FRAMEWORK_VERSION = A; 432 | INFOPLIST_FILE = SwiftBitmask/Info.plist; 433 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 434 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 435 | PRODUCT_BUNDLE_IDENTIFIER = "com.illumntr.$(PRODUCT_NAME:rfc1034identifier)"; 436 | PRODUCT_NAME = "$(TARGET_NAME)"; 437 | SKIP_INSTALL = YES; 438 | }; 439 | name = Release; 440 | }; 441 | C550451D1A3F49110057378F /* Debug */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | COMBINE_HIDPI_IMAGES = YES; 445 | FRAMEWORK_SEARCH_PATHS = ( 446 | "$(DEVELOPER_FRAMEWORKS_DIR)", 447 | "$(inherited)", 448 | ); 449 | GCC_PREPROCESSOR_DEFINITIONS = ( 450 | "DEBUG=1", 451 | "$(inherited)", 452 | ); 453 | INFOPLIST_FILE = SwiftBitmaskTests/Info.plist; 454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 455 | PRODUCT_BUNDLE_IDENTIFIER = "com.illumntr.$(PRODUCT_NAME:rfc1034identifier)"; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | }; 458 | name = Debug; 459 | }; 460 | C550451E1A3F49110057378F /* Release */ = { 461 | isa = XCBuildConfiguration; 462 | buildSettings = { 463 | COMBINE_HIDPI_IMAGES = YES; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(DEVELOPER_FRAMEWORKS_DIR)", 466 | "$(inherited)", 467 | ); 468 | INFOPLIST_FILE = SwiftBitmaskTests/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = "com.illumntr.$(PRODUCT_NAME:rfc1034identifier)"; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | }; 473 | name = Release; 474 | }; 475 | /* End XCBuildConfiguration section */ 476 | 477 | /* Begin XCConfigurationList section */ 478 | C55044FD1A3F49110057378F /* Build configuration list for PBXProject "SwiftBitmask" */ = { 479 | isa = XCConfigurationList; 480 | buildConfigurations = ( 481 | C55045171A3F49110057378F /* Debug */, 482 | C55045181A3F49110057378F /* Release */, 483 | ); 484 | defaultConfigurationIsVisible = 0; 485 | defaultConfigurationName = Release; 486 | }; 487 | C55045191A3F49110057378F /* Build configuration list for PBXNativeTarget "SwiftBitmask" */ = { 488 | isa = XCConfigurationList; 489 | buildConfigurations = ( 490 | C550451A1A3F49110057378F /* Debug */, 491 | C550451B1A3F49110057378F /* Release */, 492 | ); 493 | defaultConfigurationIsVisible = 0; 494 | defaultConfigurationName = Release; 495 | }; 496 | C550451C1A3F49110057378F /* Build configuration list for PBXNativeTarget "SwiftBitmaskTests" */ = { 497 | isa = XCConfigurationList; 498 | buildConfigurations = ( 499 | C550451D1A3F49110057378F /* Debug */, 500 | C550451E1A3F49110057378F /* Release */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | /* End XCConfigurationList section */ 506 | }; 507 | rootObject = C55044FA1A3F49110057378F /* Project object */; 508 | } 509 | -------------------------------------------------------------------------------- /SwiftBitmask.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftBitmask.xcodeproj/xcshareddata/xcschemes/SwiftBitmask.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 79 | 85 | 86 | 87 | 88 | 89 | 90 | 96 | 97 | 103 | 104 | 105 | 106 | 108 | 109 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /SwiftBitmask.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SwiftBitmask/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 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2014 bryn austin bellomy. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /SwiftBitmask/SwiftBitmask.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftBitmask.h 3 | // SwiftBitmask 4 | // 5 | // Created by bryn austin bellomy on 2014 Dec 15. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for SwiftBitmask. 12 | FOUNDATION_EXPORT double SwiftBitmaskVersionNumber; 13 | 14 | //! Project version string for SwiftBitmask. 15 | FOUNDATION_EXPORT const unsigned char SwiftBitmaskVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /SwiftBitmaskTests/AutoBitmaskTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AutoBitmaskTests.swift 3 | // SwiftBitmask 4 | // 5 | // Created by bryn austin bellomy on 2014 Dec 15. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import XCTest 11 | import SwiftBitmask 12 | 13 | 14 | private enum MonsterAttributes : String, IBitmaskRepresentable, IAutoBitmaskable 15 | { 16 | case Big = "big" 17 | case Ugly = "ugly" 18 | case Scary = "scary" 19 | 20 | static var autoBitmaskValues : [MonsterAttributes] = [.Big, .Ugly, .Scary,] 21 | 22 | var bitmaskValue: UInt16 { return AutoBitmask.autoBitmaskValueFor(self) } 23 | init(bitmaskValue: UInt16) { self = AutoBitmask.autoValueFromBitmask(bitmaskValue) } 24 | } 25 | 26 | 27 | class AutoBitmaskTests: XCTestCase 28 | { 29 | func testAutoBitmaskAlgorithmicValues() 30 | { 31 | var index = MonsterAttributes.autoBitmaskValues.indexOf(MonsterAttributes.Big)! 32 | XCTAssert(MonsterAttributes.Big.bitmaskValue == UInt16(1 << index)) 33 | 34 | index = MonsterAttributes.autoBitmaskValues.indexOf(MonsterAttributes.Ugly)! 35 | XCTAssert(MonsterAttributes.Ugly.bitmaskValue == UInt16(1 << index)) 36 | 37 | index = MonsterAttributes.autoBitmaskValues.indexOf(MonsterAttributes.Scary)! 38 | XCTAssert(MonsterAttributes.Scary.bitmaskValue == UInt16(1 << index)) 39 | } 40 | 41 | func testAutoBitmaskConcreteValues() 42 | { 43 | XCTAssert(MonsterAttributes.Big.bitmaskValue == 1) 44 | XCTAssert(MonsterAttributes.Ugly.bitmaskValue == 2) 45 | XCTAssert(MonsterAttributes.Scary.bitmaskValue == 4) 46 | } 47 | } 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /SwiftBitmaskTests/BitmaskOptionViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BitmaskOptionViewTests.swift 3 | // SwiftConfig 4 | // 5 | // Created by bryn austin bellomy on 2014 Dec 22. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import XCTest 11 | 12 | 13 | public enum ColliderType : String 14 | { 15 | case None = "none" 16 | case Hero = "hero" 17 | case Enemy = "enemy" 18 | case Projectile = "projectile" 19 | case Wall = "wall" 20 | case EnvironmentalObject = "environmental object" 21 | } 22 | 23 | extension ColliderType : IBitmaskRepresentable { 24 | public var bitmaskValue : UInt32 { return AutoBitmask.autoBitmaskValueFor(self) } 25 | } 26 | 27 | extension ColliderType : IAutoBitmaskable { 28 | public static var autoBitmaskValues : [ColliderType] { return [ .None, .Hero, .Enemy, .Projectile, .Wall, .EnvironmentalObject, ] } 29 | } 30 | 31 | extension ColliderType : IConfigRepresentable 32 | { 33 | public init?(configValue:String) 34 | { 35 | if let configStr = configValue as? String { 36 | if let obj = ColliderType(rawValue: configStr.lowercaseString)? { 37 | self = obj 38 | } 39 | else { return nil } 40 | } 41 | else { return nil } 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | class BitmaskOptionViewTests: XCTestCase 49 | { 50 | var bitmaskOptionView : ConfigBitmaskOptionView? 51 | 52 | override func setUp() 53 | { 54 | super.setUp() 55 | bitmaskOptionView = ConfigBitmaskOptionView(config:config) 56 | } 57 | 58 | override func tearDown() { 59 | // Put teardown code here. This method is called after the invocation of each test method in the class. 60 | super.tearDown() 61 | } 62 | 63 | func testExample() { 64 | // This is an example of a functional test case. 65 | XCTAssert(true, "Pass") 66 | } 67 | 68 | func testPerformanceExample() { 69 | // This is an example of a performance test case. 70 | self.measureBlock() { 71 | // Put the code you want to measure the time of here. 72 | } 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /SwiftBitmaskTests/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 | -------------------------------------------------------------------------------- /SwiftBitmaskTests/SwiftBitmaskTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftBitmaskTests.swift 3 | // SwiftBitmaskTests 4 | // 5 | // Created by bryn austin bellomy on 2014 Dec 15. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import XCTest 11 | import SwiftBitmask 12 | 13 | private enum MonsterAttributes: UInt16, IBitmaskRepresentable 14 | { 15 | case Big = 1 16 | case Ugly = 2 17 | case Scary = 4 18 | 19 | var bitmaskValue: UInt16 { return rawValue } 20 | init?(bitmaskValue: UInt16) { self.init(rawValue: bitmaskValue) } 21 | } 22 | 23 | 24 | class SwiftBitmaskTests: XCTestCase 25 | { 26 | private let bitmask = MonsterAttributes.Ugly | .Scary 27 | 28 | func testRawTypes() { 29 | let rawBitmask = Bitmask(12) 30 | XCTAssert(rawBitmask.bitmaskValue == 12) 31 | } 32 | 33 | func testSplatConstructor() { 34 | let b = Bitmask(MonsterAttributes.Big, .Scary) 35 | XCTAssert(b == MonsterAttributes.Big | MonsterAttributes.Scary) 36 | } 37 | 38 | func testArrayConstructor() { 39 | let b = Bitmask([MonsterAttributes.Big, .Scary]) 40 | XCTAssert(b == MonsterAttributes.Big | .Scary) 41 | } 42 | 43 | func testPrefixOperatorConstructor() 44 | { 45 | let singleValue = |MonsterAttributes.Ugly 46 | XCTAssert(singleValue == MonsterAttributes.Ugly) 47 | XCTAssert(|MonsterAttributes.Ugly == Bitmask(MonsterAttributes.Ugly)) 48 | } 49 | 50 | func testEquatable() { 51 | XCTAssert(bitmask == MonsterAttributes.Ugly | .Scary) 52 | } 53 | 54 | func testComparable() { 55 | let other = MonsterAttributes.Big | .Scary 56 | XCTAssert((bitmask < other) == (bitmask.bitmaskValue < other.bitmaskValue)) 57 | XCTAssert((bitmask > other) == (bitmask.bitmaskValue > other.bitmaskValue)) 58 | XCTAssert((bitmask <= other) == (bitmask.bitmaskValue <= other.bitmaskValue)) 59 | XCTAssert((bitmask >= other) == (bitmask.bitmaskValue >= other.bitmaskValue)) 60 | } 61 | 62 | func testIsSet() { 63 | XCTAssertTrue(bitmask.isSet(.Ugly)) 64 | XCTAssertTrue(bitmask.isSet(.Scary)) 65 | XCTAssertFalse(bitmask.isSet(.Big)) 66 | } 67 | 68 | func testAreSet() { 69 | XCTAssertTrue(bitmask.areSet(.Ugly, .Scary)) 70 | XCTAssertFalse(bitmask.areSet(.Ugly, .Big)) 71 | } 72 | 73 | func testLogicalOr() { 74 | XCTAssert(bitmask.bitmaskValue == MonsterAttributes.Ugly.bitmaskValue | MonsterAttributes.Scary.bitmaskValue) 75 | } 76 | 77 | func testLogicalAnd() { 78 | let other = MonsterAttributes.Ugly 79 | XCTAssert((bitmask & other) == other) 80 | XCTAssert((bitmask & other).bitmaskValue == bitmask.bitmaskValue & other.bitmaskValue) 81 | } 82 | 83 | func testLogicalXor() { 84 | let other = MonsterAttributes.Ugly 85 | XCTAssert(bitmask ^ other == MonsterAttributes.Scary) 86 | XCTAssert((bitmask ^ other).bitmaskValue == bitmask.bitmaskValue ^ other.bitmaskValue) 87 | } 88 | 89 | func testLogicalNot() { 90 | XCTAssert((~bitmask) == ~(MonsterAttributes.Ugly | .Scary)) 91 | } 92 | 93 | func testNilLiteralConvertible() { 94 | XCTAssert(bitmask & MonsterAttributes.Scary != nil) 95 | XCTAssert(bitmask & |MonsterAttributes.Scary != nil) 96 | } 97 | 98 | func testBooleanType() { 99 | XCTAssert(bitmask & MonsterAttributes.Scary) 100 | XCTAssert(bitmask & |MonsterAttributes.Scary) 101 | } 102 | 103 | func testPatternMatchingOperator() { 104 | // Implements the pattern matching operator 105 | XCTAssert(bitmask ~= MonsterAttributes.Scary | .Big) 106 | XCTAssert(bitmask ~= MonsterAttributes.Scary) 107 | XCTAssert(bitmask ~= |MonsterAttributes.Scary) 108 | XCTAssert((bitmask ~= |MonsterAttributes.Big) == false) 109 | } 110 | } 111 | 112 | 113 | 114 | 115 | --------------------------------------------------------------------------------