├── .gitignore ├── LICENSE ├── README.md ├── UDo.xcodeproj └── project.pbxproj ├── UDo ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ ├── Icon-Small@2x.png │ │ └── Icon-Spotlight-40@2x.png │ ├── Icon-60.imageset │ │ ├── Contents.json │ │ ├── Icon-60.png │ │ └── Icon-60@2x.png │ ├── Icon-72.imageset │ │ ├── Contents.json │ │ ├── Icon-72.png │ │ └── Icon-72@2x.png │ ├── Icon-76.imageset │ │ ├── Contents.json │ │ ├── Icon-76.png │ │ └── Icon-76@2x.png │ ├── Icon-Small-50.imageset │ │ ├── Contents.json │ │ ├── Icon-Small-50.png │ │ └── Icon-Small-50@2x.png │ ├── Icon-Small.imageset │ │ ├── Contents.json │ │ ├── Icon-Small.png │ │ └── Icon-Small@2x.png │ ├── Icon-Spotlight-40.imageset │ │ ├── Contents.json │ │ ├── Icon-Spotlight-40.png │ │ └── Icon-Spotlight-40@2x.png │ ├── Icon.imageset │ │ ├── Contents.json │ │ ├── Icon.png │ │ └── Icon@2x.png │ └── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── LaunchImage1136.png │ │ └── LaunchImage960.png ├── RWAppDelegate.h ├── RWAppDelegate.m ├── RWBasicTableViewCell.h ├── RWBasicTableViewCell.m ├── RWTableViewController.h ├── RWTableViewController.m ├── Storyboard.storyboard ├── UDo-Info.plist ├── UDo-Prefix.pch ├── UIAlertView+RWBlock.h ├── UIAlertView+RWBlock.m ├── en.lproj │ └── InfoPlist.strings └── main.m └── UDoTests ├── UDoTests-Info.plist ├── UDoTests.m └── en.lproj └── InfoPlist.strings /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pbxuser 3 | xcuserdata 4 | 5 | # Ignore the workspace 6 | UDo.xcodeproj/project.xcworkspace/ 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Soheil Moayedi Azarpour 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | UDo 2 | === 3 | This is a repository for the sample projects of Cookbook-style tuorial: Moving Table View Cells with a Long Press Gesture. In this cookbook-style tutorial you will learn how to move a table view row by using a long press gesture, like in Apple's Weather App. 4 | 5 | 6 | Branches 7 | ======== 8 | * Checkout UDoStarter branch for the starter project. 9 | * Checkout master branch for the UITableView complete project. 10 | * Checkout UDo.UICollectionView.Starter branch for the UICollectionView starter project. 11 | * Checkout UDo.UICollectionView branch for the UICollectionView complete project. -------------------------------------------------------------------------------- /UDo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6190AF3F199659AE00E12D44 /* RWBasicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6190AF3E199659AE00E12D44 /* RWBasicTableViewCell.m */; }; 11 | 6D3189C0187C422A00994DDF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D3189BF187C422A00994DDF /* Foundation.framework */; }; 12 | 6D3189C2187C422A00994DDF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D3189C1187C422A00994DDF /* CoreGraphics.framework */; }; 13 | 6D3189C4187C422A00994DDF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D3189C3187C422A00994DDF /* UIKit.framework */; }; 14 | 6D3189CA187C422A00994DDF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6D3189C8187C422A00994DDF /* InfoPlist.strings */; }; 15 | 6D3189CC187C422A00994DDF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D3189CB187C422A00994DDF /* main.m */; }; 16 | 6D3189D0187C422A00994DDF /* RWAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D3189CF187C422A00994DDF /* RWAppDelegate.m */; }; 17 | 6D3189D9187C422A00994DDF /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D3189D8187C422A00994DDF /* XCTest.framework */; }; 18 | 6D3189DA187C422A00994DDF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D3189BF187C422A00994DDF /* Foundation.framework */; }; 19 | 6D3189DB187C422A00994DDF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D3189C3187C422A00994DDF /* UIKit.framework */; }; 20 | 6D3189E3187C422A00994DDF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6D3189E1187C422A00994DDF /* InfoPlist.strings */; }; 21 | 6D3189E5187C422A00994DDF /* UDoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D3189E4187C422A00994DDF /* UDoTests.m */; }; 22 | 6D3189F1187C427400994DDF /* RWTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D3189F0187C427400994DDF /* RWTableViewController.m */; }; 23 | 6D3189F3187C42A800994DDF /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D3189F2187C42A800994DDF /* Images.xcassets */; }; 24 | 6D3189F5187C42BD00994DDF /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D3189F4187C42BD00994DDF /* Storyboard.storyboard */; }; 25 | 6D3189F8187C438B00994DDF /* UIAlertView+RWBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D3189F7187C438B00994DDF /* UIAlertView+RWBlock.m */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 6D3189DC187C422A00994DDF /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 6D3189B4187C422A00994DDF /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 6D3189BB187C422A00994DDF; 34 | remoteInfo = UDo; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 6190AF3D199659AE00E12D44 /* RWBasicTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RWBasicTableViewCell.h; sourceTree = ""; }; 40 | 6190AF3E199659AE00E12D44 /* RWBasicTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RWBasicTableViewCell.m; sourceTree = ""; }; 41 | 6D3189BC187C422A00994DDF /* UDo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UDo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 6D3189BF187C422A00994DDF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 43 | 6D3189C1187C422A00994DDF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 44 | 6D3189C3187C422A00994DDF /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 45 | 6D3189C7187C422A00994DDF /* UDo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UDo-Info.plist"; sourceTree = ""; }; 46 | 6D3189C9187C422A00994DDF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 47 | 6D3189CB187C422A00994DDF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 48 | 6D3189CD187C422A00994DDF /* UDo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UDo-Prefix.pch"; sourceTree = ""; }; 49 | 6D3189CE187C422A00994DDF /* RWAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RWAppDelegate.h; sourceTree = ""; }; 50 | 6D3189CF187C422A00994DDF /* RWAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RWAppDelegate.m; sourceTree = ""; }; 51 | 6D3189D7187C422A00994DDF /* UDoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UDoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 6D3189D8187C422A00994DDF /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 53 | 6D3189E0187C422A00994DDF /* UDoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UDoTests-Info.plist"; sourceTree = ""; }; 54 | 6D3189E2187C422A00994DDF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 55 | 6D3189E4187C422A00994DDF /* UDoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UDoTests.m; sourceTree = ""; }; 56 | 6D3189EF187C427400994DDF /* RWTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RWTableViewController.h; sourceTree = ""; }; 57 | 6D3189F0187C427400994DDF /* RWTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RWTableViewController.m; sourceTree = ""; }; 58 | 6D3189F2187C42A800994DDF /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 59 | 6D3189F4187C42BD00994DDF /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Storyboard.storyboard; sourceTree = ""; }; 60 | 6D3189F6187C438B00994DDF /* UIAlertView+RWBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIAlertView+RWBlock.h"; sourceTree = ""; }; 61 | 6D3189F7187C438B00994DDF /* UIAlertView+RWBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+RWBlock.m"; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | 6D3189B9187C422A00994DDF /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | 6D3189C2187C422A00994DDF /* CoreGraphics.framework in Frameworks */, 70 | 6D3189C4187C422A00994DDF /* UIKit.framework in Frameworks */, 71 | 6D3189C0187C422A00994DDF /* Foundation.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 6D3189D4187C422A00994DDF /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | 6D3189D9187C422A00994DDF /* XCTest.framework in Frameworks */, 80 | 6D3189DB187C422A00994DDF /* UIKit.framework in Frameworks */, 81 | 6D3189DA187C422A00994DDF /* Foundation.framework in Frameworks */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXFrameworksBuildPhase section */ 86 | 87 | /* Begin PBXGroup section */ 88 | 6D3189B3187C422A00994DDF = { 89 | isa = PBXGroup; 90 | children = ( 91 | 6D3189C5187C422A00994DDF /* UDo */, 92 | 6D3189DE187C422A00994DDF /* UDoTests */, 93 | 6D3189BE187C422A00994DDF /* Frameworks */, 94 | 6D3189BD187C422A00994DDF /* Products */, 95 | ); 96 | indentWidth = 2; 97 | sourceTree = ""; 98 | tabWidth = 2; 99 | }; 100 | 6D3189BD187C422A00994DDF /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 6D3189BC187C422A00994DDF /* UDo.app */, 104 | 6D3189D7187C422A00994DDF /* UDoTests.xctest */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | 6D3189BE187C422A00994DDF /* Frameworks */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 6D3189BF187C422A00994DDF /* Foundation.framework */, 113 | 6D3189C1187C422A00994DDF /* CoreGraphics.framework */, 114 | 6D3189C3187C422A00994DDF /* UIKit.framework */, 115 | 6D3189D8187C422A00994DDF /* XCTest.framework */, 116 | ); 117 | name = Frameworks; 118 | sourceTree = ""; 119 | }; 120 | 6D3189C5187C422A00994DDF /* UDo */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 6D3189F4187C42BD00994DDF /* Storyboard.storyboard */, 124 | 6D3189CE187C422A00994DDF /* RWAppDelegate.h */, 125 | 6D3189CF187C422A00994DDF /* RWAppDelegate.m */, 126 | 6D3189EF187C427400994DDF /* RWTableViewController.h */, 127 | 6D3189F0187C427400994DDF /* RWTableViewController.m */, 128 | 6190AF3D199659AE00E12D44 /* RWBasicTableViewCell.h */, 129 | 6190AF3E199659AE00E12D44 /* RWBasicTableViewCell.m */, 130 | 6D3189F6187C438B00994DDF /* UIAlertView+RWBlock.h */, 131 | 6D3189F7187C438B00994DDF /* UIAlertView+RWBlock.m */, 132 | 6D3189F2187C42A800994DDF /* Images.xcassets */, 133 | 6D3189C6187C422A00994DDF /* Supporting Files */, 134 | ); 135 | path = UDo; 136 | sourceTree = ""; 137 | }; 138 | 6D3189C6187C422A00994DDF /* Supporting Files */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 6D3189C7187C422A00994DDF /* UDo-Info.plist */, 142 | 6D3189C8187C422A00994DDF /* InfoPlist.strings */, 143 | 6D3189CB187C422A00994DDF /* main.m */, 144 | 6D3189CD187C422A00994DDF /* UDo-Prefix.pch */, 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | 6D3189DE187C422A00994DDF /* UDoTests */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 6D3189E4187C422A00994DDF /* UDoTests.m */, 153 | 6D3189DF187C422A00994DDF /* Supporting Files */, 154 | ); 155 | path = UDoTests; 156 | sourceTree = ""; 157 | }; 158 | 6D3189DF187C422A00994DDF /* Supporting Files */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 6D3189E0187C422A00994DDF /* UDoTests-Info.plist */, 162 | 6D3189E1187C422A00994DDF /* InfoPlist.strings */, 163 | ); 164 | name = "Supporting Files"; 165 | sourceTree = ""; 166 | }; 167 | /* End PBXGroup section */ 168 | 169 | /* Begin PBXNativeTarget section */ 170 | 6D3189BB187C422A00994DDF /* UDo */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = 6D3189E8187C422A00994DDF /* Build configuration list for PBXNativeTarget "UDo" */; 173 | buildPhases = ( 174 | 6D3189B8187C422A00994DDF /* Sources */, 175 | 6D3189B9187C422A00994DDF /* Frameworks */, 176 | 6D3189BA187C422A00994DDF /* Resources */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | ); 182 | name = UDo; 183 | productName = UDo; 184 | productReference = 6D3189BC187C422A00994DDF /* UDo.app */; 185 | productType = "com.apple.product-type.application"; 186 | }; 187 | 6D3189D6187C422A00994DDF /* UDoTests */ = { 188 | isa = PBXNativeTarget; 189 | buildConfigurationList = 6D3189EB187C422A00994DDF /* Build configuration list for PBXNativeTarget "UDoTests" */; 190 | buildPhases = ( 191 | 6D3189D3187C422A00994DDF /* Sources */, 192 | 6D3189D4187C422A00994DDF /* Frameworks */, 193 | 6D3189D5187C422A00994DDF /* Resources */, 194 | ); 195 | buildRules = ( 196 | ); 197 | dependencies = ( 198 | 6D3189DD187C422A00994DDF /* PBXTargetDependency */, 199 | ); 200 | name = UDoTests; 201 | productName = UDoTests; 202 | productReference = 6D3189D7187C422A00994DDF /* UDoTests.xctest */; 203 | productType = "com.apple.product-type.bundle.unit-test"; 204 | }; 205 | /* End PBXNativeTarget section */ 206 | 207 | /* Begin PBXProject section */ 208 | 6D3189B4187C422A00994DDF /* Project object */ = { 209 | isa = PBXProject; 210 | attributes = { 211 | CLASSPREFIX = RW; 212 | LastUpgradeCheck = 0610; 213 | ORGANIZATIONNAME = "Soheil Azarpour"; 214 | TargetAttributes = { 215 | 6D3189BB187C422A00994DDF = { 216 | DevelopmentTeam = 2X468FT7VV; 217 | }; 218 | 6D3189D6187C422A00994DDF = { 219 | TestTargetID = 6D3189BB187C422A00994DDF; 220 | }; 221 | }; 222 | }; 223 | buildConfigurationList = 6D3189B7187C422A00994DDF /* Build configuration list for PBXProject "UDo" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | ); 230 | mainGroup = 6D3189B3187C422A00994DDF; 231 | productRefGroup = 6D3189BD187C422A00994DDF /* Products */; 232 | projectDirPath = ""; 233 | projectRoot = ""; 234 | targets = ( 235 | 6D3189BB187C422A00994DDF /* UDo */, 236 | 6D3189D6187C422A00994DDF /* UDoTests */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | 6D3189BA187C422A00994DDF /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | 6D3189CA187C422A00994DDF /* InfoPlist.strings in Resources */, 247 | 6D3189F3187C42A800994DDF /* Images.xcassets in Resources */, 248 | 6D3189F5187C42BD00994DDF /* Storyboard.storyboard in Resources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | 6D3189D5187C422A00994DDF /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | 6D3189E3187C422A00994DDF /* InfoPlist.strings in Resources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | /* End PBXResourcesBuildPhase section */ 261 | 262 | /* Begin PBXSourcesBuildPhase section */ 263 | 6D3189B8187C422A00994DDF /* Sources */ = { 264 | isa = PBXSourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | 6D3189F8187C438B00994DDF /* UIAlertView+RWBlock.m in Sources */, 268 | 6D3189CC187C422A00994DDF /* main.m in Sources */, 269 | 6D3189F1187C427400994DDF /* RWTableViewController.m in Sources */, 270 | 6190AF3F199659AE00E12D44 /* RWBasicTableViewCell.m in Sources */, 271 | 6D3189D0187C422A00994DDF /* RWAppDelegate.m in Sources */, 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | 6D3189D3187C422A00994DDF /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 6D3189E5187C422A00994DDF /* UDoTests.m in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | /* End PBXSourcesBuildPhase section */ 284 | 285 | /* Begin PBXTargetDependency section */ 286 | 6D3189DD187C422A00994DDF /* PBXTargetDependency */ = { 287 | isa = PBXTargetDependency; 288 | target = 6D3189BB187C422A00994DDF /* UDo */; 289 | targetProxy = 6D3189DC187C422A00994DDF /* PBXContainerItemProxy */; 290 | }; 291 | /* End PBXTargetDependency section */ 292 | 293 | /* Begin PBXVariantGroup section */ 294 | 6D3189C8187C422A00994DDF /* InfoPlist.strings */ = { 295 | isa = PBXVariantGroup; 296 | children = ( 297 | 6D3189C9187C422A00994DDF /* en */, 298 | ); 299 | name = InfoPlist.strings; 300 | sourceTree = ""; 301 | }; 302 | 6D3189E1187C422A00994DDF /* InfoPlist.strings */ = { 303 | isa = PBXVariantGroup; 304 | children = ( 305 | 6D3189E2187C422A00994DDF /* en */, 306 | ); 307 | name = InfoPlist.strings; 308 | sourceTree = ""; 309 | }; 310 | /* End PBXVariantGroup section */ 311 | 312 | /* Begin XCBuildConfiguration section */ 313 | 6D3189E6187C422A00994DDF /* Debug */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ALWAYS_SEARCH_USER_PATHS = NO; 317 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 318 | CLANG_CXX_LIBRARY = "libc++"; 319 | CLANG_ENABLE_MODULES = YES; 320 | CLANG_ENABLE_OBJC_ARC = YES; 321 | CLANG_WARN_BOOL_CONVERSION = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 324 | CLANG_WARN_EMPTY_BODY = YES; 325 | CLANG_WARN_ENUM_CONVERSION = YES; 326 | CLANG_WARN_INT_CONVERSION = YES; 327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 328 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 329 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 330 | COPY_PHASE_STRIP = NO; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_DYNAMIC_NO_PIC = NO; 333 | GCC_OPTIMIZATION_LEVEL = 0; 334 | GCC_PREPROCESSOR_DEFINITIONS = ( 335 | "DEBUG=1", 336 | "$(inherited)", 337 | ); 338 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 341 | GCC_WARN_UNDECLARED_SELECTOR = YES; 342 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 343 | GCC_WARN_UNUSED_FUNCTION = YES; 344 | GCC_WARN_UNUSED_VARIABLE = YES; 345 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 346 | ONLY_ACTIVE_ARCH = YES; 347 | SDKROOT = iphoneos; 348 | }; 349 | name = Debug; 350 | }; 351 | 6D3189E7187C422A00994DDF /* Release */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 356 | CLANG_CXX_LIBRARY = "libc++"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_WARN_BOOL_CONVERSION = YES; 360 | CLANG_WARN_CONSTANT_CONVERSION = YES; 361 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 362 | CLANG_WARN_EMPTY_BODY = YES; 363 | CLANG_WARN_ENUM_CONVERSION = YES; 364 | CLANG_WARN_INT_CONVERSION = YES; 365 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 366 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 368 | COPY_PHASE_STRIP = YES; 369 | ENABLE_NS_ASSERTIONS = NO; 370 | GCC_C_LANGUAGE_STANDARD = gnu99; 371 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 372 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 373 | GCC_WARN_UNDECLARED_SELECTOR = YES; 374 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 375 | GCC_WARN_UNUSED_FUNCTION = YES; 376 | GCC_WARN_UNUSED_VARIABLE = YES; 377 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 378 | SDKROOT = iphoneos; 379 | VALIDATE_PRODUCT = YES; 380 | }; 381 | name = Release; 382 | }; 383 | 6D3189E9187C422A00994DDF /* Debug */ = { 384 | isa = XCBuildConfiguration; 385 | buildSettings = { 386 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 387 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 388 | CODE_SIGN_IDENTITY = "iPhone Developer"; 389 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 390 | GCC_PREFIX_HEADER = "UDo/UDo-Prefix.pch"; 391 | INFOPLIST_FILE = "UDo/UDo-Info.plist"; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | WRAPPER_EXTENSION = app; 394 | }; 395 | name = Debug; 396 | }; 397 | 6D3189EA187C422A00994DDF /* Release */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 401 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 402 | CODE_SIGN_IDENTITY = "iPhone Developer"; 403 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 404 | GCC_PREFIX_HEADER = "UDo/UDo-Prefix.pch"; 405 | INFOPLIST_FILE = "UDo/UDo-Info.plist"; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | WRAPPER_EXTENSION = app; 408 | }; 409 | name = Release; 410 | }; 411 | 6D3189EC187C422A00994DDF /* Debug */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/UDo.app/UDo"; 415 | FRAMEWORK_SEARCH_PATHS = ( 416 | "$(SDKROOT)/Developer/Library/Frameworks", 417 | "$(inherited)", 418 | "$(DEVELOPER_FRAMEWORKS_DIR)", 419 | ); 420 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 421 | GCC_PREFIX_HEADER = "UDo/UDo-Prefix.pch"; 422 | GCC_PREPROCESSOR_DEFINITIONS = ( 423 | "DEBUG=1", 424 | "$(inherited)", 425 | ); 426 | INFOPLIST_FILE = "UDoTests/UDoTests-Info.plist"; 427 | PRODUCT_NAME = "$(TARGET_NAME)"; 428 | TEST_HOST = "$(BUNDLE_LOADER)"; 429 | WRAPPER_EXTENSION = xctest; 430 | }; 431 | name = Debug; 432 | }; 433 | 6D3189ED187C422A00994DDF /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/UDo.app/UDo"; 437 | FRAMEWORK_SEARCH_PATHS = ( 438 | "$(SDKROOT)/Developer/Library/Frameworks", 439 | "$(inherited)", 440 | "$(DEVELOPER_FRAMEWORKS_DIR)", 441 | ); 442 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 443 | GCC_PREFIX_HEADER = "UDo/UDo-Prefix.pch"; 444 | INFOPLIST_FILE = "UDoTests/UDoTests-Info.plist"; 445 | PRODUCT_NAME = "$(TARGET_NAME)"; 446 | TEST_HOST = "$(BUNDLE_LOADER)"; 447 | WRAPPER_EXTENSION = xctest; 448 | }; 449 | name = Release; 450 | }; 451 | /* End XCBuildConfiguration section */ 452 | 453 | /* Begin XCConfigurationList section */ 454 | 6D3189B7187C422A00994DDF /* Build configuration list for PBXProject "UDo" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | 6D3189E6187C422A00994DDF /* Debug */, 458 | 6D3189E7187C422A00994DDF /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | defaultConfigurationName = Release; 462 | }; 463 | 6D3189E8187C422A00994DDF /* Build configuration list for PBXNativeTarget "UDo" */ = { 464 | isa = XCConfigurationList; 465 | buildConfigurations = ( 466 | 6D3189E9187C422A00994DDF /* Debug */, 467 | 6D3189EA187C422A00994DDF /* Release */, 468 | ); 469 | defaultConfigurationIsVisible = 0; 470 | defaultConfigurationName = Release; 471 | }; 472 | 6D3189EB187C422A00994DDF /* Build configuration list for PBXNativeTarget "UDoTests" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 6D3189EC187C422A00994DDF /* Debug */, 476 | 6D3189ED187C422A00994DDF /* Release */, 477 | ); 478 | defaultConfigurationIsVisible = 0; 479 | defaultConfigurationName = Release; 480 | }; 481 | /* End XCConfigurationList section */ 482 | }; 483 | rootObject = 6D3189B4187C422A00994DDF /* Project object */; 484 | } 485 | -------------------------------------------------------------------------------- /UDo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Small@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "40x40", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-Spotlight-40@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "60x60", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-60@2x.png", 19 | "scale" : "2x" 20 | } 21 | ], 22 | "info" : { 23 | "version" : 1, 24 | "author" : "xcode" 25 | } 26 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-60.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Icon-60.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Icon-60@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-60.imageset/Icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-60.imageset/Icon-60.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-60.imageset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-60.imageset/Icon-60@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-72.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Icon-72.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Icon-72@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-72.imageset/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-72.imageset/Icon-72.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-72.imageset/Icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-72.imageset/Icon-72@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-76.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Icon-76.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Icon-76@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-76.imageset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-76.imageset/Icon-76.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-76.imageset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-76.imageset/Icon-76@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Small-50.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Icon-Small-50.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Icon-Small-50@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Small-50.imageset/Icon-Small-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-Small-50.imageset/Icon-Small-50.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Small-50.imageset/Icon-Small-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-Small-50.imageset/Icon-Small-50@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Small.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Icon-Small.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Icon-Small@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Small.imageset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-Small.imageset/Icon-Small.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Small.imageset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-Small.imageset/Icon-Small@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Spotlight-40.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Icon-Spotlight-40.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Icon-Spotlight-40@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Spotlight-40.imageset/Icon-Spotlight-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-Spotlight-40.imageset/Icon-Spotlight-40.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon-Spotlight-40.imageset/Icon-Spotlight-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon-Spotlight-40.imageset/Icon-Spotlight-40@2x.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Icon.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "Icon@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon.imageset/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon.imageset/Icon.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/Icon.imageset/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/Icon.imageset/Icon@2x.png -------------------------------------------------------------------------------- /UDo/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 | "filename" : "LaunchImage960.png", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "extent" : "full-screen", 13 | "idiom" : "iphone", 14 | "subtype" : "retina4", 15 | "filename" : "LaunchImage1136.png", 16 | "minimum-system-version" : "7.0", 17 | "orientation" : "portrait", 18 | "scale" : "2x" 19 | } 20 | ], 21 | "info" : { 22 | "version" : 1, 23 | "author" : "xcode" 24 | } 25 | } -------------------------------------------------------------------------------- /UDo/Images.xcassets/LaunchImage.launchimage/LaunchImage1136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/LaunchImage.launchimage/LaunchImage1136.png -------------------------------------------------------------------------------- /UDo/Images.xcassets/LaunchImage.launchimage/LaunchImage960.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moayes/UDo/a8f81aaed58b10df069c7f25e9feb2989b5a4bcd/UDo/Images.xcassets/LaunchImage.launchimage/LaunchImage960.png -------------------------------------------------------------------------------- /UDo/RWAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // RWAppDelegate.h 3 | // UDo 4 | // 5 | // Created by Soheil Azarpour on 12/21/13. 6 | // Copyright (c) 2013 Ray Wenderlich. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface RWAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end -------------------------------------------------------------------------------- /UDo/RWAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // RWAppDelegate.m 3 | // UDo 4 | // 5 | // Created by Soheil Azarpour on 12/21/13. 6 | // Copyright (c) 2013 Ray Wenderlich. All rights reserved. 7 | // 8 | 9 | #import "RWAppDelegate.h" 10 | 11 | @implementation RWAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | return YES; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /UDo/RWBasicTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // RWBasicTableViewCell.h 3 | // UDo 4 | // 5 | // Created by Soheil M. Azarpour on 8/9/14. 6 | // Copyright (c) 2014 Soheil Azarpour. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface RWBasicTableViewCell : UITableViewCell 12 | 13 | @property (weak, nonatomic) IBOutlet UILabel *titleLabel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /UDo/RWBasicTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // RWBasicTableViewCell.m 3 | // UDo 4 | // 5 | // Created by Soheil M. Azarpour on 8/9/14. 6 | // Copyright (c) 2014 Soheil Azarpour. All rights reserved. 7 | // 8 | 9 | #import "RWBasicTableViewCell.h" 10 | 11 | @implementation RWBasicTableViewCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /UDo/RWTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RWTableViewController.h 3 | // UDo 4 | // 5 | // Created by Soheil Azarpour on 12/21/13. 6 | // Copyright (c) 2013 Ray Wenderlich. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface RWTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /UDo/RWTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RWTableViewController.m 3 | // UDo 4 | // 5 | // Created by Soheil Azarpour on 12/21/13. 6 | // Copyright (c) 2013 Ray Wenderlich. All rights reserved. 7 | // 8 | 9 | #import "RWTableViewController.h" 10 | #import "RWBasicTableViewCell.h" 11 | #import "UIAlertView+RWBlock.h" 12 | 13 | @interface RWTableViewController () 14 | 15 | /** @brief An array of NSString objects, data source of the table view. */ 16 | @property (strong, nonatomic) NSMutableArray *objects; 17 | 18 | @end 19 | 20 | @implementation RWTableViewController 21 | 22 | #pragma mark - Custom accessors 23 | 24 | - (NSMutableArray *)objects { 25 | if (!_objects) { 26 | _objects = [@[@"Get Milk!", @"Go to gym", @"Breakfast with Rita!", @"Call Bob", @"Pick up newspaper", @"Send an email to Joe", @"Read this tutorial!", @"Pick up flowers"] mutableCopy]; 27 | } 28 | return _objects; 29 | } 30 | 31 | #pragma mark - View life cycle 32 | 33 | - (void)viewDidLoad { 34 | self.title = @"To Do!"; 35 | 36 | UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressGestureRecognized:)]; 37 | [self.tableView addGestureRecognizer:longPress]; 38 | 39 | [super viewDidLoad]; 40 | } 41 | 42 | #pragma mark - UITableView data source and delegate methods 43 | 44 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 45 | return [self.objects count]; 46 | } 47 | 48 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 49 | static NSString *kIdentifier = @"Cell Identifier"; 50 | 51 | RWBasicTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kIdentifier forIndexPath:indexPath]; 52 | 53 | // Update cell content from data source. 54 | NSString *object = self.objects[indexPath.row]; 55 | cell.titleLabel.text = object; 56 | 57 | return cell; 58 | } 59 | 60 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 61 | return YES; 62 | } 63 | 64 | - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { 65 | return UITableViewCellEditingStyleDelete; 66 | } 67 | 68 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 69 | [self.objects removeObjectAtIndex:indexPath.row]; 70 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; 71 | } 72 | 73 | #pragma mark - IBActions 74 | 75 | - (IBAction)addButtonPressed:(id)sender { 76 | 77 | // Display an alert view with a text input. 78 | UIAlertView *inputAlertView = [[UIAlertView alloc] initWithTitle:@"Add a new to-do item:" message:nil delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:@"Add", nil]; 79 | 80 | inputAlertView.alertViewStyle = UIAlertViewStylePlainTextInput; 81 | 82 | __weak RWTableViewController *weakself = self; 83 | 84 | // Add a completion block (using our category to UIAlertView). 85 | [inputAlertView setCompletionBlock:^(UIAlertView *alertView, NSInteger buttonIndex) { 86 | 87 | // If user pressed 'Add'... 88 | if (buttonIndex == 1) { 89 | 90 | UITextField *textField = [alertView textFieldAtIndex:0]; 91 | NSString *string = [textField.text capitalizedString]; 92 | [weakself.objects addObject:string]; 93 | 94 | NSUInteger row = [weakself.objects count] - 1; 95 | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0]; 96 | [weakself.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; 97 | } 98 | }]; 99 | 100 | [inputAlertView show]; 101 | } 102 | 103 | - (IBAction)longPressGestureRecognized:(id)sender { 104 | 105 | UILongPressGestureRecognizer *longPress = (UILongPressGestureRecognizer *)sender; 106 | UIGestureRecognizerState state = longPress.state; 107 | 108 | CGPoint location = [longPress locationInView:self.tableView]; 109 | NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location]; 110 | 111 | static UIView *snapshot = nil; ///< A snapshot of the row user is moving. 112 | static NSIndexPath *sourceIndexPath = nil; ///< Initial index path, where gesture begins. 113 | 114 | switch (state) { 115 | case UIGestureRecognizerStateBegan: { 116 | if (indexPath) { 117 | sourceIndexPath = indexPath; 118 | 119 | UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; 120 | 121 | // Take a snapshot of the selected row using helper method. 122 | snapshot = [self customSnapshoFromView:cell]; 123 | 124 | // Add the snapshot as subview, centered at cell's center... 125 | __block CGPoint center = cell.center; 126 | snapshot.center = center; 127 | snapshot.alpha = 0.0; 128 | [self.tableView addSubview:snapshot]; 129 | [UIView animateWithDuration:0.25 animations:^{ 130 | 131 | // Offset for gesture location. 132 | center.y = location.y; 133 | snapshot.center = center; 134 | snapshot.transform = CGAffineTransformMakeScale(1.05, 1.05); 135 | snapshot.alpha = 0.98; 136 | cell.alpha = 0.0; 137 | cell.hidden = YES; 138 | 139 | }]; 140 | } 141 | break; 142 | } 143 | 144 | case UIGestureRecognizerStateChanged: { 145 | CGPoint center = snapshot.center; 146 | center.y = location.y; 147 | snapshot.center = center; 148 | 149 | // Is destination valid and is it different from source? 150 | if (indexPath && ![indexPath isEqual:sourceIndexPath]) { 151 | 152 | // ... update data source. 153 | [self.objects exchangeObjectAtIndex:indexPath.row withObjectAtIndex:sourceIndexPath.row]; 154 | 155 | // ... move the rows. 156 | [self.tableView moveRowAtIndexPath:sourceIndexPath toIndexPath:indexPath]; 157 | 158 | // ... and update source so it is in sync with UI changes. 159 | sourceIndexPath = indexPath; 160 | } 161 | break; 162 | } 163 | 164 | default: { 165 | // Clean up. 166 | UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:sourceIndexPath]; 167 | cell.alpha = 0.0; 168 | 169 | [UIView animateWithDuration:0.25 animations:^{ 170 | 171 | snapshot.center = cell.center; 172 | snapshot.transform = CGAffineTransformIdentity; 173 | snapshot.alpha = 0.0; 174 | cell.alpha = 1.0; 175 | 176 | } completion:^(BOOL finished) { 177 | 178 | cell.hidden = NO; 179 | sourceIndexPath = nil; 180 | [snapshot removeFromSuperview]; 181 | snapshot = nil; 182 | 183 | }]; 184 | 185 | break; 186 | } 187 | } 188 | } 189 | 190 | #pragma mark - Helper methods 191 | 192 | /** @brief Returns a customized snapshot of a given view. */ 193 | - (UIView *)customSnapshoFromView:(UIView *)inputView { 194 | 195 | // Make an image from the input view. 196 | UIGraphicsBeginImageContextWithOptions(inputView.bounds.size, NO, 0); 197 | [inputView.layer renderInContext:UIGraphicsGetCurrentContext()]; 198 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 199 | UIGraphicsEndImageContext(); 200 | 201 | // Create an image view. 202 | UIView *snapshot = [[UIImageView alloc] initWithImage:image]; 203 | snapshot.layer.masksToBounds = NO; 204 | snapshot.layer.cornerRadius = 0.0; 205 | snapshot.layer.shadowOffset = CGSizeMake(-5.0, 0.0); 206 | snapshot.layer.shadowRadius = 5.0; 207 | snapshot.layer.shadowOpacity = 0.4; 208 | 209 | return snapshot; 210 | } 211 | 212 | @end 213 | -------------------------------------------------------------------------------- /UDo/Storyboard.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /UDo/UDo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME}! 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | Ray-Wenderlich.${PRODUCT_NAME:rfc1034identifier} 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.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Storyboard 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /UDo/UDo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /UDo/UIAlertView+RWBlock.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+RWBlock.h 3 | // UDo 4 | // 5 | // Created by Soheil Azarpour on 1/7/14. 6 | // Copyright (c) 2014 Soheil Azarpour. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | typedef void (^RWAlertViewCompletionBlock)(UIAlertView *alertView, NSInteger buttonIndex); 12 | 13 | @interface UIAlertView (RWBlock) 14 | 15 | - (void)setCompletionBlock:(RWAlertViewCompletionBlock)completionBlock; 16 | - (RWAlertViewCompletionBlock)completionBlock; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /UDo/UIAlertView+RWBlock.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+RWBlock.m 3 | // UDo 4 | // 5 | // Created by Soheil Azarpour on 1/7/14. 6 | // Copyright (c) 2014 Soheil Azarpour. All rights reserved. 7 | // 8 | 9 | #import "UIAlertView+RWBlock.h" 10 | #import 11 | 12 | @implementation UIAlertView (RWBlock) 13 | 14 | - (void)setCompletionBlock:(RWAlertViewCompletionBlock)completionBlock { 15 | objc_setAssociatedObject(self, @selector(completionBlock), completionBlock, OBJC_ASSOCIATION_COPY_NONATOMIC); 16 | if (completionBlock == NULL) { 17 | self.delegate = nil; 18 | } 19 | else { 20 | self.delegate = self; 21 | } 22 | } 23 | 24 | - (RWAlertViewCompletionBlock)completionBlock { 25 | return objc_getAssociatedObject(self, @selector(completionBlock)); 26 | } 27 | 28 | #pragma mark - UIAlertViewDelegate 29 | 30 | - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex { 31 | if (self.completionBlock) { 32 | self.completionBlock(self, buttonIndex); 33 | } 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /UDo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /UDo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UDo 4 | // 5 | // Created by Soheil Azarpour on 1/7/14. 6 | // Copyright (c) 2014 Soheil Azarpour. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "RWAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([RWAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UDoTests/UDoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | Ray-Wenderlich.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /UDoTests/UDoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // UDoTests.m 3 | // UDoTests 4 | // 5 | // Created by Soheil Azarpour on 1/7/14. 6 | // Copyright (c) 2014 Soheil Azarpour. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UDoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation UDoTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /UDoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------