├── .codecov.yml ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── GrandSugarDispatch.podspec ├── GrandSugarDispatch.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── GrandSugarDispatch-OSX.xcscheme │ ├── GrandSugarDispatch-iOS.xcscheme │ ├── GrandSugarDispatch-tvOS.xcscheme │ ├── GrandSugarDispatch-watchOS.xcscheme │ ├── Tests-OSX.xcscheme │ └── Tests-iOS.xcscheme ├── LICENSE ├── Package.swift ├── README.md ├── Sources ├── GrandSugarDispatch.h ├── GrandSugarDispatch.swift └── Info.plist └── Tests ├── GrandSugarDispatchTests.swift └── Info.plist /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | branch: develop 3 | 4 | coverage: 5 | precision: 2 6 | round: nearest 7 | range: "60...100" 8 | ignore: 9 | - Tests/* 10 | 11 | status: 12 | project: 13 | default: 14 | target: auto 15 | threshold: 2.0 16 | branches: 17 | - master 18 | - develop 19 | patch: 20 | default: 21 | target: auto 22 | branches: 23 | - master 24 | - develop 25 | 26 | comment: 27 | layout: header, diff, changes, sunburst, uncovered 28 | behavior: default 29 | branches: 30 | - master 31 | - develop 32 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How To Contribute 2 | 3 | Please follow these sweet [contribution guidelines](https://github.com/jessesquires/HowToContribute). 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## New issue checklist 2 | 3 | 4 | - [ ] I have read all of the [`README`](https://github.com/jessesquires/GrandSugarDispatch/blob/develop/README.md) and [documentation](http://www.jessesquires.com/GrandSugarDispatch/). 5 | - [ ] I have reviewed the [contributing guidelines](https://github.com/jessesquires/HowToContribute). 6 | - [ ] I have searched [existing issues](https://github.com/jessesquires/GrandSugarDispatch/issues?q=is%3Aissue+sort%3Acreated-desc) and **this is not a duplicate**. 7 | 8 | ## General information 9 | 10 | - Library version(s): 11 | - OS version(s): 12 | - Devices/Simulators affected: 13 | - Reproducible in the demo project (Yes/No): 14 | - Related issues: 15 | 16 | ## Expected behavior 17 | 18 | > ... 19 | 20 | ## Actual behavior 21 | 22 | > ... 23 | 24 | ## Steps to reproduce 25 | 26 | > ... 27 | 28 | ### Crash log? Screenshots? Videos? Sample project? 29 | 30 | > ... 31 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Pull request checklist 2 | 3 | - [ ] All tests pass. Demo project builds and runs. 4 | - [ ] I have resolved any merge conflicts. 5 | - [ ] I have followed the [coding style](https://github.com/jessesquires/HowToContribute#style-guidelines), and reviewed the [contributing guidelines](https://github.com/jessesquires/HowToContribute). 6 | 7 | #### This fixes issue #___. 8 | 9 | ## What's in this pull request? 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Xcode 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | Pods/ 32 | 33 | # Carthage 34 | Carthage/Build 35 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7.3 3 | 4 | env: 5 | global: 6 | - LANG=en_US.UTF-8 7 | 8 | - PROJECT="GrandSugarDispatch.xcodeproj" 9 | - IOS_SCHEME="GrandSugarDispatch-iOS" 10 | - OSX_SCHEME="GrandSugarDispatch-OSX" 11 | - TVOS_SCHEME="GrandSugarDispatch-tvOS" 12 | - WATCHOS_SCHEME="GrandSugarDispatch-watchOS" 13 | 14 | - IOS_SDK=iphonesimulator9.3 15 | - OSX_SDK=macosx10.11 16 | - TVOS_SDK=appletvsimulator9.2 17 | - WATCHOS_SDK=watchsimulator2.2 18 | 19 | matrix: 20 | - DESTINATION="OS=8.1,name=iPhone 4s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="YES" 21 | - DESTINATION="OS=8.2,name=iPhone 5" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 22 | - DESTINATION="OS=8.3,name=iPhone 5s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 23 | - DESTINATION="OS=8.4,name=iPhone 6" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 24 | 25 | - DESTINATION="OS=9.0,name=iPhone 5s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 26 | - DESTINATION="OS=9.1,name=iPhone 6s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 27 | - DESTINATION="OS=9.2,name=iPhone 6 Plus" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 28 | - DESTINATION="OS=9.3,name=iPhone 6s Plus" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 29 | 30 | - DESTINATION="OS=8.1,name=iPad 2" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 31 | - DESTINATION="OS=8.4,name=iPad 2" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 32 | - DESTINATION="OS=9.0,name=iPad Retina" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 33 | - DESTINATION="OS=9.1,name=iPad Air" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 34 | - DESTINATION="OS=9.2,name=iPad Air 2" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 35 | - DESTINATION="OS=9.3,name=iPad Pro" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 36 | 37 | - DESTINATION="arch=x86_64" SDK="$OSX_SDK" SCHEME="$OSX_FRAMEWORK_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 38 | 39 | - DESTINATION="OS=9.0,name=Apple TV 1080p" SDK="$TVOS_SDK" SCHEME="$TVOS_SCHEME" RUN_TESTS="NO" POD_LINT="NO" 40 | - DESTINATION="OS=9.2,name=Apple TV 1080p" SDK="$TVOS_SDK" SCHEME="$TVOS_SCHEME" RUN_TESTS="NO" POD_LINT="NO" 41 | 42 | - DESTINATION="OS=2.0,name=Apple Watch - 38mm" SDK="$WATCHOS_SDK" SCHEME="$WATCHOS_SCHEME" RUN_TESTS="NO" POD_LINT="NO" 43 | - DESTINATION="OS=2.2,name=Apple Watch - 42mm" SDK="$WATCHOS_SDK" SCHEME="$WATCHOS_SCHEME" RUN_TESTS="NO" POD_LINT="NO" 44 | 45 | script: 46 | 47 | - if [ $POD_LINT == "YES" ]; then 48 | pod spec lint; 49 | pod lib lint; 50 | fi 51 | 52 | - if [ $RUN_TESTS == "YES" ]; then 53 | xcodebuild test -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO | xcpretty -c; 54 | else 55 | xcodebuild clean build -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO | xcpretty -c; 56 | fi 57 | 58 | # Build for reporting test coverage 59 | - if [ $RUN_TESTS == "YES" ]; then 60 | xcodebuild test -project GrandSugarDispatch.xcodeproj -scheme "GrandSugarDispatch-iOS" -sdk iphonesimulator; 61 | fi 62 | 63 | after_success: 64 | - bash <(curl -s https://codecov.io/bash) 65 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | The changelog for `GrandSugarDispatch`. Also see the [releases](https://github.com/jessesquires/GrandSugarDispatch/releases) on GitHub. 4 | 5 | -------------------------------------- 6 | 7 | 1.0.0 8 | ----- 9 | 10 | Initial release. :tada: 11 | -------------------------------------------------------------------------------- /GrandSugarDispatch.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'GrandSugarDispatch' 3 | s.version = '1.0.1' 4 | s.license = 'MIT' 5 | 6 | s.summary = 'Syntactic sugar for Grand Central Dispatch (GCD)' 7 | s.homepage = 'https://github.com/jessesquires/GrandSugarDispatch' 8 | s.documentation_url = 'http://www.jessesquires.com/GrandSugarDispatch/' 9 | s.social_media_url = 'https://twitter.com/jesse_squires' 10 | s.author = 'Jesse Squires' 11 | 12 | s.source = { :git => 'https://github.com/jessesquires/GrandSugarDispatch.git', :tag => s.version } 13 | s.source_files = 'Sources/*.swift' 14 | 15 | s.ios.deployment_target = '8.0' 16 | s.osx.deployment_target = '10.10' 17 | s.tvos.deployment_target = '9.0' 18 | s.watchos.deployment_target = '2.0' 19 | 20 | s.requires_arc = true 21 | s.deprecated = true 22 | end 23 | -------------------------------------------------------------------------------- /GrandSugarDispatch.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8829FA6E1CC1428D000BE4D0 /* GrandSugarDispatch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8829FA631CC1428D000BE4D0 /* GrandSugarDispatch.framework */; }; 11 | 8829FA891CC145DD000BE4D0 /* GrandSugarDispatchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8829FA831CC142D0000BE4D0 /* GrandSugarDispatchTests.swift */; }; 12 | 888FF5471CC92F5300AF15CE /* GrandSugarDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 888FF5441CC92F4B00AF15CE /* GrandSugarDispatch.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | 888FF5481CC92F5400AF15CE /* GrandSugarDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 888FF5441CC92F4B00AF15CE /* GrandSugarDispatch.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | 888FF5491CC92F5400AF15CE /* GrandSugarDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 888FF5441CC92F4B00AF15CE /* GrandSugarDispatch.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 888FF54A1CC92F5500AF15CE /* GrandSugarDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 888FF5441CC92F4B00AF15CE /* GrandSugarDispatch.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | 888FF54B1CC92F6100AF15CE /* GrandSugarDispatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888FF5451CC92F4B00AF15CE /* GrandSugarDispatch.swift */; }; 17 | 888FF54C1CC92F6100AF15CE /* GrandSugarDispatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888FF5451CC92F4B00AF15CE /* GrandSugarDispatch.swift */; }; 18 | 888FF54D1CC92F6200AF15CE /* GrandSugarDispatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888FF5451CC92F4B00AF15CE /* GrandSugarDispatch.swift */; }; 19 | 888FF54E1CC92F6300AF15CE /* GrandSugarDispatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888FF5451CC92F4B00AF15CE /* GrandSugarDispatch.swift */; }; 20 | 888FF5581CC92FE600AF15CE /* GrandSugarDispatch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 887B30A01CC69592007BC660 /* GrandSugarDispatch.framework */; }; 21 | 888FF55E1CC9301B00AF15CE /* GrandSugarDispatchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8829FA831CC142D0000BE4D0 /* GrandSugarDispatchTests.swift */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 8829FA6F1CC1428D000BE4D0 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 8829FA5A1CC1428D000BE4D0 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 8829FA621CC1428D000BE4D0; 30 | remoteInfo = GrandSugarDispatch; 31 | }; 32 | 888FF5591CC92FE600AF15CE /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 8829FA5A1CC1428D000BE4D0 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 887B309F1CC69592007BC660; 37 | remoteInfo = "GrandSugarDispatch-OSX"; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 8829FA631CC1428D000BE4D0 /* GrandSugarDispatch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GrandSugarDispatch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 8829FA6D1CC1428D000BE4D0 /* GrandSugarDispatchTests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "GrandSugarDispatchTests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 8829FA831CC142D0000BE4D0 /* GrandSugarDispatchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GrandSugarDispatchTests.swift; sourceTree = ""; }; 45 | 8829FA841CC142D0000BE4D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 887B30A01CC69592007BC660 /* GrandSugarDispatch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GrandSugarDispatch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 887B30AF1CC69669007BC660 /* GrandSugarDispatch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GrandSugarDispatch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 887B30CB1CC6980B007BC660 /* GrandSugarDispatch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GrandSugarDispatch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 888FF5441CC92F4B00AF15CE /* GrandSugarDispatch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GrandSugarDispatch.h; sourceTree = ""; }; 50 | 888FF5451CC92F4B00AF15CE /* GrandSugarDispatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GrandSugarDispatch.swift; sourceTree = ""; }; 51 | 888FF5461CC92F4B00AF15CE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 888FF5531CC92FE600AF15CE /* GrandSugarDispatchTests-OSX.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "GrandSugarDispatchTests-OSX.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 8829FA5F1CC1428D000BE4D0 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | 8829FA6A1CC1428D000BE4D0 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | 8829FA6E1CC1428D000BE4D0 /* GrandSugarDispatch.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 887B309C1CC69592007BC660 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | 887B30AB1CC69669007BC660 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | 887B30C71CC6980B007BC660 /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 888FF5501CC92FE600AF15CE /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | 888FF5581CC92FE600AF15CE /* GrandSugarDispatch.framework in Frameworks */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | /* End PBXFrameworksBuildPhase section */ 101 | 102 | /* Begin PBXGroup section */ 103 | 8829FA591CC1428D000BE4D0 = { 104 | isa = PBXGroup; 105 | children = ( 106 | 888FF5431CC92F4B00AF15CE /* Sources */, 107 | 8829FA821CC142D0000BE4D0 /* Tests */, 108 | 8829FA641CC1428D000BE4D0 /* Products */, 109 | ); 110 | sourceTree = ""; 111 | }; 112 | 8829FA641CC1428D000BE4D0 /* Products */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 8829FA631CC1428D000BE4D0 /* GrandSugarDispatch.framework */, 116 | 8829FA6D1CC1428D000BE4D0 /* GrandSugarDispatchTests-iOS.xctest */, 117 | 887B30A01CC69592007BC660 /* GrandSugarDispatch.framework */, 118 | 887B30AF1CC69669007BC660 /* GrandSugarDispatch.framework */, 119 | 887B30CB1CC6980B007BC660 /* GrandSugarDispatch.framework */, 120 | 888FF5531CC92FE600AF15CE /* GrandSugarDispatchTests-OSX.xctest */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | 8829FA821CC142D0000BE4D0 /* Tests */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 8829FA831CC142D0000BE4D0 /* GrandSugarDispatchTests.swift */, 129 | 8829FA841CC142D0000BE4D0 /* Info.plist */, 130 | ); 131 | path = Tests; 132 | sourceTree = ""; 133 | }; 134 | 888FF5431CC92F4B00AF15CE /* Sources */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 888FF5441CC92F4B00AF15CE /* GrandSugarDispatch.h */, 138 | 888FF5451CC92F4B00AF15CE /* GrandSugarDispatch.swift */, 139 | 888FF5461CC92F4B00AF15CE /* Info.plist */, 140 | ); 141 | path = Sources; 142 | sourceTree = ""; 143 | }; 144 | /* End PBXGroup section */ 145 | 146 | /* Begin PBXHeadersBuildPhase section */ 147 | 8829FA601CC1428D000BE4D0 /* Headers */ = { 148 | isa = PBXHeadersBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | 888FF5471CC92F5300AF15CE /* GrandSugarDispatch.h in Headers */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | 887B309D1CC69592007BC660 /* Headers */ = { 156 | isa = PBXHeadersBuildPhase; 157 | buildActionMask = 2147483647; 158 | files = ( 159 | 888FF5481CC92F5400AF15CE /* GrandSugarDispatch.h in Headers */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | 887B30AC1CC69669007BC660 /* Headers */ = { 164 | isa = PBXHeadersBuildPhase; 165 | buildActionMask = 2147483647; 166 | files = ( 167 | 888FF5491CC92F5400AF15CE /* GrandSugarDispatch.h in Headers */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | 887B30C81CC6980B007BC660 /* Headers */ = { 172 | isa = PBXHeadersBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 888FF54A1CC92F5500AF15CE /* GrandSugarDispatch.h in Headers */, 176 | ); 177 | runOnlyForDeploymentPostprocessing = 0; 178 | }; 179 | /* End PBXHeadersBuildPhase section */ 180 | 181 | /* Begin PBXNativeTarget section */ 182 | 8829FA621CC1428D000BE4D0 /* GrandSugarDispatch-iOS */ = { 183 | isa = PBXNativeTarget; 184 | buildConfigurationList = 8829FA771CC1428D000BE4D0 /* Build configuration list for PBXNativeTarget "GrandSugarDispatch-iOS" */; 185 | buildPhases = ( 186 | 8829FA5E1CC1428D000BE4D0 /* Sources */, 187 | 8829FA5F1CC1428D000BE4D0 /* Frameworks */, 188 | 8829FA601CC1428D000BE4D0 /* Headers */, 189 | 8829FA611CC1428D000BE4D0 /* Resources */, 190 | ); 191 | buildRules = ( 192 | ); 193 | dependencies = ( 194 | ); 195 | name = "GrandSugarDispatch-iOS"; 196 | productName = GrandSugarDispatch; 197 | productReference = 8829FA631CC1428D000BE4D0 /* GrandSugarDispatch.framework */; 198 | productType = "com.apple.product-type.framework"; 199 | }; 200 | 8829FA6C1CC1428D000BE4D0 /* GrandSugarDispatchTests-iOS */ = { 201 | isa = PBXNativeTarget; 202 | buildConfigurationList = 8829FA7A1CC1428D000BE4D0 /* Build configuration list for PBXNativeTarget "GrandSugarDispatchTests-iOS" */; 203 | buildPhases = ( 204 | 8829FA691CC1428D000BE4D0 /* Sources */, 205 | 8829FA6A1CC1428D000BE4D0 /* Frameworks */, 206 | 8829FA6B1CC1428D000BE4D0 /* Resources */, 207 | ); 208 | buildRules = ( 209 | ); 210 | dependencies = ( 211 | 8829FA701CC1428D000BE4D0 /* PBXTargetDependency */, 212 | ); 213 | name = "GrandSugarDispatchTests-iOS"; 214 | productName = GrandSugarDispatchTests; 215 | productReference = 8829FA6D1CC1428D000BE4D0 /* GrandSugarDispatchTests-iOS.xctest */; 216 | productType = "com.apple.product-type.bundle.unit-test"; 217 | }; 218 | 887B309F1CC69592007BC660 /* GrandSugarDispatch-OSX */ = { 219 | isa = PBXNativeTarget; 220 | buildConfigurationList = 887B30A51CC69592007BC660 /* Build configuration list for PBXNativeTarget "GrandSugarDispatch-OSX" */; 221 | buildPhases = ( 222 | 887B309B1CC69592007BC660 /* Sources */, 223 | 887B309C1CC69592007BC660 /* Frameworks */, 224 | 887B309D1CC69592007BC660 /* Headers */, 225 | 887B309E1CC69592007BC660 /* Resources */, 226 | ); 227 | buildRules = ( 228 | ); 229 | dependencies = ( 230 | ); 231 | name = "GrandSugarDispatch-OSX"; 232 | productName = "GrandSugarDispatch-OSX"; 233 | productReference = 887B30A01CC69592007BC660 /* GrandSugarDispatch.framework */; 234 | productType = "com.apple.product-type.framework"; 235 | }; 236 | 887B30AE1CC69669007BC660 /* GrandSugarDispatch-watchOS */ = { 237 | isa = PBXNativeTarget; 238 | buildConfigurationList = 887B30B41CC69669007BC660 /* Build configuration list for PBXNativeTarget "GrandSugarDispatch-watchOS" */; 239 | buildPhases = ( 240 | 887B30AA1CC69669007BC660 /* Sources */, 241 | 887B30AB1CC69669007BC660 /* Frameworks */, 242 | 887B30AC1CC69669007BC660 /* Headers */, 243 | 887B30AD1CC69669007BC660 /* Resources */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | ); 249 | name = "GrandSugarDispatch-watchOS"; 250 | productName = "GrandSugarDispatch-watchOS"; 251 | productReference = 887B30AF1CC69669007BC660 /* GrandSugarDispatch.framework */; 252 | productType = "com.apple.product-type.framework"; 253 | }; 254 | 887B30CA1CC6980B007BC660 /* GrandSugarDispatch-tvOS */ = { 255 | isa = PBXNativeTarget; 256 | buildConfigurationList = 887B30D21CC6980B007BC660 /* Build configuration list for PBXNativeTarget "GrandSugarDispatch-tvOS" */; 257 | buildPhases = ( 258 | 887B30C61CC6980B007BC660 /* Sources */, 259 | 887B30C71CC6980B007BC660 /* Frameworks */, 260 | 887B30C81CC6980B007BC660 /* Headers */, 261 | 887B30C91CC6980B007BC660 /* Resources */, 262 | ); 263 | buildRules = ( 264 | ); 265 | dependencies = ( 266 | ); 267 | name = "GrandSugarDispatch-tvOS"; 268 | productName = "GrandSugarDispatch-tvOS"; 269 | productReference = 887B30CB1CC6980B007BC660 /* GrandSugarDispatch.framework */; 270 | productType = "com.apple.product-type.framework"; 271 | }; 272 | 888FF5521CC92FE600AF15CE /* GrandSugarDispatchTests-OSX */ = { 273 | isa = PBXNativeTarget; 274 | buildConfigurationList = 888FF55B1CC92FE600AF15CE /* Build configuration list for PBXNativeTarget "GrandSugarDispatchTests-OSX" */; 275 | buildPhases = ( 276 | 888FF54F1CC92FE600AF15CE /* Sources */, 277 | 888FF5501CC92FE600AF15CE /* Frameworks */, 278 | 888FF5511CC92FE600AF15CE /* Resources */, 279 | ); 280 | buildRules = ( 281 | ); 282 | dependencies = ( 283 | 888FF55A1CC92FE600AF15CE /* PBXTargetDependency */, 284 | ); 285 | name = "GrandSugarDispatchTests-OSX"; 286 | productName = "GrandSugarDispatchTests-OSX"; 287 | productReference = 888FF5531CC92FE600AF15CE /* GrandSugarDispatchTests-OSX.xctest */; 288 | productType = "com.apple.product-type.bundle.unit-test"; 289 | }; 290 | /* End PBXNativeTarget section */ 291 | 292 | /* Begin PBXProject section */ 293 | 8829FA5A1CC1428D000BE4D0 /* Project object */ = { 294 | isa = PBXProject; 295 | attributes = { 296 | LastSwiftUpdateCheck = 0730; 297 | LastUpgradeCheck = 0730; 298 | ORGANIZATIONNAME = "Hexed Bits"; 299 | TargetAttributes = { 300 | 8829FA621CC1428D000BE4D0 = { 301 | CreatedOnToolsVersion = 7.3; 302 | }; 303 | 8829FA6C1CC1428D000BE4D0 = { 304 | CreatedOnToolsVersion = 7.3; 305 | }; 306 | 887B309F1CC69592007BC660 = { 307 | CreatedOnToolsVersion = 7.3; 308 | }; 309 | 887B30AE1CC69669007BC660 = { 310 | CreatedOnToolsVersion = 7.3; 311 | }; 312 | 887B30CA1CC6980B007BC660 = { 313 | CreatedOnToolsVersion = 7.3; 314 | }; 315 | 888FF5521CC92FE600AF15CE = { 316 | CreatedOnToolsVersion = 7.3; 317 | }; 318 | }; 319 | }; 320 | buildConfigurationList = 8829FA5D1CC1428D000BE4D0 /* Build configuration list for PBXProject "GrandSugarDispatch" */; 321 | compatibilityVersion = "Xcode 3.2"; 322 | developmentRegion = English; 323 | hasScannedForEncodings = 0; 324 | knownRegions = ( 325 | en, 326 | ); 327 | mainGroup = 8829FA591CC1428D000BE4D0; 328 | productRefGroup = 8829FA641CC1428D000BE4D0 /* Products */; 329 | projectDirPath = ""; 330 | projectRoot = ""; 331 | targets = ( 332 | 8829FA621CC1428D000BE4D0 /* GrandSugarDispatch-iOS */, 333 | 887B309F1CC69592007BC660 /* GrandSugarDispatch-OSX */, 334 | 887B30AE1CC69669007BC660 /* GrandSugarDispatch-watchOS */, 335 | 887B30CA1CC6980B007BC660 /* GrandSugarDispatch-tvOS */, 336 | 8829FA6C1CC1428D000BE4D0 /* GrandSugarDispatchTests-iOS */, 337 | 888FF5521CC92FE600AF15CE /* GrandSugarDispatchTests-OSX */, 338 | ); 339 | }; 340 | /* End PBXProject section */ 341 | 342 | /* Begin PBXResourcesBuildPhase section */ 343 | 8829FA611CC1428D000BE4D0 /* Resources */ = { 344 | isa = PBXResourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | }; 350 | 8829FA6B1CC1428D000BE4D0 /* Resources */ = { 351 | isa = PBXResourcesBuildPhase; 352 | buildActionMask = 2147483647; 353 | files = ( 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | }; 357 | 887B309E1CC69592007BC660 /* Resources */ = { 358 | isa = PBXResourcesBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | ); 362 | runOnlyForDeploymentPostprocessing = 0; 363 | }; 364 | 887B30AD1CC69669007BC660 /* Resources */ = { 365 | isa = PBXResourcesBuildPhase; 366 | buildActionMask = 2147483647; 367 | files = ( 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | }; 371 | 887B30C91CC6980B007BC660 /* Resources */ = { 372 | isa = PBXResourcesBuildPhase; 373 | buildActionMask = 2147483647; 374 | files = ( 375 | ); 376 | runOnlyForDeploymentPostprocessing = 0; 377 | }; 378 | 888FF5511CC92FE600AF15CE /* Resources */ = { 379 | isa = PBXResourcesBuildPhase; 380 | buildActionMask = 2147483647; 381 | files = ( 382 | ); 383 | runOnlyForDeploymentPostprocessing = 0; 384 | }; 385 | /* End PBXResourcesBuildPhase section */ 386 | 387 | /* Begin PBXSourcesBuildPhase section */ 388 | 8829FA5E1CC1428D000BE4D0 /* Sources */ = { 389 | isa = PBXSourcesBuildPhase; 390 | buildActionMask = 2147483647; 391 | files = ( 392 | 888FF54B1CC92F6100AF15CE /* GrandSugarDispatch.swift in Sources */, 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | }; 396 | 8829FA691CC1428D000BE4D0 /* Sources */ = { 397 | isa = PBXSourcesBuildPhase; 398 | buildActionMask = 2147483647; 399 | files = ( 400 | 8829FA891CC145DD000BE4D0 /* GrandSugarDispatchTests.swift in Sources */, 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | }; 404 | 887B309B1CC69592007BC660 /* Sources */ = { 405 | isa = PBXSourcesBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | 888FF54C1CC92F6100AF15CE /* GrandSugarDispatch.swift in Sources */, 409 | ); 410 | runOnlyForDeploymentPostprocessing = 0; 411 | }; 412 | 887B30AA1CC69669007BC660 /* Sources */ = { 413 | isa = PBXSourcesBuildPhase; 414 | buildActionMask = 2147483647; 415 | files = ( 416 | 888FF54D1CC92F6200AF15CE /* GrandSugarDispatch.swift in Sources */, 417 | ); 418 | runOnlyForDeploymentPostprocessing = 0; 419 | }; 420 | 887B30C61CC6980B007BC660 /* Sources */ = { 421 | isa = PBXSourcesBuildPhase; 422 | buildActionMask = 2147483647; 423 | files = ( 424 | 888FF54E1CC92F6300AF15CE /* GrandSugarDispatch.swift in Sources */, 425 | ); 426 | runOnlyForDeploymentPostprocessing = 0; 427 | }; 428 | 888FF54F1CC92FE600AF15CE /* Sources */ = { 429 | isa = PBXSourcesBuildPhase; 430 | buildActionMask = 2147483647; 431 | files = ( 432 | 888FF55E1CC9301B00AF15CE /* GrandSugarDispatchTests.swift in Sources */, 433 | ); 434 | runOnlyForDeploymentPostprocessing = 0; 435 | }; 436 | /* End PBXSourcesBuildPhase section */ 437 | 438 | /* Begin PBXTargetDependency section */ 439 | 8829FA701CC1428D000BE4D0 /* PBXTargetDependency */ = { 440 | isa = PBXTargetDependency; 441 | target = 8829FA621CC1428D000BE4D0 /* GrandSugarDispatch-iOS */; 442 | targetProxy = 8829FA6F1CC1428D000BE4D0 /* PBXContainerItemProxy */; 443 | }; 444 | 888FF55A1CC92FE600AF15CE /* PBXTargetDependency */ = { 445 | isa = PBXTargetDependency; 446 | target = 887B309F1CC69592007BC660 /* GrandSugarDispatch-OSX */; 447 | targetProxy = 888FF5591CC92FE600AF15CE /* PBXContainerItemProxy */; 448 | }; 449 | /* End PBXTargetDependency section */ 450 | 451 | /* Begin XCBuildConfiguration section */ 452 | 8829FA751CC1428D000BE4D0 /* Debug */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | ALWAYS_SEARCH_USER_PATHS = NO; 456 | CLANG_ANALYZER_NONNULL = YES; 457 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 458 | CLANG_CXX_LIBRARY = "libc++"; 459 | CLANG_ENABLE_MODULES = YES; 460 | CLANG_ENABLE_OBJC_ARC = YES; 461 | CLANG_WARN_BOOL_CONVERSION = YES; 462 | CLANG_WARN_CONSTANT_CONVERSION = YES; 463 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 464 | CLANG_WARN_EMPTY_BODY = YES; 465 | CLANG_WARN_ENUM_CONVERSION = YES; 466 | CLANG_WARN_INT_CONVERSION = YES; 467 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 468 | CLANG_WARN_UNREACHABLE_CODE = YES; 469 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 470 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 471 | COPY_PHASE_STRIP = NO; 472 | CURRENT_PROJECT_VERSION = 1; 473 | DEBUG_INFORMATION_FORMAT = dwarf; 474 | ENABLE_STRICT_OBJC_MSGSEND = YES; 475 | ENABLE_TESTABILITY = YES; 476 | GCC_C_LANGUAGE_STANDARD = gnu99; 477 | GCC_DYNAMIC_NO_PIC = NO; 478 | GCC_NO_COMMON_BLOCKS = YES; 479 | GCC_OPTIMIZATION_LEVEL = 0; 480 | GCC_PREPROCESSOR_DEFINITIONS = ( 481 | "DEBUG=1", 482 | "$(inherited)", 483 | ); 484 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 485 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 486 | GCC_WARN_UNDECLARED_SELECTOR = YES; 487 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 488 | GCC_WARN_UNUSED_FUNCTION = YES; 489 | GCC_WARN_UNUSED_VARIABLE = YES; 490 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 491 | MTL_ENABLE_DEBUG_INFO = YES; 492 | ONLY_ACTIVE_ARCH = YES; 493 | SDKROOT = iphoneos; 494 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 495 | TARGETED_DEVICE_FAMILY = "1,2"; 496 | VERSIONING_SYSTEM = "apple-generic"; 497 | VERSION_INFO_PREFIX = ""; 498 | }; 499 | name = Debug; 500 | }; 501 | 8829FA761CC1428D000BE4D0 /* Release */ = { 502 | isa = XCBuildConfiguration; 503 | buildSettings = { 504 | ALWAYS_SEARCH_USER_PATHS = NO; 505 | CLANG_ANALYZER_NONNULL = YES; 506 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 507 | CLANG_CXX_LIBRARY = "libc++"; 508 | CLANG_ENABLE_MODULES = YES; 509 | CLANG_ENABLE_OBJC_ARC = YES; 510 | CLANG_WARN_BOOL_CONVERSION = YES; 511 | CLANG_WARN_CONSTANT_CONVERSION = YES; 512 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 513 | CLANG_WARN_EMPTY_BODY = YES; 514 | CLANG_WARN_ENUM_CONVERSION = YES; 515 | CLANG_WARN_INT_CONVERSION = YES; 516 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 517 | CLANG_WARN_UNREACHABLE_CODE = YES; 518 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 519 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 520 | COPY_PHASE_STRIP = NO; 521 | CURRENT_PROJECT_VERSION = 1; 522 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 523 | ENABLE_NS_ASSERTIONS = NO; 524 | ENABLE_STRICT_OBJC_MSGSEND = YES; 525 | GCC_C_LANGUAGE_STANDARD = gnu99; 526 | GCC_NO_COMMON_BLOCKS = YES; 527 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 528 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 529 | GCC_WARN_UNDECLARED_SELECTOR = YES; 530 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 531 | GCC_WARN_UNUSED_FUNCTION = YES; 532 | GCC_WARN_UNUSED_VARIABLE = YES; 533 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 534 | MTL_ENABLE_DEBUG_INFO = NO; 535 | SDKROOT = iphoneos; 536 | TARGETED_DEVICE_FAMILY = "1,2"; 537 | VALIDATE_PRODUCT = YES; 538 | VERSIONING_SYSTEM = "apple-generic"; 539 | VERSION_INFO_PREFIX = ""; 540 | }; 541 | name = Release; 542 | }; 543 | 8829FA781CC1428D000BE4D0 /* Debug */ = { 544 | isa = XCBuildConfiguration; 545 | buildSettings = { 546 | DEFINES_MODULE = YES; 547 | DYLIB_COMPATIBILITY_VERSION = 1; 548 | DYLIB_CURRENT_VERSION = 1; 549 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 550 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 551 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 552 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 553 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 554 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.GrandSugarDispatch; 555 | PRODUCT_MODULE_NAME = "$(PRODUCT_NAME)"; 556 | PRODUCT_NAME = GrandSugarDispatch; 557 | SKIP_INSTALL = YES; 558 | }; 559 | name = Debug; 560 | }; 561 | 8829FA791CC1428D000BE4D0 /* Release */ = { 562 | isa = XCBuildConfiguration; 563 | buildSettings = { 564 | DEFINES_MODULE = YES; 565 | DYLIB_COMPATIBILITY_VERSION = 1; 566 | DYLIB_CURRENT_VERSION = 1; 567 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 568 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 569 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 570 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 571 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 572 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.GrandSugarDispatch; 573 | PRODUCT_MODULE_NAME = "$(PRODUCT_NAME)"; 574 | PRODUCT_NAME = GrandSugarDispatch; 575 | SKIP_INSTALL = YES; 576 | }; 577 | name = Release; 578 | }; 579 | 8829FA7B1CC1428D000BE4D0 /* Debug */ = { 580 | isa = XCBuildConfiguration; 581 | buildSettings = { 582 | INFOPLIST_FILE = Tests/Info.plist; 583 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 584 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.GrandSugarDispatchTests; 585 | PRODUCT_NAME = "$(TARGET_NAME)"; 586 | }; 587 | name = Debug; 588 | }; 589 | 8829FA7C1CC1428D000BE4D0 /* Release */ = { 590 | isa = XCBuildConfiguration; 591 | buildSettings = { 592 | INFOPLIST_FILE = Tests/Info.plist; 593 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 594 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.GrandSugarDispatchTests; 595 | PRODUCT_NAME = "$(TARGET_NAME)"; 596 | }; 597 | name = Release; 598 | }; 599 | 887B30A61CC69592007BC660 /* Debug */ = { 600 | isa = XCBuildConfiguration; 601 | buildSettings = { 602 | CODE_SIGN_IDENTITY = "-"; 603 | COMBINE_HIDPI_IMAGES = YES; 604 | DEFINES_MODULE = YES; 605 | DYLIB_COMPATIBILITY_VERSION = 1; 606 | DYLIB_CURRENT_VERSION = 1; 607 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 608 | FRAMEWORK_VERSION = A; 609 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 610 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 611 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 612 | MACOSX_DEPLOYMENT_TARGET = 10.10; 613 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.GrandSugarDispatch; 614 | PRODUCT_NAME = GrandSugarDispatch; 615 | SDKROOT = macosx; 616 | SKIP_INSTALL = YES; 617 | }; 618 | name = Debug; 619 | }; 620 | 887B30A71CC69592007BC660 /* Release */ = { 621 | isa = XCBuildConfiguration; 622 | buildSettings = { 623 | CODE_SIGN_IDENTITY = "-"; 624 | COMBINE_HIDPI_IMAGES = YES; 625 | DEFINES_MODULE = YES; 626 | DYLIB_COMPATIBILITY_VERSION = 1; 627 | DYLIB_CURRENT_VERSION = 1; 628 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 629 | FRAMEWORK_VERSION = A; 630 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 631 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 632 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 633 | MACOSX_DEPLOYMENT_TARGET = 10.10; 634 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.GrandSugarDispatch; 635 | PRODUCT_NAME = GrandSugarDispatch; 636 | SDKROOT = macosx; 637 | SKIP_INSTALL = YES; 638 | }; 639 | name = Release; 640 | }; 641 | 887B30B51CC69669007BC660 /* Debug */ = { 642 | isa = XCBuildConfiguration; 643 | buildSettings = { 644 | APPLICATION_EXTENSION_API_ONLY = YES; 645 | DEFINES_MODULE = YES; 646 | DYLIB_COMPATIBILITY_VERSION = 1; 647 | DYLIB_CURRENT_VERSION = 1; 648 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 649 | INFOPLIST_FILE = Sources/Info.plist; 650 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 651 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 652 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.GrandSugarDispatch-watchOS"; 653 | PRODUCT_NAME = GrandSugarDispatch; 654 | SDKROOT = watchos; 655 | SKIP_INSTALL = YES; 656 | TARGETED_DEVICE_FAMILY = 4; 657 | WATCHOS_DEPLOYMENT_TARGET = 2.2; 658 | }; 659 | name = Debug; 660 | }; 661 | 887B30B61CC69669007BC660 /* Release */ = { 662 | isa = XCBuildConfiguration; 663 | buildSettings = { 664 | APPLICATION_EXTENSION_API_ONLY = YES; 665 | DEFINES_MODULE = YES; 666 | DYLIB_COMPATIBILITY_VERSION = 1; 667 | DYLIB_CURRENT_VERSION = 1; 668 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 669 | INFOPLIST_FILE = Sources/Info.plist; 670 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 671 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 672 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.GrandSugarDispatch-watchOS"; 673 | PRODUCT_NAME = GrandSugarDispatch; 674 | SDKROOT = watchos; 675 | SKIP_INSTALL = YES; 676 | TARGETED_DEVICE_FAMILY = 4; 677 | WATCHOS_DEPLOYMENT_TARGET = 2.2; 678 | }; 679 | name = Release; 680 | }; 681 | 887B30D01CC6980B007BC660 /* Debug */ = { 682 | isa = XCBuildConfiguration; 683 | buildSettings = { 684 | DEFINES_MODULE = YES; 685 | DYLIB_COMPATIBILITY_VERSION = 1; 686 | DYLIB_CURRENT_VERSION = 1; 687 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 688 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 689 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 690 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 691 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.GrandSugarDispatch-tvOS"; 692 | PRODUCT_NAME = GrandSugarDispatch; 693 | SDKROOT = appletvos; 694 | SKIP_INSTALL = YES; 695 | TARGETED_DEVICE_FAMILY = 3; 696 | TVOS_DEPLOYMENT_TARGET = 9.0; 697 | }; 698 | name = Debug; 699 | }; 700 | 887B30D11CC6980B007BC660 /* Release */ = { 701 | isa = XCBuildConfiguration; 702 | buildSettings = { 703 | DEFINES_MODULE = YES; 704 | DYLIB_COMPATIBILITY_VERSION = 1; 705 | DYLIB_CURRENT_VERSION = 1; 706 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 707 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 708 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 709 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 710 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.GrandSugarDispatch-tvOS"; 711 | PRODUCT_NAME = GrandSugarDispatch; 712 | SDKROOT = appletvos; 713 | SKIP_INSTALL = YES; 714 | TARGETED_DEVICE_FAMILY = 3; 715 | TVOS_DEPLOYMENT_TARGET = 9.0; 716 | }; 717 | name = Release; 718 | }; 719 | 888FF55C1CC92FE600AF15CE /* Debug */ = { 720 | isa = XCBuildConfiguration; 721 | buildSettings = { 722 | CODE_SIGN_IDENTITY = "-"; 723 | COMBINE_HIDPI_IMAGES = YES; 724 | INFOPLIST_FILE = Tests/Info.plist; 725 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 726 | MACOSX_DEPLOYMENT_TARGET = 10.11; 727 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.GrandSugarDispatchTests-OSX"; 728 | PRODUCT_NAME = "$(TARGET_NAME)"; 729 | SDKROOT = macosx; 730 | }; 731 | name = Debug; 732 | }; 733 | 888FF55D1CC92FE600AF15CE /* Release */ = { 734 | isa = XCBuildConfiguration; 735 | buildSettings = { 736 | CODE_SIGN_IDENTITY = "-"; 737 | COMBINE_HIDPI_IMAGES = YES; 738 | INFOPLIST_FILE = Tests/Info.plist; 739 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 740 | MACOSX_DEPLOYMENT_TARGET = 10.11; 741 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.GrandSugarDispatchTests-OSX"; 742 | PRODUCT_NAME = "$(TARGET_NAME)"; 743 | SDKROOT = macosx; 744 | }; 745 | name = Release; 746 | }; 747 | /* End XCBuildConfiguration section */ 748 | 749 | /* Begin XCConfigurationList section */ 750 | 8829FA5D1CC1428D000BE4D0 /* Build configuration list for PBXProject "GrandSugarDispatch" */ = { 751 | isa = XCConfigurationList; 752 | buildConfigurations = ( 753 | 8829FA751CC1428D000BE4D0 /* Debug */, 754 | 8829FA761CC1428D000BE4D0 /* Release */, 755 | ); 756 | defaultConfigurationIsVisible = 0; 757 | defaultConfigurationName = Release; 758 | }; 759 | 8829FA771CC1428D000BE4D0 /* Build configuration list for PBXNativeTarget "GrandSugarDispatch-iOS" */ = { 760 | isa = XCConfigurationList; 761 | buildConfigurations = ( 762 | 8829FA781CC1428D000BE4D0 /* Debug */, 763 | 8829FA791CC1428D000BE4D0 /* Release */, 764 | ); 765 | defaultConfigurationIsVisible = 0; 766 | defaultConfigurationName = Release; 767 | }; 768 | 8829FA7A1CC1428D000BE4D0 /* Build configuration list for PBXNativeTarget "GrandSugarDispatchTests-iOS" */ = { 769 | isa = XCConfigurationList; 770 | buildConfigurations = ( 771 | 8829FA7B1CC1428D000BE4D0 /* Debug */, 772 | 8829FA7C1CC1428D000BE4D0 /* Release */, 773 | ); 774 | defaultConfigurationIsVisible = 0; 775 | defaultConfigurationName = Release; 776 | }; 777 | 887B30A51CC69592007BC660 /* Build configuration list for PBXNativeTarget "GrandSugarDispatch-OSX" */ = { 778 | isa = XCConfigurationList; 779 | buildConfigurations = ( 780 | 887B30A61CC69592007BC660 /* Debug */, 781 | 887B30A71CC69592007BC660 /* Release */, 782 | ); 783 | defaultConfigurationIsVisible = 0; 784 | defaultConfigurationName = Release; 785 | }; 786 | 887B30B41CC69669007BC660 /* Build configuration list for PBXNativeTarget "GrandSugarDispatch-watchOS" */ = { 787 | isa = XCConfigurationList; 788 | buildConfigurations = ( 789 | 887B30B51CC69669007BC660 /* Debug */, 790 | 887B30B61CC69669007BC660 /* Release */, 791 | ); 792 | defaultConfigurationIsVisible = 0; 793 | defaultConfigurationName = Release; 794 | }; 795 | 887B30D21CC6980B007BC660 /* Build configuration list for PBXNativeTarget "GrandSugarDispatch-tvOS" */ = { 796 | isa = XCConfigurationList; 797 | buildConfigurations = ( 798 | 887B30D01CC6980B007BC660 /* Debug */, 799 | 887B30D11CC6980B007BC660 /* Release */, 800 | ); 801 | defaultConfigurationIsVisible = 0; 802 | defaultConfigurationName = Release; 803 | }; 804 | 888FF55B1CC92FE600AF15CE /* Build configuration list for PBXNativeTarget "GrandSugarDispatchTests-OSX" */ = { 805 | isa = XCConfigurationList; 806 | buildConfigurations = ( 807 | 888FF55C1CC92FE600AF15CE /* Debug */, 808 | 888FF55D1CC92FE600AF15CE /* Release */, 809 | ); 810 | defaultConfigurationIsVisible = 0; 811 | }; 812 | /* End XCConfigurationList section */ 813 | }; 814 | rootObject = 8829FA5A1CC1428D000BE4D0 /* Project object */; 815 | } 816 | -------------------------------------------------------------------------------- /GrandSugarDispatch.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GrandSugarDispatch.xcodeproj/xcshareddata/xcschemes/GrandSugarDispatch-OSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /GrandSugarDispatch.xcodeproj/xcshareddata/xcschemes/GrandSugarDispatch-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /GrandSugarDispatch.xcodeproj/xcshareddata/xcschemes/GrandSugarDispatch-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /GrandSugarDispatch.xcodeproj/xcshareddata/xcschemes/GrandSugarDispatch-watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /GrandSugarDispatch.xcodeproj/xcshareddata/xcschemes/Tests-OSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /GrandSugarDispatch.xcodeproj/xcshareddata/xcschemes/Tests-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jesse Squires 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.com/GrandSugarDispatch 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/GrandSugarDispatch 12 | // 13 | // 14 | // License 15 | // Copyright © 2016 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import PackageDescription 20 | 21 | let package = Package( 22 | name: "GrandSugarDispatch" 23 | ) 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/) 2 | 3 | # :warning: DEPRECATED :warning: 4 | 5 | As of Swift 3.0 and proposal [SE-0088](https://github.com/apple/swift-evolution/blob/master/proposals/0088-libdispatch-for-swift3.md), this library is no longer necessary. 6 | 7 | ## GrandSugarDispatch 8 | [![Build Status](https://secure.travis-ci.org/jessesquires/GrandSugarDispatch.svg)](http://travis-ci.org/jessesquires/GrandSugarDispatch) [![Version Status](https://img.shields.io/cocoapods/v/GrandSugarDispatch.svg)][podLink] [![license MIT](https://img.shields.io/cocoapods/l/GrandSugarDispatch.svg)][mitLink] [![codecov](https://codecov.io/gh/jessesquires/GrandSugarDispatch/branch/develop/graph/badge.svg)](https://codecov.io/gh/jessesquires/GrandSugarDispatch) [![Platform](https://img.shields.io/cocoapods/p/GrandSugarDispatch.svg)][docsLink] [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 9 | 10 | *Syntactic sugar for Grand Central Dispatch (GCD)* 11 | 12 | ## About 13 | 14 | This library is *Swifty* wrapper around GCD. The design goals are to be small, simple, and make GCD slightly more friendly to use in Swift. For something more advanced with features like chaining, you should use [Async](https://github.com/duemunk/Async). 15 | 16 | ## Requirements 17 | 18 | * Xcode 7.3+ 19 | * iOS 8.0+ 20 | * OSX 10.10+ 21 | * tvOS 9.0+ 22 | * watchOS 2.0+ 23 | * **Swift 2.2** 24 | 25 | ## Installation 26 | 27 | #### [CocoaPods](http://cocoapods.org) (recommended) 28 | 29 | ````ruby 30 | use_frameworks! 31 | 32 | # For latest release in cocoapods 33 | pod 'GrandSugarDispatch' 34 | 35 | # Feeling adventurous? Get the latest on develop 36 | pod 'GrandSugarDispatch', :git => 'https://github.com/jessesquires/GrandSugarDispatch.git', :branch => 'develop' 37 | ```` 38 | 39 | #### [Carthage](https://github.com/Carthage/Carthage) 40 | 41 | ````bash 42 | github "jessesquires/GrandSugarDispatch" 43 | ```` 44 | 45 | ## Documentation 46 | 47 | Read the [docs][docsLink]. Generated with [jazzy](https://github.com/realm/jazzy). Hosted by [GitHub Pages](https://pages.github.com). More information on the [`gh-pages`](https://github.com/jessesquires/GrandSugarDispatch/tree/gh-pages) branch. 48 | 49 | ## Getting Started 50 | 51 | ````swift 52 | import GrandSugarDispatch 53 | ```` 54 | 55 | #### Example usage 56 | 57 | ```swift 58 | dispatch(queue: .main) { 59 | // perform task asynchronously on main queue 60 | } 61 | 62 | dispatch(queue: .utility, execution: .sync) { 63 | // perform task *synchronously* on background utility (quality of service) queue 64 | } 65 | 66 | dispatch(queue: .background, execution: .delay(0.3)) { 67 | // perform task on background queue, after a 0.3 second delay 68 | } 69 | ``` 70 | 71 | ## Unit tests 72 | 73 | There's a suite of unit tests for `GrandSugarDispatch`. Run them from Xcode by opening `GrandSugarDispatch.xcodeproj`. These tests are well commented and serve as further documentation for how to use this library. 74 | 75 | ## Contribute 76 | 77 | Please follow these sweet [contribution guidelines](https://github.com/jessesquires/HowToContribute). 78 | 79 | ## Credits 80 | 81 | Created and maintained by [**@jesse_squires**](https://twitter.com/jesse_squires). 82 | 83 | ## License 84 | 85 | `GrandSugarDispatch` is released under an [MIT License][mitLink]. See `LICENSE` for details. 86 | 87 | >**Copyright © 2016-present Jesse Squires.** 88 | 89 | *Please provide attribution, it is greatly appreciated.* 90 | 91 | [podLink]:https://cocoapods.org/pods/GrandSugarDispatch 92 | [docsLink]:http://www.jessesquires.com/GrandSugarDispatch 93 | [mitLink]:http://opensource.org/licenses/MIT 94 | -------------------------------------------------------------------------------- /Sources/GrandSugarDispatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.com/GrandSugarDispatch 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/GrandSugarDispatch 12 | // 13 | // 14 | // License 15 | // Copyright © 2016 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | FOUNDATION_EXPORT double GrandSugarDispatchVersionNumber; 22 | 23 | FOUNDATION_EXPORT const unsigned char GrandSugarDispatchVersionString[]; 24 | -------------------------------------------------------------------------------- /Sources/GrandSugarDispatch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.com/GrandSugarDispatch 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/GrandSugarDispatch 12 | // 13 | // 14 | // License 15 | // Copyright © 2016 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | 20 | import Foundation 21 | 22 | 23 | /** 24 | Describes the execution type of a dispatch queue. 25 | */ 26 | public enum Execution { 27 | /// Submits a closure for asynchronous execution on a dispatch queue and returns immediately. 28 | case async 29 | 30 | /// Submits a closure for synchronous execution on a dispatch queue and waits until that closure completes. 31 | case sync 32 | 33 | /// Submits a barrier closure for asynchronous execution and returns immediately. 34 | case barrierAsync 35 | 36 | /// Submits a barrier closure for synchronous execution and waits until that closure completes. 37 | case barrierSync 38 | 39 | /** 40 | Enqueue a closure for execution after the specified delay in seconds. 41 | 42 | - parameter seconds: The time in seconds after which the closure should execute. 43 | */ 44 | case delay(seconds: Double) 45 | } 46 | 47 | 48 | /** 49 | Describes the concurrency type of a custom dispatch queue. 50 | */ 51 | public enum Concurrency { 52 | /// Specifies a concurrent dispatch queue. 53 | case concurrent 54 | 55 | /// Specifies a serial dispatch queue. 56 | case serial 57 | } 58 | 59 | 60 | /** 61 | Describes the type of dispatch queue. 62 | */ 63 | public enum DispatchQueue { 64 | /// The serial dispatch queue associated with the application’s main thread. 65 | case main 66 | 67 | /// A system-defined global concurrent queue with a "user interactive" quality of service. 68 | case userInteractive 69 | 70 | /// A system-defined global concurrent queue with a "user initiated" quality of service. 71 | case userInitiated 72 | 73 | /// A system-defined global concurrent queue with a default quality of service. 74 | case regular 75 | 76 | /// A system-defined global concurrent queue with a "utility" quality of service. 77 | case utility 78 | 79 | /// A system-defined global concurrent queue with a "background" quality of service. 80 | case background 81 | 82 | /** 83 | A custom dispatch queue to which closures can be submitted. 84 | 85 | - parameter dispatch_queue_t: A dispatch queue. 86 | */ 87 | case custom(dispatch_queue_t) 88 | 89 | /** 90 | Creates a new dispatch queue with the specified concurrency. 91 | 92 | - parameter label: A label to attach to the queue to uniquely identify it. 93 | - parameter concurrency: The concurrency type of the dispatch queue. 94 | 95 | - returns: A newly created dispatch queue. 96 | */ 97 | public static func create(label label: String, concurrency: Concurrency) -> dispatch_queue_t { 98 | switch concurrency { 99 | case .concurrent: 100 | return dispatch_queue_create(label, DISPATCH_QUEUE_CONCURRENT) 101 | case .serial: 102 | return dispatch_queue_create(label, DISPATCH_QUEUE_SERIAL) 103 | } 104 | } 105 | 106 | private var dispatchQueue: dispatch_queue_t { 107 | switch self { 108 | case .main: 109 | return dispatch_get_main_queue() 110 | case .userInteractive: 111 | return dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0) 112 | case .userInitiated: 113 | return dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0) 114 | case .regular: 115 | return dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0) 116 | case .utility: 117 | return dispatch_get_global_queue(QOS_CLASS_UTILITY, 0) 118 | case .background: 119 | return dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0) 120 | case .custom(let queue): 121 | return queue 122 | } 123 | } 124 | } 125 | 126 | /** 127 | Submits a closure for execution on the specified dispatch queue using the specified execution type. 128 | 129 | - parameter queue: The queue on which to submit the closure. 130 | - parameter execution: The execution type for the queue. 131 | - parameter closure: The closure to submit to the dispatch queue. 132 | */ 133 | public func dispatch(queue queue: DispatchQueue, execution: Execution = .async, closure: () -> Void) { 134 | 135 | switch execution { 136 | case .async: 137 | dispatch_async(queue.dispatchQueue, closure) 138 | case .sync: 139 | dispatch_sync(queue.dispatchQueue, closure) 140 | case .barrierAsync: 141 | dispatch_barrier_async(queue.dispatchQueue, closure) 142 | case .barrierSync: 143 | dispatch_barrier_sync(queue.dispatchQueue, closure) 144 | case .delay(let seconds): 145 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(seconds * Double(NSEC_PER_SEC))), queue.dispatchQueue, closure) 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /Sources/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 | -------------------------------------------------------------------------------- /Tests/GrandSugarDispatchTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.com/GrandSugarDispatch 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/GrandSugarDispatch 12 | // 13 | // 14 | // License 15 | // Copyright © 2016 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | 20 | import XCTest 21 | 22 | @testable import GrandSugarDispatch 23 | 24 | let timeout = NSTimeInterval(30) 25 | 26 | 27 | final class GrandSugarDispatchTests: XCTestCase { 28 | 29 | func test_thatMainQueue_executesAsynchronously() { 30 | let expectation = expectationWithDescription(#function) 31 | 32 | dispatch(queue: .main, execution: .async) { 33 | XCTAssertTrue(NSThread.isMainThread()) 34 | expectation.fulfill() 35 | } 36 | 37 | waitForExpectationsWithTimeout(timeout) { (error) in 38 | XCTAssertNil(error) 39 | } 40 | } 41 | 42 | func test_thatUserInteractiveQueue_executesAsynchronously() { 43 | let expectation = expectationWithDescription(#function) 44 | 45 | dispatch(queue: .userInteractive, execution: .async) { 46 | XCTAssertFalse(NSThread.isMainThread()) 47 | expectation.fulfill() 48 | } 49 | 50 | waitForExpectationsWithTimeout(timeout) { (error) in 51 | XCTAssertNil(error) 52 | } 53 | } 54 | 55 | func test_thatUserInitiatedQueue_executesAsynchronously() { 56 | let expectation = expectationWithDescription(#function) 57 | 58 | dispatch(queue: .userInitiated, execution: .async) { 59 | XCTAssertFalse(NSThread.isMainThread()) 60 | expectation.fulfill() 61 | } 62 | 63 | waitForExpectationsWithTimeout(timeout) { (error) in 64 | XCTAssertNil(error) 65 | } 66 | } 67 | 68 | func test_thatDefaultQueue_executesAsynchronously() { 69 | let expectation = expectationWithDescription(#function) 70 | 71 | dispatch(queue: .regular, execution: .async) { 72 | XCTAssertFalse(NSThread.isMainThread()) 73 | expectation.fulfill() 74 | } 75 | 76 | waitForExpectationsWithTimeout(timeout) { (error) in 77 | XCTAssertNil(error) 78 | } 79 | } 80 | 81 | func test_thatUtilityQueue_executesAsynchronously() { 82 | let expectation = expectationWithDescription(#function) 83 | 84 | dispatch(queue: .utility, execution: .async) { 85 | XCTAssertFalse(NSThread.isMainThread()) 86 | expectation.fulfill() 87 | } 88 | 89 | waitForExpectationsWithTimeout(timeout) { (error) in 90 | XCTAssertNil(error) 91 | } 92 | } 93 | 94 | func test_thatBackgroundQueue_executesAsynchronously() { 95 | let expectation = expectationWithDescription(#function) 96 | 97 | dispatch(queue: .background, execution: .async) { 98 | XCTAssertFalse(NSThread.isMainThread()) 99 | expectation.fulfill() 100 | } 101 | 102 | waitForExpectationsWithTimeout(timeout) { (error) in 103 | XCTAssertNil(error) 104 | } 105 | } 106 | 107 | func test_thatCustomConcurrentQueue_executesAsynchronously() { 108 | let expectation = expectationWithDescription(#function) 109 | 110 | let concurrentQ = DispatchQueue.create(label: "com.jessesquires.GrandSugarDispatch", concurrency: .concurrent) 111 | 112 | dispatch(queue: .custom(concurrentQ), execution: .async) { 113 | XCTAssertFalse(NSThread.isMainThread()) 114 | expectation.fulfill() 115 | } 116 | 117 | waitForExpectationsWithTimeout(timeout) { (error) in 118 | XCTAssertNil(error) 119 | } 120 | } 121 | 122 | func test_thatCustomSerialQueue_executesAsynchronously() { 123 | let expectation = expectationWithDescription(#function) 124 | 125 | let serialQ = DispatchQueue.create(label: "com.jessesquires.GrandSugarDispatch", concurrency: .serial) 126 | 127 | dispatch(queue: .custom(serialQ), execution: .async) { 128 | XCTAssertFalse(NSThread.isMainThread()) 129 | expectation.fulfill() 130 | } 131 | 132 | waitForExpectationsWithTimeout(timeout) { (error) in 133 | XCTAssertNil(error) 134 | } 135 | } 136 | 137 | func test_thatMainQueue_executesAfterDelay() { 138 | let expectation = expectationWithDescription(#function) 139 | 140 | dispatch(queue: .main, execution: .delay(seconds: 1)) { 141 | XCTAssertTrue(NSThread.isMainThread()) 142 | expectation.fulfill() 143 | } 144 | 145 | waitForExpectationsWithTimeout(timeout) { (error) in 146 | XCTAssertNil(error) 147 | } 148 | } 149 | 150 | } 151 | -------------------------------------------------------------------------------- /Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | --------------------------------------------------------------------------------