├── .gitignore
├── .travis.yml
├── Framework
├── Info.plist
├── OrderedSet.h
└── PrivacyInfo.xcprivacy
├── LICENSE
├── OrderedSet.podspec
├── Package.swift
├── Project Files
├── OrderedSet.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── xcshareddata
│ │ └── xcschemes
│ │ │ ├── OrderedSet-iOS.xcscheme
│ │ │ ├── OrderedSet-macOS.xcscheme
│ │ │ ├── OrderedSet-tvOS.xcscheme
│ │ │ └── OrderedSet.xcscheme
│ └── xcuserdata
│ │ └── james.xcuserdatad
│ │ └── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
├── OrderedSet
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── MasterViewController.swift
└── OrderedSetTests
│ ├── Info.plist
│ └── OrderedSet_Tests.swift
├── README.md
└── Sources
└── OrderedSet.swift
/.gitignore:
--------------------------------------------------------------------------------
1 | xcuserdata
2 | *.xctimeline
3 | *.xccheckout
4 | *.xcscmblueprint
5 | *.mode2v3
6 | *.pbxuser
7 | (*)/
8 | .DS_Store
9 | Carthage/
10 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: swift
2 | osx_image: xcode10.2
3 | script: xcodebuild -sdk iphonesimulator12.2 -destination 'platform=iOS Simulator,name=iPhone 8,OS=12.2' -project Project\ Files/OrderedSet.xcodeproj -scheme OrderedSet build test
4 |
--------------------------------------------------------------------------------
/Framework/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 | 3.0.1
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSHumanReadableCopyright
22 | Copyright © 2016 Weebly. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Framework/OrderedSet.h:
--------------------------------------------------------------------------------
1 | //
2 | // OrderedSet.h
3 | // OrderedSet
4 | //
5 | // Created by Torsten Louland on 26/11/2016.
6 | // Copyright © 2016 Weebly. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | FOUNDATION_EXPORT double OrderedSetVersionNumber;
12 | FOUNDATION_EXPORT const unsigned char OrderedSetVersionString[];
13 |
--------------------------------------------------------------------------------
/Framework/PrivacyInfo.xcprivacy:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSPrivacyCollectedDataTypes
6 |
7 | NSPrivacyAccessedAPITypes
8 |
9 | NSPrivacyTrackingDomains
10 |
11 | NSPrivacyTracking
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Weebly
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.m of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Weebly nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Weebly, Inc BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 |
21 |
--------------------------------------------------------------------------------
/OrderedSet.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "OrderedSet"
3 | s.version = "6.0.3"
4 | s.summary = "A Swift implementation of an OrderedSet."
5 |
6 | s.description = <<-DESC
7 | NSOrderedSet is great and all, but you can't stuff enums and structs into it, and it
8 | lacks the mutability constraints that other collection types in Swift through var and let.
9 | Introducing OrderedSet, a wholly-Swift implementation of the common ordered, unique collection!
10 | DESC
11 |
12 | s.homepage = "https://github.com/Weebly/OrderedSet"
13 |
14 | s.license = { :type => "MIT", :file => "LICENSE" }
15 |
16 | s.author = { "Jace Conflenti" => "jace@squareup.com" }
17 | s.social_media_url = "http://twitter.com/ketzusaka"
18 |
19 | s.ios.deployment_target = "12.0"
20 | s.osx.deployment_target = "10.13"
21 | s.tvos.deployment_target = "12.0"
22 | s.watchos.deployment_target = "5.2"
23 |
24 | s.swift_version = '5.0'
25 | s.source = { :git => "https://github.com/Weebly/OrderedSet.git", :tag => "v6.0.3" }
26 | s.resource_bundles = {'OrderedSet_privacy' => ['Framework/PrivacyInfo.xcprivacy']}
27 | s.requires_arc = true
28 | s.source_files = "Sources/*.{swift}"
29 | end
30 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:4.2
2 |
3 | import PackageDescription
4 |
5 | let package = Package(
6 | name: "OrderedSet",
7 | products: [.library(name: "OrderedSet", targets: ["OrderedSet"])],
8 | targets: [.target(name: "OrderedSet", path: "Sources")]
9 | )
10 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0319D6592BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0319D6582BD2BA31009E47CE /* PrivacyInfo.xcprivacy */; };
11 | 0319D65A2BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0319D6582BD2BA31009E47CE /* PrivacyInfo.xcprivacy */; };
12 | 0319D65B2BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0319D6582BD2BA31009E47CE /* PrivacyInfo.xcprivacy */; };
13 | 0319D65C2BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0319D6582BD2BA31009E47CE /* PrivacyInfo.xcprivacy */; };
14 | 0319D65D2BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0319D6582BD2BA31009E47CE /* PrivacyInfo.xcprivacy */; };
15 | 1A15ED131A5DC30B00D40BDD /* OrderedSet_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A15ED121A5DC30B00D40BDD /* OrderedSet_Tests.swift */; };
16 | 1ABC4FBD1A5C966200DC4F4D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC4FBC1A5C966200DC4F4D /* AppDelegate.swift */; };
17 | 1ABC4FBF1A5C966200DC4F4D /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC4FBE1A5C966200DC4F4D /* MasterViewController.swift */; };
18 | 1ABC4FC41A5C966200DC4F4D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1ABC4FC21A5C966200DC4F4D /* Main.storyboard */; };
19 | 1ABC4FC61A5C966200DC4F4D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1ABC4FC51A5C966200DC4F4D /* Images.xcassets */; };
20 | 1ABC4FC91A5C966200DC4F4D /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1ABC4FC71A5C966200DC4F4D /* LaunchScreen.xib */; };
21 | 1ABC4FDF1A5C97F500DC4F4D /* OrderedSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC4FDE1A5C97F500DC4F4D /* OrderedSet.swift */; };
22 | 1AD4D0AC20C0E6A2008B34B1 /* OrderedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = AEBBEBB01DE9B371005525DE /* OrderedSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
23 | 1AF415F220C0E8D30030FC7F /* OrderedSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC4FDE1A5C97F500DC4F4D /* OrderedSet.swift */; };
24 | AEBBEBB21DE9B371005525DE /* OrderedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = AEBBEBB01DE9B371005525DE /* OrderedSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
25 | AEBBEBB61DE9B4E5005525DE /* OrderedSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC4FDE1A5C97F500DC4F4D /* OrderedSet.swift */; };
26 | AEBBEBC41DE9B852005525DE /* OrderedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = AEBBEBB01DE9B371005525DE /* OrderedSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
27 | AEBBEBC51DE9B859005525DE /* OrderedSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC4FDE1A5C97F500DC4F4D /* OrderedSet.swift */; };
28 | /* End PBXBuildFile section */
29 |
30 | /* Begin PBXContainerItemProxy section */
31 | 1ABC4FCF1A5C966200DC4F4D /* PBXContainerItemProxy */ = {
32 | isa = PBXContainerItemProxy;
33 | containerPortal = 1ABC4FAF1A5C966200DC4F4D /* Project object */;
34 | proxyType = 1;
35 | remoteGlobalIDString = 1ABC4FB61A5C966200DC4F4D;
36 | remoteInfo = OrderedSet;
37 | };
38 | /* End PBXContainerItemProxy section */
39 |
40 | /* Begin PBXFileReference section */
41 | 0319D6582BD2BA31009E47CE /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; };
42 | 1A15ED121A5DC30B00D40BDD /* OrderedSet_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedSet_Tests.swift; sourceTree = ""; };
43 | 1A6B154022B5C095006F3A5C /* OrderedSet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OrderedSet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 1ABC4FB71A5C966200DC4F4D /* OrderedSet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OrderedSet.app; sourceTree = BUILT_PRODUCTS_DIR; };
45 | 1ABC4FBB1A5C966200DC4F4D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
46 | 1ABC4FBC1A5C966200DC4F4D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
47 | 1ABC4FBE1A5C966200DC4F4D /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; };
48 | 1ABC4FC31A5C966200DC4F4D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
49 | 1ABC4FC51A5C966200DC4F4D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
50 | 1ABC4FC81A5C966200DC4F4D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
51 | 1ABC4FCE1A5C966200DC4F4D /* OrderedSetTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OrderedSetTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
52 | 1ABC4FD31A5C966200DC4F4D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
53 | 1ABC4FDE1A5C97F500DC4F4D /* OrderedSet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OrderedSet.swift; path = ../../Sources/OrderedSet.swift; sourceTree = ""; };
54 | 1AD4D0A420C0E61C008B34B1 /* OrderedSet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OrderedSet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
55 | AEBBEBAE1DE9B371005525DE /* OrderedSet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OrderedSet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
56 | AEBBEBB01DE9B371005525DE /* OrderedSet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OrderedSet.h; sourceTree = ""; };
57 | AEBBEBB11DE9B371005525DE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | AEBBEBBC1DE9B78F005525DE /* OrderedSet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OrderedSet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
59 | /* End PBXFileReference section */
60 |
61 | /* Begin PBXFrameworksBuildPhase section */
62 | 1A6B153D22B5C095006F3A5C /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | 1ABC4FB41A5C966200DC4F4D /* Frameworks */ = {
70 | isa = PBXFrameworksBuildPhase;
71 | buildActionMask = 2147483647;
72 | files = (
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | 1ABC4FCB1A5C966200DC4F4D /* Frameworks */ = {
77 | isa = PBXFrameworksBuildPhase;
78 | buildActionMask = 2147483647;
79 | files = (
80 | );
81 | runOnlyForDeploymentPostprocessing = 0;
82 | };
83 | 1AD4D0A020C0E61C008B34B1 /* Frameworks */ = {
84 | isa = PBXFrameworksBuildPhase;
85 | buildActionMask = 2147483647;
86 | files = (
87 | );
88 | runOnlyForDeploymentPostprocessing = 0;
89 | };
90 | AEBBEBAA1DE9B371005525DE /* Frameworks */ = {
91 | isa = PBXFrameworksBuildPhase;
92 | buildActionMask = 2147483647;
93 | files = (
94 | );
95 | runOnlyForDeploymentPostprocessing = 0;
96 | };
97 | AEBBEBB81DE9B78F005525DE /* Frameworks */ = {
98 | isa = PBXFrameworksBuildPhase;
99 | buildActionMask = 2147483647;
100 | files = (
101 | );
102 | runOnlyForDeploymentPostprocessing = 0;
103 | };
104 | /* End PBXFrameworksBuildPhase section */
105 |
106 | /* Begin PBXGroup section */
107 | 1ABC4FAE1A5C966200DC4F4D = {
108 | isa = PBXGroup;
109 | children = (
110 | 1ABC4FB91A5C966200DC4F4D /* OrderedSet */,
111 | 1ABC4FD11A5C966200DC4F4D /* OrderedSetTests */,
112 | AEBBEBAF1DE9B371005525DE /* Framework Support */,
113 | 1ABC4FB81A5C966200DC4F4D /* Products */,
114 | );
115 | sourceTree = "";
116 | };
117 | 1ABC4FB81A5C966200DC4F4D /* Products */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 1ABC4FB71A5C966200DC4F4D /* OrderedSet.app */,
121 | 1ABC4FCE1A5C966200DC4F4D /* OrderedSetTests.xctest */,
122 | AEBBEBAE1DE9B371005525DE /* OrderedSet.framework */,
123 | AEBBEBBC1DE9B78F005525DE /* OrderedSet.framework */,
124 | 1AD4D0A420C0E61C008B34B1 /* OrderedSet.framework */,
125 | 1A6B154022B5C095006F3A5C /* OrderedSet.framework */,
126 | );
127 | name = Products;
128 | sourceTree = "";
129 | };
130 | 1ABC4FB91A5C966200DC4F4D /* OrderedSet */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 1ABC4FDE1A5C97F500DC4F4D /* OrderedSet.swift */,
134 | 1ABC4FBC1A5C966200DC4F4D /* AppDelegate.swift */,
135 | 1ABC4FBE1A5C966200DC4F4D /* MasterViewController.swift */,
136 | 1ABC4FC21A5C966200DC4F4D /* Main.storyboard */,
137 | 1ABC4FC51A5C966200DC4F4D /* Images.xcassets */,
138 | 1ABC4FC71A5C966200DC4F4D /* LaunchScreen.xib */,
139 | 1ABC4FBA1A5C966200DC4F4D /* Supporting Files */,
140 | );
141 | path = OrderedSet;
142 | sourceTree = "";
143 | };
144 | 1ABC4FBA1A5C966200DC4F4D /* Supporting Files */ = {
145 | isa = PBXGroup;
146 | children = (
147 | 1ABC4FBB1A5C966200DC4F4D /* Info.plist */,
148 | );
149 | name = "Supporting Files";
150 | sourceTree = "";
151 | };
152 | 1ABC4FD11A5C966200DC4F4D /* OrderedSetTests */ = {
153 | isa = PBXGroup;
154 | children = (
155 | 1A15ED121A5DC30B00D40BDD /* OrderedSet_Tests.swift */,
156 | 1ABC4FD21A5C966200DC4F4D /* Supporting Files */,
157 | );
158 | path = OrderedSetTests;
159 | sourceTree = "";
160 | };
161 | 1ABC4FD21A5C966200DC4F4D /* Supporting Files */ = {
162 | isa = PBXGroup;
163 | children = (
164 | 1ABC4FD31A5C966200DC4F4D /* Info.plist */,
165 | );
166 | name = "Supporting Files";
167 | sourceTree = "";
168 | };
169 | AEBBEBAF1DE9B371005525DE /* Framework Support */ = {
170 | isa = PBXGroup;
171 | children = (
172 | 0319D6582BD2BA31009E47CE /* PrivacyInfo.xcprivacy */,
173 | AEBBEBB01DE9B371005525DE /* OrderedSet.h */,
174 | AEBBEBB11DE9B371005525DE /* Info.plist */,
175 | );
176 | name = "Framework Support";
177 | path = ../Framework;
178 | sourceTree = "";
179 | };
180 | /* End PBXGroup section */
181 |
182 | /* Begin PBXHeadersBuildPhase section */
183 | 1A6B153B22B5C095006F3A5C /* Headers */ = {
184 | isa = PBXHeadersBuildPhase;
185 | buildActionMask = 2147483647;
186 | files = (
187 | );
188 | runOnlyForDeploymentPostprocessing = 0;
189 | };
190 | 1AD4D0A120C0E61C008B34B1 /* Headers */ = {
191 | isa = PBXHeadersBuildPhase;
192 | buildActionMask = 2147483647;
193 | files = (
194 | 1AD4D0AC20C0E6A2008B34B1 /* OrderedSet.h in Headers */,
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | };
198 | AEBBEBAB1DE9B371005525DE /* Headers */ = {
199 | isa = PBXHeadersBuildPhase;
200 | buildActionMask = 2147483647;
201 | files = (
202 | AEBBEBB21DE9B371005525DE /* OrderedSet.h in Headers */,
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | };
206 | AEBBEBB91DE9B78F005525DE /* Headers */ = {
207 | isa = PBXHeadersBuildPhase;
208 | buildActionMask = 2147483647;
209 | files = (
210 | AEBBEBC41DE9B852005525DE /* OrderedSet.h in Headers */,
211 | );
212 | runOnlyForDeploymentPostprocessing = 0;
213 | };
214 | /* End PBXHeadersBuildPhase section */
215 |
216 | /* Begin PBXNativeTarget section */
217 | 1A6B153F22B5C095006F3A5C /* OrderedSet-watchOS */ = {
218 | isa = PBXNativeTarget;
219 | buildConfigurationList = 1A6B154722B5C095006F3A5C /* Build configuration list for PBXNativeTarget "OrderedSet-watchOS" */;
220 | buildPhases = (
221 | 1A6B153B22B5C095006F3A5C /* Headers */,
222 | 1A6B153C22B5C095006F3A5C /* Sources */,
223 | 1A6B153D22B5C095006F3A5C /* Frameworks */,
224 | 1A6B153E22B5C095006F3A5C /* Resources */,
225 | );
226 | buildRules = (
227 | );
228 | dependencies = (
229 | );
230 | name = "OrderedSet-watchOS";
231 | productName = "OrderedSet-watchOS";
232 | productReference = 1A6B154022B5C095006F3A5C /* OrderedSet.framework */;
233 | productType = "com.apple.product-type.framework";
234 | };
235 | 1ABC4FB61A5C966200DC4F4D /* OrderedSet */ = {
236 | isa = PBXNativeTarget;
237 | buildConfigurationList = 1ABC4FD81A5C966200DC4F4D /* Build configuration list for PBXNativeTarget "OrderedSet" */;
238 | buildPhases = (
239 | 1ABC4FB31A5C966200DC4F4D /* Sources */,
240 | 1ABC4FB41A5C966200DC4F4D /* Frameworks */,
241 | 1ABC4FB51A5C966200DC4F4D /* Resources */,
242 | );
243 | buildRules = (
244 | );
245 | dependencies = (
246 | );
247 | name = OrderedSet;
248 | productName = OrderedSet;
249 | productReference = 1ABC4FB71A5C966200DC4F4D /* OrderedSet.app */;
250 | productType = "com.apple.product-type.application";
251 | };
252 | 1ABC4FCD1A5C966200DC4F4D /* OrderedSetTests */ = {
253 | isa = PBXNativeTarget;
254 | buildConfigurationList = 1ABC4FDB1A5C966200DC4F4D /* Build configuration list for PBXNativeTarget "OrderedSetTests" */;
255 | buildPhases = (
256 | 1ABC4FCA1A5C966200DC4F4D /* Sources */,
257 | 1ABC4FCB1A5C966200DC4F4D /* Frameworks */,
258 | 1ABC4FCC1A5C966200DC4F4D /* Resources */,
259 | );
260 | buildRules = (
261 | );
262 | dependencies = (
263 | 1ABC4FD01A5C966200DC4F4D /* PBXTargetDependency */,
264 | );
265 | name = OrderedSetTests;
266 | productName = OrderedSetTests;
267 | productReference = 1ABC4FCE1A5C966200DC4F4D /* OrderedSetTests.xctest */;
268 | productType = "com.apple.product-type.bundle.unit-test";
269 | };
270 | 1AD4D0A320C0E61C008B34B1 /* OrderedSet-tvOS */ = {
271 | isa = PBXNativeTarget;
272 | buildConfigurationList = 1AD4D0A920C0E61C008B34B1 /* Build configuration list for PBXNativeTarget "OrderedSet-tvOS" */;
273 | buildPhases = (
274 | 1AD4D09F20C0E61C008B34B1 /* Sources */,
275 | 1AD4D0A020C0E61C008B34B1 /* Frameworks */,
276 | 1AD4D0A120C0E61C008B34B1 /* Headers */,
277 | 1AD4D0A220C0E61C008B34B1 /* Resources */,
278 | );
279 | buildRules = (
280 | );
281 | dependencies = (
282 | );
283 | name = "OrderedSet-tvOS";
284 | productName = "OrderedSet-tvOS";
285 | productReference = 1AD4D0A420C0E61C008B34B1 /* OrderedSet.framework */;
286 | productType = "com.apple.product-type.framework";
287 | };
288 | AEBBEBAD1DE9B371005525DE /* OrderedSet-iOS */ = {
289 | isa = PBXNativeTarget;
290 | buildConfigurationList = AEBBEBB51DE9B371005525DE /* Build configuration list for PBXNativeTarget "OrderedSet-iOS" */;
291 | buildPhases = (
292 | AEBBEBA91DE9B371005525DE /* Sources */,
293 | AEBBEBAA1DE9B371005525DE /* Frameworks */,
294 | AEBBEBAB1DE9B371005525DE /* Headers */,
295 | AEBBEBAC1DE9B371005525DE /* Resources */,
296 | );
297 | buildRules = (
298 | );
299 | dependencies = (
300 | );
301 | name = "OrderedSet-iOS";
302 | productName = "OrderedSet-iOS";
303 | productReference = AEBBEBAE1DE9B371005525DE /* OrderedSet.framework */;
304 | productType = "com.apple.product-type.framework";
305 | };
306 | AEBBEBBB1DE9B78F005525DE /* OrderedSet-macOS */ = {
307 | isa = PBXNativeTarget;
308 | buildConfigurationList = AEBBEBC11DE9B78F005525DE /* Build configuration list for PBXNativeTarget "OrderedSet-macOS" */;
309 | buildPhases = (
310 | AEBBEBB71DE9B78F005525DE /* Sources */,
311 | AEBBEBB81DE9B78F005525DE /* Frameworks */,
312 | AEBBEBB91DE9B78F005525DE /* Headers */,
313 | AEBBEBBA1DE9B78F005525DE /* Resources */,
314 | );
315 | buildRules = (
316 | );
317 | dependencies = (
318 | );
319 | name = "OrderedSet-macOS";
320 | productName = "OrderedSet-macOS";
321 | productReference = AEBBEBBC1DE9B78F005525DE /* OrderedSet.framework */;
322 | productType = "com.apple.product-type.framework";
323 | };
324 | /* End PBXNativeTarget section */
325 |
326 | /* Begin PBXProject section */
327 | 1ABC4FAF1A5C966200DC4F4D /* Project object */ = {
328 | isa = PBXProject;
329 | attributes = {
330 | BuildIndependentTargetsInParallel = YES;
331 | LastSwiftUpdateCheck = 0710;
332 | LastUpgradeCheck = 1510;
333 | ORGANIZATIONNAME = Weebly;
334 | TargetAttributes = {
335 | 1A6B153F22B5C095006F3A5C = {
336 | CreatedOnToolsVersion = 10.2;
337 | DevelopmentTeam = 5M378EFHK7;
338 | ProvisioningStyle = Automatic;
339 | };
340 | 1ABC4FB61A5C966200DC4F4D = {
341 | CreatedOnToolsVersion = 6.1.1;
342 | LastSwiftMigration = 0900;
343 | };
344 | 1ABC4FCD1A5C966200DC4F4D = {
345 | CreatedOnToolsVersion = 6.1.1;
346 | LastSwiftMigration = 0900;
347 | TestTargetID = 1ABC4FB61A5C966200DC4F4D;
348 | };
349 | 1AD4D0A320C0E61C008B34B1 = {
350 | CreatedOnToolsVersion = 9.3;
351 | ProvisioningStyle = Automatic;
352 | };
353 | AEBBEBAD1DE9B371005525DE = {
354 | CreatedOnToolsVersion = 8.1;
355 | LastSwiftMigration = 1020;
356 | ProvisioningStyle = Automatic;
357 | };
358 | AEBBEBBB1DE9B78F005525DE = {
359 | CreatedOnToolsVersion = 8.1;
360 | LastSwiftMigration = 0900;
361 | ProvisioningStyle = Automatic;
362 | };
363 | };
364 | };
365 | buildConfigurationList = 1ABC4FB21A5C966200DC4F4D /* Build configuration list for PBXProject "OrderedSet" */;
366 | compatibilityVersion = "Xcode 3.2";
367 | developmentRegion = en;
368 | hasScannedForEncodings = 0;
369 | knownRegions = (
370 | en,
371 | Base,
372 | );
373 | mainGroup = 1ABC4FAE1A5C966200DC4F4D;
374 | productRefGroup = 1ABC4FB81A5C966200DC4F4D /* Products */;
375 | projectDirPath = "";
376 | projectRoot = "";
377 | targets = (
378 | 1ABC4FB61A5C966200DC4F4D /* OrderedSet */,
379 | 1ABC4FCD1A5C966200DC4F4D /* OrderedSetTests */,
380 | AEBBEBAD1DE9B371005525DE /* OrderedSet-iOS */,
381 | AEBBEBBB1DE9B78F005525DE /* OrderedSet-macOS */,
382 | 1AD4D0A320C0E61C008B34B1 /* OrderedSet-tvOS */,
383 | 1A6B153F22B5C095006F3A5C /* OrderedSet-watchOS */,
384 | );
385 | };
386 | /* End PBXProject section */
387 |
388 | /* Begin PBXResourcesBuildPhase section */
389 | 1A6B153E22B5C095006F3A5C /* Resources */ = {
390 | isa = PBXResourcesBuildPhase;
391 | buildActionMask = 2147483647;
392 | files = (
393 | 0319D65D2BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */,
394 | );
395 | runOnlyForDeploymentPostprocessing = 0;
396 | };
397 | 1ABC4FB51A5C966200DC4F4D /* Resources */ = {
398 | isa = PBXResourcesBuildPhase;
399 | buildActionMask = 2147483647;
400 | files = (
401 | 1ABC4FC41A5C966200DC4F4D /* Main.storyboard in Resources */,
402 | 1ABC4FC91A5C966200DC4F4D /* LaunchScreen.xib in Resources */,
403 | 0319D6592BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */,
404 | 1ABC4FC61A5C966200DC4F4D /* Images.xcassets in Resources */,
405 | );
406 | runOnlyForDeploymentPostprocessing = 0;
407 | };
408 | 1ABC4FCC1A5C966200DC4F4D /* Resources */ = {
409 | isa = PBXResourcesBuildPhase;
410 | buildActionMask = 2147483647;
411 | files = (
412 | );
413 | runOnlyForDeploymentPostprocessing = 0;
414 | };
415 | 1AD4D0A220C0E61C008B34B1 /* Resources */ = {
416 | isa = PBXResourcesBuildPhase;
417 | buildActionMask = 2147483647;
418 | files = (
419 | 0319D65C2BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */,
420 | );
421 | runOnlyForDeploymentPostprocessing = 0;
422 | };
423 | AEBBEBAC1DE9B371005525DE /* Resources */ = {
424 | isa = PBXResourcesBuildPhase;
425 | buildActionMask = 2147483647;
426 | files = (
427 | 0319D65A2BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */,
428 | );
429 | runOnlyForDeploymentPostprocessing = 0;
430 | };
431 | AEBBEBBA1DE9B78F005525DE /* Resources */ = {
432 | isa = PBXResourcesBuildPhase;
433 | buildActionMask = 2147483647;
434 | files = (
435 | 0319D65B2BD2BA31009E47CE /* PrivacyInfo.xcprivacy in Resources */,
436 | );
437 | runOnlyForDeploymentPostprocessing = 0;
438 | };
439 | /* End PBXResourcesBuildPhase section */
440 |
441 | /* Begin PBXSourcesBuildPhase section */
442 | 1A6B153C22B5C095006F3A5C /* Sources */ = {
443 | isa = PBXSourcesBuildPhase;
444 | buildActionMask = 2147483647;
445 | files = (
446 | );
447 | runOnlyForDeploymentPostprocessing = 0;
448 | };
449 | 1ABC4FB31A5C966200DC4F4D /* Sources */ = {
450 | isa = PBXSourcesBuildPhase;
451 | buildActionMask = 2147483647;
452 | files = (
453 | 1ABC4FDF1A5C97F500DC4F4D /* OrderedSet.swift in Sources */,
454 | 1ABC4FBF1A5C966200DC4F4D /* MasterViewController.swift in Sources */,
455 | 1ABC4FBD1A5C966200DC4F4D /* AppDelegate.swift in Sources */,
456 | );
457 | runOnlyForDeploymentPostprocessing = 0;
458 | };
459 | 1ABC4FCA1A5C966200DC4F4D /* Sources */ = {
460 | isa = PBXSourcesBuildPhase;
461 | buildActionMask = 2147483647;
462 | files = (
463 | 1A15ED131A5DC30B00D40BDD /* OrderedSet_Tests.swift in Sources */,
464 | );
465 | runOnlyForDeploymentPostprocessing = 0;
466 | };
467 | 1AD4D09F20C0E61C008B34B1 /* Sources */ = {
468 | isa = PBXSourcesBuildPhase;
469 | buildActionMask = 2147483647;
470 | files = (
471 | 1AF415F220C0E8D30030FC7F /* OrderedSet.swift in Sources */,
472 | );
473 | runOnlyForDeploymentPostprocessing = 0;
474 | };
475 | AEBBEBA91DE9B371005525DE /* Sources */ = {
476 | isa = PBXSourcesBuildPhase;
477 | buildActionMask = 2147483647;
478 | files = (
479 | AEBBEBB61DE9B4E5005525DE /* OrderedSet.swift in Sources */,
480 | );
481 | runOnlyForDeploymentPostprocessing = 0;
482 | };
483 | AEBBEBB71DE9B78F005525DE /* Sources */ = {
484 | isa = PBXSourcesBuildPhase;
485 | buildActionMask = 2147483647;
486 | files = (
487 | AEBBEBC51DE9B859005525DE /* OrderedSet.swift in Sources */,
488 | );
489 | runOnlyForDeploymentPostprocessing = 0;
490 | };
491 | /* End PBXSourcesBuildPhase section */
492 |
493 | /* Begin PBXTargetDependency section */
494 | 1ABC4FD01A5C966200DC4F4D /* PBXTargetDependency */ = {
495 | isa = PBXTargetDependency;
496 | target = 1ABC4FB61A5C966200DC4F4D /* OrderedSet */;
497 | targetProxy = 1ABC4FCF1A5C966200DC4F4D /* PBXContainerItemProxy */;
498 | };
499 | /* End PBXTargetDependency section */
500 |
501 | /* Begin PBXVariantGroup section */
502 | 1ABC4FC21A5C966200DC4F4D /* Main.storyboard */ = {
503 | isa = PBXVariantGroup;
504 | children = (
505 | 1ABC4FC31A5C966200DC4F4D /* Base */,
506 | );
507 | name = Main.storyboard;
508 | sourceTree = "";
509 | };
510 | 1ABC4FC71A5C966200DC4F4D /* LaunchScreen.xib */ = {
511 | isa = PBXVariantGroup;
512 | children = (
513 | 1ABC4FC81A5C966200DC4F4D /* Base */,
514 | );
515 | name = LaunchScreen.xib;
516 | sourceTree = "";
517 | };
518 | /* End PBXVariantGroup section */
519 |
520 | /* Begin XCBuildConfiguration section */
521 | 1A6B154522B5C095006F3A5C /* Debug */ = {
522 | isa = XCBuildConfiguration;
523 | buildSettings = {
524 | APPLICATION_EXTENSION_API_ONLY = YES;
525 | CLANG_ANALYZER_NONNULL = YES;
526 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
527 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
528 | CLANG_ENABLE_OBJC_WEAK = YES;
529 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
530 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
531 | CODE_SIGN_IDENTITY = "";
532 | CODE_SIGN_STYLE = Automatic;
533 | CURRENT_PROJECT_VERSION = 1;
534 | DEBUG_INFORMATION_FORMAT = dwarf;
535 | DEFINES_MODULE = YES;
536 | DEVELOPMENT_TEAM = 5M378EFHK7;
537 | DYLIB_COMPATIBILITY_VERSION = 1;
538 | DYLIB_CURRENT_VERSION = 1;
539 | DYLIB_INSTALL_NAME_BASE = "@rpath";
540 | ENABLE_MODULE_VERIFIER = YES;
541 | GCC_C_LANGUAGE_STANDARD = gnu11;
542 | INFOPLIST_FILE = ../Framework/Info.plist;
543 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
544 | LD_RUNPATH_SEARCH_PATHS = (
545 | "$(inherited)",
546 | "@executable_path/Frameworks",
547 | "@loader_path/Frameworks",
548 | );
549 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
550 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
551 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
552 | MTL_FAST_MATH = YES;
553 | PRODUCT_BUNDLE_IDENTIFIER = com.Weebly.OrderedSet;
554 | PRODUCT_NAME = OrderedSet;
555 | SDKROOT = watchos;
556 | SKIP_INSTALL = YES;
557 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
558 | SWIFT_VERSION = 5.0;
559 | TARGETED_DEVICE_FAMILY = 4;
560 | VERSIONING_SYSTEM = "apple-generic";
561 | VERSION_INFO_PREFIX = "";
562 | WATCHOS_DEPLOYMENT_TARGET = 5.2;
563 | };
564 | name = Debug;
565 | };
566 | 1A6B154622B5C095006F3A5C /* Release */ = {
567 | isa = XCBuildConfiguration;
568 | buildSettings = {
569 | APPLICATION_EXTENSION_API_ONLY = YES;
570 | CLANG_ANALYZER_NONNULL = YES;
571 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
572 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
573 | CLANG_ENABLE_OBJC_WEAK = YES;
574 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
575 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
576 | CODE_SIGN_IDENTITY = "";
577 | CODE_SIGN_STYLE = Automatic;
578 | COPY_PHASE_STRIP = NO;
579 | CURRENT_PROJECT_VERSION = 1;
580 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
581 | DEFINES_MODULE = YES;
582 | DEVELOPMENT_TEAM = 5M378EFHK7;
583 | DYLIB_COMPATIBILITY_VERSION = 1;
584 | DYLIB_CURRENT_VERSION = 1;
585 | DYLIB_INSTALL_NAME_BASE = "@rpath";
586 | ENABLE_MODULE_VERIFIER = YES;
587 | GCC_C_LANGUAGE_STANDARD = gnu11;
588 | INFOPLIST_FILE = ../Framework/Info.plist;
589 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
590 | LD_RUNPATH_SEARCH_PATHS = (
591 | "$(inherited)",
592 | "@executable_path/Frameworks",
593 | "@loader_path/Frameworks",
594 | );
595 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
596 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
597 | MTL_FAST_MATH = YES;
598 | PRODUCT_BUNDLE_IDENTIFIER = com.Weebly.OrderedSet;
599 | PRODUCT_NAME = OrderedSet;
600 | SDKROOT = watchos;
601 | SKIP_INSTALL = YES;
602 | SWIFT_VERSION = 5.0;
603 | TARGETED_DEVICE_FAMILY = 4;
604 | VERSIONING_SYSTEM = "apple-generic";
605 | VERSION_INFO_PREFIX = "";
606 | WATCHOS_DEPLOYMENT_TARGET = 5.2;
607 | };
608 | name = Release;
609 | };
610 | 1ABC4FD61A5C966200DC4F4D /* Debug */ = {
611 | isa = XCBuildConfiguration;
612 | buildSettings = {
613 | ALWAYS_SEARCH_USER_PATHS = NO;
614 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
615 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
616 | CLANG_CXX_LIBRARY = "libc++";
617 | CLANG_ENABLE_MODULES = YES;
618 | CLANG_ENABLE_OBJC_ARC = YES;
619 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
620 | CLANG_WARN_BOOL_CONVERSION = YES;
621 | CLANG_WARN_COMMA = YES;
622 | CLANG_WARN_CONSTANT_CONVERSION = YES;
623 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
624 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
625 | CLANG_WARN_EMPTY_BODY = YES;
626 | CLANG_WARN_ENUM_CONVERSION = YES;
627 | CLANG_WARN_INFINITE_RECURSION = YES;
628 | CLANG_WARN_INT_CONVERSION = YES;
629 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
630 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
631 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
632 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
633 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
634 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
635 | CLANG_WARN_STRICT_PROTOTYPES = YES;
636 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
637 | CLANG_WARN_UNREACHABLE_CODE = YES;
638 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
639 | COPY_PHASE_STRIP = NO;
640 | ENABLE_STRICT_OBJC_MSGSEND = YES;
641 | ENABLE_TESTABILITY = YES;
642 | ENABLE_USER_SCRIPT_SANDBOXING = YES;
643 | GCC_C_LANGUAGE_STANDARD = gnu99;
644 | GCC_DYNAMIC_NO_PIC = NO;
645 | GCC_NO_COMMON_BLOCKS = YES;
646 | GCC_OPTIMIZATION_LEVEL = 0;
647 | GCC_PREPROCESSOR_DEFINITIONS = (
648 | "DEBUG=1",
649 | "$(inherited)",
650 | );
651 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
652 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
653 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
654 | GCC_WARN_UNDECLARED_SELECTOR = YES;
655 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
656 | GCC_WARN_UNUSED_FUNCTION = YES;
657 | GCC_WARN_UNUSED_VARIABLE = YES;
658 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
659 | MACOSX_DEPLOYMENT_TARGET = 10.13;
660 | MTL_ENABLE_DEBUG_INFO = YES;
661 | ONLY_ACTIVE_ARCH = YES;
662 | SDKROOT = iphoneos;
663 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
664 | SWIFT_SWIFT3_OBJC_INFERENCE = Off;
665 | SWIFT_VERSION = 5.0;
666 | TVOS_DEPLOYMENT_TARGET = 12.0;
667 | WATCHOS_DEPLOYMENT_TARGET = 5.2;
668 | };
669 | name = Debug;
670 | };
671 | 1ABC4FD71A5C966200DC4F4D /* Release */ = {
672 | isa = XCBuildConfiguration;
673 | buildSettings = {
674 | ALWAYS_SEARCH_USER_PATHS = NO;
675 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
676 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
677 | CLANG_CXX_LIBRARY = "libc++";
678 | CLANG_ENABLE_MODULES = YES;
679 | CLANG_ENABLE_OBJC_ARC = YES;
680 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
681 | CLANG_WARN_BOOL_CONVERSION = YES;
682 | CLANG_WARN_COMMA = YES;
683 | CLANG_WARN_CONSTANT_CONVERSION = YES;
684 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
685 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
686 | CLANG_WARN_EMPTY_BODY = YES;
687 | CLANG_WARN_ENUM_CONVERSION = YES;
688 | CLANG_WARN_INFINITE_RECURSION = YES;
689 | CLANG_WARN_INT_CONVERSION = YES;
690 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
691 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
692 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
693 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
694 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
695 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
696 | CLANG_WARN_STRICT_PROTOTYPES = YES;
697 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
698 | CLANG_WARN_UNREACHABLE_CODE = YES;
699 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
700 | COPY_PHASE_STRIP = YES;
701 | ENABLE_NS_ASSERTIONS = NO;
702 | ENABLE_STRICT_OBJC_MSGSEND = YES;
703 | ENABLE_USER_SCRIPT_SANDBOXING = YES;
704 | GCC_C_LANGUAGE_STANDARD = gnu99;
705 | GCC_NO_COMMON_BLOCKS = YES;
706 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
707 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
708 | GCC_WARN_UNDECLARED_SELECTOR = YES;
709 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
710 | GCC_WARN_UNUSED_FUNCTION = YES;
711 | GCC_WARN_UNUSED_VARIABLE = YES;
712 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
713 | MACOSX_DEPLOYMENT_TARGET = 10.13;
714 | MTL_ENABLE_DEBUG_INFO = NO;
715 | SDKROOT = iphoneos;
716 | SWIFT_COMPILATION_MODE = wholemodule;
717 | SWIFT_OPTIMIZATION_LEVEL = "-O";
718 | SWIFT_SWIFT3_OBJC_INFERENCE = Off;
719 | SWIFT_VERSION = 5.0;
720 | TVOS_DEPLOYMENT_TARGET = 12.0;
721 | VALIDATE_PRODUCT = YES;
722 | WATCHOS_DEPLOYMENT_TARGET = 5.2;
723 | };
724 | name = Release;
725 | };
726 | 1ABC4FD91A5C966200DC4F4D /* Debug */ = {
727 | isa = XCBuildConfiguration;
728 | buildSettings = {
729 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
730 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
731 | INFOPLIST_FILE = OrderedSet/Info.plist;
732 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
733 | LD_RUNPATH_SEARCH_PATHS = (
734 | "$(inherited)",
735 | "@executable_path/Frameworks",
736 | );
737 | PRODUCT_BUNDLE_IDENTIFIER = "com.Weebly.$(PRODUCT_NAME:rfc1034identifier)";
738 | PRODUCT_NAME = "$(TARGET_NAME)";
739 | };
740 | name = Debug;
741 | };
742 | 1ABC4FDA1A5C966200DC4F4D /* Release */ = {
743 | isa = XCBuildConfiguration;
744 | buildSettings = {
745 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
746 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
747 | INFOPLIST_FILE = OrderedSet/Info.plist;
748 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
749 | LD_RUNPATH_SEARCH_PATHS = (
750 | "$(inherited)",
751 | "@executable_path/Frameworks",
752 | );
753 | PRODUCT_BUNDLE_IDENTIFIER = "com.Weebly.$(PRODUCT_NAME:rfc1034identifier)";
754 | PRODUCT_NAME = "$(TARGET_NAME)";
755 | };
756 | name = Release;
757 | };
758 | 1ABC4FDC1A5C966200DC4F4D /* Debug */ = {
759 | isa = XCBuildConfiguration;
760 | buildSettings = {
761 | BUNDLE_LOADER = "$(TEST_HOST)";
762 | GCC_PREPROCESSOR_DEFINITIONS = (
763 | "DEBUG=1",
764 | "$(inherited)",
765 | );
766 | INFOPLIST_FILE = OrderedSetTests/Info.plist;
767 | LD_RUNPATH_SEARCH_PATHS = (
768 | "$(inherited)",
769 | "@executable_path/Frameworks",
770 | "@loader_path/Frameworks",
771 | );
772 | PRODUCT_BUNDLE_IDENTIFIER = "com.Weebly.$(PRODUCT_NAME:rfc1034identifier)";
773 | PRODUCT_NAME = "$(TARGET_NAME)";
774 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OrderedSet.app/OrderedSet";
775 | };
776 | name = Debug;
777 | };
778 | 1ABC4FDD1A5C966200DC4F4D /* Release */ = {
779 | isa = XCBuildConfiguration;
780 | buildSettings = {
781 | BUNDLE_LOADER = "$(TEST_HOST)";
782 | INFOPLIST_FILE = OrderedSetTests/Info.plist;
783 | LD_RUNPATH_SEARCH_PATHS = (
784 | "$(inherited)",
785 | "@executable_path/Frameworks",
786 | "@loader_path/Frameworks",
787 | );
788 | PRODUCT_BUNDLE_IDENTIFIER = "com.Weebly.$(PRODUCT_NAME:rfc1034identifier)";
789 | PRODUCT_NAME = "$(TARGET_NAME)";
790 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OrderedSet.app/OrderedSet";
791 | };
792 | name = Release;
793 | };
794 | 1AD4D0AA20C0E61C008B34B1 /* Debug */ = {
795 | isa = XCBuildConfiguration;
796 | buildSettings = {
797 | APPLICATION_EXTENSION_API_ONLY = YES;
798 | CLANG_ANALYZER_NONNULL = YES;
799 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
800 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
801 | CLANG_ENABLE_OBJC_WEAK = YES;
802 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
803 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
804 | CODE_SIGN_IDENTITY = "";
805 | CODE_SIGN_STYLE = Automatic;
806 | CURRENT_PROJECT_VERSION = 1;
807 | DEBUG_INFORMATION_FORMAT = dwarf;
808 | DEFINES_MODULE = YES;
809 | DEVELOPMENT_TEAM = "";
810 | DYLIB_COMPATIBILITY_VERSION = 1;
811 | DYLIB_CURRENT_VERSION = 1;
812 | DYLIB_INSTALL_NAME_BASE = "@rpath";
813 | ENABLE_MODULE_VERIFIER = YES;
814 | GCC_C_LANGUAGE_STANDARD = gnu11;
815 | INFOPLIST_FILE = ../Framework/Info.plist;
816 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
817 | LD_RUNPATH_SEARCH_PATHS = (
818 | "$(inherited)",
819 | "@executable_path/Frameworks",
820 | "@loader_path/Frameworks",
821 | );
822 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
823 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
824 | PRODUCT_BUNDLE_IDENTIFIER = com.Weebly.OrderedSet;
825 | PRODUCT_NAME = OrderedSet;
826 | SDKROOT = appletvos;
827 | SKIP_INSTALL = YES;
828 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
829 | TARGETED_DEVICE_FAMILY = 3;
830 | TVOS_DEPLOYMENT_TARGET = 12.0;
831 | VERSIONING_SYSTEM = "apple-generic";
832 | VERSION_INFO_PREFIX = "";
833 | };
834 | name = Debug;
835 | };
836 | 1AD4D0AB20C0E61C008B34B1 /* Release */ = {
837 | isa = XCBuildConfiguration;
838 | buildSettings = {
839 | APPLICATION_EXTENSION_API_ONLY = YES;
840 | CLANG_ANALYZER_NONNULL = YES;
841 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
842 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
843 | CLANG_ENABLE_OBJC_WEAK = YES;
844 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
845 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
846 | CODE_SIGN_IDENTITY = "";
847 | CODE_SIGN_STYLE = Automatic;
848 | COPY_PHASE_STRIP = NO;
849 | CURRENT_PROJECT_VERSION = 1;
850 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
851 | DEFINES_MODULE = YES;
852 | DEVELOPMENT_TEAM = "";
853 | DYLIB_COMPATIBILITY_VERSION = 1;
854 | DYLIB_CURRENT_VERSION = 1;
855 | DYLIB_INSTALL_NAME_BASE = "@rpath";
856 | ENABLE_MODULE_VERIFIER = YES;
857 | GCC_C_LANGUAGE_STANDARD = gnu11;
858 | INFOPLIST_FILE = ../Framework/Info.plist;
859 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
860 | LD_RUNPATH_SEARCH_PATHS = (
861 | "$(inherited)",
862 | "@executable_path/Frameworks",
863 | "@loader_path/Frameworks",
864 | );
865 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
866 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
867 | PRODUCT_BUNDLE_IDENTIFIER = com.Weebly.OrderedSet;
868 | PRODUCT_NAME = OrderedSet;
869 | SDKROOT = appletvos;
870 | SKIP_INSTALL = YES;
871 | TARGETED_DEVICE_FAMILY = 3;
872 | TVOS_DEPLOYMENT_TARGET = 12.0;
873 | VERSIONING_SYSTEM = "apple-generic";
874 | VERSION_INFO_PREFIX = "";
875 | };
876 | name = Release;
877 | };
878 | AEBBEBB31DE9B371005525DE /* Debug */ = {
879 | isa = XCBuildConfiguration;
880 | buildSettings = {
881 | APPLICATION_EXTENSION_API_ONLY = YES;
882 | CLANG_ANALYZER_NONNULL = YES;
883 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
884 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
885 | CODE_SIGN_IDENTITY = "";
886 | CURRENT_PROJECT_VERSION = 1;
887 | DEBUG_INFORMATION_FORMAT = dwarf;
888 | DEFINES_MODULE = YES;
889 | DYLIB_COMPATIBILITY_VERSION = 1;
890 | DYLIB_CURRENT_VERSION = 1;
891 | DYLIB_INSTALL_NAME_BASE = "@rpath";
892 | ENABLE_MODULE_VERIFIER = YES;
893 | EXCLUDED_ARCHS = "";
894 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
895 | INFOPLIST_FILE = ../Framework/Info.plist;
896 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
897 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
898 | LD_RUNPATH_SEARCH_PATHS = (
899 | "$(inherited)",
900 | "@executable_path/Frameworks",
901 | "@loader_path/Frameworks",
902 | );
903 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
904 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
905 | PRODUCT_BUNDLE_IDENTIFIER = com.Weebly.OrderedSet;
906 | PRODUCT_NAME = "$(PROJECT_NAME)";
907 | SKIP_INSTALL = YES;
908 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
909 | TARGETED_DEVICE_FAMILY = "1,2";
910 | VERSIONING_SYSTEM = "apple-generic";
911 | VERSION_INFO_PREFIX = "";
912 | };
913 | name = Debug;
914 | };
915 | AEBBEBB41DE9B371005525DE /* Release */ = {
916 | isa = XCBuildConfiguration;
917 | buildSettings = {
918 | APPLICATION_EXTENSION_API_ONLY = YES;
919 | CLANG_ANALYZER_NONNULL = YES;
920 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
921 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
922 | CODE_SIGN_IDENTITY = "";
923 | COPY_PHASE_STRIP = NO;
924 | CURRENT_PROJECT_VERSION = 1;
925 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
926 | DEFINES_MODULE = YES;
927 | DYLIB_COMPATIBILITY_VERSION = 1;
928 | DYLIB_CURRENT_VERSION = 1;
929 | DYLIB_INSTALL_NAME_BASE = "@rpath";
930 | ENABLE_MODULE_VERIFIER = YES;
931 | EXCLUDED_ARCHS = "";
932 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
933 | INFOPLIST_FILE = ../Framework/Info.plist;
934 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
935 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
936 | LD_RUNPATH_SEARCH_PATHS = (
937 | "$(inherited)",
938 | "@executable_path/Frameworks",
939 | "@loader_path/Frameworks",
940 | );
941 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
942 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
943 | PRODUCT_BUNDLE_IDENTIFIER = com.Weebly.OrderedSet;
944 | PRODUCT_NAME = "$(PROJECT_NAME)";
945 | SKIP_INSTALL = YES;
946 | TARGETED_DEVICE_FAMILY = "1,2";
947 | VERSIONING_SYSTEM = "apple-generic";
948 | VERSION_INFO_PREFIX = "";
949 | };
950 | name = Release;
951 | };
952 | AEBBEBC21DE9B78F005525DE /* Debug */ = {
953 | isa = XCBuildConfiguration;
954 | buildSettings = {
955 | APPLICATION_EXTENSION_API_ONLY = YES;
956 | CLANG_ANALYZER_NONNULL = YES;
957 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
958 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
959 | CODE_SIGN_IDENTITY = "-";
960 | COMBINE_HIDPI_IMAGES = YES;
961 | CURRENT_PROJECT_VERSION = 1;
962 | DEAD_CODE_STRIPPING = YES;
963 | DEBUG_INFORMATION_FORMAT = dwarf;
964 | DEFINES_MODULE = YES;
965 | DYLIB_COMPATIBILITY_VERSION = 1;
966 | DYLIB_CURRENT_VERSION = 1;
967 | DYLIB_INSTALL_NAME_BASE = "@rpath";
968 | ENABLE_MODULE_VERIFIER = YES;
969 | FRAMEWORK_VERSION = A;
970 | INFOPLIST_FILE = ../Framework/Info.plist;
971 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
972 | LD_RUNPATH_SEARCH_PATHS = (
973 | "$(inherited)",
974 | "@executable_path/../Frameworks",
975 | "@loader_path/Frameworks",
976 | );
977 | MACOSX_DEPLOYMENT_TARGET = 10.13;
978 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
979 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
980 | PRODUCT_BUNDLE_IDENTIFIER = com.Weebly.OrderedSet;
981 | PRODUCT_NAME = "$(PROJECT_NAME)";
982 | SDKROOT = macosx;
983 | SKIP_INSTALL = YES;
984 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
985 | SWIFT_SWIFT3_OBJC_INFERENCE = Off;
986 | VERSIONING_SYSTEM = "apple-generic";
987 | VERSION_INFO_PREFIX = "";
988 | };
989 | name = Debug;
990 | };
991 | AEBBEBC31DE9B78F005525DE /* Release */ = {
992 | isa = XCBuildConfiguration;
993 | buildSettings = {
994 | APPLICATION_EXTENSION_API_ONLY = YES;
995 | CLANG_ANALYZER_NONNULL = YES;
996 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
997 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
998 | CODE_SIGN_IDENTITY = "-";
999 | COMBINE_HIDPI_IMAGES = YES;
1000 | COPY_PHASE_STRIP = NO;
1001 | CURRENT_PROJECT_VERSION = 1;
1002 | DEAD_CODE_STRIPPING = YES;
1003 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1004 | DEFINES_MODULE = YES;
1005 | DYLIB_COMPATIBILITY_VERSION = 1;
1006 | DYLIB_CURRENT_VERSION = 1;
1007 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1008 | ENABLE_MODULE_VERIFIER = YES;
1009 | FRAMEWORK_VERSION = A;
1010 | INFOPLIST_FILE = ../Framework/Info.plist;
1011 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1012 | LD_RUNPATH_SEARCH_PATHS = (
1013 | "$(inherited)",
1014 | "@executable_path/../Frameworks",
1015 | "@loader_path/Frameworks",
1016 | );
1017 | MACOSX_DEPLOYMENT_TARGET = 10.13;
1018 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
1019 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
1020 | PRODUCT_BUNDLE_IDENTIFIER = com.Weebly.OrderedSet;
1021 | PRODUCT_NAME = "$(PROJECT_NAME)";
1022 | SDKROOT = macosx;
1023 | SKIP_INSTALL = YES;
1024 | SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1025 | VERSIONING_SYSTEM = "apple-generic";
1026 | VERSION_INFO_PREFIX = "";
1027 | };
1028 | name = Release;
1029 | };
1030 | /* End XCBuildConfiguration section */
1031 |
1032 | /* Begin XCConfigurationList section */
1033 | 1A6B154722B5C095006F3A5C /* Build configuration list for PBXNativeTarget "OrderedSet-watchOS" */ = {
1034 | isa = XCConfigurationList;
1035 | buildConfigurations = (
1036 | 1A6B154522B5C095006F3A5C /* Debug */,
1037 | 1A6B154622B5C095006F3A5C /* Release */,
1038 | );
1039 | defaultConfigurationIsVisible = 0;
1040 | defaultConfigurationName = Release;
1041 | };
1042 | 1ABC4FB21A5C966200DC4F4D /* Build configuration list for PBXProject "OrderedSet" */ = {
1043 | isa = XCConfigurationList;
1044 | buildConfigurations = (
1045 | 1ABC4FD61A5C966200DC4F4D /* Debug */,
1046 | 1ABC4FD71A5C966200DC4F4D /* Release */,
1047 | );
1048 | defaultConfigurationIsVisible = 0;
1049 | defaultConfigurationName = Release;
1050 | };
1051 | 1ABC4FD81A5C966200DC4F4D /* Build configuration list for PBXNativeTarget "OrderedSet" */ = {
1052 | isa = XCConfigurationList;
1053 | buildConfigurations = (
1054 | 1ABC4FD91A5C966200DC4F4D /* Debug */,
1055 | 1ABC4FDA1A5C966200DC4F4D /* Release */,
1056 | );
1057 | defaultConfigurationIsVisible = 0;
1058 | defaultConfigurationName = Release;
1059 | };
1060 | 1ABC4FDB1A5C966200DC4F4D /* Build configuration list for PBXNativeTarget "OrderedSetTests" */ = {
1061 | isa = XCConfigurationList;
1062 | buildConfigurations = (
1063 | 1ABC4FDC1A5C966200DC4F4D /* Debug */,
1064 | 1ABC4FDD1A5C966200DC4F4D /* Release */,
1065 | );
1066 | defaultConfigurationIsVisible = 0;
1067 | defaultConfigurationName = Release;
1068 | };
1069 | 1AD4D0A920C0E61C008B34B1 /* Build configuration list for PBXNativeTarget "OrderedSet-tvOS" */ = {
1070 | isa = XCConfigurationList;
1071 | buildConfigurations = (
1072 | 1AD4D0AA20C0E61C008B34B1 /* Debug */,
1073 | 1AD4D0AB20C0E61C008B34B1 /* Release */,
1074 | );
1075 | defaultConfigurationIsVisible = 0;
1076 | defaultConfigurationName = Release;
1077 | };
1078 | AEBBEBB51DE9B371005525DE /* Build configuration list for PBXNativeTarget "OrderedSet-iOS" */ = {
1079 | isa = XCConfigurationList;
1080 | buildConfigurations = (
1081 | AEBBEBB31DE9B371005525DE /* Debug */,
1082 | AEBBEBB41DE9B371005525DE /* Release */,
1083 | );
1084 | defaultConfigurationIsVisible = 0;
1085 | defaultConfigurationName = Release;
1086 | };
1087 | AEBBEBC11DE9B78F005525DE /* Build configuration list for PBXNativeTarget "OrderedSet-macOS" */ = {
1088 | isa = XCConfigurationList;
1089 | buildConfigurations = (
1090 | AEBBEBC21DE9B78F005525DE /* Debug */,
1091 | AEBBEBC31DE9B78F005525DE /* Release */,
1092 | );
1093 | defaultConfigurationIsVisible = 0;
1094 | defaultConfigurationName = Release;
1095 | };
1096 | /* End XCConfigurationList section */
1097 | };
1098 | rootObject = 1ABC4FAF1A5C966200DC4F4D /* Project object */;
1099 | }
1100 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet.xcodeproj/xcshareddata/xcschemes/OrderedSet-iOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
52 |
53 |
59 |
60 |
66 |
67 |
68 |
69 |
71 |
72 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet.xcodeproj/xcshareddata/xcschemes/OrderedSet-macOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
52 |
53 |
59 |
60 |
66 |
67 |
68 |
69 |
71 |
72 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet.xcodeproj/xcshareddata/xcschemes/OrderedSet-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
52 |
53 |
59 |
60 |
66 |
67 |
68 |
69 |
71 |
72 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet.xcodeproj/xcshareddata/xcschemes/OrderedSet.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
51 |
52 |
53 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
76 |
78 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet.xcodeproj/xcuserdata/james.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // OrderedSet
4 | //
5 | // Created by James Richard on 1/6/15.
6 | // Copyright (c) 2015 Weebly.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | internal func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/Project Files/OrderedSet/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 | APPL
17 | CFBundleShortVersionString
18 | 3.0.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 2
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UIStatusBarTintParameters
34 |
35 | UINavigationBar
36 |
37 | Style
38 | UIBarStyleDefault
39 | Translucent
40 |
41 |
42 |
43 | UISupportedInterfaceOrientations
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Project Files/OrderedSet/MasterViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MasterViewController.swift
3 | // OrderedSet
4 | //
5 | // Created by James Richard on 1/6/15.
6 | // Copyright (c) 2015 Weebly.
7 | //
8 |
9 | import UIKit
10 |
11 | class MasterViewController: UITableViewController {
12 |
13 | var objects = OrderedSet()
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 | // Do any additional setup after loading the view, typically from a nib.
18 | self.navigationItem.leftBarButtonItem = self.editButtonItem
19 |
20 | let addButton = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(MasterViewController.insertNewObject(_:)))
21 | self.navigationItem.rightBarButtonItem = addButton
22 | }
23 |
24 | @objc func insertNewObject(_ sender: AnyObject) {
25 | objects.insert(Date(), at: 0)
26 | let indexPath = IndexPath(row: 0, section: 0)
27 | self.tableView.insertRows(at: [indexPath], with: .automatic)
28 | }
29 |
30 | // MARK: - Table View
31 |
32 | override func numberOfSections(in tableView: UITableView) -> Int {
33 | return 1
34 | }
35 |
36 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
37 | return objects.count
38 | }
39 |
40 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
41 | let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as UITableViewCell
42 |
43 | let object = objects[(indexPath as NSIndexPath).row] as Date
44 | cell.textLabel!.text = object.description
45 | return cell
46 | }
47 |
48 | override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
49 | // Return false if you do not want the specified item to be editable.
50 | return true
51 | }
52 |
53 | override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
54 | if editingStyle == .delete {
55 | objects.removeObject(at: indexPath.row)
56 | tableView.deleteRows(at: [indexPath], with: .fade)
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/Project Files/OrderedSetTests/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 |
--------------------------------------------------------------------------------
/Project Files/OrderedSetTests/OrderedSet_Tests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // OrderedSet_Tests.swift
3 | // Weebly
4 | //
5 | // Created by James Richard on 10/22/14.
6 | // Copyright (c) 2014 Weebly. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | import OrderedSet
11 |
12 | class OrderedSet_Tests: XCTestCase {
13 |
14 | //TODO: add tests for more Swift 2.x default SequenceType and Collection implementations
15 |
16 | // MARK: Count
17 |
18 | func testCount_withoutObjects_is0() {
19 | let subject = OrderedSet()
20 | XCTAssertEqual(subject.count, 0)
21 | }
22 |
23 | // MARK: isEmpty
24 |
25 | func testIsEmpty_whenEmpty_isTrue() {
26 | let subject = OrderedSet()
27 | XCTAssertTrue(subject.isEmpty)
28 | }
29 |
30 | func testIsEmpty_whenEmptyNotEmpty_isFalse() {
31 | let subject = OrderedSet(sequence: ["One"])
32 | XCTAssertFalse(subject.isEmpty)
33 | }
34 |
35 | // MARK: Append
36 |
37 | func testAppend_increasesCount() {
38 | var subject = OrderedSet()
39 | subject.append("Test")
40 | XCTAssertEqual(subject.count, 1)
41 | }
42 |
43 | func testAppend_withSameObjectTwice_keepsCountAs1() {
44 | var subject = OrderedSet()
45 | subject.append("Test")
46 | subject.append("Test")
47 | XCTAssertEqual(subject.count, 1)
48 | }
49 |
50 | // MARK: Subscript
51 |
52 | func testObjectSubscript_returnsCorrectObject() {
53 | var subject = OrderedSet()
54 | subject.append("Test")
55 | XCTAssert(subject[0] == "Test")
56 | }
57 |
58 | func testSubscriptInsertion_replacesObject() {
59 | var subject = OrderedSet(sequence: ["One", "Two", "Three"])
60 | subject[1] = "wat"
61 | XCTAssertEqual(subject.count, 3)
62 | XCTAssert(subject[0] == "One")
63 | XCTAssert(subject[1] == "wat")
64 | XCTAssert(subject[2] == "Three")
65 | }
66 |
67 | func testSubscriptSetting_iteratesCorrectly() {
68 | var subject: OrderedSet = [0, 1, 2]
69 | subject[1] = 0
70 | var contents = [Int]()
71 | for i in subject {
72 | contents.append(i)
73 | }
74 |
75 | XCTAssertEqual(contents.count, 2)
76 | XCTAssertEqual(contents[0], 0)
77 | XCTAssertEqual(contents[1], 2)
78 | }
79 |
80 | func testSubscriptAssignObjectAtIndex_doesNotAffectOtherSet() {
81 | let other: OrderedSet = ["One"]
82 | var subject = other
83 | subject[0] = "Two"
84 | XCTAssertNotEqual(subject, other)
85 | }
86 |
87 | // MARK: Contains
88 |
89 | func testContains_whenObjectIsContained_isTrue() {
90 | var subject = OrderedSet()
91 | subject.append("Test")
92 | XCTAssertTrue(subject.contains("Test"))
93 | }
94 |
95 | func testContains_whenObjectIsNotContained_isFalse() {
96 | let subject = OrderedSet()
97 | XCTAssertFalse(subject.contains("Test"))
98 | }
99 |
100 | // MARK: Enumeration
101 |
102 | func testEnumeration_enumeratesAllObjectsInOrder() {
103 | let subject = OrderedSet(sequence: ["One", "Two", "Three"])
104 | var enumeratedObjects = [String]()
105 | for object in subject {
106 | enumeratedObjects.append(object)
107 | }
108 |
109 | let expected = ["One", "Two", "Three"]
110 |
111 | XCTAssertEqual(enumeratedObjects, expected)
112 | }
113 |
114 | // MARK: Init With Sequence
115 |
116 | func testInitWithSequence_withDuplicates_onlyCountsThemOnce() {
117 | let subject = OrderedSet(sequence: ["One", "Two", "Two", "Four"])
118 | XCTAssertEqual(subject.count, 3)
119 | }
120 |
121 | func testInitWithSequence_withDuplicates_doesntChangeIndexAfterFirst() {
122 | let subject = OrderedSet(sequence: ["One", "Two", "Two", "Four"])
123 | XCTAssert(subject[0] == "One")
124 | XCTAssert(subject[1] == "Two")
125 | XCTAssert(subject[2] == "Four")
126 | }
127 |
128 | // MARK: Init With Array Literal
129 |
130 | func testInitializingWithArrayLiteral_includesItemsInOrder() {
131 | let subject: OrderedSet = ["One", "Two"]
132 | var enumeratedObjects = [String]()
133 | for object in subject {
134 | enumeratedObjects.append(object)
135 | }
136 |
137 | let expected = ["One", "Two"]
138 |
139 | XCTAssertEqual(enumeratedObjects, expected)
140 | }
141 |
142 | // MARK: Index Of Object
143 |
144 | func testIndexOfObject_whenObjectExists_isCorrectIndex() {
145 | let subject = OrderedSet(sequence: ["One", "Two", "Three"])
146 | XCTAssert(subject.index(of: "Three") == 2)
147 | }
148 |
149 | func testIndexOfObject_whenObjectDoesntExist_isNil() {
150 | let subject = OrderedSet(sequence: ["One", "Two", "Three"])
151 | XCTAssertNil(subject.index(of: "Four"))
152 | }
153 |
154 | // MARK: Remove
155 |
156 | func testRemove_whenObjectExists_reducesCount() {
157 | var subject = OrderedSet(sequence: ["One", "Two", "Three"])
158 | subject.remove("Two")
159 | XCTAssertEqual(subject.count, 2)
160 | }
161 |
162 | func testRemove_whenObjectDoesntExist_doesntChangeCount() {
163 | var subject = OrderedSet(sequence: ["One", "Two", "Three"])
164 | subject.remove("Twoz")
165 | XCTAssertEqual(subject.count, 3)
166 | }
167 |
168 | func testRemove_whenObjectIsNotLast_updatesOrdering() {
169 | var subject = OrderedSet(sequence: ["One", "Two", "Three", "Four"])
170 | subject.remove("Two")
171 | XCTAssert(subject[0] == "One")
172 | XCTAssert(subject[1] == "Three")
173 | XCTAssert(subject[2] == "Four")
174 | }
175 |
176 | // MARK: Remove Objects
177 |
178 | func testRemoveObjects_removesPassedInObjects() {
179 | var subject = OrderedSet(sequence: ["One", "Two", "Three", "Four"])
180 | subject.remove(["Two", "Four"])
181 | let expected: OrderedSet = ["One", "Three"]
182 | XCTAssertEqual(subject, expected)
183 | }
184 |
185 | func testRemoveObjects_returnsCollectionOfCorrectIndexPositions() {
186 | var subject = OrderedSet(sequence: ["One", "Two", "Three", "Four"])
187 | let indexes = subject.remove(["Two", "Four"])
188 | XCTAssertEqual(indexes, [1, 3])
189 | }
190 |
191 | func testRemoveObjects__whenAnObjectDoesntExist_returnsCollectionOfCorrectIndexPositions() {
192 | var subject = OrderedSet(sequence: ["One", "Two", "Three", "Four"])
193 | let indexes = subject.remove(["Two", "Three", "Six"])
194 | XCTAssertEqual(indexes, [1, 2])
195 | }
196 |
197 | func testRemoveObjects__whenRemovingSameObjectFromTwoSets_doesNotCrash() {
198 | var original = OrderedSet(sequence: ["One"])
199 | var subject = original
200 | original.remove("One")
201 | subject.remove("One")
202 | }
203 |
204 | // MARK: Remove Object At Index
205 |
206 | func testRemoveObjectAtIndex_removesTheObjectAtIndex() {
207 | var subject = OrderedSet(sequence: ["One", "Two", "Three", "Four"])
208 | subject.removeObject(at: 1)
209 | let expected: OrderedSet = ["One", "Three", "Four"]
210 | XCTAssertEqual(subject, expected)
211 | }
212 |
213 | // MARK: Index of removed Object
214 |
215 | func testRemoveObject_returnsCorrectIndex() {
216 | var subject = OrderedSet(sequence: ["One", "Two", "Three"])
217 | let index = subject.remove("Two")
218 | XCTAssertEqual(index, 1)
219 | }
220 |
221 | // MARK: Remove All Objects
222 |
223 | func testRemoveAllObjects_removesAllObjectsThatSatisfyGivenPredicate() {
224 | var subject = OrderedSet(sequence: ["One", "Two", "Three"])
225 | let removedObjects = subject.removeAllObjects(where: { $0.hasPrefix("T") })
226 | let expected: OrderedSet = ["One"]
227 | XCTAssertEqual(subject, expected)
228 | let expectedRemovedObjects: OrderedSet = ["Two", "Three"]
229 | XCTAssertEqual(removedObjects, expectedRemovedObjects)
230 | }
231 |
232 | func testRemoveAllObjects_removesAllObjects() {
233 | var subject = OrderedSet(sequence: ["One", "Two", "Three"])
234 | subject.removeAllObjects()
235 | XCTAssertEqual(subject.count, 0)
236 | }
237 |
238 | // MARK: Intersects Sequence
239 |
240 | func testIntersectsSequence_withoutIntersection_isFalse() {
241 | let subject = OrderedSet(sequence: ["One", "Two", "Three"])
242 | XCTAssertFalse(subject.intersects(["Four"]))
243 | }
244 |
245 | func testIntersectsSequence_withIntersection_isTrue() {
246 | let subject = OrderedSet(sequence: ["One", "Two", "Three"])
247 | XCTAssertTrue(subject.intersects(["Two"]))
248 | }
249 |
250 | // MARK: Is Subset Of Sequence
251 |
252 | func testIsSubsetOfSequence_whenIsSubset_isTrue() {
253 | let subject = OrderedSet(sequence: ["One", "Two", "Three"])
254 | XCTAssertTrue(subject.isSubset(of: ["Three", "Two", "One"]))
255 | }
256 |
257 | func testIsSubsetOfSequence_whenIsSubset_andContainsDuplicates_isTrue() {
258 | let subject = OrderedSet(sequence: ["One", "Two", "Three"])
259 | XCTAssertTrue(subject.isSubset(of: ["Three", "Two", "One", "Three"]))
260 | }
261 |
262 | func testIsSubsetOfSequence_whenIsNotSubset_isFalse() {
263 | let subject = OrderedSet(sequence: ["One", "Two"])
264 | XCTAssertTrue(subject.isSubset(of: ["Three", "Two", "One"]))
265 | }
266 |
267 | // MARK: Concatenation
268 |
269 | func testConcatingOrderedSets_returnsJoinedSet() {
270 | let first: OrderedSet = ["One"]
271 | let second: OrderedSet = ["One", "Two"]
272 | let result = first + second
273 | XCTAssertEqual(result.count, 2)
274 | XCTAssert(result[0] == "One")
275 | XCTAssert(result[1] == "Two")
276 | }
277 |
278 | func testConcatAppendOrderedSets_returnsJoinedOrderedSet() {
279 | var subject: OrderedSet = ["One"]
280 | let second: OrderedSet = ["One", "Two"]
281 | subject += second
282 | XCTAssertEqual(subject.count, 2)
283 | XCTAssert(subject[0] == "One")
284 | XCTAssert(subject[1] == "Two")
285 | }
286 |
287 | // MARK: Decatenate
288 |
289 | func testDecatenate_removesMatchedObjects() {
290 | let subject: OrderedSet = ["One", "Two", "Three"]
291 | let second: OrderedSet = ["One", "Three"]
292 | let result = subject - second
293 | XCTAssertEqual(result.count, 1)
294 | XCTAssert(result[0] == "Two")
295 | }
296 |
297 | func testDecatenateEquals_removesMatchedObjects() {
298 | var subject: OrderedSet = ["One", "Two", "Three"]
299 | let second: OrderedSet = ["One", "Three"]
300 | subject -= second
301 | XCTAssertEqual(subject.count, 1)
302 | XCTAssert(subject[0] == "Two")
303 | }
304 |
305 | // MARK: Map
306 |
307 | func testMap_mapsEachObject() {
308 | let subject: OrderedSet = ["One", "Two", "Three"]
309 | let result = subject.map { $0.hashValue }
310 | let expected = ["One".hashValue, "Two".hashValue, "Three".hashValue]
311 | XCTAssertTrue(result == expected)
312 | }
313 |
314 | // MARK: Equality
315 |
316 | func testEquals_isTrue_whenEqual() {
317 | let first: OrderedSet = ["One", "Two", "Three"]
318 | let second: OrderedSet = ["One", "Two", "Three"]
319 | XCTAssertEqual(first, second)
320 | }
321 |
322 | func testEquals_isFalse_whenNotEqual() {
323 | let first: OrderedSet = ["One", "Two", "Three"]
324 | let second: OrderedSet = ["One", "Two", "Four"]
325 | XCTAssertNotEqual(first, second)
326 | }
327 |
328 | func testEquals_isFalse_whenFirstArrayIsLargerThanSecond() {
329 | let first: OrderedSet = ["One", "Two", "Three", "Four"]
330 | let second: OrderedSet = ["One", "Two", "Three"]
331 | XCTAssertNotEqual(first, second)
332 | }
333 |
334 | func testEquals_isFalse_whenSecondArrayIsLargerThanFirst() {
335 | let first: OrderedSet = ["One", "Two", "Three"]
336 | let second: OrderedSet = ["One", "Two", "Three", "Four"]
337 | XCTAssertNotEqual(first, second)
338 | }
339 |
340 | func testEquals_isFalse_whenSecondArrayIsDifferentOrderThanFirst() {
341 | let first: OrderedSet = ["One", "Two", "Three"]
342 | let second: OrderedSet = ["Three", "Two", "One"]
343 | XCTAssertNotEqual(first, second)
344 | }
345 |
346 | // MARK: First
347 |
348 | func testFirst_whenEmpty_isNil() {
349 | let subject = OrderedSet()
350 | XCTAssert(subject.first == nil)
351 | }
352 |
353 | func testFirst_whenNotEmpty_isFirstElement() {
354 | let subject: OrderedSet = ["One", "Two", "Three"]
355 | XCTAssert(subject.first == "One")
356 | }
357 |
358 | // MARK: Last
359 |
360 | func testLast_whenEmpty_isNil() {
361 | let subject = OrderedSet()
362 | XCTAssert(subject.last == nil)
363 | }
364 |
365 | func testLast_whenNotEmpty_isFirstElement() {
366 | let subject: OrderedSet = ["One", "Two", "Three"]
367 | XCTAssert(subject.last == "Three")
368 | }
369 |
370 | // MARK: - Swap Object
371 |
372 | func testSwapObject_whenBothObjectsExist_swapsBothObjects() {
373 | var subject: OrderedSet = ["One", "Two", "Three"]
374 | subject.swapObject("One", with: "Three")
375 | let expected: OrderedSet = ["Three", "Two", "One"]
376 | XCTAssertEqual(subject, expected)
377 | }
378 |
379 | func testSwapObject_whenOneObjectsExist_doesntChangeSet() {
380 | var subject: OrderedSet = ["One", "Two", "Three"]
381 | subject.swapObject("One", with: "Four")
382 | let expected: OrderedSet = ["One", "Two", "Three"]
383 | XCTAssertEqual(subject, expected)
384 | }
385 |
386 | // MARK: Move Object to Index
387 |
388 | func testMoveObjectToIndex_whenObjectExists_whenMovingAmongEntireSet_movesObjectUp_andShiftsOthersDown() {
389 | var subject: OrderedSet = ["One", "Two", "Three"]
390 | subject.moveObject("One", toIndex: 2)
391 | let expected: OrderedSet = ["Two", "Three", "One"]
392 | XCTAssertEqual(subject, expected)
393 | }
394 |
395 | func testMoveObjectToIndex_whenObjectExists_whenMovingAmongEntireSet_movesObjectDown_andShiftsOthersUp() {
396 | var subject: OrderedSet = ["One", "Two", "Three"]
397 | subject.moveObject("Three", toIndex: 0)
398 | let expected: OrderedSet = ["Three", "One", "Two"]
399 | XCTAssertEqual(subject, expected)
400 | }
401 |
402 | func testMoveObjectToIndex_whenObjectExists_whenMovingAmongSubsetOfSet_movesObjectUp_andShiftsTraversedObjectsDown() {
403 | var subject: OrderedSet = ["One", "Two", "Three", "Four", "Five"]
404 | subject.moveObject("Four", toIndex: 1)
405 | let expected: OrderedSet = ["One", "Four", "Two", "Three", "Five"]
406 | XCTAssertEqual(subject, expected)
407 | }
408 |
409 | func testMoveObjectToIndex_whenObjectExists_whenMovingAmongSubsetOfSet_movesObjectDown_andShiftsTraversedObjectsUp() {
410 | var subject: OrderedSet = ["One", "Two", "Three", "Four", "Five"]
411 | subject.moveObject("Two", toIndex: 3)
412 | let expected: OrderedSet = ["One", "Three", "Four", "Two", "Five"]
413 | XCTAssertEqual(subject, expected)
414 | }
415 |
416 | func testMoveObjectToIndex_whenObjectDoesntExist_isNoop() {
417 | var subject: OrderedSet = ["One", "Two", "Three"]
418 | subject.moveObject("Four", toIndex: 0)
419 | let expected: OrderedSet = ["One", "Two", "Three"]
420 | XCTAssertEqual(subject, expected)
421 | }
422 |
423 | func testMoveObjectToIndex_whenObjectIsSameIndex_isNoop() {
424 | var subject: OrderedSet = ["One", "Two", "Three"]
425 | subject.moveObject("One", toIndex: 0)
426 | let expected: OrderedSet = ["One", "Two", "Three"]
427 | XCTAssertEqual(subject, expected)
428 | }
429 |
430 | func testMoveObject_withFullMove_mapsCorrectly() {
431 | var subject: OrderedSet = ["One", "Two", "Three", "Four", "Five"]
432 | subject.moveObject("One", toIndex: 4)
433 | XCTAssertEqual(subject.map { $0 }, ["Two", "Three", "Four", "Five", "One"])
434 | }
435 |
436 | func testMoveObject_withInnerMove_mapsCorrectly() {
437 | var subject: OrderedSet = ["p0", "p1", "c1", "p2", "p3", "c2"]
438 | subject.moveObject("p2", toIndex: 1)
439 | XCTAssertEqual(subject.map { $0 }, ["p0", "p2", "p1", "c1", "p3", "c2"])
440 | }
441 |
442 | // MARK: Insert Object at Index
443 |
444 | func testMoveObjectAtIndex_whenObjectExists_whenMovingAmongEntireSet_movesObjectUp_andShiftsOthersDown() {
445 | var subject: OrderedSet = ["One", "Two", "Three"]
446 | subject.moveObject(at: 0, to: 2)
447 | let expected: OrderedSet = ["Two", "Three", "One"]
448 | XCTAssertEqual(subject, expected)
449 | }
450 |
451 | func testMoveObjectAtIndex_whenObjectExists_whenMovingAmongEntireSet_movesObjectDown_andShiftsOthersUp() {
452 | var subject: OrderedSet = ["One", "Two", "Three"]
453 | subject.moveObject(at: 2, to: 0)
454 | let expected: OrderedSet = ["Three", "One", "Two"]
455 | XCTAssertEqual(subject, expected)
456 | }
457 |
458 | func testMoveObjectAtIndex_whenObjectExists_whenMovingAmongSubsetOfSet_movesObjectUp_andShiftsTraversedObjectsDown() {
459 | var subject: OrderedSet = ["One", "Two", "Three", "Four", "Five"]
460 | subject.moveObject(at: 3, to: 1)
461 | let expected: OrderedSet = ["One", "Four", "Two", "Three", "Five"]
462 | XCTAssertEqual(subject, expected)
463 | }
464 |
465 | func testMoveObjectAtIndex_whenObjectExists_whenMovingAmongSubsetOfSet_movesObjectDown_andShiftsTraversedObjectsUp() {
466 | var subject: OrderedSet = ["One", "Two", "Three", "Four", "Five"]
467 | subject.moveObject(at: 1, to: 3)
468 | let expected: OrderedSet = ["One", "Three", "Four", "Two", "Five"]
469 | XCTAssertEqual(subject, expected)
470 | }
471 |
472 | func testMoveObjectAtIndex_whenSameIndexes_isNoop() {
473 | var subject: OrderedSet = ["One", "Two", "Three"]
474 | subject.moveObject(at: 0, to: 0)
475 | let expected: OrderedSet = ["One", "Two", "Three"]
476 | XCTAssertEqual(subject, expected)
477 | }
478 |
479 | func testInsertObjectAtIndex_whenObjectDoesntExist_insertsObjectAtCorrectSpot() {
480 | var subject: OrderedSet = ["One", "Two", "Three"]
481 | subject.insert("Zero", at: 0)
482 | let expected: OrderedSet = ["Zero", "One", "Two", "Three"]
483 | XCTAssertEqual(subject, expected)
484 | }
485 |
486 | func testInsertObjectAtIndex_whenObjectDoesExist_isNoop() {
487 | var subject: OrderedSet = ["One", "Two", "Three"]
488 | subject.insert("Two", at: 0)
489 | let expected: OrderedSet = ["One", "Two", "Three"]
490 | XCTAssertEqual(subject, expected)
491 | }
492 |
493 | func testInsertObjectAtIndex_canInsertObjectAtTail() {
494 | var subject: OrderedSet = ["One", "Two", "Three"]
495 | subject.insert("Four", at: 3)
496 | let expected: OrderedSet = ["One", "Two", "Three", "Four"]
497 | XCTAssertEqual(subject, expected)
498 | }
499 |
500 | // MARK: Insert Objects at Index
501 |
502 | func testInsertObjectsAtIndex_whenObjectsDontExist_insertsObjectsAtCorrectSpot() {
503 | var subject: OrderedSet = ["One", "Two", "Three"]
504 | subject.insert(["Foo", "Bar"], at: 1)
505 | let expected: OrderedSet = ["One", "Foo", "Bar", "Two", "Three"]
506 | XCTAssertEqual(subject, expected)
507 | }
508 |
509 | func testInsertObjectsAtIndex_whenSomeObjectsExist_insertsOnlyNonExistingObjectsAtCorrectSpot() {
510 | var subject: OrderedSet = ["One", "Two", "Three"]
511 | subject.insert(["Foo", "Three"], at: 1)
512 | let expected: OrderedSet = ["One", "Foo", "Two", "Three"]
513 | XCTAssertEqual(subject, expected)
514 | }
515 |
516 | func testInsertObjectsAtIndex_whenRepeatedObjectsAreInserted_insertsOnlyOne() {
517 | var subject: OrderedSet = ["One", "Two", "Three"]
518 | subject.insert(["Foo", "Foo"], at: 1)
519 | let expected: OrderedSet = ["One", "Foo", "Two", "Three"]
520 | XCTAssertEqual(subject, expected)
521 | }
522 |
523 | func testInsertObjectsAtIndex_canInsertObjectAtTail() {
524 | var subject: OrderedSet = ["One", "Two", "Three"]
525 | subject.insert(["Four", "Five"], at: 3)
526 | let expected: OrderedSet = ["One", "Two", "Three", "Four", "Five"]
527 | XCTAssertEqual(subject, expected)
528 | }
529 |
530 | // MARK: Append Objects
531 |
532 | func testAppendObjects_whenObjectsDontExist_appendsAllObjects() {
533 | var subject: OrderedSet = ["One", "Two", "Three"]
534 | subject.append(contentsOf: ["Foo", "Bar"])
535 | let expected: OrderedSet = ["One", "Two", "Three", "Foo", "Bar"]
536 | XCTAssertEqual(subject, expected)
537 | }
538 |
539 | func testAppendObjects_whenSomeObjectsExist_appendsOnlyNonExistingObjects() {
540 | var subject: OrderedSet = ["One", "Two", "Three"]
541 | subject.append(contentsOf: ["Foo", "Two"])
542 | let expected: OrderedSet = ["One", "Two", "Three", "Foo"]
543 | XCTAssertEqual(subject, expected)
544 | }
545 |
546 | func testAppendObjects_whenRepeatedObjectsAreAppended_appendsOnlyOne() {
547 | var subject: OrderedSet = ["One", "Two", "Three"]
548 | subject.append(contentsOf: ["Foo", "Foo"])
549 | let expected: OrderedSet = ["One", "Two", "Three", "Foo"]
550 | XCTAssertEqual(subject, expected)
551 | }
552 |
553 | // MARK: Description
554 |
555 | func testDescription_printsDescription() {
556 | let subject: OrderedSet = ["One", "Two", "Three"]
557 | XCTAssertEqual(subject.description, "OrderedSet (3 object(s)): [One, Two, Three]")
558 | }
559 |
560 | // MARK: Operator Overloads
561 |
562 | func testAddOperator_appendsSequence() {
563 | let initial: OrderedSet = ["One", "Two"]
564 | let subject = initial + ["Three"]
565 |
566 | XCTAssertEqual(initial, ["One", "Two"])
567 | XCTAssertEqual(subject, ["One", "Two", "Three"])
568 | }
569 |
570 | func testAddInPlaceOperator_appendsSequence() {
571 | var subject: OrderedSet = ["One", "Two"]
572 | subject += ["Three"]
573 |
574 | XCTAssertEqual(subject, ["One", "Two", "Three"])
575 | }
576 |
577 | func testSubtractOperator_removesSequence() {
578 | let initial: OrderedSet = ["One", "Two", "Three"]
579 | let subject = initial - ["Three"]
580 |
581 | XCTAssertEqual(initial, ["One", "Two", "Three"])
582 | XCTAssertEqual(subject, ["One", "Two"])
583 | }
584 |
585 | func testSubtractInPlaceOperator_removesSequence() {
586 | var subject: OrderedSet = ["One", "Two", "Three"]
587 | subject -= ["Three"]
588 |
589 | XCTAssertEqual(subject, ["One", "Two"])
590 | }
591 |
592 | }
593 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | OrderedSet is essentially the Swift equivalent of Foundation's NSOrderedSet/NSMutableOrderedSet. It was created so Swift would have a unique, ordered collection with fast lookup performance that supported strong typing through Generics, and so we could store Swift structs and enums in it.
4 |
5 | # Usage
6 |
7 | OrderedSet works very much like an Array. Here are some basic examples of its usage:
8 |
9 | ```swift
10 | var set = OrderedSet()
11 | set.append(1)
12 | set.contains(1) // => true
13 | set[0] = 2
14 | set[0] // => 2
15 | set.insert(3, at: 0)
16 | set // => [3, 2]
17 | set = [1,2,3] // OrderedSet's support array literals
18 | set // => [1, 2, 3]
19 | set += [3, 4] // You can concatenate any sequence type to an OrderedSet
20 | set // => [1, 2, 3, 4] (Since 3 was already in the set it was not added again)
21 | ```
22 |
23 | Its also recommended that you use the instance methods when possible instead of the global Swift methods for searching an OrderedSet. For example, the Swift.contains(haystack, needle) method will enumerate the OrderedSet instead of making use of the fast lookup implementation that the OrderedSet.contains(needle) method will do.
24 |
25 | Be sure to check out the unit tests to see all the different ways to interact with an OrderedSet in action. You can also check out the sample project, which tweaks the default master/detail project to use an OrderedSet instead of an Array.
26 |
27 | # Installation
28 |
29 | OrderedSet is a single Swift file in the Sources directory. You can copy that file into your project, or use via CocoaPods by adding the following line to your Podfile:
30 |
31 | ```ruby
32 | pod 'OrderedSet', '5.0'
33 | ```
34 |
35 | or use via Carthage by adding
36 |
37 | ```
38 | github "Weebly/OrderedSet"
39 | ```
40 |
41 | to your Cartfile and embedding the OrderedSet.framework in your app.
42 |
43 | And then add the following import where you want to use OrderedSet:
44 |
45 | ```swift
46 | import OrderedSet
47 | ```
48 |
49 |
50 | Using SwiftPM:
51 | ```swift
52 | package.append(.package(url: "https://github.com/Weebly/OrderedSet.git", .upToNextMajor(from: "5.0.0")))
53 | ```
54 |
55 | # License
56 |
57 | OrderedSet is available under the MIT license. See the LICENSE file for more info.
58 |
59 | # CONTRIBUTING
60 |
61 | We love to have your help to make OrderedSet better. Feel free to
62 |
63 | * open an issue if you run into any problem.
64 | * fork the project and submit pull request.
65 |
66 |
--------------------------------------------------------------------------------
/Sources/OrderedSet.swift:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2014 James Richard.
2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT).
3 |
4 | /// An ordered, unique collection of objects.
5 | public struct OrderedSet {
6 | fileprivate var contents = [T: Index]() // Needs to have a value of Index instead of Void for fast removals
7 | fileprivate var sequencedContents = SequencedContents()
8 |
9 | fileprivate class SequencedContents {
10 | fileprivate var pointers = [UnsafeMutablePointer]()
11 |
12 | func append(_ element: UnsafeMutablePointer) {
13 | pointers.append(element)
14 | }
15 |
16 | func index(after i: Int) -> Int {
17 | return pointers.index(after: i)
18 | }
19 |
20 | func insert(_ element: UnsafeMutablePointer, at i: Int) {
21 | pointers.insert(element, at: i)
22 | }
23 |
24 | var last: UnsafeMutablePointer? {
25 | return pointers.last
26 | }
27 |
28 | @discardableResult
29 | func remove(at i: Int) -> UnsafeMutablePointer {
30 | return pointers.remove(at: i)
31 | }
32 |
33 | func removeAll() {
34 | pointers.removeAll()
35 | }
36 |
37 | subscript(_ i: Int) -> UnsafeMutablePointer {
38 | get { return pointers[i] }
39 | set { pointers[i] = newValue }
40 | }
41 |
42 | func copy() -> SequencedContents {
43 | let copy = SequencedContents()
44 | copy.pointers.reserveCapacity(pointers.count)
45 | for p in pointers {
46 | let newP = UnsafeMutablePointer.allocate(capacity: 1)
47 | newP.initialize(from: p, count: 1)
48 | copy.pointers.append(newP)
49 | }
50 | return copy
51 | }
52 | }
53 |
54 | /**
55 | Inititalizes an empty ordered set.
56 | - returns: An empty ordered set.
57 | */
58 | public init() { }
59 |
60 | /**
61 | Initializes a new ordered set with the order and contents
62 | of sequence.
63 | If an object appears more than once in the sequence it will only appear
64 | once in the ordered set, at the position of its first occurance.
65 | - parameter sequence: The sequence to initialize the ordered set with.
66 | - returns: An initialized ordered set with the contents of sequence.
67 | */
68 | public init(sequence: S) where S.Iterator.Element == T {
69 | for object in sequence where contents[object] == nil {
70 | contents[object] = contents.count
71 |
72 | let pointer = UnsafeMutablePointer.allocate(capacity: 1)
73 | pointer.initialize(to: object)
74 | sequencedContents.append(pointer)
75 | }
76 | }
77 |
78 | public init(arrayLiteral elements: T...) {
79 | for object in elements where contents[object] == nil {
80 | contents[object] = contents.count
81 |
82 | let pointer = UnsafeMutablePointer.allocate(capacity: 1)
83 | pointer.initialize(to: object)
84 | sequencedContents.append(pointer)
85 | }
86 | }
87 |
88 | /**
89 | Locate the index of an object in the ordered set.
90 | It is preferable to use this method over the global find() for performance reasons.
91 | - parameter object: The object to find the index for.
92 | - returns: The index of the object, or nil if the object is not in the ordered set.
93 | */
94 | public func index(of object: T) -> Index? {
95 | if let index = contents[object] {
96 | return index
97 | }
98 |
99 | return nil
100 | }
101 |
102 | /**
103 | Appends an object to the end of the ordered set.
104 | - parameter object: The object to be appended.
105 | */
106 | public mutating func append(_ object: T) {
107 |
108 | if let lastIndex = index(of: object) {
109 | remove(object)
110 | insert(object, at: lastIndex)
111 | } else {
112 | contents[object] = contents.count
113 |
114 | if !isKnownUniquelyReferenced(&sequencedContents) {
115 | sequencedContents = sequencedContents.copy()
116 | }
117 | let pointer = UnsafeMutablePointer.allocate(capacity: 1)
118 | pointer.initialize(to: object)
119 | sequencedContents.append(pointer)
120 | }
121 | }
122 |
123 | /**
124 | Appends a sequence of objects to the end of the ordered set.
125 | - parameter sequence: The sequence of objects to be appended.
126 | */
127 | public mutating func append(contentsOf sequence: S) where S.Iterator.Element == T {
128 | var gen = sequence.makeIterator()
129 | while let object: T = gen.next() {
130 | append(object)
131 | }
132 | }
133 |
134 | /**
135 | Removes an object from the ordered set.
136 | If the object exists in the ordered set, it will be removed.
137 | If it is not the last object in the ordered set, subsequent
138 | objects will be shifted down one position.
139 | - parameter object: The object to be removed.
140 | - returns: The former index position of the object.
141 | */
142 | @discardableResult
143 | public mutating func remove(_ object: T) -> Index? {
144 | if let index = contents[object] {
145 | contents[object] = nil
146 |
147 | if !isKnownUniquelyReferenced(&sequencedContents) {
148 | sequencedContents = sequencedContents.copy()
149 | }
150 | sequencedContents[index].deinitialize(count: 1)
151 | sequencedContents[index].deallocate()
152 | sequencedContents.remove(at: index)
153 |
154 | for (object, i) in contents {
155 | if i < index {
156 | continue
157 | }
158 |
159 | contents[object] = i - 1
160 | }
161 |
162 | return index
163 | }
164 | return nil
165 | }
166 |
167 | /**
168 | Removes the given objects from the ordered set.
169 | - parameter objects: The objects to be removed.
170 | - returns: A collection of the former index positions of the objects. An index position is not provided for objects that were not found.
171 | */
172 | @discardableResult
173 | public mutating func remove(_ objects: S) -> [Index]? where S.Iterator.Element == T {
174 |
175 | var indexes = [Index]()
176 | objects.forEach { object in
177 | if let index = index(of: object) {
178 | indexes.append(index)
179 | }
180 | }
181 |
182 | var gen = objects.makeIterator()
183 | while let object: T = gen.next() {
184 | remove(object)
185 | }
186 | return indexes
187 | }
188 |
189 | /**
190 | Removes an object at a given index.
191 | This method will cause a fatal error if you attempt to move an object to an index that is out of bounds.
192 | - parameter index: The index of the object to be removed.
193 | */
194 | public mutating func removeObject(at index: Index) {
195 | if index < 0 || index >= count {
196 | fatalError("Attempting to remove an object at an index that does not exist")
197 | }
198 |
199 | remove(sequencedContents[index].pointee)
200 | }
201 |
202 | /**
203 | Removes all objects that satisfy the given predicate in the ordered set.
204 | - parameter shouldBeRemoved: A closure that takes an object in the ordered set as its argument and returns a Boolean value indicating whether the object should be removed from the ordered set.
205 | - returns: The objects that were removed from the ordered set.
206 | */
207 | @discardableResult
208 | public mutating func removeAllObjects(where shouldBeRemoved: (T) -> Bool) -> OrderedSet {
209 |
210 | var removedObjects = OrderedSet()
211 | var pointers = sequencedContents.pointers.makeIterator()
212 | while let object = pointers.next()?.pointee {
213 | if shouldBeRemoved(object) {
214 | remove(object)
215 | removedObjects.append(object)
216 | }
217 | }
218 | return removedObjects
219 | }
220 |
221 | /**
222 | Removes all objects in the ordered set.
223 | */
224 | public mutating func removeAllObjects() {
225 | contents.removeAll()
226 |
227 | if !isKnownUniquelyReferenced(&sequencedContents) {
228 | sequencedContents = sequencedContents.copy()
229 | }
230 | for sequencedContent in sequencedContents.pointers {
231 | sequencedContent.deinitialize(count: 1)
232 | sequencedContent.deallocate()
233 | }
234 |
235 | sequencedContents.removeAll()
236 | }
237 |
238 | /**
239 | Swaps two objects contained within the ordered set.
240 | Both objects must exist within the set, or the swap will not occur.
241 | - parameter first: The first object to be swapped.
242 | - parameter second: The second object to be swapped.
243 | */
244 | public mutating func swapObject(_ first: T, with second: T) {
245 | if let firstPosition = contents[first] {
246 | if let secondPosition = contents[second] {
247 | contents[first] = secondPosition
248 | contents[second] = firstPosition
249 |
250 | if !isKnownUniquelyReferenced(&sequencedContents) {
251 | sequencedContents = sequencedContents.copy()
252 | }
253 | sequencedContents[firstPosition].pointee = second
254 | sequencedContents[secondPosition].pointee = first
255 | }
256 | }
257 | }
258 |
259 | /**
260 | Tests if the ordered set contains any objects within a sequence.
261 | - parameter other: The sequence to look for the intersection in.
262 | - returns: Returns true if the sequence and set contain any equal objects, otherwise false.
263 | */
264 | public func intersects(_ other: S) -> Bool where S.Iterator.Element == T {
265 | var gen = other.makeIterator()
266 | while let object: T = gen.next() {
267 | if contains(object) {
268 | return true
269 | }
270 | }
271 |
272 | return false
273 | }
274 |
275 | /**
276 | Tests if a the ordered set is a subset of another sequence.
277 | - parameter sequence: The sequence to check.
278 | - returns: true if the sequence contains all objects contained in the receiver, otherwise false.
279 | */
280 | public func isSubset(of sequence: S) -> Bool where S.Iterator.Element == T {
281 | for (object, _) in contents {
282 | if !sequence.contains(object) {
283 | return false
284 | }
285 | }
286 |
287 | return true
288 | }
289 |
290 | /**
291 | Moves an object to a different index, shifting all objects in between the movement.
292 | This method is a no-op if the object doesn't exist in the set or the index is the
293 | same that the object is currently at.
294 | This method will cause a fatal error if you attempt to move an object to an index that is out of bounds.
295 | - parameter object: The object to be moved
296 | - parameter index: The index that the object should be moved to.
297 | */
298 | public mutating func moveObject(_ object: T, toIndex index: Index) {
299 | if index < 0 || index >= count {
300 | fatalError("Attempting to move an object at an index that does not exist")
301 | }
302 |
303 | if let position = contents[object] {
304 | // Return if the client attempted to move to the current index
305 | if position == index {
306 | return
307 | }
308 |
309 | let adjustment = position > index ? -1 : 1
310 |
311 | if !isKnownUniquelyReferenced(&sequencedContents) {
312 | sequencedContents = sequencedContents.copy()
313 | }
314 |
315 | var currentIndex = position
316 | while currentIndex != index {
317 | let nextIndex = currentIndex + adjustment
318 |
319 | let firstObject = sequencedContents[currentIndex].pointee
320 | let secondObject = sequencedContents[nextIndex].pointee
321 |
322 | sequencedContents[currentIndex].pointee = secondObject
323 | sequencedContents[nextIndex].pointee = firstObject
324 |
325 | contents[firstObject] = nextIndex
326 | contents[secondObject] = currentIndex
327 |
328 | currentIndex += adjustment
329 | }
330 | }
331 | }
332 |
333 | /**
334 | Moves an object from one index to a different index, shifting all objects in between the movement.
335 | This method is a no-op if the index is the same that the object is currently at.
336 | This method will cause a fatal error if you attempt to move an object fro man index that is out of bounds
337 | or to an index that is out of bounds.
338 | - parameter index: The index of the object to be moved.
339 | - parameter toIndex: The index that the object should be moved to.
340 | */
341 | public mutating func moveObject(at index: Index, to toIndex: Index) {
342 | if (index < 0 || index >= count) || (toIndex < 0 || toIndex >= count) {
343 | fatalError("Attempting to move an object at or to an index that does not exist")
344 | }
345 |
346 | moveObject(self[index], toIndex: toIndex)
347 | }
348 |
349 | /**
350 | Inserts an object at a given index, shifting all objects above it up one.
351 | This method will cause a fatal error if you attempt to insert the object out of bounds.
352 | If the object already exists in the OrderedSet, this operation is a no-op.
353 | - parameter object: The object to be inserted.
354 | - parameter index: The index to be inserted at.
355 | */
356 | public mutating func insert(_ object: T, at index: Index) {
357 | if index > count || index < 0 {
358 | fatalError("Attempting to insert an object at an index that does not exist")
359 | }
360 |
361 | if contents[object] != nil {
362 | return
363 | }
364 |
365 | // Append our object, then swap them until its at the end.
366 | append(object)
367 |
368 | for i in (index..(_ objects: S, at index: Index) where S.Iterator.Element == T {
382 | if index > count || index < 0 {
383 | fatalError("Attempting to insert an object at an index that does not exist")
384 | }
385 |
386 | var addedObjectCount = 0
387 |
388 | if !isKnownUniquelyReferenced(&sequencedContents) {
389 | sequencedContents = sequencedContents.copy()
390 | }
391 |
392 | for object in objects where contents[object] == nil {
393 | let seqIdx = index + addedObjectCount
394 | let element = UnsafeMutablePointer.allocate(capacity: 1)
395 | element.initialize(to: object)
396 | sequencedContents.insert(element, at: seqIdx)
397 | contents[object] = seqIdx
398 | addedObjectCount += 1
399 | }
400 |
401 | // Now we'll remove duplicates and update the shifted objects position in the contents
402 | // dictionary.
403 | for i in index + addedObjectCount.. 0 else { return nil }
430 | return sequencedContents[0].pointee
431 | }
432 |
433 | public func index(after index: Int) -> Int {
434 | return sequencedContents.index(after: index)
435 | }
436 |
437 | public typealias Index = Int
438 |
439 | public var startIndex: Int {
440 | return 0
441 | }
442 |
443 | public var endIndex: Int {
444 | return contents.count
445 | }
446 |
447 | public subscript(index: Index) -> T {
448 | get {
449 | return sequencedContents[index].pointee
450 | }
451 |
452 | set {
453 | if !isKnownUniquelyReferenced(&sequencedContents) {
454 | sequencedContents = sequencedContents.copy()
455 | }
456 |
457 | let previousCount = contents.count
458 | contents[sequencedContents[index].pointee] = nil
459 | contents[newValue] = index
460 |
461 | // If the count is reduced we used an existing value, and need to sync up sequencedContents
462 | if contents.count == previousCount {
463 | sequencedContents[index].pointee = newValue
464 | } else {
465 | sequencedContents[index].deinitialize(count: 1)
466 | sequencedContents[index].deallocate()
467 | sequencedContents.remove(at: index)
468 | }
469 | }
470 | }
471 |
472 | }
473 |
474 | public func + (lhs: OrderedSet, rhs: S) -> OrderedSet where S.Element == T {
475 | var joinedSet = lhs
476 | joinedSet.append(contentsOf: rhs)
477 |
478 | return joinedSet
479 | }
480 |
481 | public func += (lhs: inout OrderedSet, rhs: S) where S.Element == T {
482 | lhs.append(contentsOf: rhs)
483 | }
484 |
485 | public func - (lhs: OrderedSet, rhs: S) -> OrderedSet where S.Element == T {
486 | var purgedSet = lhs
487 | purgedSet.remove(rhs)
488 |
489 | return purgedSet
490 | }
491 |
492 | public func -= (lhs: inout OrderedSet, rhs: S) where S.Element == T {
493 | lhs.remove(rhs)
494 | }
495 |
496 | extension OrderedSet: Equatable { }
497 |
498 | public func == (lhs: OrderedSet, rhs: OrderedSet) -> Bool {
499 | if lhs.count != rhs.count {
500 | return false
501 | }
502 |
503 | for object in lhs where lhs.contents[object] != rhs.contents[object] {
504 | return false
505 | }
506 |
507 | return true
508 | }
509 |
510 | extension OrderedSet: CustomStringConvertible {
511 | public var description: String {
512 | let children = map({ "\($0)" }).joined(separator: ", ")
513 | return "OrderedSet (\(count) object(s)): [\(children)]"
514 | }
515 | }
516 |
517 | extension OrderedSet: RandomAccessCollection {}
518 |
--------------------------------------------------------------------------------