├── .gitignore
├── .swiftpm
└── xcode
│ └── package.xcworkspace
│ └── contents.xcworkspacedata
├── .travis.yml
├── Async.xcodeproj
├── AsyncTests_Info.plist
├── Async_Info.plist
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcshareddata
│ └── xcschemes
│ ├── Async.xcscheme
│ └── xcschememanagement.plist
├── AsyncPodsExample
├── AsyncExample OS X
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── ViewController.swift
├── AsyncExample iOS
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── ViewController.swift
├── AsyncExample tvOS
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── App Icon & Top Shelf Image.brandassets
│ │ │ ├── App Icon - Large.imagestack
│ │ │ │ ├── Back.imagestacklayer
│ │ │ │ │ ├── Content.imageset
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Front.imagestacklayer
│ │ │ │ │ ├── Content.imageset
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Middle.imagestacklayer
│ │ │ │ │ ├── Content.imageset
│ │ │ │ │ └── Contents.json
│ │ │ │ │ └── Contents.json
│ │ │ ├── App Icon - Small.imagestack
│ │ │ │ ├── Back.imagestacklayer
│ │ │ │ │ ├── Content.imageset
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Front.imagestacklayer
│ │ │ │ │ ├── Content.imageset
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Middle.imagestacklayer
│ │ │ │ │ ├── Content.imageset
│ │ │ │ │ └── Contents.json
│ │ │ │ │ └── Contents.json
│ │ │ ├── Contents.json
│ │ │ └── Top Shelf Image.imageset
│ │ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ └── Main.storyboard
│ ├── Info.plist
│ └── ViewController.swift
├── AsyncPodsExample.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── AsyncExample OS X.xcscheme
│ │ ├── AsyncExample iOS.xcscheme
│ │ └── AsyncExample tvOS.xcscheme
├── AsyncPodsExample.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Podfile
├── Podfile.lock
└── Pods
│ ├── Local Podspecs
│ └── AsyncSwift.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ └── project.pbxproj
│ └── Target Support Files
│ ├── AsyncSwift-iOS
│ ├── AsyncSwift-iOS-dummy.m
│ ├── AsyncSwift-iOS-prefix.pch
│ ├── AsyncSwift-iOS-umbrella.h
│ ├── AsyncSwift-iOS.modulemap
│ ├── AsyncSwift-iOS.xcconfig
│ └── Info.plist
│ ├── AsyncSwift-macOS
│ ├── AsyncSwift-macOS-dummy.m
│ ├── AsyncSwift-macOS-prefix.pch
│ ├── AsyncSwift-macOS-umbrella.h
│ ├── AsyncSwift-macOS.modulemap
│ ├── AsyncSwift-macOS.xcconfig
│ └── Info.plist
│ ├── AsyncSwift-tvOS
│ ├── AsyncSwift-tvOS-dummy.m
│ ├── AsyncSwift-tvOS-prefix.pch
│ ├── AsyncSwift-tvOS-umbrella.h
│ ├── AsyncSwift-tvOS.modulemap
│ ├── AsyncSwift-tvOS.xcconfig
│ └── Info.plist
│ ├── Pods-AsyncExample OS X
│ ├── Info.plist
│ ├── Pods-AsyncExample OS X-acknowledgements.markdown
│ ├── Pods-AsyncExample OS X-acknowledgements.plist
│ ├── Pods-AsyncExample OS X-dummy.m
│ ├── Pods-AsyncExample OS X-frameworks.sh
│ ├── Pods-AsyncExample OS X-resources.sh
│ ├── Pods-AsyncExample OS X-umbrella.h
│ ├── Pods-AsyncExample OS X.debug.xcconfig
│ ├── Pods-AsyncExample OS X.modulemap
│ └── Pods-AsyncExample OS X.release.xcconfig
│ ├── Pods-AsyncExample iOS
│ ├── Info.plist
│ ├── Pods-AsyncExample iOS-acknowledgements.markdown
│ ├── Pods-AsyncExample iOS-acknowledgements.plist
│ ├── Pods-AsyncExample iOS-dummy.m
│ ├── Pods-AsyncExample iOS-frameworks.sh
│ ├── Pods-AsyncExample iOS-resources.sh
│ ├── Pods-AsyncExample iOS-umbrella.h
│ ├── Pods-AsyncExample iOS.debug.xcconfig
│ ├── Pods-AsyncExample iOS.modulemap
│ └── Pods-AsyncExample iOS.release.xcconfig
│ └── Pods-AsyncExample tvOS
│ ├── Info.plist
│ ├── Pods-AsyncExample tvOS-acknowledgements.markdown
│ ├── Pods-AsyncExample tvOS-acknowledgements.plist
│ ├── Pods-AsyncExample tvOS-dummy.m
│ ├── Pods-AsyncExample tvOS-frameworks.sh
│ ├── Pods-AsyncExample tvOS-resources.sh
│ ├── Pods-AsyncExample tvOS-umbrella.h
│ ├── Pods-AsyncExample tvOS.debug.xcconfig
│ ├── Pods-AsyncExample tvOS.modulemap
│ └── Pods-AsyncExample tvOS.release.xcconfig
├── AsyncSwift.podspec
├── Configs
├── Async-Debug.xcconfig
├── Async-Release.xcconfig
├── AsyncTests-Debug.xcconfig
├── AsyncTests-Release.xcconfig
├── Base-Debug.xcconfig
├── Base-Release.xcconfig
└── Base.xcconfig
├── Info.plist
├── LICENSE.txt
├── Makefile
├── Package.swift
├── README.md
├── Sources
└── Async
│ └── Async.swift
└── Tests
├── AsyncTests
├── AsyncGroupTests.swift
└── AsyncTests.swift
├── BuildSettingsTests
├── expected.xcconfig
└── main.sh
└── Info.plist
/.gitignore:
--------------------------------------------------------------------------------
1 | # xcode noise
2 | .build/*
3 | *.pbxuser
4 | *.mode1v3
5 | *.mode2v3
6 | *.perspectivev3
7 | # NB: also, whitelist the default ones, some projects need to use these
8 | !default.pbxuser
9 | !default.mode1v3
10 | !default.mode2v3
11 | !default.perspectivev3
12 |
13 | # old skool
14 | .svn
15 |
16 | # osx noise
17 | .DS_Store
18 | profile
19 |
20 |
21 | # Xcode
22 | */build/*
23 | xcuserdata
24 | xcuserdata/
25 | profile
26 | *.moved-aside
27 | DerivedData
28 | .idea/
29 | *.hmap
30 | *.xccheckout
31 |
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | osx_image: xcode11.1
3 |
4 | env:
5 | - "DESTINATION='platform=iOS Simulator,name=iPhone 11' ACTION=build"
6 | - "DESTINATION='platform=watchOS Simulator,name=Apple Watch Series 5 - 44mm' ACTION=build"
7 | - "DESTINATION='platform=tvOS Simulator,name=Apple TV' ACTION=build"
8 | - "DESTINATION='platform=OS X' ACTION=build"
9 |
10 | script:
11 | - set -o pipefail && xcodebuild -project Async.xcodeproj -scheme Async -destination "$DESTINATION" $ACTION | xcpretty
12 | - ./Tests/BuildSettingsTests/main.sh "$DESTINATION"
13 | # - set -o pipefail && xcodebuild -project AsyncTest/Async.xcodeproj -scheme Async -destination 'platform=OS X' test | xcpretty
14 | # - set -o pipefail && xcodebuild -project AsyncTest/Async.xcodeproj -scheme Async -destination 'platform=watchOS Simulator,name=Apple Watch - 38mm' build | xcpretty
15 | # - set -o pipefail && xcodebuild -project AsyncTest/Async.xcodeproj -scheme Async -destination 'platform=tvOS Simulator,name=Apple TV 1080p' test | xcpretty
16 |
17 | # Carthage
18 | # - xcodebuild -project Async.xcodeproj -scheme "Async iOS" | xcpretty
19 | # - xcodebuild -project Async.xcodeproj -scheme "Async OSX" | xcpretty
20 | # - xcodebuild -project Async.xcodeproj -scheme "Async tvOS" | xcpretty
21 | # - xcodebuild -project Async.xcodeproj -scheme "Async watchOS" | xcpretty
22 |
23 | # CocoaPods
24 | # - xcodebuild clean -workspace AsyncPodsExample/AsyncPodsExample.xcworkspace -scheme "AsyncExample iOS" -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty
25 | # - xcodebuild clean -workspace AsyncPodsExample/AsyncPodsExample.xcworkspace -scheme "AsyncExample OS X" -sdk macosx ONLY_ACTIVE_ARCH=NO | xcpretty
26 | # tvOS target has issues with signing
27 | # - xcodebuild clean build -workspace AsyncPodsExample/AsyncPodsExample.xcworkspace -scheme "AsyncExample tvOS" -sdk appletvos ONLY_ACTIVE_ARCH=NO
28 |
29 | # Tests (OS X only, since simulator doesn't play nice with GCD)
30 | # - set -o pipefail && xcodebuild clean build test -project AsyncTest/Async.xcodeproj -scheme "AsyncOSX" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ONLY_ACTIVE_ARCH=NO | xcpretty
31 | # - set -o pipefail && xcodebuild test -project AsyncTest/Async.xcodeproj -scheme "AsyncOSX" | xcpretty
32 |
33 | after_success:
34 | - bash <(curl -s https://codecov.io/bash) -J 'Async'
35 |
--------------------------------------------------------------------------------
/Async.xcodeproj/AsyncTests_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | BNDL
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Async.xcodeproj/Async_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Async.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | OBJ_24 /* Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_9 /* Async.swift */; };
11 | OBJ_31 /* AsyncGroupTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_12 /* AsyncGroupTests.swift */; };
12 | OBJ_32 /* AsyncTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_13 /* AsyncTests.swift */; };
13 | OBJ_34 /* Async.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_17 /* Async.framework */; };
14 | /* End PBXBuildFile section */
15 |
16 | /* Begin PBXContainerItemProxy section */
17 | 1F7018B61EA0FE7F00CD23AC /* PBXContainerItemProxy */ = {
18 | isa = PBXContainerItemProxy;
19 | containerPortal = OBJ_1 /* Project object */;
20 | proxyType = 1;
21 | remoteGlobalIDString = OBJ_19;
22 | remoteInfo = Async;
23 | };
24 | /* End PBXContainerItemProxy section */
25 |
26 | /* Begin PBXFileReference section */
27 | 1F9952281EA0FF2F0095B0F1 /* Async-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Async-Debug.xcconfig"; sourceTree = ""; };
28 | 1F9952291EA0FF2F0095B0F1 /* Async-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Async-Release.xcconfig"; sourceTree = ""; };
29 | 1F99522A1EA0FF2F0095B0F1 /* AsyncTests-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "AsyncTests-Debug.xcconfig"; sourceTree = ""; };
30 | 1F99522B1EA0FF2F0095B0F1 /* AsyncTests-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "AsyncTests-Release.xcconfig"; sourceTree = ""; };
31 | 1F99522C1EA0FF2F0095B0F1 /* Base-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Base-Debug.xcconfig"; sourceTree = ""; };
32 | 1F99522D1EA0FF2F0095B0F1 /* Base-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Base-Release.xcconfig"; sourceTree = ""; };
33 | 1FC6D32E1EA10026004DAA25 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = ""; };
34 | OBJ_12 /* AsyncGroupTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncGroupTests.swift; sourceTree = ""; };
35 | OBJ_13 /* AsyncTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncTests.swift; sourceTree = ""; };
36 | OBJ_14 /* AsyncPodsExample */ = {isa = PBXFileReference; lastKnownFileType = folder; path = AsyncPodsExample; sourceTree = SOURCE_ROOT; };
37 | OBJ_15 /* Configs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Configs; sourceTree = SOURCE_ROOT; };
38 | OBJ_17 /* Async.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Async.framework; sourceTree = BUILT_PRODUCTS_DIR; };
39 | OBJ_18 /* AsyncTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = AsyncTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
40 | OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; };
41 | OBJ_9 /* Async.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Async.swift; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | OBJ_25 /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 0;
48 | files = (
49 | );
50 | runOnlyForDeploymentPostprocessing = 0;
51 | };
52 | OBJ_33 /* Frameworks */ = {
53 | isa = PBXFrameworksBuildPhase;
54 | buildActionMask = 0;
55 | files = (
56 | OBJ_34 /* Async.framework in Frameworks */,
57 | );
58 | runOnlyForDeploymentPostprocessing = 0;
59 | };
60 | /* End PBXFrameworksBuildPhase section */
61 |
62 | /* Begin PBXGroup section */
63 | 1F9952271EA0FF2F0095B0F1 /* Configs */ = {
64 | isa = PBXGroup;
65 | children = (
66 | 1FC6D32E1EA10026004DAA25 /* Base.xcconfig */,
67 | 1F9952281EA0FF2F0095B0F1 /* Async-Debug.xcconfig */,
68 | 1F9952291EA0FF2F0095B0F1 /* Async-Release.xcconfig */,
69 | 1F99522A1EA0FF2F0095B0F1 /* AsyncTests-Debug.xcconfig */,
70 | 1F99522B1EA0FF2F0095B0F1 /* AsyncTests-Release.xcconfig */,
71 | 1F99522C1EA0FF2F0095B0F1 /* Base-Debug.xcconfig */,
72 | 1F99522D1EA0FF2F0095B0F1 /* Base-Release.xcconfig */,
73 | );
74 | path = Configs;
75 | sourceTree = "";
76 | };
77 | OBJ_10 /* Tests */ = {
78 | isa = PBXGroup;
79 | children = (
80 | OBJ_11 /* AsyncTests */,
81 | );
82 | name = Tests;
83 | sourceTree = SOURCE_ROOT;
84 | };
85 | OBJ_11 /* AsyncTests */ = {
86 | isa = PBXGroup;
87 | children = (
88 | OBJ_12 /* AsyncGroupTests.swift */,
89 | OBJ_13 /* AsyncTests.swift */,
90 | );
91 | name = AsyncTests;
92 | path = Tests/AsyncTests;
93 | sourceTree = SOURCE_ROOT;
94 | };
95 | OBJ_16 /* Products */ = {
96 | isa = PBXGroup;
97 | children = (
98 | OBJ_17 /* Async.framework */,
99 | OBJ_18 /* AsyncTests.xctest */,
100 | );
101 | name = Products;
102 | sourceTree = BUILT_PRODUCTS_DIR;
103 | };
104 | OBJ_5 = {
105 | isa = PBXGroup;
106 | children = (
107 | 1F9952271EA0FF2F0095B0F1 /* Configs */,
108 | OBJ_6 /* Package.swift */,
109 | OBJ_7 /* Sources */,
110 | OBJ_10 /* Tests */,
111 | OBJ_14 /* AsyncPodsExample */,
112 | OBJ_15 /* Configs */,
113 | OBJ_16 /* Products */,
114 | );
115 | sourceTree = "";
116 | };
117 | OBJ_7 /* Sources */ = {
118 | isa = PBXGroup;
119 | children = (
120 | OBJ_8 /* Async */,
121 | );
122 | name = Sources;
123 | sourceTree = SOURCE_ROOT;
124 | };
125 | OBJ_8 /* Async */ = {
126 | isa = PBXGroup;
127 | children = (
128 | OBJ_9 /* Async.swift */,
129 | );
130 | name = Async;
131 | path = Sources/Async;
132 | sourceTree = SOURCE_ROOT;
133 | };
134 | /* End PBXGroup section */
135 |
136 | /* Begin PBXNativeTarget section */
137 | OBJ_19 /* Async */ = {
138 | isa = PBXNativeTarget;
139 | buildConfigurationList = OBJ_20 /* Build configuration list for PBXNativeTarget "Async" */;
140 | buildPhases = (
141 | OBJ_23 /* Sources */,
142 | OBJ_25 /* Frameworks */,
143 | );
144 | buildRules = (
145 | );
146 | dependencies = (
147 | );
148 | name = Async;
149 | productName = Async;
150 | productReference = OBJ_17 /* Async.framework */;
151 | productType = "com.apple.product-type.framework";
152 | };
153 | OBJ_26 /* AsyncTests */ = {
154 | isa = PBXNativeTarget;
155 | buildConfigurationList = OBJ_27 /* Build configuration list for PBXNativeTarget "AsyncTests" */;
156 | buildPhases = (
157 | OBJ_30 /* Sources */,
158 | OBJ_33 /* Frameworks */,
159 | );
160 | buildRules = (
161 | );
162 | dependencies = (
163 | OBJ_35 /* PBXTargetDependency */,
164 | );
165 | name = AsyncTests;
166 | productName = AsyncTests;
167 | productReference = OBJ_18 /* AsyncTests.xctest */;
168 | productType = "com.apple.product-type.bundle.unit-test";
169 | };
170 | /* End PBXNativeTarget section */
171 |
172 | /* Begin PBXProject section */
173 | OBJ_1 /* Project object */ = {
174 | isa = PBXProject;
175 | attributes = {
176 | LastUpgradeCheck = 9999;
177 | TargetAttributes = {
178 | OBJ_19 = {
179 | LastSwiftMigration = 0900;
180 | };
181 | OBJ_26 = {
182 | LastSwiftMigration = 0900;
183 | };
184 | };
185 | };
186 | buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "Async" */;
187 | compatibilityVersion = "Xcode 3.2";
188 | developmentRegion = English;
189 | hasScannedForEncodings = 0;
190 | knownRegions = (
191 | en,
192 | );
193 | mainGroup = OBJ_5;
194 | productRefGroup = OBJ_16 /* Products */;
195 | projectDirPath = "";
196 | projectRoot = "";
197 | targets = (
198 | OBJ_19 /* Async */,
199 | OBJ_26 /* AsyncTests */,
200 | );
201 | };
202 | /* End PBXProject section */
203 |
204 | /* Begin PBXSourcesBuildPhase section */
205 | OBJ_23 /* Sources */ = {
206 | isa = PBXSourcesBuildPhase;
207 | buildActionMask = 0;
208 | files = (
209 | OBJ_24 /* Async.swift in Sources */,
210 | );
211 | runOnlyForDeploymentPostprocessing = 0;
212 | };
213 | OBJ_30 /* Sources */ = {
214 | isa = PBXSourcesBuildPhase;
215 | buildActionMask = 0;
216 | files = (
217 | OBJ_31 /* AsyncGroupTests.swift in Sources */,
218 | OBJ_32 /* AsyncTests.swift in Sources */,
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | };
222 | /* End PBXSourcesBuildPhase section */
223 |
224 | /* Begin PBXTargetDependency section */
225 | OBJ_35 /* PBXTargetDependency */ = {
226 | isa = PBXTargetDependency;
227 | target = OBJ_19 /* Async */;
228 | targetProxy = 1F7018B61EA0FE7F00CD23AC /* PBXContainerItemProxy */;
229 | };
230 | /* End PBXTargetDependency section */
231 |
232 | /* Begin XCBuildConfiguration section */
233 | OBJ_21 /* Debug */ = {
234 | isa = XCBuildConfiguration;
235 | baseConfigurationReference = 1F9952281EA0FF2F0095B0F1 /* Async-Debug.xcconfig */;
236 | buildSettings = {
237 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
238 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
239 | TVOS_DEPLOYMENT_TARGET = 9.0;
240 | };
241 | name = Debug;
242 | };
243 | OBJ_22 /* Release */ = {
244 | isa = XCBuildConfiguration;
245 | baseConfigurationReference = 1F9952291EA0FF2F0095B0F1 /* Async-Release.xcconfig */;
246 | buildSettings = {
247 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
248 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
249 | TVOS_DEPLOYMENT_TARGET = 9.0;
250 | };
251 | name = Release;
252 | };
253 | OBJ_28 /* Debug */ = {
254 | isa = XCBuildConfiguration;
255 | baseConfigurationReference = 1F99522A1EA0FF2F0095B0F1 /* AsyncTests-Debug.xcconfig */;
256 | buildSettings = {
257 | };
258 | name = Debug;
259 | };
260 | OBJ_29 /* Release */ = {
261 | isa = XCBuildConfiguration;
262 | baseConfigurationReference = 1F99522B1EA0FF2F0095B0F1 /* AsyncTests-Release.xcconfig */;
263 | buildSettings = {
264 | };
265 | name = Release;
266 | };
267 | OBJ_3 /* Debug */ = {
268 | isa = XCBuildConfiguration;
269 | baseConfigurationReference = 1F99522C1EA0FF2F0095B0F1 /* Base-Debug.xcconfig */;
270 | buildSettings = {
271 | SWIFT_VERSION = 4.2;
272 | };
273 | name = Debug;
274 | };
275 | OBJ_4 /* Release */ = {
276 | isa = XCBuildConfiguration;
277 | baseConfigurationReference = 1F99522D1EA0FF2F0095B0F1 /* Base-Release.xcconfig */;
278 | buildSettings = {
279 | SWIFT_VERSION = 4.2;
280 | };
281 | name = Release;
282 | };
283 | /* End XCBuildConfiguration section */
284 |
285 | /* Begin XCConfigurationList section */
286 | OBJ_2 /* Build configuration list for PBXProject "Async" */ = {
287 | isa = XCConfigurationList;
288 | buildConfigurations = (
289 | OBJ_3 /* Debug */,
290 | OBJ_4 /* Release */,
291 | );
292 | defaultConfigurationIsVisible = 0;
293 | defaultConfigurationName = Debug;
294 | };
295 | OBJ_20 /* Build configuration list for PBXNativeTarget "Async" */ = {
296 | isa = XCConfigurationList;
297 | buildConfigurations = (
298 | OBJ_21 /* Debug */,
299 | OBJ_22 /* Release */,
300 | );
301 | defaultConfigurationIsVisible = 0;
302 | defaultConfigurationName = Debug;
303 | };
304 | OBJ_27 /* Build configuration list for PBXNativeTarget "AsyncTests" */ = {
305 | isa = XCConfigurationList;
306 | buildConfigurations = (
307 | OBJ_28 /* Debug */,
308 | OBJ_29 /* Release */,
309 | );
310 | defaultConfigurationIsVisible = 0;
311 | defaultConfigurationName = Debug;
312 | };
313 | /* End XCConfigurationList section */
314 | };
315 | rootObject = OBJ_1 /* Project object */;
316 | }
317 |
--------------------------------------------------------------------------------
/Async.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Async.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Async.xcodeproj/xcshareddata/xcschemes/Async.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
55 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
74 |
76 |
77 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/Async.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SchemeUserState
5 |
6 | Async.xcscheme
7 |
8 |
9 | SuppressBuildableAutocreation
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample OS X/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // AsyncExample OS X
4 | //
5 | // Created by Tobias DM on 15/07/14.
6 | // Copyright (c) 2014 Tobias Due Munk. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate { }
13 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample OS X/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample OS X/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | ${MACOSX_DEPLOYMENT_TARGET}
27 | NSHumanReadableCopyright
28 | Copyright © 2014 Tobias Due Munk. All rights reserved.
29 | NSMainStoryboardFile
30 | Main
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample OS X/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // AsyncExample OS X
4 | //
5 | // Created by Tobias DM on 15/07/14.
6 | // Copyright (c) 2014 Tobias Due Munk. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 | import Async
11 |
12 | class ViewController: NSViewController {
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | // Async syntactic sugar
18 | Async.background {
19 | print("A: This is run on the \(qos_class_self().description) (expected \(DispatchQoS.QoSClass.background.description))")
20 | }.main {
21 | print("B: This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)), after the previous block")
22 | }
23 |
24 | // Regular GCD
25 | /*
26 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {
27 | print("REGULAR GCD: This is run on the background queue")
28 |
29 | dispatch_async(dispatch_get_main_queue(), 0), {
30 | print("REGULAR GCD: This is run on the main queue")
31 | })
32 | })
33 | */
34 |
35 | /*
36 | // Chaining with Async
37 | var id = 0
38 | Async.main {
39 | print("This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)) count: \(++id) (expected 1) ")
40 | // Prints: "This is run on the Main (expected Main) count: 1 (expected 1)"
41 | }.userInteractive {
42 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_USER_INTERACTIVE.description)) count: \(++id) (expected 2) ")
43 | // Prints: "This is run on the Main (expected Main) count: 2 (expected 2)"
44 | }.userInitiated {
45 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_USER_INITIATED.description)) count: \(++id) (expected 3) ")
46 | // Prints: "This is run on the User Initiated (expected User Initiated) count: 3 (expected 3)"
47 | }.utility {
48 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_UTILITY.description)) count: \(++id) (expected 4) ")
49 | // Prints: "This is run on the Utility (expected Utility) count: 4 (expected 4)"
50 | }.background {
51 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_BACKGROUND.description)) count: \(++id) (expected 5) ")
52 | // Prints: "This is run on the User Interactive (expected User Interactive) count: 5 (expected 5)"
53 | }
54 | */
55 |
56 | /*
57 | // Keep reference for block for later chaining
58 | let backgroundBlock = Async.background {
59 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_BACKGROUND.description))")
60 | }
61 | // Run other code here...
62 | backgroundBlock.main {
63 | print("This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)), after the previous block")
64 | }
65 | */
66 |
67 | /*
68 | // Custom queues
69 | let customQueue = dispatch_queue_create("CustomQueueLabel", DISPATCH_QUEUE_CONCURRENT)
70 | let otherCustomQueue = dispatch_queue_create("OtherCustomQueueLabel", DISPATCH_QUEUE_CONCURRENT)
71 | Async.customQueue(customQueue) {
72 | print("Custom queue")
73 | }.customQueue(otherCustomQueue) {
74 | print("Other custom queue")
75 | }
76 | */
77 |
78 | /*
79 | // After
80 | let seconds = 0.5
81 | Async.main(after: seconds) {
82 | print("Is called after 0.5 seconds")
83 | }.background(after: 0.4) {
84 | print("At least 0.4 seconds after previous block, and 0.9 after Async code is called")
85 | }
86 | */
87 |
88 | /*
89 | // Cancel blocks not yet dispatched
90 | let block1 = Async.background {
91 | // Heavy work
92 | for i in 0...1000 {
93 | print("A \(i)")
94 | }
95 | }
96 | let block2 = block1.background {
97 | print("B – shouldn't be reached, since cancelled")
98 | }
99 | Async.main {
100 | block1.cancel() // First block is _not_ cancelled
101 | block2.cancel() // Second block _is_ cancelled
102 | }
103 | */
104 | }
105 | }
106 |
107 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample iOS/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // AsyncExample iOS
4 | //
5 | // Created by Tobias DM on 15/07/14.
6 | // Copyright (c) 2014 Tobias DM. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample iOS/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 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample iOS/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 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample iOS/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample iOS/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 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample iOS/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // AsyncExample iOS
4 | //
5 | // Created by Tobias DM on 15/07/14.
6 | // Copyright (c) 2014 Tobias Due Munk. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Async
11 |
12 | class ViewController: UIViewController {
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | // Async syntactic sugar
18 | Async.background {
19 | print("A: This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_BACKGROUND.description))")
20 | }.main {
21 | print("B: This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)), after the previous block")
22 | }
23 |
24 | // Regular GCD
25 | /*
26 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {
27 | print("REGULAR GCD: This is run on the background queue")
28 |
29 | dispatch_async(dispatch_get_main_queue(), 0), {
30 | print("REGULAR GCD: This is run on the main queue")
31 | })
32 | })
33 | */
34 |
35 | /*
36 | // Chaining with Async
37 | var id = 0
38 | Async.main {
39 | print("This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)) count: \(++id) (expected 1) ")
40 | // Prints: "This is run on the Main (expected Main) count: 1 (expected 1)"
41 | }.userInteractive {
42 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_USER_INTERACTIVE.description)) count: \(++id) (expected 2) ")
43 | // Prints: "This is run on the Main (expected Main) count: 2 (expected 2)"
44 | }.userInitiated {
45 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_USER_INITIATED.description)) count: \(++id) (expected 3) ")
46 | // Prints: "This is run on the User Initiated (expected User Initiated) count: 3 (expected 3)"
47 | }.utility {
48 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_UTILITY.description)) count: \(++id) (expected 4) ")
49 | // Prints: "This is run on the Utility (expected Utility) count: 4 (expected 4)"
50 | }.background {
51 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_BACKGROUND.description)) count: \(++id) (expected 5) ")
52 | // Prints: "This is run on the User Interactive (expected User Interactive) count: 5 (expected 5)"
53 | }
54 | */
55 |
56 | /*
57 | // Keep reference for block for later chaining
58 | let backgroundBlock = Async.background {
59 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_BACKGROUND.description))")
60 | }
61 | // Run other code here...
62 | backgroundBlock.main {
63 | print("This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)), after the previous block")
64 | }
65 | */
66 |
67 | /*
68 | // Custom queues
69 | let customQueue = dispatch_queue_create("CustomQueueLabel", DISPATCH_QUEUE_CONCURRENT)
70 | let otherCustomQueue = dispatch_queue_create("OtherCustomQueueLabel", DISPATCH_QUEUE_CONCURRENT)
71 | Async.customQueue(customQueue) {
72 | print("Custom queue")
73 | }.customQueue(otherCustomQueue) {
74 | print("Other custom queue")
75 | }
76 | */
77 |
78 | /*
79 | // After
80 | let seconds = 0.5
81 | Async.main(after: seconds) {
82 | print("Is called after 0.5 seconds")
83 | }.background(after: 0.4) {
84 | print("At least 0.4 seconds after previous block, and 0.9 after Async code is called")
85 | }
86 | */
87 |
88 | /*
89 | // Cancel blocks not yet dispatched
90 | let block1 = Async.background {
91 | // Heavy work
92 | for i in 0...1000 {
93 | print("A \(i)")
94 | }
95 | }
96 | let block2 = block1.background {
97 | print("B – shouldn't be reached, since cancelled")
98 | }
99 | Async.main {
100 | block1.cancel() // First block is _not_ cancelled
101 | block2.cancel() // Second block _is_ cancelled
102 | }
103 | */
104 | }
105 | }
106 |
107 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // AsyncExample tvOS
4 | //
5 | // Created by Tommy Baggett on 10/26/15.
6 | // Copyright © 2015 developmunk. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "tv",
5 | "scale" : "1x"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "layers" : [
3 | {
4 | "filename" : "Front.imagestacklayer"
5 | },
6 | {
7 | "filename" : "Middle.imagestacklayer"
8 | },
9 | {
10 | "filename" : "Back.imagestacklayer"
11 | }
12 | ],
13 | "info" : {
14 | "version" : 1,
15 | "author" : "xcode"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "tv",
5 | "scale" : "1x"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "tv",
5 | "scale" : "1x"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "tv",
5 | "scale" : "1x"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "layers" : [
3 | {
4 | "filename" : "Front.imagestacklayer"
5 | },
6 | {
7 | "filename" : "Middle.imagestacklayer"
8 | },
9 | {
10 | "filename" : "Back.imagestacklayer"
11 | }
12 | ],
13 | "info" : {
14 | "version" : 1,
15 | "author" : "xcode"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "tv",
5 | "scale" : "1x"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "tv",
5 | "scale" : "1x"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "assets" : [
3 | {
4 | "size" : "1280x768",
5 | "idiom" : "tv",
6 | "filename" : "App Icon - Large.imagestack",
7 | "role" : "primary-app-icon"
8 | },
9 | {
10 | "size" : "400x240",
11 | "idiom" : "tv",
12 | "filename" : "App Icon - Small.imagestack",
13 | "role" : "primary-app-icon"
14 | },
15 | {
16 | "size" : "1920x720",
17 | "idiom" : "tv",
18 | "filename" : "Top Shelf Image.imageset",
19 | "role" : "top-shelf-image"
20 | }
21 | ],
22 | "info" : {
23 | "version" : 1,
24 | "author" : "xcode"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "tv",
5 | "scale" : "1x"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "landscape",
5 | "idiom" : "tv",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "9.0",
8 | "scale" : "1x"
9 | }
10 | ],
11 | "info" : {
12 | "version" : 1,
13 | "author" : "xcode"
14 | }
15 | }
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/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 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/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 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | arm64
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncExample tvOS/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // AsyncExample tvOS
4 | //
5 | // Created by Tobias DM on 26/10/14.
6 | // Copyright (c) 2015 Tobias Due Munk. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Async
11 |
12 | class ViewController: UIViewController {
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | // Async syntactic sugar
18 | Async.background {
19 | print("A: This is run on the \(qos_class_self().description) (expected \(DispatchQoS.QoSClass.background.description))")
20 | }.main {
21 | print("B: This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)), after the previous block")
22 | }
23 |
24 | // Regular GCD
25 | /*
26 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {
27 | print("REGULAR GCD: This is run on the background queue")
28 |
29 | dispatch_async(dispatch_get_main_queue(), 0), {
30 | print("REGULAR GCD: This is run on the main queue")
31 | })
32 | })
33 | */
34 |
35 | /*
36 | // Chaining with Async
37 | var id = 0
38 | Async.main {
39 | print("This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)) count: \(++id) (expected 1) ")
40 | // Prints: "This is run on the Main (expected Main) count: 1 (expected 1)"
41 | }.userInteractive {
42 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_USER_INTERACTIVE.description)) count: \(++id) (expected 2) ")
43 | // Prints: "This is run on the Main (expected Main) count: 2 (expected 2)"
44 | }.userInitiated {
45 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_USER_INITIATED.description)) count: \(++id) (expected 3) ")
46 | // Prints: "This is run on the User Initiated (expected User Initiated) count: 3 (expected 3)"
47 | }.utility {
48 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_UTILITY.description)) count: \(++id) (expected 4) ")
49 | // Prints: "This is run on the Utility (expected Utility) count: 4 (expected 4)"
50 | }.background {
51 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_BACKGROUND.description)) count: \(++id) (expected 5) ")
52 | // Prints: "This is run on the User Interactive (expected User Interactive) count: 5 (expected 5)"
53 | }
54 | */
55 |
56 | /*
57 | // Keep reference for block for later chaining
58 | let backgroundBlock = Async.background {
59 | print("This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_BACKGROUND.description))")
60 | }
61 | // Run other code here...
62 | backgroundBlock.main {
63 | print("This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)), after the previous block")
64 | }
65 | */
66 |
67 | /*
68 | // Custom queues
69 | let customQueue = dispatch_queue_create("CustomQueueLabel", DISPATCH_QUEUE_CONCURRENT)
70 | let otherCustomQueue = dispatch_queue_create("OtherCustomQueueLabel", DISPATCH_QUEUE_CONCURRENT)
71 | Async.customQueue(customQueue) {
72 | print("Custom queue")
73 | }.customQueue(otherCustomQueue) {
74 | print("Other custom queue")
75 | }
76 | */
77 |
78 | /*
79 | // After
80 | let seconds = 0.5
81 | Async.main(after: seconds) {
82 | print("Is called after 0.5 seconds")
83 | }.background(after: 0.4) {
84 | print("At least 0.4 seconds after previous block, and 0.9 after Async code is called")
85 | }
86 | */
87 |
88 | /*
89 | // Cancel blocks not yet dispatched
90 | let block1 = Async.background {
91 | // Heavy work
92 | for i in 0...1000 {
93 | print("A \(i)")
94 | }
95 | }
96 | let block2 = block1.background {
97 | print("B – shouldn't be reached, since cancelled")
98 | }
99 | Async.main {
100 | block1.cancel() // First block is _not_ cancelled
101 | block2.cancel() // Second block _is_ cancelled
102 | }
103 | */
104 | }
105 | }
106 |
107 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncPodsExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncPodsExample.xcodeproj/xcshareddata/xcschemes/AsyncExample OS X.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncPodsExample.xcodeproj/xcshareddata/xcschemes/AsyncExample iOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncPodsExample.xcodeproj/xcshareddata/xcschemes/AsyncExample tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncPodsExample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/AsyncPodsExample/AsyncPodsExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Podfile:
--------------------------------------------------------------------------------
1 | source 'https://github.com/CocoaPods/Specs.git'
2 |
3 | target 'AsyncExample iOS' do
4 | platform :ios, '8.0'
5 | use_frameworks!
6 | pod 'AsyncSwift', :path => '../'
7 | end
8 | target 'AsyncExample tvOS' do
9 | platform :tvos, '9.0'
10 | use_frameworks!
11 | pod 'AsyncSwift', :path => '../'
12 | end
13 | target 'AsyncExample OS X' do
14 | platform :osx, '10.10'
15 | use_frameworks!
16 | pod 'AsyncSwift', :path => '../'
17 | end
18 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AsyncSwift (2.0.5)
3 |
4 | DEPENDENCIES:
5 | - AsyncSwift (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | AsyncSwift:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | AsyncSwift: 62ddcdafa3120c8780610af93152de4fcc8a5618
13 |
14 | PODFILE CHECKSUM: c3ad687081866de096cfcd637a5439ffa36aff6f
15 |
16 | COCOAPODS: 1.5.3
17 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Local Podspecs/AsyncSwift.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "AsyncSwift",
3 | "version": "2.0.5",
4 | "summary": "Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch",
5 | "homepage": "https://github.com/duemunk/Async",
6 | "license": {
7 | "type": "MIT"
8 | },
9 | "authors": {
10 | "Tobias Due Munk": "tobias@developmunk.dk"
11 | },
12 | "platforms": {
13 | "osx": "10.10",
14 | "ios": "8.0",
15 | "tvos": "9.0",
16 | "watchos": "3.0"
17 | },
18 | "source": {
19 | "git": "https://github.com/duemunk/Async.git",
20 | "tag": "2.0.5"
21 | },
22 | "source_files": "Sources/**/*.swift",
23 | "requires_arc": true,
24 | "module_name": "Async"
25 | }
26 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AsyncSwift (2.0.5)
3 |
4 | DEPENDENCIES:
5 | - AsyncSwift (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | AsyncSwift:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | AsyncSwift: 62ddcdafa3120c8780610af93152de4fcc8a5618
13 |
14 | PODFILE CHECKSUM: c3ad687081866de096cfcd637a5439ffa36aff6f
15 |
16 | COCOAPODS: 1.5.3
17 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-iOS/AsyncSwift-iOS-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_AsyncSwift_iOS : NSObject
3 | @end
4 | @implementation PodsDummy_AsyncSwift_iOS
5 | @end
6 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-iOS/AsyncSwift-iOS-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-iOS/AsyncSwift-iOS-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double AsyncVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char AsyncVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-iOS/AsyncSwift-iOS.modulemap:
--------------------------------------------------------------------------------
1 | framework module Async {
2 | umbrella header "AsyncSwift-iOS-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-iOS/AsyncSwift-iOS.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-iOS
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-iOS/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 | 2.0.5
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-macOS/AsyncSwift-macOS-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_AsyncSwift_macOS : NSObject
3 | @end
4 | @implementation PodsDummy_AsyncSwift_macOS
5 | @end
6 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-macOS/AsyncSwift-macOS-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-macOS/AsyncSwift-macOS-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double AsyncVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char AsyncVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-macOS/AsyncSwift-macOS.modulemap:
--------------------------------------------------------------------------------
1 | framework module Async {
2 | umbrella header "AsyncSwift-macOS-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-macOS/AsyncSwift-macOS.xcconfig:
--------------------------------------------------------------------------------
1 | CODE_SIGN_IDENTITY =
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-macOS
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-macOS/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 | 2.0.5
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-tvOS/AsyncSwift-tvOS-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_AsyncSwift_tvOS : NSObject
3 | @end
4 | @implementation PodsDummy_AsyncSwift_tvOS
5 | @end
6 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-tvOS/AsyncSwift-tvOS-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-tvOS/AsyncSwift-tvOS-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double AsyncVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char AsyncVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-tvOS/AsyncSwift-tvOS.modulemap:
--------------------------------------------------------------------------------
1 | framework module Async {
2 | umbrella header "AsyncSwift-tvOS-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-tvOS/AsyncSwift-tvOS.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-tvOS
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/AsyncSwift-tvOS/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 | 2.0.5
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## AsyncSwift
5 |
6 | The MIT License (MIT)
7 |
8 | Copyright (c) 2014 Tobias Due Munk
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy of
11 | this software and associated documentation files (the "Software"), to deal in
12 | the Software without restriction, including without limitation the rights to
13 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14 | the Software, and to permit persons to whom the Software is furnished to do so,
15 | subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
23 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 |
27 | Generated by CocoaPods - https://cocoapods.org
28 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | The MIT License (MIT)
18 |
19 | Copyright (c) 2014 Tobias Due Munk
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy of
22 | this software and associated documentation files (the "Software"), to deal in
23 | the Software without restriction, including without limitation the rights to
24 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
25 | the Software, and to permit persons to whom the Software is furnished to do so,
26 | subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
33 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
34 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
35 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
36 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 |
38 | License
39 | MIT
40 | Title
41 | AsyncSwift
42 | Type
43 | PSGroupSpecifier
44 |
45 |
46 | FooterText
47 | Generated by CocoaPods - https://cocoapods.org
48 | Title
49 |
50 | Type
51 | PSGroupSpecifier
52 |
53 |
54 | StringsTable
55 | Acknowledgements
56 | Title
57 | Acknowledgements
58 |
59 |
60 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_AsyncExample_OS_X : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_AsyncExample_OS_X
5 | @end
6 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # frameworks to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
14 |
15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
17 |
18 | # Used as a return value for each invocation of `strip_invalid_archs` function.
19 | STRIP_BINARY_RETVAL=0
20 |
21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
24 |
25 | # Copies and strips a vendored framework
26 | install_framework()
27 | {
28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
29 | local source="${BUILT_PRODUCTS_DIR}/$1"
30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
32 | elif [ -r "$1" ]; then
33 | local source="$1"
34 | fi
35 |
36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
37 |
38 | if [ -L "${source}" ]; then
39 | echo "Symlinked..."
40 | source="$(readlink "${source}")"
41 | fi
42 |
43 | # Use filter instead of exclude so missing patterns don't throw errors.
44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
46 |
47 | local basename
48 | basename="$(basename -s .framework "$1")"
49 | binary="${destination}/${basename}.framework/${basename}"
50 | if ! [ -r "$binary" ]; then
51 | binary="${destination}/${basename}"
52 | fi
53 |
54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
56 | strip_invalid_archs "$binary"
57 | fi
58 |
59 | # Resign the code if required by the build settings to avoid unstable apps
60 | code_sign_if_enabled "${destination}/$(basename "$1")"
61 |
62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
64 | local swift_runtime_libs
65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
66 | for lib in $swift_runtime_libs; do
67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
69 | code_sign_if_enabled "${destination}/${lib}"
70 | done
71 | fi
72 | }
73 |
74 | # Copies and strips a vendored dSYM
75 | install_dsym() {
76 | local source="$1"
77 | if [ -r "$source" ]; then
78 | # Copy the dSYM into a the targets temp dir.
79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
81 |
82 | local basename
83 | basename="$(basename -s .framework.dSYM "$source")"
84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
85 |
86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
88 | strip_invalid_archs "$binary"
89 | fi
90 |
91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
92 | # Move the stripped file into its final destination.
93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
95 | else
96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
98 | fi
99 | fi
100 | }
101 |
102 | # Signs a framework with the provided identity
103 | code_sign_if_enabled() {
104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
105 | # Use the current code_sign_identitiy
106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
108 |
109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
110 | code_sign_cmd="$code_sign_cmd &"
111 | fi
112 | echo "$code_sign_cmd"
113 | eval "$code_sign_cmd"
114 | fi
115 | }
116 |
117 | # Strip invalid architectures
118 | strip_invalid_archs() {
119 | binary="$1"
120 | # Get architectures for current target binary
121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
122 | # Intersect them with the architectures we are building for
123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
124 | # If there are no archs supported by this binary then warn the user
125 | if [[ -z "$intersected_archs" ]]; then
126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
127 | STRIP_BINARY_RETVAL=0
128 | return
129 | fi
130 | stripped=""
131 | for arch in $binary_archs; do
132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
133 | # Strip non-valid architectures in-place
134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
135 | stripped="$stripped $arch"
136 | fi
137 | done
138 | if [[ "$stripped" ]]; then
139 | echo "Stripped $binary of architectures:$stripped"
140 | fi
141 | STRIP_BINARY_RETVAL=1
142 | }
143 |
144 |
145 | if [[ "$CONFIGURATION" == "Debug" ]]; then
146 | install_framework "${BUILT_PRODUCTS_DIR}/AsyncSwift-macOS/Async.framework"
147 | fi
148 | if [[ "$CONFIGURATION" == "Release" ]]; then
149 | install_framework "${BUILT_PRODUCTS_DIR}/AsyncSwift-macOS/Async.framework"
150 | fi
151 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
152 | wait
153 | fi
154 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_AsyncExample_OS_XVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_AsyncExample_OS_XVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | CODE_SIGN_IDENTITY =
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-macOS"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
6 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-macOS/Async.framework/Headers"
7 | OTHER_LDFLAGS = $(inherited) -framework "Async"
8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
9 | PODS_BUILD_DIR = ${BUILD_DIR}
10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
12 | PODS_ROOT = ${SRCROOT}/Pods
13 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_AsyncExample_OS_X {
2 | umbrella header "Pods-AsyncExample OS X-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample OS X/Pods-AsyncExample OS X.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | CODE_SIGN_IDENTITY =
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-macOS"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
6 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-macOS/Async.framework/Headers"
7 | OTHER_LDFLAGS = $(inherited) -framework "Async"
8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
9 | PODS_BUILD_DIR = ${BUILD_DIR}
10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
12 | PODS_ROOT = ${SRCROOT}/Pods
13 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## AsyncSwift
5 |
6 | The MIT License (MIT)
7 |
8 | Copyright (c) 2014 Tobias Due Munk
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy of
11 | this software and associated documentation files (the "Software"), to deal in
12 | the Software without restriction, including without limitation the rights to
13 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14 | the Software, and to permit persons to whom the Software is furnished to do so,
15 | subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
23 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 |
27 | Generated by CocoaPods - https://cocoapods.org
28 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | The MIT License (MIT)
18 |
19 | Copyright (c) 2014 Tobias Due Munk
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy of
22 | this software and associated documentation files (the "Software"), to deal in
23 | the Software without restriction, including without limitation the rights to
24 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
25 | the Software, and to permit persons to whom the Software is furnished to do so,
26 | subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
33 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
34 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
35 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
36 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 |
38 | License
39 | MIT
40 | Title
41 | AsyncSwift
42 | Type
43 | PSGroupSpecifier
44 |
45 |
46 | FooterText
47 | Generated by CocoaPods - https://cocoapods.org
48 | Title
49 |
50 | Type
51 | PSGroupSpecifier
52 |
53 |
54 | StringsTable
55 | Acknowledgements
56 | Title
57 | Acknowledgements
58 |
59 |
60 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_AsyncExample_iOS : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_AsyncExample_iOS
5 | @end
6 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # frameworks to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
14 |
15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
17 |
18 | # Used as a return value for each invocation of `strip_invalid_archs` function.
19 | STRIP_BINARY_RETVAL=0
20 |
21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
24 |
25 | # Copies and strips a vendored framework
26 | install_framework()
27 | {
28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
29 | local source="${BUILT_PRODUCTS_DIR}/$1"
30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
32 | elif [ -r "$1" ]; then
33 | local source="$1"
34 | fi
35 |
36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
37 |
38 | if [ -L "${source}" ]; then
39 | echo "Symlinked..."
40 | source="$(readlink "${source}")"
41 | fi
42 |
43 | # Use filter instead of exclude so missing patterns don't throw errors.
44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
46 |
47 | local basename
48 | basename="$(basename -s .framework "$1")"
49 | binary="${destination}/${basename}.framework/${basename}"
50 | if ! [ -r "$binary" ]; then
51 | binary="${destination}/${basename}"
52 | fi
53 |
54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
56 | strip_invalid_archs "$binary"
57 | fi
58 |
59 | # Resign the code if required by the build settings to avoid unstable apps
60 | code_sign_if_enabled "${destination}/$(basename "$1")"
61 |
62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
64 | local swift_runtime_libs
65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
66 | for lib in $swift_runtime_libs; do
67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
69 | code_sign_if_enabled "${destination}/${lib}"
70 | done
71 | fi
72 | }
73 |
74 | # Copies and strips a vendored dSYM
75 | install_dsym() {
76 | local source="$1"
77 | if [ -r "$source" ]; then
78 | # Copy the dSYM into a the targets temp dir.
79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
81 |
82 | local basename
83 | basename="$(basename -s .framework.dSYM "$source")"
84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
85 |
86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
88 | strip_invalid_archs "$binary"
89 | fi
90 |
91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
92 | # Move the stripped file into its final destination.
93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
95 | else
96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
98 | fi
99 | fi
100 | }
101 |
102 | # Signs a framework with the provided identity
103 | code_sign_if_enabled() {
104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
105 | # Use the current code_sign_identitiy
106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
108 |
109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
110 | code_sign_cmd="$code_sign_cmd &"
111 | fi
112 | echo "$code_sign_cmd"
113 | eval "$code_sign_cmd"
114 | fi
115 | }
116 |
117 | # Strip invalid architectures
118 | strip_invalid_archs() {
119 | binary="$1"
120 | # Get architectures for current target binary
121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
122 | # Intersect them with the architectures we are building for
123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
124 | # If there are no archs supported by this binary then warn the user
125 | if [[ -z "$intersected_archs" ]]; then
126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
127 | STRIP_BINARY_RETVAL=0
128 | return
129 | fi
130 | stripped=""
131 | for arch in $binary_archs; do
132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
133 | # Strip non-valid architectures in-place
134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
135 | stripped="$stripped $arch"
136 | fi
137 | done
138 | if [[ "$stripped" ]]; then
139 | echo "Stripped $binary of architectures:$stripped"
140 | fi
141 | STRIP_BINARY_RETVAL=1
142 | }
143 |
144 |
145 | if [[ "$CONFIGURATION" == "Debug" ]]; then
146 | install_framework "${BUILT_PRODUCTS_DIR}/AsyncSwift-iOS/Async.framework"
147 | fi
148 | if [[ "$CONFIGURATION" == "Release" ]]; then
149 | install_framework "${BUILT_PRODUCTS_DIR}/AsyncSwift-iOS/Async.framework"
150 | fi
151 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
152 | wait
153 | fi
154 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_AsyncExample_iOSVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_AsyncExample_iOSVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-iOS"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-iOS/Async.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "Async"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_AsyncExample_iOS {
2 | umbrella header "Pods-AsyncExample iOS-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample iOS/Pods-AsyncExample iOS.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-iOS"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-iOS/Async.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "Async"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## AsyncSwift
5 |
6 | The MIT License (MIT)
7 |
8 | Copyright (c) 2014 Tobias Due Munk
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy of
11 | this software and associated documentation files (the "Software"), to deal in
12 | the Software without restriction, including without limitation the rights to
13 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14 | the Software, and to permit persons to whom the Software is furnished to do so,
15 | subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
23 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 |
27 | Generated by CocoaPods - https://cocoapods.org
28 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | The MIT License (MIT)
18 |
19 | Copyright (c) 2014 Tobias Due Munk
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy of
22 | this software and associated documentation files (the "Software"), to deal in
23 | the Software without restriction, including without limitation the rights to
24 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
25 | the Software, and to permit persons to whom the Software is furnished to do so,
26 | subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
33 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
34 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
35 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
36 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 |
38 | License
39 | MIT
40 | Title
41 | AsyncSwift
42 | Type
43 | PSGroupSpecifier
44 |
45 |
46 | FooterText
47 | Generated by CocoaPods - https://cocoapods.org
48 | Title
49 |
50 | Type
51 | PSGroupSpecifier
52 |
53 |
54 | StringsTable
55 | Acknowledgements
56 | Title
57 | Acknowledgements
58 |
59 |
60 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_AsyncExample_tvOS : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_AsyncExample_tvOS
5 | @end
6 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # frameworks to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
14 |
15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
17 |
18 | # Used as a return value for each invocation of `strip_invalid_archs` function.
19 | STRIP_BINARY_RETVAL=0
20 |
21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
24 |
25 | # Copies and strips a vendored framework
26 | install_framework()
27 | {
28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
29 | local source="${BUILT_PRODUCTS_DIR}/$1"
30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
32 | elif [ -r "$1" ]; then
33 | local source="$1"
34 | fi
35 |
36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
37 |
38 | if [ -L "${source}" ]; then
39 | echo "Symlinked..."
40 | source="$(readlink "${source}")"
41 | fi
42 |
43 | # Use filter instead of exclude so missing patterns don't throw errors.
44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
46 |
47 | local basename
48 | basename="$(basename -s .framework "$1")"
49 | binary="${destination}/${basename}.framework/${basename}"
50 | if ! [ -r "$binary" ]; then
51 | binary="${destination}/${basename}"
52 | fi
53 |
54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
56 | strip_invalid_archs "$binary"
57 | fi
58 |
59 | # Resign the code if required by the build settings to avoid unstable apps
60 | code_sign_if_enabled "${destination}/$(basename "$1")"
61 |
62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
64 | local swift_runtime_libs
65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
66 | for lib in $swift_runtime_libs; do
67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
69 | code_sign_if_enabled "${destination}/${lib}"
70 | done
71 | fi
72 | }
73 |
74 | # Copies and strips a vendored dSYM
75 | install_dsym() {
76 | local source="$1"
77 | if [ -r "$source" ]; then
78 | # Copy the dSYM into a the targets temp dir.
79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
81 |
82 | local basename
83 | basename="$(basename -s .framework.dSYM "$source")"
84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
85 |
86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
88 | strip_invalid_archs "$binary"
89 | fi
90 |
91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
92 | # Move the stripped file into its final destination.
93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
95 | else
96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
98 | fi
99 | fi
100 | }
101 |
102 | # Signs a framework with the provided identity
103 | code_sign_if_enabled() {
104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
105 | # Use the current code_sign_identitiy
106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
108 |
109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
110 | code_sign_cmd="$code_sign_cmd &"
111 | fi
112 | echo "$code_sign_cmd"
113 | eval "$code_sign_cmd"
114 | fi
115 | }
116 |
117 | # Strip invalid architectures
118 | strip_invalid_archs() {
119 | binary="$1"
120 | # Get architectures for current target binary
121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
122 | # Intersect them with the architectures we are building for
123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
124 | # If there are no archs supported by this binary then warn the user
125 | if [[ -z "$intersected_archs" ]]; then
126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
127 | STRIP_BINARY_RETVAL=0
128 | return
129 | fi
130 | stripped=""
131 | for arch in $binary_archs; do
132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
133 | # Strip non-valid architectures in-place
134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
135 | stripped="$stripped $arch"
136 | fi
137 | done
138 | if [[ "$stripped" ]]; then
139 | echo "Stripped $binary of architectures:$stripped"
140 | fi
141 | STRIP_BINARY_RETVAL=1
142 | }
143 |
144 |
145 | if [[ "$CONFIGURATION" == "Debug" ]]; then
146 | install_framework "${BUILT_PRODUCTS_DIR}/AsyncSwift-tvOS/Async.framework"
147 | fi
148 | if [[ "$CONFIGURATION" == "Release" ]]; then
149 | install_framework "${BUILT_PRODUCTS_DIR}/AsyncSwift-tvOS/Async.framework"
150 | fi
151 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
152 | wait
153 | fi
154 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
61 | ;;
62 | *.xib)
63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
115 | else
116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_AsyncExample_tvOSVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_AsyncExample_tvOSVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-tvOS"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-tvOS/Async.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "Async"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_AsyncExample_tvOS {
2 | umbrella header "Pods-AsyncExample tvOS-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/AsyncPodsExample/Pods/Target Support Files/Pods-AsyncExample tvOS/Pods-AsyncExample tvOS.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-tvOS"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AsyncSwift-tvOS/Async.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "Async"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/AsyncSwift.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "AsyncSwift"
3 | s.version = "2.1.0"
4 | s.summary = "Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch"
5 | s.homepage = "https://github.com/duemunk/Async"
6 | s.license = { :type => "MIT" }
7 | s.authors = { "Tobias Due Munk" => "tobias@developmunk.dk" }
8 |
9 | s.osx.deployment_target = "10.10"
10 | s.ios.deployment_target = "8.0"
11 | s.tvos.deployment_target = "9.0"
12 | s.watchos.deployment_target = "3.0"
13 | s.source = { :git => "https://github.com/duemunk/Async.git", :tag => "2.0.5"}
14 | s.source_files = "Sources/**/*.swift"
15 | s.requires_arc = true
16 | s.module_name = 'Async'
17 | s.swift_versions = ['4.0', '4.2', '5.0', '5.1']
18 | end
19 |
--------------------------------------------------------------------------------
/Configs/Async-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | // Generated using xcconfig-extractor by Toshihiro Suzuki - https://github.com/toshi0383/xcconfig-extractor
2 | ENABLE_TESTABILITY = YES
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks
4 | HEADER_SEARCH_PATHS = $(inherited)
5 | INFOPLIST_FILE = Async.xcodeproj/Async_Info.plist
6 | LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks @loader_path/Frameworks
7 | OTHER_LDFLAGS = $(inherited)
8 | OTHER_SWIFT_FLAGS = $(inherited)
9 | PRODUCT_BUNDLE_IDENTIFIER = dk.developmunk.Async
10 | PRODUCT_MODULE_NAME = $(TARGET_NAME:c99extidentifier)
11 | PRODUCT_NAME = $(TARGET_NAME:c99extidentifier)
12 | SKIP_INSTALL = YES
13 | TARGET_NAME = Async
14 |
--------------------------------------------------------------------------------
/Configs/Async-Release.xcconfig:
--------------------------------------------------------------------------------
1 | // Generated using xcconfig-extractor by Toshihiro Suzuki - https://github.com/toshi0383/xcconfig-extractor
2 | ENABLE_TESTABILITY = YES
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks
4 | HEADER_SEARCH_PATHS = $(inherited)
5 | INFOPLIST_FILE = Async.xcodeproj/Async_Info.plist
6 | LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks @loader_path/Frameworks
7 | OTHER_LDFLAGS = $(inherited)
8 | OTHER_SWIFT_FLAGS = $(inherited)
9 | PRODUCT_BUNDLE_IDENTIFIER = dk.developmunk.Async
10 | PRODUCT_MODULE_NAME = $(TARGET_NAME:c99extidentifier)
11 | PRODUCT_NAME = $(TARGET_NAME:c99extidentifier)
12 | SKIP_INSTALL = YES
13 | TARGET_NAME = Async
14 |
--------------------------------------------------------------------------------
/Configs/AsyncTests-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | // Generated using xcconfig-extractor by Toshihiro Suzuki - https://github.com/toshi0383/xcconfig-extractor
2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks
4 | HEADER_SEARCH_PATHS = $(inherited)
5 | INFOPLIST_FILE = Async.xcodeproj/AsyncTests_Info.plist
6 | LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks @loader_path/Frameworks
7 | OTHER_LDFLAGS = $(inherited)
8 | OTHER_SWIFT_FLAGS = $(inherited)
9 | TARGET_NAME = AsyncTests
10 |
--------------------------------------------------------------------------------
/Configs/AsyncTests-Release.xcconfig:
--------------------------------------------------------------------------------
1 | // Generated using xcconfig-extractor by Toshihiro Suzuki - https://github.com/toshi0383/xcconfig-extractor
2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks
4 | HEADER_SEARCH_PATHS = $(inherited)
5 | INFOPLIST_FILE = Async.xcodeproj/AsyncTests_Info.plist
6 | LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks @loader_path/Frameworks
7 | OTHER_LDFLAGS = $(inherited)
8 | OTHER_SWIFT_FLAGS = $(inherited)
9 | TARGET_NAME = AsyncTests
10 |
--------------------------------------------------------------------------------
/Configs/Base-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | // Generated using xcconfig-extractor by Toshihiro Suzuki - https://github.com/toshi0383/xcconfig-extractor
2 | #include "Base.xcconfig"
3 | CLANG_ENABLE_OBJC_ARC = YES
4 | COMBINE_HIDPI_IMAGES = YES
5 | COPY_PHASE_STRIP = NO
6 | DEBUG_INFORMATION_FORMAT = dwarf
7 | DYLIB_INSTALL_NAME_BASE = @rpath
8 | ENABLE_NS_ASSERTIONS = YES
9 | GCC_OPTIMIZATION_LEVEL = 0
10 | MACOSX_DEPLOYMENT_TARGET = 10.10
11 | ONLY_ACTIVE_ARCH = YES
12 | OTHER_SWIFT_FLAGS = -DXcode
13 | PRODUCT_NAME = $(TARGET_NAME)
14 | SDKROOT = macosx
15 | SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator
16 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE
17 | SWIFT_OPTIMIZATION_LEVEL = -Onone
18 | SWIFT_VERSION = 4.2
19 | USE_HEADERMAP = NO
20 |
--------------------------------------------------------------------------------
/Configs/Base-Release.xcconfig:
--------------------------------------------------------------------------------
1 | // Generated using xcconfig-extractor by Toshihiro Suzuki - https://github.com/toshi0383/xcconfig-extractor
2 | #include "Base.xcconfig"
3 | CLANG_ENABLE_OBJC_ARC = YES
4 | COMBINE_HIDPI_IMAGES = YES
5 | COPY_PHASE_STRIP = YES
6 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
7 | DYLIB_INSTALL_NAME_BASE = @rpath
8 | GCC_OPTIMIZATION_LEVEL = s
9 | MACOSX_DEPLOYMENT_TARGET = 10.10
10 | OTHER_SWIFT_FLAGS = -DXcode
11 | PRODUCT_NAME = $(TARGET_NAME)
12 | SDKROOT = macosx
13 | SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator
14 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE
15 | SWIFT_OPTIMIZATION_LEVEL = -Owholemodule
16 | SWIFT_VERSION = 4.2
17 | USE_HEADERMAP = NO
18 |
--------------------------------------------------------------------------------
/Configs/Base.xcconfig:
--------------------------------------------------------------------------------
1 | APPLICATION_EXTENSION_API_ONLY=YES
2 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=YES
3 | CURRENT_PROJECT_VERSION=1
4 |
--------------------------------------------------------------------------------
/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 | 2.0.5
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Tobias Due Munk
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | XCODEBUILD=xcodebuild
2 | OPTIONS=\
3 | -project Async.xcodeproj\
4 | -scheme Async\
5 | -destination "$(DESTINATION)"
6 | SHOW_BUILD_SETTINGS=$(XCODEBUILD) $(OPTIONS) -showBuildSettings
7 | BUILD=$(XCODEBUILD) $(OPTIONS) build
8 | CLEAN=$(XCODEBUILD) $(OPTIONS) clean
9 |
10 | .PHONY: settings build clean
11 |
12 | settings:
13 | $(SHOW_BUILD_SETTINGS)
14 |
15 | build: clean
16 | $(BUILD)
17 |
18 | clean:
19 | $(CLEAN)
20 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.1
2 | //
3 | // Async.swift
4 | //
5 | // Created by Tobias DM on 18/02/16.
6 | //
7 | // The MIT License (MIT)
8 | // Copyright (c) 2014 Tobias Due Munk
9 | //
10 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
11 | // this software and associated documentation files (the "Software"), to deal in
12 | // the Software without restriction, including without limitation the rights to
13 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14 | // the Software, and to permit persons to whom the Software is furnished to do so,
15 | // subject to the following conditions:
16 | //
17 | // The above copyright notice and this permission notice shall be included in all
18 | // copies or substantial portions of the Software.
19 | //
20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
23 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 |
27 | import PackageDescription
28 |
29 | let package = Package(
30 | name: "Async",
31 | platforms: [
32 | .macOS(.v10_10),
33 | .iOS(.v8),
34 | .watchOS(.v3),
35 | .tvOS(.v9),
36 | ],
37 | products: [
38 | .library(name: "Async", targets: ["Async"]),
39 | ],
40 | targets: [
41 | .target(name: "Async"),
42 | .testTarget(name: "AsyncTests", dependencies: ["Async"])
43 | ]
44 | )
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This project is no longer maintained.
2 |
3 | # Async
4 | []() []() []() []() []() [](https://travis-ci.org/duemunk/Async) [](https://github.com/Carthage/Carthage) [](https://github.com/CocoaPods/CocoaPods) [](https://gist.github.com/duemunk/61e45932dbb1a2ca0954)
5 |
6 |
7 |
8 | Now more than syntactic sugar for asynchronous dispatches in Grand Central Dispatch ([GCD](https://developer.apple.com/library/prerelease/ios/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html)) in Swift
9 |
10 | **Async** sugar looks like this:
11 | ```swift
12 | Async.userInitiated {
13 | 10
14 | }.background {
15 | "Score: \($0)"
16 | }.main {
17 | label.text = $0
18 | }
19 | ```
20 |
21 | So even though GCD has nice-ish syntax as of Swift 3.0, compare the above with:
22 | ```swift
23 | DispatchQueue.global(qos: .userInitiated).async {
24 | let value = 10
25 | DispatchQueue.global(qos: .background).async {
26 | let text = "Score: \(value)"
27 | DispatchQueue.main.async {
28 | label.text = text
29 | }
30 | }
31 | }
32 | ```
33 |
34 | **AsyncGroup** sugar looks like this:
35 | ```swift
36 | let group = AsyncGroup()
37 | group.background {
38 | print("This is run on the background queue")
39 | }
40 | group.background {
41 | print("This is also run on the background queue in parallel")
42 | }
43 | group.wait()
44 | print("Both asynchronous blocks are complete")
45 | ```
46 |
47 | ### Install
48 | #### Swift Package Manager
49 | ##### Add To Your Project In Xcode 11:
50 | File > Swift Packages > Add Package Dependency
51 | ##### Add As A Dependency In Package.swift:
52 | ```swift
53 | dependencies: [
54 | .package(url: "https://github.com/duemunk/Async", from: "2.1.0"),
55 | ],
56 | ```
57 | #### CocoaPods
58 | ```ruby
59 | use_frameworks!
60 | pod "AsyncSwift"
61 | ```
62 | #### Carthage
63 | ```ruby
64 | github "duemunk/Async"
65 | ```
66 |
67 | ### Benefits
68 | 1. Avoid code indentation by chaining
69 | 2. Arguments and return types reduce polluted scopes
70 |
71 | ### Things you can do
72 | Supports the modern queue classes:
73 | ```swift
74 | Async.main {}
75 | Async.userInteractive {}
76 | Async.userInitiated {}
77 | Async.utility {}
78 | Async.background {}
79 | ```
80 |
81 | Chain as many blocks as you want:
82 | ```swift
83 | Async.userInitiated {
84 | // 1
85 | }.main {
86 | // 2
87 | }.background {
88 | // 3
89 | }.main {
90 | // 4
91 | }
92 | ```
93 |
94 | Store reference for later chaining:
95 | ```swift
96 | let backgroundBlock = Async.background {
97 | print("This is run on the background queue")
98 | }
99 |
100 | // Run other code here...
101 |
102 | // Chain to reference
103 | backgroundBlock.main {
104 | print("This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)), after the previous block")
105 | }
106 | ```
107 |
108 | Custom queues:
109 | ```swift
110 | let customQueue = DispatchQueue(label: "CustomQueueLabel", attributes: [.concurrent])
111 | let otherCustomQueue = DispatchQueue(label: "OtherCustomQueueLabel")
112 | Async.custom(queue: customQueue) {
113 | print("Custom queue")
114 | }.custom(queue: otherCustomQueue) {
115 | print("Other custom queue")
116 | }
117 | ```
118 |
119 | Dispatch block after delay:
120 | ```swift
121 | let seconds = 0.5
122 | Async.main(after: seconds) {
123 | print("Is called after 0.5 seconds")
124 | }.background(after: 0.4) {
125 | print("At least 0.4 seconds after previous block, and 0.9 after Async code is called")
126 | }
127 | ```
128 |
129 | Cancel blocks that aren't already dispatched:
130 | ```swift
131 | // Cancel blocks not yet dispatched
132 | let block1 = Async.background {
133 | // Heavy work
134 | for i in 0...1000 {
135 | print("A \(i)")
136 | }
137 | }
138 | let block2 = block1.background {
139 | print("B – shouldn't be reached, since cancelled")
140 | }
141 | Async.main {
142 | // Cancel async to allow block1 to begin
143 | block1.cancel() // First block is _not_ cancelled
144 | block2.cancel() // Second block _is_ cancelled
145 | }
146 | ```
147 |
148 | Wait for block to finish – an ease way to continue on current queue after background task:
149 | ```swift
150 | let block = Async.background {
151 | // Do stuff
152 | }
153 |
154 | // Do other stuff
155 |
156 | block.wait()
157 | ```
158 |
159 | ### How does it work
160 | The way it work is by using the new notification API for GCD introduced in OS X 10.10 and iOS 8. Each chaining block is called when the previous queue has finished.
161 | ```swift
162 | let previousBlock = {}
163 | let chainingBlock = {}
164 | let dispatchQueueForChainingBlock = ...
165 |
166 | // Use the GCD API to extend the blocks
167 | let _previousBlock = dispatch_block_create(DISPATCH_BLOCK_INHERIT_QOS_CLASS, previousBlock)
168 | let _chainingBlock = dispatch_block_create(DISPATCH_BLOCK_INHERIT_QOS_CLASS, chainingBlock)
169 |
170 | // Use the GCD API to call back when finishing the "previous" block
171 | dispatch_block_notify(_previousBlock, dispatchQueueForChainingBlock, _chainingBlock)
172 | ```
173 |
174 | The syntax part of the chaining works by having class methods on the `Async` object e.g. `Async.main {}` which returns a struct. The struct has matching methods e.g. `theStruct.main {}`.
175 |
176 | ### Known bugs
177 | Modern GCD queues don't work as expected in the iOS Simulator. See issues [13](https://github.com/duemunk/Async/issues/13), [22](https://github.com/duemunk/Async/issues/22).
178 |
179 | ### Known improvements
180 | The ```dispatch_block_t``` can't be extended. Workaround used: Wrap ```dispatch_block_t``` in a struct that takes the block as a property.
181 |
182 | ### Apply
183 | There is also a wrapper for [`dispatch_apply()`](https://developer.apple.com/library/mac/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html#//apple_ref/c/func/dispatch_apply) for quick parallelisation of a `for` loop.
184 | ```swift
185 | Apply.background(100) { i in
186 | // Do stuff e.g. print(i)
187 | }
188 | ```
189 | Note that this function returns after the block has been run all 100 times i.e. it is not asynchronous. For asynchronous behaviour, wrap it in a an `Async` block like `Async.background { Apply.background(100) { ... } }`.
190 |
191 | ### AsyncGroup
192 | **AsyncGroup** facilitates working with groups of asynchronous blocks.
193 |
194 | Multiple dispatch blocks with GCD:
195 | ```swift
196 | let group = AsyncGroup()
197 | group.background {
198 | // Run on background queue
199 | }
200 | group.utility {
201 | // Run on utility queue, in parallel to the previous block
202 | }
203 | group.wait()
204 | ```
205 | All modern queue classes:
206 | ```swift
207 | group.main {}
208 | group.userInteractive {}
209 | group.userInitiated {}
210 | group.utility {}
211 | group.background {}
212 | ```
213 | Custom queues:
214 | ```swift
215 | let customQueue = dispatch_queue_create("Label", DISPATCH_QUEUE_CONCURRENT)
216 | group.custom(queue: customQueue) {}
217 | ```
218 | Wait for group to finish:
219 | ```swift
220 | let group = AsyncGroup()
221 | group.background {
222 | // Do stuff
223 | }
224 | group.background {
225 | // Do other stuff in parallel
226 | }
227 | // Wait for both to finish
228 | group.wait()
229 | // Do rest of stuff
230 | ```
231 | Custom asynchronous operations:
232 | ```swift
233 | let group = AsyncGroup()
234 | group.enter()
235 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
236 | // Do stuff
237 | group.leave()
238 | }
239 | group.enter()
240 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
241 | // Do other stuff in parallel
242 | group.leave()
243 | }
244 | // Wait for both to finish
245 | group.wait()
246 | // Do rest of stuff
247 | ```
248 |
249 | ### License
250 | The MIT License (MIT)
251 |
252 | Copyright (c) 2016 Tobias Due Munk
253 |
254 | Permission is hereby granted, free of charge, to any person obtaining a copy of
255 | this software and associated documentation files (the "Software"), to deal in
256 | the Software without restriction, including without limitation the rights to
257 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
258 | the Software, and to permit persons to whom the Software is furnished to do so,
259 | subject to the following conditions:
260 |
261 | The above copyright notice and this permission notice shall be included in all
262 | copies or substantial portions of the Software.
263 |
264 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
265 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
266 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
267 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
268 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
269 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
270 |
--------------------------------------------------------------------------------
/Sources/Async/Async.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Async.swift
3 | //
4 | // Created by Tobias DM on 15/07/14.
5 | //
6 | // OS X 10.10+ and iOS 8.0+
7 | // Only use with ARC
8 | //
9 | // The MIT License (MIT)
10 | // Copyright (c) 2014 Tobias Due Munk
11 | //
12 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
13 | // this software and associated documentation files (the "Software"), to deal in
14 | // the Software without restriction, including without limitation the rights to
15 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
16 | // the Software, and to permit persons to whom the Software is furnished to do so,
17 | // subject to the following conditions:
18 | //
19 | // The above copyright notice and this permission notice shall be included in all
20 | // copies or substantial portions of the Software.
21 | //
22 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
24 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
25 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
26 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 |
29 |
30 | import Foundation
31 |
32 | // MARK: - DSL for GCD queues
33 |
34 | /**
35 | `GCD` is a convenience enum with cases to get `DispatchQueue` of different quality of service classes, as provided by `DispatchQueue.global` or `DispatchQueue` for main thread or a specific custom queue.
36 |
37 | let mainQueue = GCD.main
38 | let utilityQueue = GCD.utility
39 | let customQueue = GCD.custom(queue: aDispatchQueue)
40 |
41 | - SeeAlso: Grand Central Dispatch
42 | */
43 | private enum GCD {
44 | case main, userInteractive, userInitiated, utility, background, custom(queue: DispatchQueue)
45 |
46 | var queue: DispatchQueue {
47 | switch self {
48 | case .main: return .main
49 | case .userInteractive: return .global(qos: .userInteractive)
50 | case .userInitiated: return .global(qos: .userInitiated)
51 | case .utility: return .global(qos: .utility)
52 | case .background: return .global(qos: .background)
53 | case .custom(let queue): return queue
54 | }
55 | }
56 | }
57 |
58 |
59 |
60 | // MARK: - Async – Struct
61 |
62 | /**
63 | The **Async** struct is the main part of the Async.framework. Handles an internally `@convention(block) () -> Swift.Void`.
64 |
65 | Chainable dispatch blocks with GCD:
66 |
67 | Async.background {
68 | // Run on background queue
69 | }.main {
70 | // Run on main queue, after the previous block
71 | }
72 |
73 | All moderns queue classes:
74 |
75 | Async.main {}
76 | Async.userInteractive {}
77 | Async.userInitiated {}
78 | Async.utility {}
79 | Async.background {}
80 |
81 | Custom queues:
82 |
83 | let customQueue = dispatch_queue_create("Label", DISPATCH_QUEUE_CONCURRENT)
84 | Async.customQueue(customQueue) {}
85 |
86 | Dispatch block after delay:
87 |
88 | let seconds = 0.5
89 | Async.main(after: seconds) {}
90 |
91 | Cancel blocks not yet dispatched
92 |
93 | let block1 = Async.background {
94 | // Some work
95 | }
96 | let block2 = block1.background {
97 | // Some other work
98 | }
99 | Async.main {
100 | // Cancel async to allow block1 to begin
101 | block1.cancel() // First block is NOT cancelled
102 | block2.cancel() // Second block IS cancelled
103 | }
104 |
105 | Wait for block to finish:
106 |
107 | let block = Async.background {
108 | // Do stuff
109 | }
110 | // Do other stuff
111 | // Wait for "Do stuff" to finish
112 | block.wait()
113 | // Do rest of stuff
114 |
115 | - SeeAlso: Grand Central Dispatch
116 | */
117 |
118 | private class Reference {
119 | var value: T?
120 | }
121 |
122 | public typealias Async = AsyncBlock
123 |
124 | public struct AsyncBlock {
125 |
126 |
127 | // MARK: - Private properties and init
128 |
129 | /**
130 | Private property to hold internally on to a `@convention(block) () -> Swift.Void`
131 | */
132 | private let block: DispatchWorkItem
133 |
134 | private let input: Reference?
135 | private let output_: Reference
136 |
137 | public var output: Out? { output_.value }
138 |
139 | /**
140 | Private init that takes a `@convention(block) () -> Swift.Void`
141 | */
142 | private init(_ block: DispatchWorkItem, input: Reference? = nil, output: Reference = Reference()) {
143 | self.block = block
144 | self.input = input
145 | self.output_ = output
146 | }
147 |
148 |
149 | // MARK: - Static methods
150 |
151 | /**
152 | Sends the a block to be run asynchronously on the main thread.
153 |
154 | - parameters:
155 | - after: After how many seconds the block should be run.
156 | - block: The block that is to be passed to be run on the main queue
157 |
158 | - returns: An `Async` struct
159 |
160 | - SeeAlso: Has parity with non-static method
161 | */
162 | @discardableResult
163 | public static func main(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock {
164 | AsyncBlock.async(after: seconds, block: block, queue: .main)
165 | }
166 |
167 | /**
168 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_USER_INTERACTIVE.
169 |
170 | - parameters:
171 | - after: After how many seconds the block should be run.
172 | - block: The block that is to be passed to be run on the queue
173 |
174 | - returns: An `Async` struct
175 |
176 | - SeeAlso: Has parity with non-static method
177 | */
178 | @discardableResult
179 | public static func userInteractive(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock {
180 | AsyncBlock.async(after: seconds, block: block, queue: .userInteractive)
181 | }
182 |
183 | /**
184 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_USER_INITIATED.
185 |
186 | - parameters:
187 | - after: After how many seconds the block should be run.
188 | - block: The block that is to be passed to be run on the queue
189 |
190 | - returns: An `Async` struct
191 |
192 | - SeeAlso: Has parity with non-static method
193 | */
194 | @discardableResult
195 | public static func userInitiated(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock {
196 | Async.async(after: seconds, block: block, queue: .userInitiated)
197 | }
198 |
199 | /**
200 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_UTILITY.
201 |
202 | - parameters:
203 | - after: After how many seconds the block should be run.
204 | - block: The block that is to be passed to be run on queue
205 |
206 | - returns: An `Async` struct
207 |
208 | - SeeAlso: Has parity with non-static method
209 | */
210 | @discardableResult
211 | public static func utility(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock {
212 | Async.async(after: seconds, block: block, queue: .utility)
213 | }
214 |
215 | /**
216 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_BACKGROUND.
217 |
218 | - parameters:
219 | - after: After how many seconds the block should be run.
220 | - block: The block that is to be passed to be run on the queue
221 |
222 | - returns: An `Async` struct
223 |
224 | - SeeAlso: Has parity with non-static method
225 | */
226 | @discardableResult
227 | public static func background(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock {
228 | Async.async(after: seconds, block: block, queue: .background)
229 | }
230 |
231 | /**
232 | Sends the a block to be run asynchronously on a custom queue.
233 |
234 | - parameters:
235 | - after: After how many seconds the block should be run.
236 | - block: The block that is to be passed to be run on the queue
237 |
238 | - returns: An `Async` struct
239 |
240 | - SeeAlso: Has parity with non-static method
241 | */
242 | @discardableResult
243 | public static func custom(queue: DispatchQueue, after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock {
244 | Async.async(after: seconds, block: block, queue: .custom(queue: queue))
245 | }
246 |
247 |
248 | // MARK: - Private static methods
249 |
250 | /**
251 | Convenience for dispatch_async(). Encapsulates the block in a "true" GCD block using DISPATCH_BLOCK_INHERIT_QOS_CLASS.
252 |
253 | - parameters:
254 | - block: The block that is to be passed to be run on the `queue`
255 | - queue: The queue on which the `block` is run.
256 |
257 | - returns: An `Async` struct which encapsulates the `@convention(block) () -> Swift.Void`
258 | */
259 |
260 | private static func async(after seconds: Double? = nil, block: @escaping () -> O, queue: GCD) -> AsyncBlock {
261 | let reference = Reference()
262 | let block = DispatchWorkItem(block: {
263 | reference.value = block()
264 | })
265 |
266 | if let seconds = seconds {
267 | let time = DispatchTime.now() + seconds
268 | queue.queue.asyncAfter(deadline: time, execute: block)
269 | } else {
270 | queue.queue.async(execute: block)
271 | }
272 |
273 | // Wrap block in a struct since @convention(block) () -> Swift.Void can't be extended
274 | return AsyncBlock(block, output: reference)
275 | }
276 |
277 |
278 | // MARK: - Instance methods (matches static ones)
279 |
280 | /**
281 | Sends the a block to be run asynchronously on the main thread, after the current block has finished.
282 |
283 | - parameters:
284 | - after: After how many seconds the block should be run.
285 | - block: The block that is to be passed to be run on the main queue
286 |
287 | - returns: An `Async` struct
288 |
289 | - SeeAlso: Has parity with static method
290 | */
291 | @discardableResult
292 | public func main(after seconds: Double? = nil, _ chainingBlock: @escaping (Out) -> O) -> AsyncBlock {
293 | chain(after: seconds, block: chainingBlock, queue: .main)
294 | }
295 |
296 | /**
297 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_USER_INTERACTIVE, after the current block has finished.
298 |
299 | - parameters:
300 | - after: After how many seconds the block should be run.
301 | - block: The block that is to be passed to be run on the queue
302 |
303 | - returns: An `Async` struct
304 |
305 | - SeeAlso: Has parity with static method
306 | */
307 | @discardableResult
308 | public func userInteractive(after seconds: Double? = nil, _ chainingBlock: @escaping (Out) -> O) -> AsyncBlock {
309 | chain(after: seconds, block: chainingBlock, queue: .userInteractive)
310 | }
311 |
312 | /**
313 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_USER_INITIATED, after the current block has finished.
314 |
315 | - parameters:
316 | - after: After how many seconds the block should be run.
317 | - block: The block that is to be passed to be run on the queue
318 |
319 | - returns: An `Async` struct
320 |
321 | - SeeAlso: Has parity with static method
322 | */
323 | @discardableResult
324 | public func userInitiated(after seconds: Double? = nil, _ chainingBlock: @escaping (Out) -> O) -> AsyncBlock {
325 | chain(after: seconds, block: chainingBlock, queue: .userInitiated)
326 | }
327 |
328 | /**
329 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_UTILITY, after the current block has finished.
330 |
331 | - parameters:
332 | - after: After how many seconds the block should be run.
333 | - block: The block that is to be passed to be run on the queue
334 |
335 | - returns: An `Async` struct
336 |
337 | - SeeAlso: Has parity with static method
338 | */
339 | @discardableResult
340 | public func utility(after seconds: Double? = nil, _ chainingBlock: @escaping (Out) -> O) -> AsyncBlock {
341 | chain(after: seconds, block: chainingBlock, queue: .utility)
342 | }
343 |
344 | /**
345 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_BACKGROUND, after the current block has finished.
346 |
347 | - parameters:
348 | - after: After how many seconds the block should be run.
349 | - block: The block that is to be passed to be run on the queue
350 |
351 | - returns: An `Async` struct
352 |
353 | - SeeAlso: Has parity with static method
354 | */
355 | @discardableResult
356 | public func background(after seconds: Double? = nil, _ chainingBlock: @escaping (Out) -> O) -> AsyncBlock {
357 | chain(after: seconds, block: chainingBlock, queue: .background)
358 | }
359 |
360 | /**
361 | Sends the a block to be run asynchronously on a custom queue, after the current block has finished.
362 |
363 | - parameters:
364 | - after: After how many seconds the block should be run.
365 | - block: The block that is to be passed to be run on the queue
366 |
367 | - returns: An `Async` struct
368 |
369 | - SeeAlso: Has parity with static method
370 | */
371 | @discardableResult
372 | public func custom(queue: DispatchQueue, after seconds: Double? = nil, _ chainingBlock: @escaping (Out) -> O) -> AsyncBlock {
373 | chain(after: seconds, block: chainingBlock, queue: .custom(queue: queue))
374 | }
375 |
376 | // MARK: - Instance methods
377 |
378 | /**
379 | Convenience function to call `dispatch_block_cancel()` on the encapsulated block.
380 | Cancels the current block, if it hasn't already begun running to GCD.
381 |
382 | Usage:
383 |
384 | let block1 = Async.background {
385 | // Some work
386 | }
387 | let block2 = block1.background {
388 | // Some other work
389 | }
390 | Async.main {
391 | // Cancel async to allow block1 to begin
392 | block1.cancel() // First block is NOT cancelled
393 | block2.cancel() // Second block IS cancelled
394 | }
395 |
396 | */
397 | public func cancel() {
398 | block.cancel()
399 | }
400 |
401 |
402 | /**
403 | Convenience function to call `dispatch_block_wait()` on the encapsulated block.
404 | Waits for the current block to finish, on any given thread.
405 |
406 | - parameters:
407 | - seconds: Max seconds to wait for block to finish. If value is 0.0, it uses DISPATCH_TIME_FOREVER. Default value is 0.
408 |
409 | - SeeAlso: dispatch_block_wait, DISPATCH_TIME_FOREVER
410 | */
411 | @discardableResult
412 | public func wait(seconds: Double? = nil) -> DispatchTimeoutResult {
413 | let timeout = seconds
414 | .flatMap { DispatchTime.now() + $0 }
415 | ?? .distantFuture
416 | return block.wait(timeout: timeout)
417 | }
418 |
419 |
420 | // MARK: Private instance methods
421 |
422 | /**
423 | Convenience for `dispatch_block_notify()` to
424 |
425 | - parameters:
426 | - block: The block that is to be passed to be run on the `queue`
427 | - queue: The queue on which the `block` is run.
428 |
429 | - returns: An `Async` struct which encapsulates the `@convention(block) () -> Swift.Void`, which is called when the current block has finished.
430 |
431 | - SeeAlso: dispatch_block_notify, dispatch_block_create
432 | */
433 |
434 | private func chain(after seconds: Double? = nil, block chainingBlock: @escaping (Out) -> O, queue: GCD) -> AsyncBlock {
435 | let reference = Reference()
436 | let dispatchWorkItem = DispatchWorkItem(block: {
437 | reference.value = chainingBlock(self.output_.value!)
438 | })
439 |
440 | let queue = queue.queue
441 | if let seconds = seconds {
442 | block.notify(queue: queue) {
443 | let time = DispatchTime.now() + seconds
444 | queue.asyncAfter(deadline: time, execute: dispatchWorkItem)
445 | }
446 | } else {
447 | block.notify(queue: queue, execute: dispatchWorkItem)
448 | }
449 |
450 | // See Async.async() for comments
451 | return AsyncBlock(dispatchWorkItem, input: self.output_, output: reference)
452 | }
453 | }
454 |
455 |
456 | // MARK: - Apply - DSL for `dispatch_apply`
457 |
458 | /**
459 | `Apply` is an empty struct with convenience static functions to parallelize a for-loop, as provided by `dispatch_apply`.
460 |
461 | Apply.background(100) { i in
462 | // Calls blocks in parallel
463 | }
464 |
465 | `Apply` runs a block multiple times, before returning. If you want run the block asynchronously from the current thread, wrap it in an `Async` block:
466 |
467 | Async.background {
468 | Apply.background(100) { i in
469 | // Calls blocks in parallel asynchronously
470 | }
471 | }
472 |
473 | - SeeAlso: Grand Central Dispatch, dispatch_apply
474 | */
475 | public struct Apply {
476 |
477 | /**
478 | Block is run any given amount of times on a queue with a quality of service of QOS_CLASS_USER_INTERACTIVE. The block is being passed an index parameter.
479 |
480 | - parameters:
481 | - iterations: How many times the block should be run. Index provided to block goes from `0.. ()) {
485 | GCD.userInteractive.queue.async {
486 | DispatchQueue.concurrentPerform(iterations: iterations, execute: block)
487 | }
488 | }
489 |
490 | /**
491 | Block is run any given amount of times on a queue with a quality of service of QOS_CLASS_USER_INITIATED. The block is being passed an index parameter.
492 |
493 | - parameters:
494 | - iterations: How many times the block should be run. Index provided to block goes from `0.. ()) {
498 | GCD.userInitiated.queue.async {
499 | DispatchQueue.concurrentPerform(iterations: iterations, execute: block)
500 | }
501 | }
502 |
503 | /**
504 | Block is run any given amount of times on a queue with a quality of service of QOS_CLASS_UTILITY. The block is being passed an index parameter.
505 |
506 | - parameters:
507 | - iterations: How many times the block should be run. Index provided to block goes from `0.. ()) {
511 | GCD.utility.queue.async {
512 | DispatchQueue.concurrentPerform(iterations: iterations, execute: block)
513 | }
514 | }
515 |
516 | /**
517 | Block is run any given amount of times on a queue with a quality of service of QOS_CLASS_BACKGROUND. The block is being passed an index parameter.
518 |
519 | - parameters:
520 | - iterations: How many times the block should be run. Index provided to block goes from `0.. ()) {
524 | GCD.background.queue.async {
525 | DispatchQueue.concurrentPerform(iterations: iterations, execute: block)
526 | }
527 | }
528 |
529 | /**
530 | Block is run any given amount of times on a custom queue. The block is being passed an index parameter.
531 |
532 | - parameters:
533 | - iterations: How many times the block should be run. Index provided to block goes from `0.. ()) {
537 | queue.async {
538 | DispatchQueue.concurrentPerform(iterations: iterations, execute: block)
539 | }
540 | }
541 | }
542 |
543 |
544 | // MARK: - AsyncGroup – Struct
545 |
546 | /**
547 | The **AsyncGroup** struct facilitates working with groups of asynchronous blocks. Handles a internally `dispatch_group_t`.
548 |
549 | Multiple dispatch blocks with GCD:
550 |
551 | let group = AsyncGroup()
552 | group.background {
553 | // Run on background queue
554 | }
555 | group.utility {
556 | // Run on untility queue, after the previous block
557 | }
558 | group.wait()
559 |
560 | All moderns queue classes:
561 |
562 | group.main {}
563 | group.userInteractive {}
564 | group.userInitiated {}
565 | group.utility {}
566 | group.background {}
567 |
568 | Custom queues:
569 |
570 | let customQueue = dispatch_queue_create("Label", DISPATCH_QUEUE_CONCURRENT)
571 | group.customQueue(customQueue) {}
572 |
573 | Wait for group to finish:
574 |
575 | let group = AsyncGroup()
576 | group.background {
577 | // Do stuff
578 | }
579 | group.background {
580 | // Do other stuff in parallel
581 | }
582 | // Wait for both to finish
583 | group.wait()
584 | // Do rest of stuff
585 |
586 | - SeeAlso: Grand Central Dispatch
587 | */
588 | public struct AsyncGroup {
589 |
590 | // MARK: - Private properties and init
591 |
592 | /**
593 | Private property to internally on to a `dispatch_group_t`
594 | */
595 | private let group = DispatchGroup()
596 |
597 | /**
598 | Private init that takes a `dispatch_group_t`
599 | */
600 | public init() {}
601 |
602 | /**
603 | Convenience for `dispatch_group_async()`
604 |
605 | - parameters:
606 | - block: The block that is to be passed to be run on the `queue`
607 | - queue: The queue on which the `block` is run.
608 |
609 | - SeeAlso: dispatch_group_async, dispatch_group_create
610 | */
611 | private func async(block: @escaping @convention(block) () -> Swift.Void, queue: GCD) {
612 | queue.queue.async(group: group, execute: block)
613 | }
614 |
615 | /**
616 | Convenience for `dispatch_group_enter()`. Used to add custom blocks to the current group.
617 |
618 | - SeeAlso: dispatch_group_enter, dispatch_group_leave
619 | */
620 | public func enter() {
621 | group.enter()
622 | }
623 |
624 | /**
625 | Convenience for `dispatch_group_leave()`. Used to flag a custom added block is complete.
626 |
627 | - SeeAlso: dispatch_group_enter, dispatch_group_leave
628 | */
629 | public func leave() {
630 | group.leave()
631 | }
632 |
633 |
634 | // MARK: - Instance methods
635 |
636 | /**
637 | Sends the a block to be run asynchronously on the main thread, in the current group.
638 |
639 | - parameters:
640 | - block: The block that is to be passed to be run on the main queue
641 | */
642 | public func main(_ block: @escaping @convention(block) () -> Swift.Void) {
643 | async(block: block, queue: .main)
644 | }
645 |
646 | /**
647 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_USER_INTERACTIVE, in the current group.
648 |
649 | - parameters:
650 | - block: The block that is to be passed to be run on the queue
651 | */
652 | public func userInteractive(_ block: @escaping @convention(block) () -> Swift.Void) {
653 | async(block: block, queue: .userInteractive)
654 | }
655 |
656 | /**
657 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_USER_INITIATED, in the current group.
658 |
659 | - parameters:
660 | - block: The block that is to be passed to be run on the queue
661 | */
662 | public func userInitiated(_ block: @escaping @convention(block) () -> Swift.Void) {
663 | async(block: block, queue: .userInitiated)
664 | }
665 |
666 | /**
667 | Sends the a block to be run asynchronously on a queue with a quality of service of
668 | QOS_CLASS_UTILITY, in the current block.
669 |
670 | - parameters:
671 | - block: The block that is to be passed to be run on the queue
672 | */
673 | public func utility(_ block: @escaping @convention(block) () -> Swift.Void) {
674 | async(block: block, queue: .utility)
675 | }
676 |
677 | /**
678 | Sends the a block to be run asynchronously on a queue with a quality of service of QOS_CLASS_BACKGROUND, in the current block.
679 |
680 | - parameters:
681 | - block: The block that is to be passed to be run on the queue
682 | */
683 | public func background(_ block: @escaping @convention(block) () -> Swift.Void) {
684 | async(block: block, queue: .background)
685 | }
686 |
687 | /**
688 | Sends the a block to be run asynchronously on a custom queue, in the current group.
689 |
690 | - parameters:
691 | - queue: Custom queue where the block will be run.
692 | - block: The block that is to be passed to be run on the queue
693 | */
694 | public func custom(queue: DispatchQueue, block: @escaping @convention(block) () -> Swift.Void) {
695 | async(block: block, queue: .custom(queue: queue))
696 | }
697 |
698 | /**
699 | Convenience function to call `dispatch_group_wait()` on the encapsulated block.
700 | Waits for the current group to finish, on any given thread.
701 |
702 | - parameters:
703 | - seconds: Max seconds to wait for block to finish. If value is nil, it uses DISPATCH_TIME_FOREVER. Default value is nil.
704 |
705 | - SeeAlso: dispatch_group_wait, DISPATCH_TIME_FOREVER
706 | */
707 | @discardableResult
708 | public func wait(seconds: Double? = nil) -> DispatchTimeoutResult {
709 | let timeout = seconds
710 | .flatMap { DispatchTime.now() + $0 }
711 | ?? .distantFuture
712 | return group.wait(timeout: timeout)
713 | }
714 | }
715 |
716 | /**
717 | Each QoSClassDescription's case contains a description for qos_class_t or DispatchQoS.QoSClass cases
718 | */
719 | private enum QoSClassDescription: String {
720 | case main = "Main"
721 | case userInteractive = "User Interactive"
722 | case userInitiated = "User Initiated"
723 | case `default` = "Default"
724 | case utility = "Utility"
725 | case background = "Background"
726 | case unspecified = "Unspecified"
727 | case unknown = "Unknown"
728 | }
729 |
730 | // MARK: - Extension for `qos_class_t`
731 |
732 | /**
733 | Extension to add description string for each quality of service class.
734 | */
735 | public extension qos_class_t {
736 |
737 | /**
738 | Description of the `qos_class_t`. E.g. "Main", "User Interactive", etc. for the given Quality of Service class.
739 | */
740 | var description: String {
741 | let result: QoSClassDescription
742 | switch self {
743 | case qos_class_main(): result = .main
744 | case DispatchQoS.QoSClass.userInteractive.rawValue: result = .userInteractive
745 | case DispatchQoS.QoSClass.userInitiated.rawValue: result = .userInitiated
746 | case DispatchQoS.QoSClass.default.rawValue: result = .default
747 | case DispatchQoS.QoSClass.utility.rawValue: result = .utility
748 | case DispatchQoS.QoSClass.background.rawValue: result = .background
749 | case DispatchQoS.QoSClass.unspecified.rawValue: result = .unspecified
750 | default: result = .unknown
751 | }
752 | return result.rawValue
753 | }
754 | }
755 |
756 |
757 | // MARK: - Extension for `DispatchQueue.GlobalAttributes`
758 |
759 | /**
760 | Extension to add description string for each quality of service class.
761 | */
762 | public extension DispatchQoS.QoSClass {
763 |
764 | var description: String {
765 | let result: QoSClassDescription
766 | switch self {
767 | case DispatchQoS.QoSClass(rawValue: qos_class_main())!: result = .main
768 | case .userInteractive: result = .userInteractive
769 | case .userInitiated: result = .userInitiated
770 | case .default: result = .default
771 | case .utility: result = .utility
772 | case .background: result = .background
773 | case .unspecified: result = .unspecified
774 | @unknown default: result = .unknown
775 | }
776 | return result.rawValue
777 | }
778 | }
779 |
--------------------------------------------------------------------------------
/Tests/AsyncTests/AsyncGroupTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AsyncGroupTests.swift
3 | // Async
4 | //
5 | // Created by Eneko Alonso on 2/2/16.
6 | // Copyright © 2016 developmunk. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import XCTest
11 | import Async
12 |
13 | class AsyncGroupTests: XCTestCase {
14 |
15 | // Typical testing time delay. Must be bigger than `timeMargin`
16 | let timeDelay = 0.3
17 | // Allowed error for timeDelay
18 | let timeMargin = 0.2
19 |
20 | func testMainGroup() {
21 | let expectation = self.expectation(description: "Expected on main queue")
22 | let group = AsyncGroup()
23 | group.main {
24 | #if targetEnvironment(simulator)
25 | XCTAssert(Thread.isMainThread, "Should be on main thread (simulator)")
26 | #else
27 | XCTAssertEqual(qos_class_self(), qos_class_main())
28 | #endif
29 | expectation.fulfill()
30 | }
31 | waitForExpectations(timeout: timeMargin, handler: nil)
32 | }
33 |
34 | func testUserInteractiveGroup() {
35 | let expectation = self.expectation(description: "Expected on user interactive queue")
36 | let group = AsyncGroup()
37 | group.userInteractive {
38 | XCTAssertEqual(qos_class_self(), DispatchQoS.QoSClass.userInteractive.rawValue)
39 | expectation.fulfill()
40 | }
41 | waitForExpectations(timeout: timeMargin, handler: nil)
42 | }
43 |
44 | func testUserInitiatedGroup() {
45 | let expectation = self.expectation(description: "Expected on user initiated queue")
46 | let group = AsyncGroup()
47 | group.userInitiated {
48 | XCTAssertEqual(qos_class_self(), DispatchQoS.QoSClass.userInitiated.rawValue)
49 | expectation.fulfill()
50 | }
51 | waitForExpectations(timeout: timeMargin, handler: nil)
52 | }
53 |
54 | func testUtilityGroup() {
55 | let expectation = self.expectation(description: "Expected on utility queue")
56 | let group = AsyncGroup()
57 | group.utility {
58 | XCTAssertEqual(qos_class_self(), DispatchQoS.QoSClass.utility.rawValue)
59 | expectation.fulfill()
60 | }
61 | waitForExpectations(timeout: timeMargin, handler: nil)
62 | }
63 |
64 | func testBackgroundGroup() {
65 | let expectation = self.expectation(description: "Expected on background queue")
66 | let group = AsyncGroup()
67 | group.background {
68 | XCTAssertEqual(qos_class_self(), DispatchQoS.QoSClass.background.rawValue)
69 | expectation.fulfill()
70 | }
71 | waitForExpectations(timeout: timeMargin, handler: nil)
72 | }
73 |
74 | func testGroupCustomQueueConcurrent() {
75 | let expectation = self.expectation(description: "Expected custom queue")
76 | let label = "CustomQueueLabel"
77 | let customQueue = DispatchQueue(label: label, attributes: [.concurrent])
78 | let key = DispatchSpecificKey()
79 | customQueue.setSpecific(key: key, value: label)
80 | let group = AsyncGroup()
81 | group.custom(queue: customQueue) {
82 | XCTAssertEqual(DispatchQueue.getSpecific(key: key), label)
83 | expectation.fulfill()
84 | }
85 | waitForExpectations(timeout: timeMargin, handler: nil)
86 | }
87 |
88 | func testGroupCustomQueueSerial() {
89 | let expectation = self.expectation(description: "Expected custom queue")
90 | let label = "CustomQueueLabel"
91 | let customQueue = DispatchQueue(label: label, attributes: [])
92 | let key = DispatchSpecificKey()
93 | customQueue.setSpecific(key: key, value: label)
94 | let group = AsyncGroup()
95 | group.custom(queue: customQueue) {
96 | XCTAssertEqual(DispatchQueue.getSpecific(key: key), label)
97 | expectation.fulfill()
98 | }
99 | waitForExpectations(timeout: timeMargin, handler: nil)
100 | }
101 |
102 | func testGroupWait() {
103 | var id = 0
104 | let group = AsyncGroup()
105 | group.background {
106 | // Some work
107 | Thread.sleep(forTimeInterval: 0.1)
108 | id += 1
109 | XCTAssertEqual(id, 1, "")
110 | }
111 | XCTAssertEqual(id, 0, "")
112 |
113 | group.wait()
114 | id += 1
115 | XCTAssertEqual(id, 2, "")
116 | }
117 |
118 | func testGroupWaitMax() {
119 | var id = 0
120 | let date = Date()
121 | let upperTimeDelay = timeDelay + timeMargin
122 | let group = AsyncGroup()
123 | group.background {
124 | id += 1
125 | XCTAssertEqual(id, 1, "The id should be 1") // A
126 | // Some work that takes longer than we want to wait for
127 | Thread.sleep(forTimeInterval: self.timeDelay + self.timeMargin)
128 | id += 1 // C
129 | }
130 | XCTAssertEqual(id, 0, "The id should be 0, since block is send to background")
131 | // Wait
132 | group.wait(seconds: timeDelay)
133 | id += 1
134 | XCTAssertEqual(id, 2, "The id should be 2, since the block has begun running") // B
135 | let timePassed = Date().timeIntervalSince(date)
136 | XCTAssert(timePassed < upperTimeDelay, "Shouldn't wait \(upperTimeDelay) seconds before firing")
137 | }
138 |
139 | func testMultipleGroups() {
140 | let count = 3
141 | let iterations = 0..
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 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------