├── .gitignore ├── AMSpringboard.podspec ├── AMSpringboard.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── AMSpringboard.xcscheme │ └── AMSpringboardDemo.xcscheme ├── AMSpringboard.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── WorkspaceSettings.xcsettings ├── AMSpringboard ├── AMSpringboard-Prefix.pch └── Classes │ ├── AMSpringboard.h │ ├── AMSpringboardDataProvider.h │ ├── AMSpringboardDataProvider.m │ ├── AMSpringboardErrors.h │ ├── AMSpringboardItemSpecifier.h │ ├── AMSpringboardItemSpecifier.m │ ├── AMSpringboardView.h │ ├── AMSpringboardView.m │ ├── AMSpringboardViewCell.h │ ├── AMSpringboardViewCell.m │ ├── NSIndexPath+AMSpringboard.h │ ├── NSIndexPath+AMSpringboard.m │ ├── UIImage+AMHighlightedImage.h │ └── UIImage+AMHighlightedImage.m ├── AMSpringboardDemo ├── AMSpringboardDemo-Info.plist ├── AMSpringboardDemo_Prefix.pch ├── Classes │ ├── AMSpringboardDemoAppDelegate.h │ ├── AMSpringboardDemoAppDelegate.m │ ├── DataProviderViewController.h │ ├── DataProviderViewController.m │ ├── DataProviderViewController.xib │ ├── DataSourceViewController.h │ ├── DataSourceViewController.m │ └── DataSourceViewController.xib ├── Resources │ ├── Default-568h@2x.png │ ├── MainWindow.xib │ ├── Springboard.plist │ └── beer-icon.png └── main.m ├── AMSpringboardTests ├── AMSpringboardTests-Info.plist ├── AMSpringboardTests-Prefix.pch ├── AMSpringboardTests.h ├── AMSpringboardTests.m └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── Podfile ├── Podfile.lock └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.pbxuser 3 | *.perspectivev3 4 | *.xcuserstate 5 | *.mergesave 6 | *.bak 7 | .~* 8 | .DS_Store 9 | xcuserdata 10 | Pods 11 | -------------------------------------------------------------------------------- /AMSpringboard.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'AMSpringboard' 3 | s.version = '0.2.1' 4 | s.summary = 'A simple Springboard view, following the Data Source / Delegate pattern.' 5 | s.homepage = 'https://github.com/amrox/AMSpringboard' 6 | s.author = { 'Andy Mroczkowski' => 'andy@mrox.net' } 7 | s.source = { :git => 'https://github.com/amrox/AMSpringboard.git', :tag => "#{s.version}" } 8 | s.license = { :type => 'MIT', :file => 'LICENSE' } 9 | s.platform = :ios, '6.0' 10 | s.source_files = 'AMSpringboard/Classes/**/*.{h,m}' 11 | s.frameworks = 'Foundation', 'UIKit' 12 | s.dependency 'AMFoundation', '~> 0.2.0' 13 | end 14 | -------------------------------------------------------------------------------- /AMSpringboard.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 11 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 12 | 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; 13 | 3E53B01611464695A912685C /* libPods-AMSpringboard.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2765D6E10F2F47649EFAA236 /* libPods-AMSpringboard.a */; }; 14 | B387B93D17CE722900128198 /* AMSpringboard.h in Headers */ = {isa = PBXBuildFile; fileRef = B387B93017CE722900128198 /* AMSpringboard.h */; }; 15 | B387B93E17CE722900128198 /* AMSpringboardDataProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = B387B93117CE722900128198 /* AMSpringboardDataProvider.h */; }; 16 | B387B93F17CE722900128198 /* AMSpringboardDataProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B93217CE722900128198 /* AMSpringboardDataProvider.m */; }; 17 | B387B94017CE722900128198 /* AMSpringboardItemSpecifier.h in Headers */ = {isa = PBXBuildFile; fileRef = B387B93317CE722900128198 /* AMSpringboardItemSpecifier.h */; }; 18 | B387B94117CE722900128198 /* AMSpringboardItemSpecifier.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B93417CE722900128198 /* AMSpringboardItemSpecifier.m */; }; 19 | B387B94217CE722900128198 /* AMSpringboardView.h in Headers */ = {isa = PBXBuildFile; fileRef = B387B93517CE722900128198 /* AMSpringboardView.h */; }; 20 | B387B94317CE722900128198 /* AMSpringboardView.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B93617CE722900128198 /* AMSpringboardView.m */; }; 21 | B387B94417CE722900128198 /* AMSpringboardViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = B387B93717CE722900128198 /* AMSpringboardViewCell.h */; }; 22 | B387B94517CE722900128198 /* AMSpringboardViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B93817CE722900128198 /* AMSpringboardViewCell.m */; }; 23 | B387B94617CE722900128198 /* NSIndexPath+AMSpringboard.h in Headers */ = {isa = PBXBuildFile; fileRef = B387B93917CE722900128198 /* NSIndexPath+AMSpringboard.h */; }; 24 | B387B94717CE722900128198 /* NSIndexPath+AMSpringboard.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B93A17CE722900128198 /* NSIndexPath+AMSpringboard.m */; }; 25 | B387B94817CE722900128198 /* UIImage+AMHighlightedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B387B93B17CE722900128198 /* UIImage+AMHighlightedImage.h */; }; 26 | B387B94917CE722900128198 /* UIImage+AMHighlightedImage.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B93C17CE722900128198 /* UIImage+AMHighlightedImage.m */; }; 27 | B387B95317CE735A00128198 /* AMSpringboardDemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B94C17CE735A00128198 /* AMSpringboardDemoAppDelegate.m */; }; 28 | B387B95417CE735A00128198 /* DataProviderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B94E17CE735A00128198 /* DataProviderViewController.m */; }; 29 | B387B95517CE735A00128198 /* DataProviderViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B387B94F17CE735A00128198 /* DataProviderViewController.xib */; }; 30 | B387B95617CE735A00128198 /* DataSourceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B95117CE735A00128198 /* DataSourceViewController.m */; }; 31 | B387B95717CE735A00128198 /* DataSourceViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B387B95217CE735A00128198 /* DataSourceViewController.xib */; }; 32 | B387B96F17CE73EF00128198 /* beer-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B387B96C17CE73EF00128198 /* beer-icon.png */; }; 33 | B387B97017CE73EF00128198 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = B387B96D17CE73EF00128198 /* MainWindow.xib */; }; 34 | B387B97117CE73EF00128198 /* Springboard.plist in Resources */ = {isa = PBXBuildFile; fileRef = B387B96E17CE73EF00128198 /* Springboard.plist */; }; 35 | B387B97417CE741100128198 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B387B97317CE741100128198 /* main.m */; }; 36 | B387B97817CE748800128198 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B387B97717CE748800128198 /* Default-568h@2x.png */; }; 37 | B3A2EC1D1343A3E000836F69 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 38 | B3A2EC3A1343AEE400836F69 /* libAMSpringboard.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B3A2EC1C1343A3E000836F69 /* libAMSpringboard.a */; }; 39 | B3C12DAF13392332008F8C17 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3C12DAE13392332008F8C17 /* QuartzCore.framework */; }; 40 | /* End PBXBuildFile section */ 41 | 42 | /* Begin PBXContainerItemProxy section */ 43 | B3A2EC371343AEB400836F69 /* PBXContainerItemProxy */ = { 44 | isa = PBXContainerItemProxy; 45 | containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; 46 | proxyType = 1; 47 | remoteGlobalIDString = B3A2EC1B1343A3E000836F69; 48 | remoteInfo = AMSpringboard; 49 | }; 50 | /* End PBXContainerItemProxy section */ 51 | 52 | /* Begin PBXFileReference section */ 53 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 54 | 1D6058910D05DD3D006BFB54 /* AMSpringboardDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AMSpringboardDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 56 | 2765D6E10F2F47649EFAA236 /* libPods-AMSpringboard.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AMSpringboard.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 58 | 9329431D7AD34D8E90CB90C2 /* Pods-AMSpringboard.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AMSpringboard.xcconfig"; path = "Pods/Pods-AMSpringboard.xcconfig"; sourceTree = ""; }; 59 | B387B93017CE722900128198 /* AMSpringboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AMSpringboard.h; path = AMSpringboard/Classes/AMSpringboard.h; sourceTree = SOURCE_ROOT; }; 60 | B387B93117CE722900128198 /* AMSpringboardDataProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AMSpringboardDataProvider.h; path = AMSpringboard/Classes/AMSpringboardDataProvider.h; sourceTree = SOURCE_ROOT; }; 61 | B387B93217CE722900128198 /* AMSpringboardDataProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AMSpringboardDataProvider.m; path = AMSpringboard/Classes/AMSpringboardDataProvider.m; sourceTree = SOURCE_ROOT; }; 62 | B387B93317CE722900128198 /* AMSpringboardItemSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AMSpringboardItemSpecifier.h; path = AMSpringboard/Classes/AMSpringboardItemSpecifier.h; sourceTree = SOURCE_ROOT; }; 63 | B387B93417CE722900128198 /* AMSpringboardItemSpecifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AMSpringboardItemSpecifier.m; path = AMSpringboard/Classes/AMSpringboardItemSpecifier.m; sourceTree = SOURCE_ROOT; }; 64 | B387B93517CE722900128198 /* AMSpringboardView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AMSpringboardView.h; path = AMSpringboard/Classes/AMSpringboardView.h; sourceTree = SOURCE_ROOT; }; 65 | B387B93617CE722900128198 /* AMSpringboardView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AMSpringboardView.m; path = AMSpringboard/Classes/AMSpringboardView.m; sourceTree = SOURCE_ROOT; }; 66 | B387B93717CE722900128198 /* AMSpringboardViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AMSpringboardViewCell.h; path = AMSpringboard/Classes/AMSpringboardViewCell.h; sourceTree = SOURCE_ROOT; }; 67 | B387B93817CE722900128198 /* AMSpringboardViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AMSpringboardViewCell.m; path = AMSpringboard/Classes/AMSpringboardViewCell.m; sourceTree = SOURCE_ROOT; }; 68 | B387B93917CE722900128198 /* NSIndexPath+AMSpringboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSIndexPath+AMSpringboard.h"; path = "AMSpringboard/Classes/NSIndexPath+AMSpringboard.h"; sourceTree = SOURCE_ROOT; }; 69 | B387B93A17CE722900128198 /* NSIndexPath+AMSpringboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSIndexPath+AMSpringboard.m"; path = "AMSpringboard/Classes/NSIndexPath+AMSpringboard.m"; sourceTree = SOURCE_ROOT; }; 70 | B387B93B17CE722900128198 /* UIImage+AMHighlightedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+AMHighlightedImage.h"; path = "AMSpringboard/Classes/UIImage+AMHighlightedImage.h"; sourceTree = SOURCE_ROOT; }; 71 | B387B93C17CE722900128198 /* UIImage+AMHighlightedImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+AMHighlightedImage.m"; path = "AMSpringboard/Classes/UIImage+AMHighlightedImage.m"; sourceTree = SOURCE_ROOT; }; 72 | B387B94B17CE735A00128198 /* AMSpringboardDemoAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AMSpringboardDemoAppDelegate.h; path = AMSpringboardDemo/Classes/AMSpringboardDemoAppDelegate.h; sourceTree = SOURCE_ROOT; }; 73 | B387B94C17CE735A00128198 /* AMSpringboardDemoAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AMSpringboardDemoAppDelegate.m; path = AMSpringboardDemo/Classes/AMSpringboardDemoAppDelegate.m; sourceTree = SOURCE_ROOT; }; 74 | B387B94D17CE735A00128198 /* DataProviderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataProviderViewController.h; path = AMSpringboardDemo/Classes/DataProviderViewController.h; sourceTree = SOURCE_ROOT; }; 75 | B387B94E17CE735A00128198 /* DataProviderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DataProviderViewController.m; path = AMSpringboardDemo/Classes/DataProviderViewController.m; sourceTree = SOURCE_ROOT; }; 76 | B387B94F17CE735A00128198 /* DataProviderViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = DataProviderViewController.xib; path = AMSpringboardDemo/Classes/DataProviderViewController.xib; sourceTree = SOURCE_ROOT; }; 77 | B387B95017CE735A00128198 /* DataSourceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataSourceViewController.h; path = AMSpringboardDemo/Classes/DataSourceViewController.h; sourceTree = SOURCE_ROOT; }; 78 | B387B95117CE735A00128198 /* DataSourceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DataSourceViewController.m; path = AMSpringboardDemo/Classes/DataSourceViewController.m; sourceTree = SOURCE_ROOT; }; 79 | B387B95217CE735A00128198 /* DataSourceViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = DataSourceViewController.xib; path = AMSpringboardDemo/Classes/DataSourceViewController.xib; sourceTree = SOURCE_ROOT; }; 80 | B387B95D17CE73A400128198 /* AMSpringboardDemo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AMSpringboardDemo_Prefix.pch; path = AMSpringboardDemo/AMSpringboardDemo_Prefix.pch; sourceTree = SOURCE_ROOT; }; 81 | B387B95E17CE73A400128198 /* AMSpringboardDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "AMSpringboardDemo-Info.plist"; path = "AMSpringboardDemo/AMSpringboardDemo-Info.plist"; sourceTree = SOURCE_ROOT; }; 82 | B387B96C17CE73EF00128198 /* beer-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "beer-icon.png"; path = "AMSpringboardDemo/Resources/beer-icon.png"; sourceTree = SOURCE_ROOT; }; 83 | B387B96D17CE73EF00128198 /* MainWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MainWindow.xib; path = AMSpringboardDemo/Resources/MainWindow.xib; sourceTree = SOURCE_ROOT; }; 84 | B387B96E17CE73EF00128198 /* Springboard.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Springboard.plist; path = AMSpringboardDemo/Resources/Springboard.plist; sourceTree = SOURCE_ROOT; }; 85 | B387B97317CE741100128198 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = AMSpringboardDemo/main.m; sourceTree = SOURCE_ROOT; }; 86 | B387B97717CE748800128198 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "AMSpringboardDemo/Resources/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; 87 | B3A2EC1C1343A3E000836F69 /* libAMSpringboard.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAMSpringboard.a; sourceTree = BUILT_PRODUCTS_DIR; }; 88 | B3A2EC201343A3E000836F69 /* AMSpringboard-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "AMSpringboard-Prefix.pch"; path = "AMSpringboard/AMSpringboard-Prefix.pch"; sourceTree = ""; }; 89 | B3C12DAE13392332008F8C17 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 90 | B3FF333217CEEBCF00513212 /* AMSpringboardErrors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AMSpringboardErrors.h; path = AMSpringboard/Classes/AMSpringboardErrors.h; sourceTree = SOURCE_ROOT; }; 91 | C0C679CE371E4C0680426AF8 /* libPods-AMSpringboard-Demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AMSpringboard-Demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 92 | FFB4561C32E04024815C1503 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 93 | /* End PBXFileReference section */ 94 | 95 | /* Begin PBXFrameworksBuildPhase section */ 96 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 97 | isa = PBXFrameworksBuildPhase; 98 | buildActionMask = 2147483647; 99 | files = ( 100 | B3A2EC3A1343AEE400836F69 /* libAMSpringboard.a in Frameworks */, 101 | B3C12DAF13392332008F8C17 /* QuartzCore.framework in Frameworks */, 102 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 103 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 104 | 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */, 105 | 3E53B01611464695A912685C /* libPods-AMSpringboard.a in Frameworks */, 106 | ); 107 | runOnlyForDeploymentPostprocessing = 0; 108 | }; 109 | B3A2EC191343A3E000836F69 /* Frameworks */ = { 110 | isa = PBXFrameworksBuildPhase; 111 | buildActionMask = 2147483647; 112 | files = ( 113 | B3A2EC1D1343A3E000836F69 /* Foundation.framework in Frameworks */, 114 | ); 115 | runOnlyForDeploymentPostprocessing = 0; 116 | }; 117 | /* End PBXFrameworksBuildPhase section */ 118 | 119 | /* Begin PBXGroup section */ 120 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 1D6058910D05DD3D006BFB54 /* AMSpringboardDemo.app */, 124 | ); 125 | name = Products; 126 | sourceTree = ""; 127 | }; 128 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | B337CD82130FB01000423A68 /* AMSpringboard */, 132 | B387B94A17CE72A700128198 /* AMSpringboardDemo */, 133 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 134 | 19C28FACFE9D520D11CA2CBB /* Products */, 135 | 9329431D7AD34D8E90CB90C2 /* Pods-AMSpringboard.xcconfig */, 136 | ); 137 | name = CustomTemplate; 138 | sourceTree = ""; 139 | }; 140 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | B387B97717CE748800128198 /* Default-568h@2x.png */, 144 | B387B96C17CE73EF00128198 /* beer-icon.png */, 145 | B387B96D17CE73EF00128198 /* MainWindow.xib */, 146 | B387B96E17CE73EF00128198 /* Springboard.plist */, 147 | ); 148 | name = Resources; 149 | path = AMSpringboardDemo/Resources; 150 | sourceTree = ""; 151 | }; 152 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | B3A2EC1C1343A3E000836F69 /* libAMSpringboard.a */, 156 | B3C12DAE13392332008F8C17 /* QuartzCore.framework */, 157 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 158 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 159 | 288765FC0DF74451002DB57D /* CoreGraphics.framework */, 160 | FFB4561C32E04024815C1503 /* libPods.a */, 161 | 2765D6E10F2F47649EFAA236 /* libPods-AMSpringboard.a */, 162 | C0C679CE371E4C0680426AF8 /* libPods-AMSpringboard-Demo.a */, 163 | ); 164 | name = Frameworks; 165 | sourceTree = ""; 166 | }; 167 | B337CD82130FB01000423A68 /* AMSpringboard */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | B387B93017CE722900128198 /* AMSpringboard.h */, 171 | B3FF333217CEEBCF00513212 /* AMSpringboardErrors.h */, 172 | B387B93517CE722900128198 /* AMSpringboardView.h */, 173 | B387B93617CE722900128198 /* AMSpringboardView.m */, 174 | B387B93717CE722900128198 /* AMSpringboardViewCell.h */, 175 | B387B93817CE722900128198 /* AMSpringboardViewCell.m */, 176 | B387B93917CE722900128198 /* NSIndexPath+AMSpringboard.h */, 177 | B387B93A17CE722900128198 /* NSIndexPath+AMSpringboard.m */, 178 | B387B93B17CE722900128198 /* UIImage+AMHighlightedImage.h */, 179 | B387B93C17CE722900128198 /* UIImage+AMHighlightedImage.m */, 180 | B3E83DB9133F159500397B4D /* AMSpringboardDataProvider */, 181 | B3A2EC1F1343A3E000836F69 /* Supporting Files */, 182 | ); 183 | name = AMSpringboard; 184 | path = Classes/AMSpringboardView; 185 | sourceTree = ""; 186 | }; 187 | B387B94A17CE72A700128198 /* AMSpringboardDemo */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | B387B94B17CE735A00128198 /* AMSpringboardDemoAppDelegate.h */, 191 | B387B94C17CE735A00128198 /* AMSpringboardDemoAppDelegate.m */, 192 | B387B94D17CE735A00128198 /* DataProviderViewController.h */, 193 | B387B94E17CE735A00128198 /* DataProviderViewController.m */, 194 | B387B94F17CE735A00128198 /* DataProviderViewController.xib */, 195 | B387B95017CE735A00128198 /* DataSourceViewController.h */, 196 | B387B95117CE735A00128198 /* DataSourceViewController.m */, 197 | B387B95217CE735A00128198 /* DataSourceViewController.xib */, 198 | B387B97217CE740100128198 /* Other Sources */, 199 | B387B95C17CE739000128198 /* Supporting Files */, 200 | 29B97317FDCFA39411CA2CEA /* Resources */, 201 | ); 202 | name = AMSpringboardDemo; 203 | path = Classes/AMSpringboardView; 204 | sourceTree = ""; 205 | }; 206 | B387B95C17CE739000128198 /* Supporting Files */ = { 207 | isa = PBXGroup; 208 | children = ( 209 | B387B95D17CE73A400128198 /* AMSpringboardDemo_Prefix.pch */, 210 | B387B95E17CE73A400128198 /* AMSpringboardDemo-Info.plist */, 211 | ); 212 | name = "Supporting Files"; 213 | sourceTree = ""; 214 | }; 215 | B387B97217CE740100128198 /* Other Sources */ = { 216 | isa = PBXGroup; 217 | children = ( 218 | B387B97317CE741100128198 /* main.m */, 219 | ); 220 | name = "Other Sources"; 221 | sourceTree = ""; 222 | }; 223 | B3A2EC1F1343A3E000836F69 /* Supporting Files */ = { 224 | isa = PBXGroup; 225 | children = ( 226 | B3A2EC201343A3E000836F69 /* AMSpringboard-Prefix.pch */, 227 | ); 228 | name = "Supporting Files"; 229 | path = ../../AMSpringboard; 230 | sourceTree = ""; 231 | }; 232 | B3E83DB9133F159500397B4D /* AMSpringboardDataProvider */ = { 233 | isa = PBXGroup; 234 | children = ( 235 | B387B93117CE722900128198 /* AMSpringboardDataProvider.h */, 236 | B387B93217CE722900128198 /* AMSpringboardDataProvider.m */, 237 | B387B93317CE722900128198 /* AMSpringboardItemSpecifier.h */, 238 | B387B93417CE722900128198 /* AMSpringboardItemSpecifier.m */, 239 | ); 240 | name = AMSpringboardDataProvider; 241 | sourceTree = ""; 242 | }; 243 | /* End PBXGroup section */ 244 | 245 | /* Begin PBXHeadersBuildPhase section */ 246 | B3A2EC1A1343A3E000836F69 /* Headers */ = { 247 | isa = PBXHeadersBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | B387B93D17CE722900128198 /* AMSpringboard.h in Headers */, 251 | B387B93E17CE722900128198 /* AMSpringboardDataProvider.h in Headers */, 252 | B387B94017CE722900128198 /* AMSpringboardItemSpecifier.h in Headers */, 253 | B387B94217CE722900128198 /* AMSpringboardView.h in Headers */, 254 | B387B94417CE722900128198 /* AMSpringboardViewCell.h in Headers */, 255 | B387B94617CE722900128198 /* NSIndexPath+AMSpringboard.h in Headers */, 256 | B387B94817CE722900128198 /* UIImage+AMHighlightedImage.h in Headers */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | /* End PBXHeadersBuildPhase section */ 261 | 262 | /* Begin PBXNativeTarget section */ 263 | 1D6058900D05DD3D006BFB54 /* AMSpringboardDemo */ = { 264 | isa = PBXNativeTarget; 265 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AMSpringboardDemo" */; 266 | buildPhases = ( 267 | 4D046C6DEC174B93A149F29D /* Check Pods Manifest.lock */, 268 | 1D60588D0D05DD3D006BFB54 /* Resources */, 269 | 1D60588E0D05DD3D006BFB54 /* Sources */, 270 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 271 | 731C09ECA46C47B1A2BAEE43 /* Copy Pods Resources */, 272 | ); 273 | buildRules = ( 274 | ); 275 | dependencies = ( 276 | B3A2EC381343AEB400836F69 /* PBXTargetDependency */, 277 | ); 278 | name = AMSpringboardDemo; 279 | productName = AMSpringboardView; 280 | productReference = 1D6058910D05DD3D006BFB54 /* AMSpringboardDemo.app */; 281 | productType = "com.apple.product-type.application"; 282 | }; 283 | B3A2EC1B1343A3E000836F69 /* AMSpringboard */ = { 284 | isa = PBXNativeTarget; 285 | buildConfigurationList = B3A2EC211343A3E000836F69 /* Build configuration list for PBXNativeTarget "AMSpringboard" */; 286 | buildPhases = ( 287 | E79B4ED1DB6141CE93ACB586 /* Check Pods Manifest.lock */, 288 | B3A2EC181343A3E000836F69 /* Sources */, 289 | B3A2EC191343A3E000836F69 /* Frameworks */, 290 | B3A2EC1A1343A3E000836F69 /* Headers */, 291 | 08612D015C1840F2AC83B6EF /* Copy Pods Resources */, 292 | ); 293 | buildRules = ( 294 | ); 295 | dependencies = ( 296 | ); 297 | name = AMSpringboard; 298 | productName = AMSpringboard; 299 | productReference = B3A2EC1C1343A3E000836F69 /* libAMSpringboard.a */; 300 | productType = "com.apple.product-type.library.static"; 301 | }; 302 | /* End PBXNativeTarget section */ 303 | 304 | /* Begin PBXProject section */ 305 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 306 | isa = PBXProject; 307 | attributes = { 308 | LastUpgradeCheck = 0460; 309 | }; 310 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AMSpringboard" */; 311 | compatibilityVersion = "Xcode 3.2"; 312 | developmentRegion = English; 313 | hasScannedForEncodings = 1; 314 | knownRegions = ( 315 | English, 316 | Japanese, 317 | French, 318 | German, 319 | ); 320 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 321 | projectDirPath = ""; 322 | projectRoot = ""; 323 | targets = ( 324 | B3A2EC1B1343A3E000836F69 /* AMSpringboard */, 325 | 1D6058900D05DD3D006BFB54 /* AMSpringboardDemo */, 326 | ); 327 | }; 328 | /* End PBXProject section */ 329 | 330 | /* Begin PBXResourcesBuildPhase section */ 331 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 332 | isa = PBXResourcesBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | B387B95517CE735A00128198 /* DataProviderViewController.xib in Resources */, 336 | B387B95717CE735A00128198 /* DataSourceViewController.xib in Resources */, 337 | B387B96F17CE73EF00128198 /* beer-icon.png in Resources */, 338 | B387B97017CE73EF00128198 /* MainWindow.xib in Resources */, 339 | B387B97117CE73EF00128198 /* Springboard.plist in Resources */, 340 | B387B97817CE748800128198 /* Default-568h@2x.png in Resources */, 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | }; 344 | /* End PBXResourcesBuildPhase section */ 345 | 346 | /* Begin PBXShellScriptBuildPhase section */ 347 | 08612D015C1840F2AC83B6EF /* Copy Pods Resources */ = { 348 | isa = PBXShellScriptBuildPhase; 349 | buildActionMask = 2147483647; 350 | files = ( 351 | ); 352 | inputPaths = ( 353 | ); 354 | name = "Copy Pods Resources"; 355 | outputPaths = ( 356 | ); 357 | runOnlyForDeploymentPostprocessing = 0; 358 | shellPath = /bin/sh; 359 | shellScript = "\"${SRCROOT}/Pods/Pods-AMSpringboard-resources.sh\"\n"; 360 | showEnvVarsInLog = 0; 361 | }; 362 | 4D046C6DEC174B93A149F29D /* Check Pods Manifest.lock */ = { 363 | isa = PBXShellScriptBuildPhase; 364 | buildActionMask = 2147483647; 365 | files = ( 366 | ); 367 | inputPaths = ( 368 | ); 369 | name = "Check Pods Manifest.lock"; 370 | outputPaths = ( 371 | ); 372 | runOnlyForDeploymentPostprocessing = 0; 373 | shellPath = /bin/sh; 374 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 375 | showEnvVarsInLog = 0; 376 | }; 377 | 731C09ECA46C47B1A2BAEE43 /* Copy Pods Resources */ = { 378 | isa = PBXShellScriptBuildPhase; 379 | buildActionMask = 2147483647; 380 | files = ( 381 | ); 382 | inputPaths = ( 383 | ); 384 | name = "Copy Pods Resources"; 385 | outputPaths = ( 386 | ); 387 | runOnlyForDeploymentPostprocessing = 0; 388 | shellPath = /bin/sh; 389 | shellScript = "\"${SRCROOT}/Pods/Pods-AMSpringboard-Demo-resources.sh\"\n"; 390 | showEnvVarsInLog = 0; 391 | }; 392 | E79B4ED1DB6141CE93ACB586 /* Check Pods Manifest.lock */ = { 393 | isa = PBXShellScriptBuildPhase; 394 | buildActionMask = 2147483647; 395 | files = ( 396 | ); 397 | inputPaths = ( 398 | ); 399 | name = "Check Pods Manifest.lock"; 400 | outputPaths = ( 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | shellPath = /bin/sh; 404 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 405 | showEnvVarsInLog = 0; 406 | }; 407 | /* End PBXShellScriptBuildPhase section */ 408 | 409 | /* Begin PBXSourcesBuildPhase section */ 410 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 411 | isa = PBXSourcesBuildPhase; 412 | buildActionMask = 2147483647; 413 | files = ( 414 | B387B95317CE735A00128198 /* AMSpringboardDemoAppDelegate.m in Sources */, 415 | B387B95417CE735A00128198 /* DataProviderViewController.m in Sources */, 416 | B387B95617CE735A00128198 /* DataSourceViewController.m in Sources */, 417 | B387B97417CE741100128198 /* main.m in Sources */, 418 | ); 419 | runOnlyForDeploymentPostprocessing = 0; 420 | }; 421 | B3A2EC181343A3E000836F69 /* Sources */ = { 422 | isa = PBXSourcesBuildPhase; 423 | buildActionMask = 2147483647; 424 | files = ( 425 | B387B93F17CE722900128198 /* AMSpringboardDataProvider.m in Sources */, 426 | B387B94117CE722900128198 /* AMSpringboardItemSpecifier.m in Sources */, 427 | B387B94317CE722900128198 /* AMSpringboardView.m in Sources */, 428 | B387B94517CE722900128198 /* AMSpringboardViewCell.m in Sources */, 429 | B387B94717CE722900128198 /* NSIndexPath+AMSpringboard.m in Sources */, 430 | B387B94917CE722900128198 /* UIImage+AMHighlightedImage.m in Sources */, 431 | ); 432 | runOnlyForDeploymentPostprocessing = 0; 433 | }; 434 | /* End PBXSourcesBuildPhase section */ 435 | 436 | /* Begin PBXTargetDependency section */ 437 | B3A2EC381343AEB400836F69 /* PBXTargetDependency */ = { 438 | isa = PBXTargetDependency; 439 | target = B3A2EC1B1343A3E000836F69 /* AMSpringboard */; 440 | targetProxy = B3A2EC371343AEB400836F69 /* PBXContainerItemProxy */; 441 | }; 442 | /* End PBXTargetDependency section */ 443 | 444 | /* Begin XCBuildConfiguration section */ 445 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 446 | isa = XCBuildConfiguration; 447 | baseConfigurationReference = 9329431D7AD34D8E90CB90C2 /* Pods-AMSpringboard.xcconfig */; 448 | buildSettings = { 449 | ALWAYS_SEARCH_USER_PATHS = NO; 450 | COPY_PHASE_STRIP = NO; 451 | GCC_DYNAMIC_NO_PIC = NO; 452 | GCC_OPTIMIZATION_LEVEL = 0; 453 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 454 | GCC_PREFIX_HEADER = AMSpringboardDemo/AMSpringboardDemo_Prefix.pch; 455 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 456 | INFOPLIST_FILE = "AMSpringboardDemo/AMSpringboardDemo-Info.plist"; 457 | OTHER_LDFLAGS = "-all_load"; 458 | PRODUCT_NAME = AMSpringboardDemo; 459 | }; 460 | name = Debug; 461 | }; 462 | 1D6058950D05DD3E006BFB54 /* Release */ = { 463 | isa = XCBuildConfiguration; 464 | baseConfigurationReference = 9329431D7AD34D8E90CB90C2 /* Pods-AMSpringboard.xcconfig */; 465 | buildSettings = { 466 | ALWAYS_SEARCH_USER_PATHS = NO; 467 | COPY_PHASE_STRIP = YES; 468 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 469 | GCC_PREFIX_HEADER = AMSpringboardDemo/AMSpringboardDemo_Prefix.pch; 470 | INFOPLIST_FILE = "AMSpringboardDemo/AMSpringboardDemo-Info.plist"; 471 | OTHER_LDFLAGS = "-all_load"; 472 | PRODUCT_NAME = AMSpringboardDemo; 473 | VALIDATE_PRODUCT = YES; 474 | }; 475 | name = Release; 476 | }; 477 | B3A2EC221343A3E000836F69 /* Debug */ = { 478 | isa = XCBuildConfiguration; 479 | baseConfigurationReference = 9329431D7AD34D8E90CB90C2 /* Pods-AMSpringboard.xcconfig */; 480 | buildSettings = { 481 | ALWAYS_SEARCH_USER_PATHS = NO; 482 | DSTROOT = /tmp/AMSpringboard.dst; 483 | GCC_C_LANGUAGE_STANDARD = gnu99; 484 | GCC_OPTIMIZATION_LEVEL = 0; 485 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 486 | GCC_PREFIX_HEADER = "AMSpringboard/AMSpringboard-Prefix.pch"; 487 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 488 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 489 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 490 | OTHER_LDFLAGS = "-ObjC"; 491 | PRODUCT_NAME = "$(TARGET_NAME)"; 492 | }; 493 | name = Debug; 494 | }; 495 | B3A2EC231343A3E000836F69 /* Release */ = { 496 | isa = XCBuildConfiguration; 497 | baseConfigurationReference = 9329431D7AD34D8E90CB90C2 /* Pods-AMSpringboard.xcconfig */; 498 | buildSettings = { 499 | ALWAYS_SEARCH_USER_PATHS = NO; 500 | DSTROOT = /tmp/AMSpringboard.dst; 501 | GCC_C_LANGUAGE_STANDARD = gnu99; 502 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 503 | GCC_PREFIX_HEADER = "AMSpringboard/AMSpringboard-Prefix.pch"; 504 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 505 | OTHER_LDFLAGS = "-ObjC"; 506 | PRODUCT_NAME = "$(TARGET_NAME)"; 507 | }; 508 | name = Release; 509 | }; 510 | C01FCF4F08A954540054247B /* Debug */ = { 511 | isa = XCBuildConfiguration; 512 | buildSettings = { 513 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 514 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 515 | GCC_C_LANGUAGE_STANDARD = c99; 516 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 517 | GCC_WARN_UNUSED_VARIABLE = YES; 518 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 519 | SDKROOT = iphoneos; 520 | }; 521 | name = Debug; 522 | }; 523 | C01FCF5008A954540054247B /* Release */ = { 524 | isa = XCBuildConfiguration; 525 | buildSettings = { 526 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 527 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 528 | GCC_C_LANGUAGE_STANDARD = c99; 529 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 530 | GCC_WARN_UNUSED_VARIABLE = YES; 531 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 532 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 533 | SDKROOT = iphoneos; 534 | }; 535 | name = Release; 536 | }; 537 | /* End XCBuildConfiguration section */ 538 | 539 | /* Begin XCConfigurationList section */ 540 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AMSpringboardDemo" */ = { 541 | isa = XCConfigurationList; 542 | buildConfigurations = ( 543 | 1D6058940D05DD3E006BFB54 /* Debug */, 544 | 1D6058950D05DD3E006BFB54 /* Release */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | B3A2EC211343A3E000836F69 /* Build configuration list for PBXNativeTarget "AMSpringboard" */ = { 550 | isa = XCConfigurationList; 551 | buildConfigurations = ( 552 | B3A2EC221343A3E000836F69 /* Debug */, 553 | B3A2EC231343A3E000836F69 /* Release */, 554 | ); 555 | defaultConfigurationIsVisible = 0; 556 | defaultConfigurationName = Release; 557 | }; 558 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AMSpringboard" */ = { 559 | isa = XCConfigurationList; 560 | buildConfigurations = ( 561 | C01FCF4F08A954540054247B /* Debug */, 562 | C01FCF5008A954540054247B /* Release */, 563 | ); 564 | defaultConfigurationIsVisible = 0; 565 | defaultConfigurationName = Release; 566 | }; 567 | /* End XCConfigurationList section */ 568 | }; 569 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 570 | } 571 | -------------------------------------------------------------------------------- /AMSpringboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AMSpringboard.xcodeproj/xcshareddata/xcschemes/AMSpringboard.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 44 | 45 | 46 | 47 | 55 | 56 | 58 | 59 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /AMSpringboard.xcodeproj/xcshareddata/xcschemes/AMSpringboardDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 44 | 45 | 51 | 52 | 53 | 54 | 55 | 56 | 64 | 65 | 71 | 72 | 73 | 74 | 76 | 77 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /AMSpringboard.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AMSpringboard.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AMSpringboard/AMSpringboard-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'AMSpringboard' target in the 'AMSpringboard' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboard.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/29/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #ifndef AMSpringboard_h 10 | #define AMSpringboard_h 11 | 12 | #import "AMSpringboardView.h" 13 | #import "AMSpringboardViewCell.h" 14 | #import "NSIndexPath+AMSpringboard.h" 15 | #import "AMSpringboardItemSpecifier.h" 16 | #import "AMSpringboardErrors.h" 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardDataProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardController.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/25/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "AMSpringboardView.h" 10 | 11 | @class AMSpringboardViewCell; 12 | @class AMSpringboardItemSpecifier; 13 | 14 | @interface AMSpringboardDataProvider : NSObject 15 | 16 | + (id) dataProvider; 17 | + (id) dataProviderFromDictionary:(NSDictionary *)dict error:(NSError **)outError; 18 | + (id) dataProviderFromPlistWithPath:(NSString *)path error:(NSError **)outError; 19 | 20 | @property (nonatomic, retain) NSMutableArray *pages; // A mutable array of mutable arrays. Must call [springboardView reloadData] after changes. 21 | @property (nonatomic, assign) NSUInteger columnCount; // Must call [springboardView reloadData] after changes. 22 | @property (nonatomic, assign) NSUInteger rowCount; // Must call [springboardView reloadData] after changes. 23 | 24 | - (AMSpringboardItemSpecifier *)itemSpecifierForPosition:(NSIndexPath*)position; 25 | 26 | @end 27 | 28 | 29 | 30 | @interface AMSpringboardDataProvider (Subclass) 31 | 32 | - (AMSpringboardViewCell*) makeCellWithIdentifier:(NSString*)identifier; 33 | - (void) configureCell:(AMSpringboardViewCell*)cell withItemSpecifier:(AMSpringboardItemSpecifier*)itemSpecifier; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardDataProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardController.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/25/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "AMSpringboardDataProvider.h" 10 | 11 | #import "AMSpringboardViewCell.h" 12 | #import "AMSpringboardItemSpecifier.h" 13 | #import "NSIndexPath+AMSpringboard.h" 14 | #import "AMSpringboardErrors.h" 15 | 16 | @implementation AMSpringboardDataProvider 17 | 18 | + (id) dataProvider 19 | { 20 | return [[[self alloc] init] autorelease]; 21 | } 22 | 23 | 24 | + (id) dataProviderFromDictionary_v1:(NSDictionary*)dict error:(NSError**)outError 25 | { 26 | AMSpringboardDataProvider* dataProvider = [self dataProvider]; 27 | 28 | dataProvider.columnCount = [[dict objectForKey:@"columnCount"] unsignedIntegerValue]; 29 | dataProvider.rowCount = [[dict objectForKey:@"rowCount"] unsignedIntegerValue]; 30 | 31 | NSArray* rawPages = [dict objectForKey:@"pages"]; 32 | 33 | NSMutableArray* pages = [[[NSMutableArray alloc] initWithCapacity:[rawPages count]] autorelease]; 34 | 35 | for( NSUInteger i=0; i<[rawPages count]; i++ ) 36 | { 37 | NSArray* rawPage = [rawPages objectAtIndex:i]; 38 | NSMutableArray* page = [NSMutableArray arrayWithCapacity:[rawPage count]]; 39 | [pages addObject:page]; 40 | 41 | for( NSUInteger j=0; j<[rawPage count]; j++ ) 42 | { 43 | NSDictionary* pageDict = [rawPage objectAtIndex:j]; 44 | if( [[pageDict objectForKey:kAMSpringboardBoardItemIdentifier] isEqualToString:kAMSpringboardBoardItemIdentifierNull] ) 45 | { 46 | [page addObject:[AMSpringboardNullItem nullItem]]; 47 | } 48 | else 49 | { 50 | AMSpringboardItemSpecifier* item = [[AMSpringboardItemSpecifier alloc] initWithDictionary:pageDict]; 51 | [page addObject:item]; 52 | [item release]; 53 | } 54 | } 55 | } 56 | 57 | dataProvider.pages = pages; 58 | 59 | return dataProvider; 60 | } 61 | 62 | 63 | + (id) dataProviderFromDictionary:(NSDictionary*)dict error:(NSError**)outError 64 | { 65 | NSString* version = [dict objectForKey:@"version"]; 66 | if( [version isEqualToString:@"1"] ) 67 | { 68 | return [self dataProviderFromDictionary_v1:dict error:outError]; 69 | } 70 | 71 | if( outError != NULL ) 72 | { 73 | *outError = [NSError errorWithDomain:AMSpringboardErrorDomain 74 | code:AMSpringboardUnkownPlistFormatError 75 | userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 76 | @"Unknown Plist format", NSLocalizedDescriptionKey, 77 | nil]]; 78 | } 79 | 80 | return nil; 81 | } 82 | 83 | 84 | + (id) dataProviderFromPlistWithPath:(NSString*)path error:(NSError**)outError 85 | { 86 | NSData* data = [NSData dataWithContentsOfFile:path options:0 error:outError]; 87 | if( data == nil ) 88 | return nil; 89 | 90 | NSDictionary* plistDict = [NSPropertyListSerialization propertyListWithData:data options:0 format:nil error:outError]; 91 | if( plistDict == nil ) 92 | return nil; 93 | 94 | return [self dataProviderFromDictionary:plistDict error:outError]; 95 | } 96 | 97 | 98 | - (void)dealloc 99 | { 100 | [_pages release]; 101 | [super dealloc]; 102 | } 103 | 104 | 105 | - (AMSpringboardItemSpecifier*) itemSpecifierForPosition:(NSIndexPath*)position 106 | { 107 | NSArray* items = [self.pages objectAtIndex:[position springboardPage]]; 108 | NSUInteger index = [position springboardColumn] + [position springboardRow]*self.columnCount; 109 | 110 | if( index >= [items count] ) 111 | return nil; 112 | 113 | AMSpringboardItemSpecifier* item = [items objectAtIndex:index]; 114 | if( item == [AMSpringboardNullItem nullItem] ) 115 | return nil; 116 | 117 | return item; 118 | } 119 | 120 | #pragma mark AMSpringboardViewDataSource 121 | 122 | - (NSUInteger) numberOfPagesInSpringboardView:(AMSpringboardView*)springboardView 123 | { 124 | return [self.pages count]; 125 | } 126 | 127 | 128 | - (NSUInteger) numberOfRowsInSpringboardView:(AMSpringboardView*)springboardView 129 | { 130 | return self.rowCount; 131 | } 132 | 133 | 134 | - (NSUInteger) numberOfColumnsInSpringboardView:(AMSpringboardView*)springboardView 135 | { 136 | return self.columnCount; 137 | } 138 | 139 | 140 | - (AMSpringboardViewCell*) springboardView:(AMSpringboardView*)springboardView cellForPositionWithIndexPath:(NSIndexPath*)indexPath 141 | { 142 | AMSpringboardViewCell* cell = nil; 143 | 144 | AMSpringboardItemSpecifier* item = [self itemSpecifierForPosition:indexPath]; 145 | if( item != nil ) 146 | { 147 | NSString* identifier = [item objectForKey:kAMSpringboardBoardItemIdentifier]; 148 | cell = [springboardView dequeueReusableCellWithIdentifier:identifier]; 149 | if( cell == nil ) 150 | { 151 | cell = [self makeCellWithIdentifier:identifier]; 152 | } 153 | [self configureCell:cell withItemSpecifier:item]; 154 | } 155 | return cell; 156 | } 157 | 158 | @end 159 | 160 | 161 | @implementation AMSpringboardDataProvider (Subclass) 162 | 163 | - (AMSpringboardViewCell*) makeCellWithIdentifier:(NSString*)identifier 164 | { 165 | AMSpringboardViewCell* cell = [[[AMSpringboardViewCell alloc] initWithStyle:AMSpringboardViewCellStyleDefault reuseIdentifier:identifier] autorelease]; 166 | return cell; 167 | } 168 | 169 | 170 | - (void) configureCell:(AMSpringboardViewCell*)cell withItemSpecifier:(AMSpringboardItemSpecifier*)itemSpecifier 171 | { 172 | cell.image = [UIImage imageNamed:[itemSpecifier objectForKey:kAMSpringboardBoardItemImageName]]; 173 | cell.textLabel.text = [itemSpecifier objectForKey:kAMSpringboardBoardItemTitle]; 174 | } 175 | 176 | @end 177 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardErrors.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardErrors.h 3 | // AMSpringboard 4 | // 5 | // Created by Andy Mroczkowski on 8/28/13. 6 | // 7 | // 8 | 9 | #ifndef AMSpringboard_AMSpringboardErrors_h 10 | #define AMSpringboard_AMSpringboardErrors_h 11 | 12 | #define AMSpringboardErrorDomain @"com.amerzing.AMSpringboard" 13 | 14 | enum AMSpingboardErrorCode { 15 | AMSpringboardUnkownPlistFormatError = 1, 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardItemSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardItemSpecifier.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/1/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString* const kAMSpringboardBoardItemIdentifier; // defaults to name of this class (AMSpringboardItemSpecifier) 12 | extern NSString* const kAMSpringboardBoardItemTitle; 13 | extern NSString* const kAMSpringboardBoardItemImageName; 14 | 15 | extern NSString* const kAMSpringboardBoardItemIdentifierNull; 16 | 17 | 18 | @interface AMSpringboardItemSpecifier : NSObject 19 | { 20 | NSMutableDictionary* _dict; 21 | } 22 | 23 | - (id) initWithDictionary:(NSDictionary*)dict; 24 | - (id) init; 25 | 26 | - (NSDictionary*) dictionaryRepresentation; 27 | - (id) objectForKey:(NSString*)key; 28 | - (void) setObject:(id)object forKey:(NSString*)key; 29 | 30 | @end 31 | 32 | 33 | 34 | 35 | @interface AMSpringboardItemSpecifier (Convenience) 36 | 37 | + (id) itemSpecifierWithTitle:(NSString*)title imageName:(NSString*)imageName; 38 | 39 | @end 40 | 41 | 42 | 43 | 44 | @interface AMSpringboardNullItem : AMSpringboardItemSpecifier 45 | 46 | + (AMSpringboardItemSpecifier*) nullItem; 47 | 48 | @end -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardItemSpecifier.m: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardItemSpecifier.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/1/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "AMSpringboardItemSpecifier.h" 10 | 11 | NSString* const kAMSpringboardBoardItemIdentifier = @"identifier"; 12 | NSString* const kAMSpringboardBoardItemTitle = @"title"; 13 | NSString* const kAMSpringboardBoardItemImageName = @"image"; 14 | NSString* const kAMSpringboardBoardItemIdentifierNull = @"Null"; 15 | 16 | 17 | @interface AMSpringboardItemSpecifier () 18 | @property (nonatomic, retain) NSMutableDictionary* dict; 19 | @end 20 | 21 | @implementation AMSpringboardItemSpecifier 22 | 23 | @synthesize dict = _dict; 24 | 25 | - (id) initWithDictionary:(NSDictionary*)dict 26 | { 27 | self = [super init]; 28 | if (self != nil) 29 | { 30 | _dict = [dict mutableCopy]; 31 | if( [_dict objectForKey:kAMSpringboardBoardItemIdentifier] == nil ) 32 | { 33 | [_dict setObject:NSStringFromClass([self class]) forKey:kAMSpringboardBoardItemIdentifier]; 34 | } 35 | } 36 | return self; 37 | } 38 | 39 | 40 | - (id) init 41 | { 42 | NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; 43 | [dict setObject:NSStringFromClass([self class]) 44 | forKey:kAMSpringboardBoardItemIdentifier]; 45 | id s = [self initWithDictionary:dict]; 46 | [dict release]; 47 | return s; 48 | } 49 | 50 | 51 | - (void) dealloc 52 | { 53 | [_dict release]; 54 | [super dealloc]; 55 | } 56 | 57 | - (NSString *)description 58 | { 59 | return [NSString stringWithFormat:@"<%@ %p> %@", NSStringFromClass(self.class), self, self.dictionaryRepresentation]; 60 | } 61 | 62 | 63 | - (NSDictionary*) dictionaryRepresentation 64 | { 65 | return [[self.dict copy] autorelease];; 66 | } 67 | 68 | 69 | - (id) objectForKey:(NSString*)key 70 | { 71 | return [self.dict objectForKey:key]; 72 | } 73 | 74 | 75 | - (void) setObject:(id)object forKey:(NSString*)key 76 | { 77 | [self.dict setObject:object forKey:key]; 78 | } 79 | 80 | 81 | #pragma mark NSCoding 82 | 83 | - (id) initWithCoder:(NSCoder *)aDecoder 84 | { 85 | self = [super init]; 86 | if (self != nil) 87 | { 88 | _dict = [aDecoder decodeObjectForKey:@"dict"]; 89 | } 90 | return self; 91 | } 92 | 93 | 94 | - (void)encodeWithCoder:(NSCoder *)aCoder; 95 | { 96 | [aCoder encodeObject:self.dict forKey:@"dict"]; 97 | } 98 | 99 | 100 | @end 101 | 102 | 103 | 104 | @implementation AMSpringboardItemSpecifier (Convenience) 105 | 106 | + (id) itemSpecifierWithTitle:(NSString*)title imageName:(NSString*)imageName 107 | { 108 | AMSpringboardItemSpecifier* item = [[AMSpringboardItemSpecifier alloc] init]; 109 | if( title != nil ) 110 | [item setObject:title forKey:kAMSpringboardBoardItemTitle]; 111 | if( imageName != nil ) 112 | [item setObject:imageName forKey:kAMSpringboardBoardItemImageName]; 113 | return [item autorelease]; 114 | } 115 | 116 | @end 117 | 118 | 119 | static AMSpringboardNullItem* __sharedNullItem = nil; 120 | 121 | @implementation AMSpringboardNullItem 122 | 123 | + (AMSpringboardItemSpecifier*) nullItem 124 | { 125 | @synchronized(@"AMSpringboardNullItem_Lock") 126 | { 127 | if( __sharedNullItem == nil ) 128 | { 129 | __sharedNullItem = [[AMSpringboardNullItem alloc] init]; 130 | [__sharedNullItem.dict setObject:kAMSpringboardBoardItemIdentifierNull forKey:kAMSpringboardBoardItemIdentifier]; 131 | } 132 | } 133 | return __sharedNullItem; 134 | } 135 | 136 | 137 | - (void) setObject:(id)object forKey:(NSString*)key; 138 | { 139 | NSAssert(true, @"can't set keys on AMSpringboardNullItem"); 140 | } 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardView.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 2/19/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @class AMSpringboardViewCell; 13 | 14 | @protocol AMSpringboardViewDataSource; 15 | @protocol AMSpringboardViewDelegate; 16 | 17 | #define kAMSpringboarViewCellSelectionDelayNone (0.0f) 18 | #define kAMSpringboarViewCellSelectionDelayDefault (0.1f) 19 | 20 | @interface AMSpringboardView : UIView 21 | 22 | @property (nonatomic, assign) IBOutlet id delegate; 23 | @property (nonatomic, assign) IBOutlet id dataSource; 24 | 25 | - (AMSpringboardViewCell *)dequeueReusableCellWithIdentifier:(NSString*)identifier; 26 | 27 | - (void)reloadData; 28 | - (void)reloadCellAtPosition:(NSIndexPath *)position; 29 | 30 | @property (nonatomic, assign) NSInteger currentPage; 31 | 32 | - (NSArray *)indexPathsForVisibleRows; 33 | - (NSArray *)visibleCells; 34 | - (AMSpringboardViewCell *)cellForPositionWithIndexPath:(NSIndexPath *)indexPath; 35 | - (NSIndexPath *)indexPathForCell:(AMSpringboardViewCell *)cell; /* Returns an index path representing of a given cell. */ 36 | 37 | - (NSIndexPath *)positionForPoint:(CGPoint)point; 38 | 39 | /** 40 | * @default NO 41 | * @discussion if YES, it will notify the delegate after 42 | * a touch down event, as opposed to touch up. 43 | */ 44 | @property (nonatomic, assign) BOOL shouldSelectCellsOnTouchDown; 45 | 46 | @property (nonatomic, assign) NSTimeInterval cellSelectionDelay; 47 | 48 | @end 49 | 50 | 51 | #pragma mark - 52 | @protocol AMSpringboardViewDataSource 53 | 54 | @required 55 | - (NSUInteger)numberOfPagesInSpringboardView:(AMSpringboardView *)springboardView; 56 | - (NSUInteger)numberOfRowsInSpringboardView:(AMSpringboardView *)springboardView; 57 | - (NSUInteger)numberOfColumnsInSpringboardView:(AMSpringboardView *)springboardView; 58 | - (AMSpringboardViewCell *)springboardView:(AMSpringboardView *)springboardView cellForPositionWithIndexPath:(NSIndexPath *)indexPath; 59 | 60 | @end 61 | 62 | 63 | #pragma mark - 64 | @protocol AMSpringboardViewDelegate 65 | 66 | @required 67 | - (void) springboardView:(AMSpringboardView*)springboardView didSelectCellWithPosition:(NSIndexPath*)position; 68 | 69 | @end 70 | 71 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardView.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 2/19/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "AMSpringboardView.h" 10 | 11 | #import 12 | 13 | #import "AMSpringboardViewCell.h" 14 | #import "AMSpringboardItemSpecifier.h" 15 | #import "NSIndexPath+AMSpringboard.h" 16 | 17 | #define kDefaultColumnPadding (1) 18 | #define VALID_SPRINBOARD_CELL(obj) (obj != nil && (id)obj != [NSNull null]) 19 | 20 | @class AMSpringboardContentView; 21 | 22 | @interface AMSpringboardView () 23 | @property (nonatomic, retain) UIScrollView *scrollView; 24 | @property (nonatomic, retain) UIPageControl *pageControl; 25 | @property (nonatomic, retain) AMSpringboardContentView *contentView; 26 | @property (nonatomic, retain) NSMutableDictionary *cells; 27 | @property (nonatomic, retain) NSMutableArray *unusedCells; 28 | @property (nonatomic, assign) NSUInteger columnPadding; 29 | @property (nonatomic, retain) NSIndexPath *selectedPosition; 30 | @property (nonatomic, retain) NSIndexPath *positionBeingSelectedAfterDelay; 31 | - (NSUInteger) pageCount; 32 | - (NSUInteger) rowCount; 33 | - (NSUInteger) columnCount; 34 | - (CGRect) activeRect; 35 | - (NSArray*) positionsIntersectingRect:(CGRect)rect; 36 | - (void) addCellToView:(AMSpringboardViewCell*)cell position:(NSIndexPath*)position; 37 | - (void) setFrameForCell:(AMSpringboardViewCell*)cell position:(NSIndexPath*)position; 38 | @end 39 | 40 | 41 | @interface AMSpringboardContentView : UIView 42 | @property (nonatomic, assign) AMSpringboardView* springboardView; 43 | @end 44 | 45 | 46 | @implementation AMSpringboardView 47 | 48 | - (void) updatePageControlFrame 49 | { 50 | CGRect pageControlFrame = CGRectZero; 51 | pageControlFrame.size = [_pageControl sizeForNumberOfPages:(NSInteger)[self pageCount]]; 52 | pageControlFrame.origin.x = (self.bounds.size.width - pageControlFrame.size.width) / 2.f; 53 | pageControlFrame.origin.y = self.bounds.size.height - pageControlFrame.size.height; 54 | _pageControl.frame = pageControlFrame; 55 | _pageControl.numberOfPages = (NSInteger)[self pageCount]; 56 | } 57 | 58 | 59 | // call after updatePageControlFrame 60 | - (void) updateScrollViewFrame 61 | { 62 | CGRect scrollViewFrame = self.bounds; 63 | if( !self.pageControl.hidden ) 64 | { 65 | scrollViewFrame.size.height -= self.pageControl.frame.size.height; 66 | } 67 | 68 | // see: http://stackoverflow.com/questions/2653785/uiscrollview-doesnt-bounce/3231675#3231675 69 | if( !CGRectEqualToRect(self.scrollView.frame, scrollViewFrame) ) 70 | { 71 | self.scrollView.frame = scrollViewFrame; 72 | } 73 | 74 | [self.contentView setFrame:CGRectMake(0, 0, 75 | self.scrollView.bounds.size.width * [self pageCount], 76 | self.scrollView.bounds.size.height)]; 77 | 78 | self.scrollView.contentSize = self.contentView.bounds.size; 79 | } 80 | 81 | 82 | - (void) _init 83 | { 84 | _cells = [[NSMutableDictionary alloc] init]; 85 | _unusedCells = [[NSMutableArray alloc] init]; 86 | _columnPadding = kDefaultColumnPadding; 87 | _cellSelectionDelay = kAMSpringboarViewCellSelectionDelayDefault; 88 | 89 | _pageControl = [[UIPageControl alloc] initWithFrame:CGRectZero]; 90 | _pageControl.hidesForSinglePage = YES; 91 | _pageControl.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; 92 | _pageControl.backgroundColor = [UIColor clearColor]; 93 | [self addSubview:_pageControl]; 94 | 95 | // AMSpringboardScrollView* springboardScroll = [[AMSpringboardScrollView alloc] initWithFrame:CGRectZero]; 96 | // springboardScroll.springboardView = self; 97 | UIScrollView* springboardScroll = [[UIScrollView alloc] initWithFrame:CGRectZero]; 98 | 99 | _scrollView = springboardScroll; 100 | _scrollView.delegate = self; 101 | _scrollView.pagingEnabled = YES; 102 | _scrollView.bounces = YES; 103 | _scrollView.alwaysBounceHorizontal = YES; 104 | _scrollView.delaysContentTouches = NO; 105 | _scrollView.directionalLockEnabled = YES; 106 | _scrollView.showsHorizontalScrollIndicator = NO; 107 | _scrollView.showsVerticalScrollIndicator = NO; 108 | _scrollView.contentOffset = CGPointZero; 109 | [self addSubview:_scrollView]; 110 | 111 | AMSpringboardContentView* contentView = [[AMSpringboardContentView alloc] initWithFrame:CGRectZero]; 112 | contentView.springboardView = self; 113 | [_scrollView addSubview:contentView]; 114 | self.contentView = contentView; 115 | self.contentView.backgroundColor = [UIColor clearColor]; 116 | [contentView release]; 117 | } 118 | 119 | 120 | - (id) initWithFrame:(CGRect)frame 121 | { 122 | self = [super initWithFrame:frame]; 123 | if (self != nil) 124 | { 125 | [self _init]; 126 | } 127 | return self; 128 | } 129 | 130 | 131 | - (id) initWithCoder:(NSCoder *)aDecoder 132 | { 133 | self = [super initWithCoder:aDecoder]; 134 | if (self != nil) 135 | { 136 | [self _init]; 137 | } 138 | return self; 139 | } 140 | 141 | 142 | - (void) dealloc 143 | { 144 | [_pageControl release]; 145 | [_scrollView release]; 146 | [_contentView release]; 147 | [_unusedCells release]; 148 | [_cells release]; 149 | [_positionBeingSelectedAfterDelay release]; 150 | [super dealloc]; 151 | } 152 | 153 | 154 | - (void) addUnusedCell:(AMSpringboardViewCell*)cell 155 | { 156 | // -- only save a columns worth of cells 157 | if( [self.unusedCells count] < [self columnCount] ) 158 | { 159 | [self.unusedCells addObject:cell]; 160 | } 161 | } 162 | 163 | 164 | - (NSUInteger) pageCount 165 | { 166 | return [self.dataSource numberOfPagesInSpringboardView:self]; 167 | } 168 | 169 | 170 | - (NSUInteger) rowCount 171 | { 172 | return [self.dataSource numberOfRowsInSpringboardView:self]; 173 | } 174 | 175 | 176 | - (NSUInteger) columnCount 177 | { 178 | return [self.dataSource numberOfColumnsInSpringboardView:self]; 179 | } 180 | 181 | 182 | - (NSInteger) currentPage 183 | { 184 | BOOL scrollViewFrameIsSet = !CGRectIsEmpty(self.scrollView.frame); 185 | 186 | // until the scroll view frame is set, it will always start on page 0. 187 | return scrollViewFrameIsSet ? lround(self.scrollView.contentOffset.x / self.scrollView.bounds.size.width) : 0; 188 | } 189 | 190 | - (void) setCurrentPage:(NSInteger)currentPage 191 | { 192 | CGPoint offset = CGPointZero; 193 | offset.x = self.scrollView.bounds.size.width * currentPage; 194 | self.scrollView.contentOffset = offset; 195 | } 196 | 197 | 198 | - (CGRect) zoneRectForCellWithPosition:(NSIndexPath*)position 199 | { 200 | if( !([self columnCount] > 0 && [self rowCount] > 0) ) 201 | return CGRectZero; 202 | 203 | CGSize pageSize = self.scrollView.bounds.size; 204 | CGFloat zoneWidth = (((CGFloat)pageSize.width) / [self columnCount]); 205 | CGFloat zoneHeight = (((CGFloat)pageSize.height) / [self rowCount]); 206 | 207 | CGRect rect = CGRectZero; 208 | rect.origin.x = [position springboardPage] * pageSize.width; 209 | rect.origin.x += zoneWidth * [position springboardColumn]; 210 | rect.origin.y = zoneHeight * [position springboardRow]; 211 | rect.size.width = zoneWidth; 212 | rect.size.height = zoneHeight; 213 | 214 | return CGRectIntegral(rect); 215 | } 216 | 217 | 218 | - (CGPoint) centerForCellWithPosition:(NSIndexPath*)position 219 | { 220 | return AMRectCenter([self zoneRectForCellWithPosition:position]); 221 | } 222 | 223 | 224 | - (AMSpringboardViewCell *)cellForPositionWithIndexPath:(NSIndexPath *)indexPath 225 | { 226 | AMSpringboardViewCell *cell = [self.cells objectForKey:indexPath]; 227 | if( cell == nil ) 228 | { 229 | cell = [self.dataSource springboardView:self cellForPositionWithIndexPath:indexPath]; 230 | 231 | if( cell != nil ) 232 | { 233 | [self.cells setObject:cell forKey:indexPath]; 234 | } 235 | else 236 | { 237 | [self.cells setObject:[NSNull null] forKey:indexPath]; 238 | } 239 | } 240 | return cell; 241 | } 242 | 243 | - (NSIndexPath *)indexPathForCell:(AMSpringboardViewCell *)cell 244 | { 245 | return [[self.cells keysOfEntriesPassingTest:^BOOL(id key, id obj, BOOL *stop) { 246 | if (obj == cell) 247 | { 248 | *stop = YES; 249 | return YES; 250 | } 251 | 252 | return NO; 253 | }] anyObject]; 254 | } 255 | 256 | - (void)updateCellsForPositions:(NSArray *)positions 257 | { 258 | for (NSIndexPath *position in positions) 259 | { 260 | [self updateCellForPosition:position]; 261 | } 262 | } 263 | 264 | - (void)updateCellForPosition:(NSIndexPath *)position 265 | { 266 | id cell = [self cellForPositionWithIndexPath:position]; 267 | if( VALID_SPRINBOARD_CELL(cell) ) 268 | { 269 | if( [cell superview] == nil ) 270 | { 271 | [self addCellToView:cell position:position]; 272 | } 273 | else 274 | { 275 | [self setFrameForCell:cell position:position]; 276 | } 277 | [cell setNeedsDisplay]; 278 | } 279 | } 280 | 281 | - (void) layoutSubviews 282 | { 283 | [self updatePageControlFrame]; 284 | [self updateScrollViewFrame]; 285 | 286 | NSArray* positions = [self positionsIntersectingRect:[self activeRect]]; 287 | [self updateCellsForPositions:positions]; 288 | } 289 | 290 | 291 | - (void) reloadData 292 | { 293 | NSUInteger pageCount = [self pageCount]; 294 | 295 | self.pageControl.numberOfPages = (NSInteger)pageCount; 296 | 297 | for( id cell in [self.cells allValues] ) 298 | { 299 | if( [cell respondsToSelector:@selector(removeFromSuperview)] ) 300 | [cell removeFromSuperview]; 301 | } 302 | 303 | [self.cells removeAllObjects]; 304 | [self.unusedCells removeAllObjects]; 305 | 306 | NSArray* positions = [self positionsIntersectingRect:[self activeRect]]; 307 | [self updateCellsForPositions:positions]; 308 | 309 | [self setNeedsLayout]; 310 | 311 | self.scrollView.scrollEnabled = (pageCount > 1); 312 | } 313 | 314 | - (void)reloadCellAtPosition:(NSIndexPath *)position 315 | { 316 | id cell = [self.cells objectForKey:position]; 317 | 318 | if (cell != nil) 319 | { 320 | if ([cell respondsToSelector:@selector(removeFromSuperview)]) 321 | [cell removeFromSuperview]; 322 | 323 | [self.cells removeObjectForKey:position]; 324 | 325 | [self updateCellForPosition:position]; 326 | } 327 | } 328 | 329 | - (AMSpringboardViewCell*) dequeueReusableCellWithIdentifier:(NSString*)identifier 330 | { 331 | AMSpringboardViewCell* dequeuedCell = nil; 332 | 333 | for( AMSpringboardViewCell* cell in self.unusedCells ) 334 | { 335 | if( [cell.reuseIdentifier isEqualToString:identifier] ) 336 | { 337 | dequeuedCell = cell; 338 | break; 339 | } 340 | } 341 | 342 | if( dequeuedCell != nil ) 343 | { 344 | [[dequeuedCell retain] autorelease]; // make sure it doesn't get dealloc'd 345 | [self.unusedCells removeObject:dequeuedCell]; 346 | } 347 | 348 | [dequeuedCell prepareForReuse]; 349 | 350 | return dequeuedCell; 351 | } 352 | 353 | - (void) setFrameForCell:(AMSpringboardViewCell*)cell position:(NSIndexPath*)position 354 | { 355 | cell.center = [self centerForCellWithPosition:position]; 356 | cell.frame = CGRectIntegral(cell.frame); 357 | } 358 | 359 | 360 | - (void) addCellToView:(AMSpringboardViewCell*)cell position:(NSIndexPath*)position 361 | { 362 | //NSLog( @"adding: %@", cell ); 363 | [self setFrameForCell:cell position:position]; 364 | [self.contentView addSubview:cell]; 365 | [cell setNeedsDisplay]; 366 | } 367 | 368 | 369 | - (void) loadCellsForPage:(NSUInteger)page column:(NSUInteger)column 370 | { 371 | if( page >= [self pageCount] ) 372 | return; 373 | 374 | if( column >= [self columnCount] ) 375 | return; 376 | 377 | for( NSUInteger row=0; row<[self rowCount]; row++ ) 378 | { 379 | NSIndexPath* position = [NSIndexPath indexPathForSpringboardPage:page column:column row:row]; 380 | AMSpringboardViewCell* cell = [self cellForPositionWithIndexPath:position]; 381 | if( cell != nil ) 382 | { 383 | [self addCellToView:cell position:position]; 384 | } 385 | } 386 | } 387 | 388 | 389 | - (CGFloat) pageWidth 390 | { 391 | return self.scrollView.bounds.size.width; 392 | } 393 | 394 | 395 | - (NSIndexPath *)positionForPoint:(CGPoint)point 396 | { 397 | if( !([self columnCount] > 0 && [self rowCount] > 0) ) 398 | return nil; 399 | 400 | CGSize pageSize = self.scrollView.bounds.size; 401 | if( pageSize.width == 0 || pageSize.height == 0 ) 402 | return nil; 403 | 404 | point = AMPointClampedToRect(point, self.contentView.bounds); 405 | 406 | NSUInteger page = (NSUInteger)floor(point.x / pageSize.width); 407 | 408 | NSUInteger col = (NSUInteger)floor((point.x - (page * pageSize.width)) 409 | / (pageSize.width / [self columnCount])); 410 | col = MIN([self columnCount]-1, col); 411 | 412 | NSUInteger row = (NSUInteger)floor(point.y / (pageSize.height / [self rowCount])); 413 | row = MIN([self rowCount]-1, row); 414 | 415 | return [NSIndexPath indexPathForSpringboardPage:page column:col row:row]; 416 | } 417 | 418 | - (NSIndexPath *)positionForTouch:(UITouch *)touch 419 | { 420 | CGPoint p = [touch locationInView:self.contentView]; 421 | return [self positionForPoint:p]; 422 | } 423 | 424 | - (NSArray *)indexPathsForVisibleRows 425 | { 426 | NSInteger page = self.currentPage; 427 | NSUInteger rows = self.rowCount, 428 | cols = self.columnCount; 429 | 430 | NSMutableArray *result = [NSMutableArray arrayWithCapacity:rows * cols]; 431 | 432 | NSUInteger row = 0, 433 | col = 0; 434 | 435 | for (row = 0; row < rows; row++) 436 | { 437 | for (col = 0; col < cols; col++) 438 | [result addObject:[NSIndexPath indexPathForSpringboardPage:(NSUInteger)page column:col row:row]]; 439 | } 440 | 441 | return [NSArray arrayWithArray:result]; 442 | } 443 | 444 | - (NSArray *)visibleCells 445 | { 446 | NSArray *visibleIndexPaths = [self indexPathsForVisibleRows]; 447 | NSMutableArray *result = [NSMutableArray arrayWithCapacity:[visibleIndexPaths count]]; 448 | 449 | for (NSIndexPath *indexPath in visibleIndexPaths) 450 | { 451 | AMSpringboardViewCell *cell = [self cellForPositionWithIndexPath:indexPath]; 452 | 453 | if (VALID_SPRINBOARD_CELL(cell)) 454 | [result addObject:cell]; 455 | } 456 | 457 | return [NSArray arrayWithArray:result]; 458 | } 459 | 460 | 461 | - (NSArray*) positionsIntersectingRect:(CGRect)rect 462 | { 463 | NSMutableArray* positions = [NSMutableArray array]; 464 | 465 | NSIndexPath* topLeft = [self positionForPoint: 466 | CGPointMake(CGRectGetMinX(rect), CGRectGetMinY(rect))]; 467 | NSIndexPath* botRight = [self positionForPoint: 468 | CGPointMake(CGRectGetMaxX(rect)-1, CGRectGetMaxY(rect)-1)]; 469 | 470 | NSIndexPath* cur = topLeft; 471 | while(1) 472 | { 473 | for( NSUInteger row=[topLeft springboardRow]; row<=[botRight springboardRow]; row++ ) 474 | { 475 | [positions addObject:[NSIndexPath indexPathForSpringboardPage:[cur springboardPage] 476 | column:[cur springboardColumn] 477 | row:row]]; 478 | } 479 | 480 | if( ([cur springboardPage] == [botRight springboardPage] && 481 | [cur springboardColumn] == [botRight springboardColumn]) ) 482 | break; 483 | 484 | NSUInteger nextPage = [cur springboardPage]; 485 | NSUInteger nextCol = ([cur springboardColumn]+1) % [self columnCount]; 486 | if( nextCol < [cur springboardColumn] ) nextPage++; 487 | cur = [NSIndexPath indexPathForSpringboardPage:nextPage 488 | column:nextCol 489 | row:[topLeft springboardRow]]; 490 | 491 | if( [cur springboardPage] == [self pageCount] ) 492 | break; 493 | } 494 | 495 | return positions; 496 | } 497 | 498 | 499 | - (CGRect) activeRect 500 | { 501 | // make sure there is at least 1 column 502 | NSUInteger columnCount = [self columnCount]; 503 | if( columnCount <= 0 ) 504 | return CGRectZero; 505 | 506 | CGRect rect; 507 | CGFloat widthPad = ([self pageWidth] / columnCount) * self.columnPadding; 508 | rect.origin.x = self.scrollView.contentOffset.x - widthPad; 509 | rect.origin.y = self.scrollView.contentOffset.y; 510 | rect.size.width = self.scrollView.bounds.size.width + (widthPad*2); // double to accomodate the left width 511 | rect.size.height = self.scrollView.bounds.size.height; 512 | //NSLog(@"activeRect:%@", NSStringFromCGRect(rect)); 513 | return rect; 514 | } 515 | 516 | #pragma mark UIScrollViewDelegate 517 | 518 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 519 | { 520 | CGRect visibleFrame = [self activeRect]; 521 | 522 | for( NSIndexPath* pos in [[[self.cells allKeys] copy] autorelease] ) 523 | { 524 | id cell = [self.cells objectForKey:pos]; 525 | if( cell != nil ) 526 | { 527 | CGRect zone = [self zoneRectForCellWithPosition:pos]; 528 | if( !CGRectIntersectsRect(zone, visibleFrame) ) 529 | { 530 | //NSLog( @"pruning: %@", pos ); 531 | if( cell != [NSNull null] ) 532 | { 533 | [self addUnusedCell:cell]; 534 | [cell removeFromSuperview]; 535 | } 536 | [self.cells removeObjectForKey:pos]; 537 | } 538 | } 539 | } 540 | 541 | //NSLog(@"visible rect: %@", NSStringFromCGRect(visibleFrame)); 542 | NSArray* positions = [self positionsIntersectingRect:visibleFrame]; 543 | [self updateCellsForPositions:positions]; 544 | 545 | // -- recalculate page control 546 | self.pageControl.currentPage = self.currentPage; 547 | } 548 | 549 | - (void)deselectCellWithPosition:(NSIndexPath *)position 550 | { 551 | id cell = [self cellForPositionWithIndexPath:position]; 552 | if( VALID_SPRINBOARD_CELL(cell) ) 553 | { 554 | [cell setHighlighted:NO]; 555 | } 556 | self.selectedPosition = nil; 557 | } 558 | 559 | - (void)deselectSelectedCell 560 | { 561 | if (self.selectedPosition) 562 | { 563 | [self deselectCellWithPosition:self.selectedPosition]; 564 | } 565 | } 566 | 567 | - (void)selectCellWithPosition:(NSIndexPath *)position 568 | { 569 | [self cancelExistingDelayedSelectionOfCell]; 570 | 571 | if (self.selectedPosition != nil) 572 | { 573 | [self deselectCellWithPosition:position]; 574 | } 575 | 576 | id cell = [self cellForPositionWithIndexPath:position]; 577 | if (VALID_SPRINBOARD_CELL(cell)) 578 | { 579 | if (!self.shouldSelectCellsOnTouchDown) 580 | [cell setHighlighted:YES]; 581 | self.selectedPosition = position; 582 | } 583 | } 584 | 585 | - (void)selectCellWithPosition:(NSIndexPath *)position afterDelay:(NSTimeInterval)delay 586 | { 587 | self.positionBeingSelectedAfterDelay = position; 588 | [self performSelector:@selector(selectCellWithPosition:) withObject:position afterDelay:delay]; 589 | } 590 | 591 | - (void)delayedSelectionOfCellWithPosition:(NSIndexPath *)position 592 | { 593 | [self selectCellWithPosition:position afterDelay:self.cellSelectionDelay]; 594 | } 595 | 596 | - (void)cancelDelayedSelectionOfCellWithPosition:(NSIndexPath *)position 597 | { 598 | [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(selectCellWithPosition:) object:position]; 599 | } 600 | 601 | - (void)cancelExistingDelayedSelectionOfCell 602 | { 603 | if (self.positionBeingSelectedAfterDelay != nil) 604 | { 605 | [self cancelDelayedSelectionOfCellWithPosition:self.positionBeingSelectedAfterDelay]; 606 | self.positionBeingSelectedAfterDelay = nil; 607 | } 608 | } 609 | 610 | - (void)informDelegateOfSelectedCellPosition 611 | { 612 | if (self.selectedPosition != nil) 613 | { 614 | [self.delegate springboardView:self 615 | didSelectCellWithPosition:self.selectedPosition]; 616 | [self performSelector:@selector(deselectSelectedCell) withObject:nil afterDelay:0.0]; 617 | } 618 | } 619 | 620 | - (BOOL)isValidPosition:(NSIndexPath *)position 621 | { 622 | if( [position springboardPage] >= [self pageCount] ) // unsigned so don't have to check for negative 623 | return NO; 624 | 625 | if( [position springboardColumn] >= [self columnCount] ) // unsigned so don't have to check for negative 626 | return NO; 627 | 628 | if( [position springboardRow] >= [self rowCount] ) // unsigned so don't have to check for negative 629 | return NO; 630 | 631 | return YES; 632 | } 633 | 634 | @end 635 | 636 | 637 | // ----------------------------------------------------------------------------------- 638 | #pragma mark - 639 | @implementation AMSpringboardContentView 640 | 641 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 642 | { 643 | NSIndexPath* position = [self.springboardView positionForTouch:[touches anyObject]]; 644 | 645 | if (self.springboardView.shouldSelectCellsOnTouchDown) 646 | { 647 | [self.springboardView selectCellWithPosition:position]; 648 | [self.springboardView informDelegateOfSelectedCellPosition]; 649 | } 650 | else 651 | { 652 | [self.springboardView delayedSelectionOfCellWithPosition:position]; 653 | } 654 | } 655 | 656 | - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event 657 | { 658 | [self.springboardView cancelExistingDelayedSelectionOfCell]; 659 | 660 | [self.springboardView deselectSelectedCell]; 661 | } 662 | 663 | 664 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 665 | { 666 | [self.springboardView cancelExistingDelayedSelectionOfCell]; 667 | 668 | [self.springboardView informDelegateOfSelectedCellPosition]; 669 | } 670 | 671 | @end 672 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardViewCell.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 2/19/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | AMSpringboardViewCellStyleDefault = 1, 13 | AMSpringboardViewCellStyleMultiline, 14 | AMSpringboardViewCellStyleEmpty 15 | } AMSpringboardViewCellStyle; 16 | 17 | 18 | @interface AMSpringboardViewCell : UIView 19 | 20 | - (id) initWithStyle:(AMSpringboardViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier; 21 | - (id) initWithStyle:(AMSpringboardViewCellStyle)style reuseIdentifier:(NSString *)identifier size:(CGSize)size; 22 | - (id) initWithStyle:(AMSpringboardViewCellStyle)style 23 | reuseIdentifier:(NSString *)reuseIdentifier 24 | size:(CGSize)size 25 | fontName:(NSString *)fontName; 26 | 27 | @property (nonatomic, readonly, retain) UIImageView *imageView; // default is nil. label will be created if necessary. 28 | @property (nonatomic, retain) UIImage *image; 29 | 30 | @property (nonatomic, readonly, retain) UILabel *textLabel; // default is nil. label will be created if necessary. 31 | 32 | @property (nonatomic, assign) BOOL highlighted; 33 | 34 | @property (nonatomic, readonly, copy) NSString *reuseIdentifier; 35 | 36 | @property (nonatomic, readonly, assign) CGFloat labelFontSize; 37 | 38 | - (void)prepareForReuse; 39 | 40 | #pragma mark Subclasses 41 | 42 | /** 43 | @default YES 44 | */ 45 | - (BOOL)shouldShadeImageWhenHighlighted; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/AMSpringboardViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardViewCell.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 2/19/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "AMSpringboardViewCell.h" 10 | 11 | #import 12 | 13 | #import 14 | 15 | 16 | // Copied from Macros.h. Need a better place to make this stuff accessible from everywhere. 17 | #define UICOLOR_RGB_BYTE(R,G,B,A) [UIColor colorWithRed:(CGFloat)(R)/255 green:(CGFloat)(G)/255 blue:(CGFloat)(B)/255 alpha:(CGFloat)(A)/255] 18 | 19 | #define UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone) 20 | #define DEVICE_IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) 21 | #define DEVICE_IS_IPAD (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone) 22 | 23 | #define DEFAULT_WIDTH 105 24 | #define DEFAULT_HEIGHT 100 25 | 26 | #define LABEL_HEIGHT 30 27 | 28 | #define FONT_SIZE_IPHONE 13 29 | #define FONT_SIZE_IPAD 26 30 | 31 | @interface AMSpringboardCellHighlightView : UIView 32 | @property (nonatomic, assign) AMSpringboardViewCell* cell; // WEAK ref 33 | @end 34 | 35 | @interface AMSpringboardViewCell () 36 | 37 | @property (nonatomic,readwrite,copy) NSString* reuseIdentifier; 38 | @property (nonatomic,readwrite,retain) UILabel* textLabel; 39 | @property (nonatomic,readwrite,retain) UIImageView* imageView; 40 | @property (nonatomic,readwrite,retain) AMSpringboardCellHighlightView* highlightView; 41 | 42 | @end 43 | 44 | 45 | #pragma mark - 46 | @implementation AMSpringboardViewCell 47 | 48 | @synthesize reuseIdentifier = _reuseIdentifier; 49 | @synthesize image = _image; 50 | @synthesize textLabel = _textLabel; 51 | @synthesize imageView = _imageView; 52 | @synthesize highlightView = _highlightView; 53 | @synthesize highlighted = _highlighted; 54 | @synthesize labelFontSize = _labelFontSize; 55 | 56 | 57 | - (void)setupViewForStyle:(AMSpringboardViewCellStyle)style fontName:(NSString *)fontName 58 | { 59 | if (style == AMSpringboardViewCellStyleDefault || style == AMSpringboardViewCellStyleMultiline) 60 | { 61 | self.opaque = NO; 62 | 63 | self.imageView = [[[UIImageView alloc] init] autorelease]; 64 | self.imageView.contentMode = UIViewContentModeScaleAspectFit; 65 | 66 | [self addSubview:self.imageView]; 67 | self.highlightView = [[[AMSpringboardCellHighlightView alloc] init] autorelease]; 68 | self.highlightView.cell = self; 69 | [self addSubview:self.highlightView]; 70 | 71 | if (style == AMSpringboardViewCellStyleDefault) 72 | { 73 | [self.textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.bounds.size.height-LABEL_HEIGHT, 74 | self.bounds.size.width, LABEL_HEIGHT)] release]; 75 | 76 | self.textLabel.lineBreakMode = NSLineBreakByWordWrapping; 77 | // self.textLabel.backgroundColor = [UIColor clearColor]; 78 | self.textLabel.font = fontName ? [UIFont fontWithName:fontName size:self.labelFontSize] : 79 | [UIFont systemFontOfSize:self.labelFontSize]; 80 | self.textLabel.textColor = UICOLOR_RGB_BYTE(91, 73, 120, 255); 81 | self.textLabel.adjustsFontSizeToFitWidth = YES; 82 | self.textLabel.minimumFontSize = 8; 83 | self.textLabel.textAlignment = NSTextAlignmentCenter; 84 | [self addSubview:self.textLabel]; 85 | } 86 | else if (style == AMSpringboardViewCellStyleMultiline) 87 | { 88 | [self.textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.bounds.size.height-LABEL_HEIGHT, 89 | self.bounds.size.width, 0)] release]; 90 | 91 | self.textLabel.clipsToBounds = NO; 92 | self.textLabel.numberOfLines = 2; 93 | self.textLabel.lineBreakMode = NSLineBreakByWordWrapping; 94 | self.textLabel.backgroundColor = [UIColor clearColor]; 95 | self.textLabel.textAlignment = NSTextAlignmentCenter; 96 | [self addSubview:self.textLabel]; 97 | } 98 | 99 | self.highlightView.frame = self.imageView.frame = [self imageFrame]; 100 | } 101 | } 102 | 103 | 104 | - (id)initWithStyle:(AMSpringboardViewCellStyle)style reuseIdentifier:(NSString *)identifier 105 | { 106 | return [self initWithStyle:style reuseIdentifier:identifier size:CGSizeMake(DEFAULT_WIDTH, DEFAULT_HEIGHT)]; 107 | } 108 | 109 | - (id)initWithStyle:(AMSpringboardViewCellStyle)style reuseIdentifier:(NSString *)identifier size:(CGSize)size 110 | { 111 | 112 | return [self initWithStyle:style 113 | reuseIdentifier:identifier 114 | size:size 115 | fontName:nil]; 116 | } 117 | 118 | - (id) initWithStyle:(AMSpringboardViewCellStyle)style 119 | reuseIdentifier:(NSString*)identifier 120 | size:(CGSize)size 121 | fontName:(NSString *)fontName 122 | { 123 | if ((self = [self initWithFrame:CGRectMake(0, 0, size.width, size.height)])) 124 | { 125 | self.reuseIdentifier = identifier; 126 | [self setupViewForStyle:style fontName:fontName]; 127 | } 128 | 129 | return self; 130 | } 131 | 132 | 133 | - (void) dealloc 134 | { 135 | [_reuseIdentifier release]; 136 | [_image release]; 137 | [_highlightView release]; 138 | [_textLabel release]; 139 | [super dealloc]; 140 | } 141 | 142 | - (CGRect)imageFrame 143 | { 144 | CGRect imageFrame = self.bounds; 145 | imageFrame.size.height -= LABEL_HEIGHT; 146 | imageFrame = AMRectInsetWithAspectRatio(imageFrame, 1); 147 | return imageFrame; 148 | } 149 | 150 | - (CGFloat)labelFontSize 151 | { 152 | if (!_labelFontSize) 153 | { 154 | @synchronized(self) 155 | { 156 | if (!_labelFontSize) 157 | { 158 | if (DEVICE_IS_IPAD) 159 | _labelFontSize = FONT_SIZE_IPAD; 160 | else 161 | _labelFontSize = FONT_SIZE_IPHONE; 162 | } 163 | } 164 | } 165 | 166 | return _labelFontSize; 167 | } 168 | 169 | - (void) layoutSubviews 170 | { 171 | self.textLabel.frame = CGRectMake(0, self.frame.size.height - LABEL_HEIGHT, self.frame.size.width, LABEL_HEIGHT); 172 | } 173 | 174 | - (void) setHighlighted:(BOOL)highlighted 175 | { 176 | if( highlighted != _highlighted ) 177 | { 178 | _highlighted = highlighted; 179 | [self.highlightView setNeedsDisplay]; 180 | } 181 | } 182 | 183 | 184 | - (void) setImage:(UIImage *)image 185 | { 186 | if( image != _image ) 187 | { 188 | [image retain]; 189 | [_image release]; 190 | _image = image; 191 | 192 | self.imageView.image = image; 193 | 194 | [self layoutSubviews]; 195 | } 196 | } 197 | 198 | 199 | // default implementation does nothing 200 | - (void) prepareForReuse {} 201 | 202 | - (BOOL)shouldShadeImageWhenHighlighted 203 | { 204 | return YES; 205 | } 206 | 207 | @end 208 | 209 | 210 | @implementation AMSpringboardCellHighlightView : UIView 211 | 212 | - (id)initWithFrame:(CGRect)frame 213 | { 214 | self = [super initWithFrame:frame]; 215 | if (self) 216 | { 217 | self.backgroundColor = [UIColor clearColor]; 218 | } 219 | return self; 220 | } 221 | 222 | - (void) drawRect:(CGRect)rect 223 | { 224 | if ([self.cell shouldShadeImageWhenHighlighted] && self.cell.highlighted) 225 | { 226 | CGContextRef context = UIGraphicsGetCurrentContext(); 227 | CGContextSaveGState(context); 228 | 229 | CGRect bounds = self.bounds; 230 | 231 | CGContextSetBlendMode(context, kCGBlendModeMultiply); 232 | 233 | CGContextScaleCTM(context, 1.0, -1.0); 234 | CGContextTranslateCTM(context, 0.0, -bounds.size.height); 235 | 236 | CGContextClipToRect(context, rect); 237 | CGContextClipToMask(context, bounds, self.cell.image.CGImage); 238 | 239 | UIColor* color = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.4f]; 240 | CGContextSetFillColor(context, CGColorGetComponents(color.CGColor)); 241 | CGContextFillRect(context, rect); 242 | 243 | CGContextRestoreGState(context); 244 | } 245 | } 246 | 247 | 248 | @end 249 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/NSIndexPath+AMSpringboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSIndexPath+AMSpringboardView.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/6/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define kAMSpringboardViewAllRows NSUIntegerMax 12 | 13 | @interface NSIndexPath (AMSpringboard) 14 | 15 | + (NSIndexPath*) indexPathForSpringboardPage:(NSUInteger)page column:(NSUInteger)column row:(NSUInteger)row; 16 | 17 | + (NSIndexPath*) indexPathForSpringboardPage:(NSUInteger)page column:(NSUInteger)column; 18 | 19 | - (NSUInteger) springboardPage; 20 | - (NSUInteger) springboardColumn; 21 | - (NSUInteger) springboardRow; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/NSIndexPath+AMSpringboard.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSIndexPath+AMSpringboardView.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/6/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "NSIndexPath+AMSpringboard.h" 10 | 11 | @implementation NSIndexPath (AMSpringboard) 12 | 13 | 14 | + (NSIndexPath*) indexPathForSpringboardPage:(NSUInteger)page column:(NSUInteger)column row:(NSUInteger)row; 15 | { 16 | NSUInteger idx[3] = {page, column, row}; 17 | return [NSIndexPath indexPathWithIndexes:idx length:3]; 18 | } 19 | 20 | 21 | + (NSIndexPath*) indexPathForSpringboardPage:(NSUInteger)page column:(NSUInteger)column 22 | { 23 | return [self indexPathForSpringboardPage:page column:column row:kAMSpringboardViewAllRows]; 24 | } 25 | 26 | 27 | - (NSUInteger) springboardPage 28 | { 29 | return [self indexAtPosition:0]; 30 | } 31 | 32 | 33 | - (NSUInteger) springboardColumn 34 | { 35 | return [self indexAtPosition:1]; 36 | } 37 | 38 | 39 | - (NSUInteger) springboardRow 40 | { 41 | return [self indexAtPosition:2]; 42 | } 43 | 44 | 45 | 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/UIImage+AMHighlightedImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AMHighlightedImage.h 3 | // AMSpringboard 4 | // 5 | // Created by Andy Mroczkowski on 4/1/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface UIImage (AMShadedImage) 13 | 14 | #define kAMShadedImageDefaultShading (0.4) 15 | 16 | - (UIImage*) copyShadedImage; 17 | - (UIImage*) copyImageWithShading:(CGFloat)shading; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /AMSpringboard/Classes/UIImage+AMHighlightedImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AMHighlightedImage.m 3 | // AMSpringboard 4 | // 5 | // Created by Andy Mroczkowski on 4/1/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "UIImage+AMHighlightedImage.h" 10 | 11 | 12 | @implementation UIImage (AMShadedImage) 13 | 14 | 15 | - (UIImage*) copyShadedImage 16 | { 17 | return [self copyImageWithShading:kAMShadedImageDefaultShading]; 18 | } 19 | 20 | 21 | - (UIImage*) copyImageWithShading:(CGFloat)shading 22 | { 23 | CGImageRef cgImage = self.CGImage; 24 | 25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | CGContextRef context = CGBitmapContextCreate(NULL, 27 | CGImageGetWidth(cgImage), 28 | CGImageGetHeight(cgImage), 29 | CGImageGetBitsPerComponent(cgImage), 30 | CGImageGetBytesPerRow(cgImage), 31 | colorSpace, 32 | kCGImageAlphaPremultipliedLast); 33 | CGColorSpaceRelease(colorSpace); 34 | 35 | CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height); 36 | 37 | CGContextClipToMask(context, rect, cgImage); 38 | 39 | CGContextDrawImage(context, rect, cgImage); 40 | 41 | CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, shading); 42 | CGContextFillRect(context, rect); 43 | 44 | CGImageRef cgImageHighlight = CGBitmapContextCreateImage(context); 45 | CGContextRelease(context); 46 | 47 | UIImage* highlightImage = [[UIImage alloc] initWithCGImage:cgImageHighlight]; 48 | CGImageRelease(cgImageHighlight); 49 | 50 | 51 | return highlightImage; 52 | } 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /AMSpringboardDemo/AMSpringboardDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.amerzing.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /AMSpringboardDemo/AMSpringboardDemo_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'AMSpringboard' target in the 'AMSpringboard' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Classes/AMSpringboardDemoAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardViewAppDelegate.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 2/18/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AMSpringboardDemoAppDelegate : NSObject { 12 | UIWindow *window; 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; 18 | 19 | @end 20 | 21 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Classes/AMSpringboardDemoAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardViewAppDelegate.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 2/18/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "AMSpringboardDemoAppDelegate.h" 10 | 11 | @implementation AMSpringboardDemoAppDelegate 12 | 13 | @synthesize window; 14 | @synthesize tabBarController; 15 | 16 | 17 | #pragma mark - 18 | #pragma mark Application lifecycle 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | 22 | 23 | self.window.rootViewController = self.tabBarController; 24 | [self.window makeKeyAndVisible]; 25 | 26 | return YES; 27 | } 28 | 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application { 31 | /* 32 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 33 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 34 | */ 35 | } 36 | 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application { 39 | /* 40 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 41 | If your application supports background execution, called instead of applicationWillTerminate: when the user quits. 42 | */ 43 | } 44 | 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application { 47 | /* 48 | Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. 49 | */ 50 | } 51 | 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application { 54 | /* 55 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 56 | */ 57 | } 58 | 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application { 61 | /* 62 | Called when the application is about to terminate. 63 | See also applicationDidEnterBackground:. 64 | */ 65 | } 66 | 67 | 68 | #pragma mark - 69 | #pragma mark Memory management 70 | 71 | - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 72 | /* 73 | Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. 74 | */ 75 | } 76 | 77 | 78 | - (void)dealloc { 79 | [window release]; 80 | [super dealloc]; 81 | } 82 | 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Classes/DataProviderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DataProviderViewController.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/28/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AMSpringboardView.h" 12 | 13 | @class AMSpringboardDataProvider; 14 | 15 | @interface DataProviderViewController : UIViewController 16 | { 17 | AMSpringboardView* _springboardView; 18 | 19 | AMSpringboardDataProvider* _dataProvider; 20 | } 21 | 22 | @property (nonatomic, retain) IBOutlet AMSpringboardView* springboardView; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Classes/DataProviderViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DataProviderViewController.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/28/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "DataProviderViewController.h" 10 | 11 | #import "AMSpringboardDataProvider.h" 12 | #import "AMSpringboardItemSpecifier.h" 13 | 14 | @interface DataProviderViewController () 15 | @property (nonatomic, retain) AMSpringboardDataProvider* dataProvider; 16 | @end 17 | 18 | 19 | @implementation DataProviderViewController 20 | 21 | @synthesize springboardView = _springboardView; 22 | @synthesize dataProvider = _dataProvider; 23 | 24 | 25 | - (void) _initDataProvider 26 | { 27 | // -- manual page array creation 28 | /* 29 | self.dataProvider = [AMSpringboardDataProvider dataProvider]; 30 | self.dataProvider.rowCount = 3; 31 | self.dataProvider.columnCount = 2; 32 | NSMutableArray* pages = [NSMutableArray arrayWithObjects: 33 | [NSMutableArray arrayWithObjects: 34 | [AMSpringboardItemSpecifier itemSpecifierWithTitle:@"one" 35 | imageName:@"beer-icon"], 36 | 37 | [AMSpringboardNullItem nullItem], 38 | 39 | [AMSpringboardItemSpecifier itemSpecifierWithTitle:@"two" 40 | imageName:@"beer-icon"], 41 | 42 | [AMSpringboardNullItem nullItem], 43 | 44 | [AMSpringboardItemSpecifier itemSpecifierWithTitle:@"three" 45 | imageName:@"beer-icon"], 46 | 47 | [AMSpringboardItemSpecifier itemSpecifierWithTitle:@"four" 48 | imageName:@"beer-icon"], 49 | 50 | nil], 51 | [NSMutableArray arrayWithObjects: 52 | [AMSpringboardItemSpecifier itemSpecifierWithTitle:@"one" 53 | imageName:@"beer-icon"], 54 | [AMSpringboardNullItem nullItem], 55 | 56 | [AMSpringboardItemSpecifier itemSpecifierWithTitle:@"two" 57 | imageName:@"beer-icon"], 58 | 59 | [AMSpringboardItemSpecifier itemSpecifierWithTitle:@"three" 60 | imageName:@"beer-icon"], 61 | 62 | [AMSpringboardNullItem nullItem], 63 | 64 | [AMSpringboardItemSpecifier itemSpecifierWithTitle:@"four" 65 | imageName:@"beer-icon"], 66 | nil], 67 | nil]; 68 | self.dataProvider.pages = pages; 69 | */ 70 | 71 | // -- Page creation from plist file 72 | NSError* error = nil; 73 | NSString* path = [[NSBundle mainBundle] pathForResource:@"Springboard" ofType:@"plist"]; 74 | self.dataProvider = [AMSpringboardDataProvider dataProviderFromPlistWithPath:path error:&error]; 75 | 76 | // -- set data source 77 | self.springboardView.dataSource = self.dataProvider; 78 | } 79 | 80 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 81 | { 82 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 83 | if (self) { 84 | // Custom initialization 85 | } 86 | return self; 87 | } 88 | 89 | - (void)dealloc 90 | { 91 | [_springboardView release]; 92 | [super dealloc]; 93 | } 94 | 95 | - (void)didReceiveMemoryWarning 96 | { 97 | // Releases the view if it doesn't have a superview. 98 | [super didReceiveMemoryWarning]; 99 | 100 | // Release any cached data, images, etc that aren't in use. 101 | } 102 | 103 | #pragma mark - View lifecycle 104 | 105 | - (void)viewDidLoad 106 | { 107 | [super viewDidLoad]; 108 | 109 | self.springboardView.backgroundColor = [UIColor groupTableViewBackgroundColor]; 110 | [self _initDataProvider]; 111 | } 112 | 113 | - (void)viewDidUnload 114 | { 115 | [super viewDidUnload]; 116 | 117 | self.springboardView = nil; 118 | } 119 | 120 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 121 | { 122 | // Return YES for supported orientations 123 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 124 | } 125 | 126 | 127 | #pragma mark AMSpringboardViewDelegate 128 | 129 | - (void) springboardView:(AMSpringboardView*)springboardView didSelectCellWithPosition:(NSIndexPath*)position 130 | { 131 | NSLog(@"selected %@", position); 132 | } 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Classes/DataProviderViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 1306 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 301 12 | 13 | 14 | YES 15 | IBProxyObject 16 | IBUIView 17 | 18 | 19 | YES 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | YES 24 | 25 | YES 26 | 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | 41 | 274 42 | 43 | YES 44 | 45 | 46 | 274 47 | {320, 460} 48 | 49 | 50 | 51 | 52 | 3 53 | MQA 54 | 55 | 2 56 | 57 | 58 | IBCocoaTouchFramework 59 | 60 | 61 | {{0, 20}, {320, 460}} 62 | 63 | 64 | 65 | 66 | 3 67 | MQA 68 | 69 | 70 | 71 | IBCocoaTouchFramework 72 | 73 | 74 | 75 | 76 | YES 77 | 78 | 79 | view 80 | 81 | 82 | 83 | 3 84 | 85 | 86 | 87 | delegate 88 | 89 | 90 | 91 | 5 92 | 93 | 94 | 95 | springboardView 96 | 97 | 98 | 99 | 6 100 | 101 | 102 | 103 | 104 | YES 105 | 106 | 0 107 | 108 | 109 | 110 | 111 | 112 | 1 113 | 114 | 115 | YES 116 | 117 | 118 | 119 | 120 | 121 | -1 122 | 123 | 124 | File's Owner 125 | 126 | 127 | -2 128 | 129 | 130 | 131 | 132 | 4 133 | 134 | 135 | 136 | 137 | 138 | 139 | YES 140 | 141 | YES 142 | -1.CustomClassName 143 | -2.CustomClassName 144 | 1.IBEditorWindowLastContentRect 145 | 1.IBPluginDependency 146 | 4.CustomClassName 147 | 4.IBPluginDependency 148 | 149 | 150 | YES 151 | DataProviderViewController 152 | UIResponder 153 | {{556, 412}, {320, 480}} 154 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 155 | AMSpringboardView 156 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 157 | 158 | 159 | 160 | YES 161 | 162 | 163 | 164 | 165 | 166 | YES 167 | 168 | 169 | 170 | 171 | 6 172 | 173 | 174 | 175 | YES 176 | 177 | AMSpringboardView 178 | UIView 179 | 180 | YES 181 | 182 | YES 183 | dataSource 184 | delegate 185 | 186 | 187 | YES 188 | id 189 | id 190 | 191 | 192 | 193 | YES 194 | 195 | YES 196 | dataSource 197 | delegate 198 | 199 | 200 | YES 201 | 202 | dataSource 203 | id 204 | 205 | 206 | delegate 207 | id 208 | 209 | 210 | 211 | 212 | IBProjectSource 213 | ./Classes/AMSpringboardView.h 214 | 215 | 216 | 217 | DataProviderViewController 218 | UIViewController 219 | 220 | springboardView 221 | AMSpringboardView 222 | 223 | 224 | springboardView 225 | 226 | springboardView 227 | AMSpringboardView 228 | 229 | 230 | 231 | IBProjectSource 232 | ./Classes/DataProviderViewController.h 233 | 234 | 235 | 236 | 237 | 0 238 | IBCocoaTouchFramework 239 | 240 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 241 | 242 | 243 | YES 244 | 3 245 | 301 246 | 247 | 248 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Classes/DataSourceViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/1/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AMSpringboard.h" 12 | 13 | 14 | @interface DataSourceViewController : UIViewController 15 | { 16 | 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Classes/DataSourceViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 3/1/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "DataSourceViewController.h" 10 | 11 | 12 | @implementation DataSourceViewController 13 | 14 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 15 | { 16 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 17 | if (self) { 18 | // Custom initialization 19 | } 20 | return self; 21 | } 22 | 23 | - (void)dealloc 24 | { 25 | [super dealloc]; 26 | } 27 | 28 | - (void)didReceiveMemoryWarning 29 | { 30 | // Releases the view if it doesn't have a superview. 31 | [super didReceiveMemoryWarning]; 32 | 33 | // Release any cached data, images, etc that aren't in use. 34 | } 35 | 36 | #pragma mark - View lifecycle 37 | 38 | - (void)viewDidLoad 39 | { 40 | [super viewDidLoad]; 41 | 42 | AMSpringboardView* springboardView = (AMSpringboardView*)self.view; 43 | 44 | springboardView.delegate = self; 45 | springboardView.dataSource = self; 46 | springboardView.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; 47 | springboardView.shouldSelectCellsOnTouchDown = YES; 48 | } 49 | 50 | - (void)viewDidUnload 51 | { 52 | [super viewDidUnload]; 53 | // Release any retained subviews of the main view. 54 | // e.g. self.myOutlet = nil; 55 | } 56 | 57 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 58 | { 59 | // Return YES for supported orientations 60 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 61 | } 62 | 63 | #pragma mark AMSpringBoardViewDataSource 64 | 65 | - (NSUInteger) numberOfPagesInSpringboardView:(AMSpringboardView*)springboardView 66 | { 67 | return 5; 68 | } 69 | 70 | 71 | - (NSUInteger) numberOfRowsInSpringboardView:(AMSpringboardView*)springboardView 72 | { 73 | return 3; 74 | } 75 | 76 | 77 | - (NSUInteger) numberOfColumnsInSpringboardView:(AMSpringboardView*)springboardView 78 | { 79 | return 3; 80 | } 81 | 82 | #pragma mark AMSpringboardViewDelegate 83 | 84 | - (AMSpringboardViewCell*) springboardView:(AMSpringboardView*)springboardView cellForPositionWithIndexPath:(NSIndexPath*)indexPath 85 | { 86 | if( [indexPath springboardRow] == 2 && [indexPath springboardColumn] == 2 ) 87 | return nil; 88 | 89 | static NSString* identifier = @"Myidentifier"; 90 | 91 | AMSpringboardViewCell* cell = (AMSpringboardViewCell*)[springboardView dequeueReusableCellWithIdentifier:identifier]; 92 | if( cell == nil ) 93 | { 94 | cell = [[[AMSpringboardViewCell alloc] initWithStyle:AMSpringboardViewCellStyleDefault reuseIdentifier:identifier] autorelease]; 95 | //cell.backgroundColor = [UIColor redColor]; 96 | } 97 | 98 | cell.textLabel.text = [NSString stringWithFormat:@"(%d, %d, %d)", 99 | [indexPath springboardPage], 100 | [indexPath springboardColumn], 101 | [indexPath springboardRow]]; 102 | cell.textLabel.textColor = [UIColor whiteColor]; 103 | cell.textLabel.backgroundColor = [UIColor clearColor]; 104 | 105 | cell.image = [UIImage imageNamed:@"beer-icon"]; 106 | 107 | return cell; 108 | } 109 | 110 | 111 | - (void) springboardView:(AMSpringboardView*)springboardView didSelectCellWithPosition:(NSIndexPath*)position 112 | { 113 | NSLog(@"selected: %@", position); 114 | } 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Classes/DataSourceViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J869 6 | 1306 7 | 1038.35 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 301 12 | 13 | 14 | YES 15 | IBProxyObject 16 | IBUIView 17 | 18 | 19 | YES 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | YES 24 | 25 | YES 26 | 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | 41 | 274 42 | {{0, 20}, {320, 460}} 43 | 44 | 45 | 46 | 47 | 3 48 | MAA 49 | 50 | 51 | IBCocoaTouchFramework 52 | 53 | 54 | 55 | 56 | YES 57 | 58 | 59 | view 60 | 61 | 62 | 63 | 3 64 | 65 | 66 | 67 | delegate 68 | 69 | 70 | 71 | 5 72 | 73 | 74 | 75 | dataSource 76 | 77 | 78 | 79 | 6 80 | 81 | 82 | 83 | 84 | YES 85 | 86 | 0 87 | 88 | 89 | 90 | 91 | 92 | 1 93 | 94 | 95 | YES 96 | 97 | 98 | Springboard View 99 | 100 | 101 | -1 102 | 103 | 104 | File's Owner 105 | 106 | 107 | -2 108 | 109 | 110 | 111 | 112 | 113 | 114 | YES 115 | 116 | YES 117 | -1.CustomClassName 118 | -2.CustomClassName 119 | 1.CustomClassName 120 | 1.IBEditorWindowLastContentRect 121 | 1.IBPluginDependency 122 | 123 | 124 | YES 125 | DataSourceViewController 126 | UIResponder 127 | AMSpringboardView 128 | {{556, 412}, {320, 480}} 129 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 130 | 131 | 132 | 133 | YES 134 | 135 | 136 | 137 | 138 | 139 | YES 140 | 141 | 142 | 143 | 144 | 6 145 | 146 | 147 | 148 | YES 149 | 150 | AMSpringboardView 151 | UIView 152 | 153 | YES 154 | 155 | YES 156 | dataSource 157 | delegate 158 | 159 | 160 | YES 161 | id 162 | id 163 | 164 | 165 | 166 | YES 167 | 168 | YES 169 | dataSource 170 | delegate 171 | 172 | 173 | YES 174 | 175 | dataSource 176 | id 177 | 178 | 179 | delegate 180 | id 181 | 182 | 183 | 184 | 185 | IBProjectSource 186 | ./Classes/AMSpringboardView.h 187 | 188 | 189 | 190 | DataSourceViewController 191 | UIViewController 192 | 193 | IBProjectSource 194 | ./Classes/DataSourceViewController.h 195 | 196 | 197 | 198 | 199 | 0 200 | IBCocoaTouchFramework 201 | 202 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 203 | 204 | 205 | YES 206 | 3 207 | 301 208 | 209 | 210 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amrox/AMSpringboard/eec0f60f9794495b854ed416a35c9e635aaffb35/AMSpringboardDemo/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /AMSpringboardDemo/Resources/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J869 6 | 1306 7 | 1038.35 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 301 12 | 13 | 14 | YES 15 | IBProxyObject 16 | IBUITabBarItem 17 | IBUIViewController 18 | IBUICustomObject 19 | IBUITabBarController 20 | IBUIWindow 21 | IBUITabBar 22 | 23 | 24 | YES 25 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 26 | 27 | 28 | YES 29 | 30 | YES 31 | 32 | 33 | 34 | 35 | YES 36 | 37 | IBFilesOwner 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBFirstResponder 42 | IBCocoaTouchFramework 43 | 44 | 45 | IBCocoaTouchFramework 46 | 47 | 48 | 49 | 1316 50 | 51 | {320, 480} 52 | 53 | 1 54 | MSAxIDEAA 55 | 56 | NO 57 | NO 58 | 59 | IBCocoaTouchFramework 60 | YES 61 | 62 | 63 | 64 | 65 | 66 | 1 67 | 1 68 | 69 | IBCocoaTouchFramework 70 | NO 71 | 72 | 73 | DataSource 74 | IBCocoaTouchFramework 75 | 76 | 77 | 78 | DataSourceViewController 79 | 80 | 1 81 | 1 82 | 83 | IBCocoaTouchFramework 84 | NO 85 | 86 | 87 | YES 88 | 89 | 90 | 91 | DataProvider 92 | IBCocoaTouchFramework 93 | 94 | 95 | 96 | DataProviderViewController 97 | 98 | 1 99 | 1 100 | 101 | IBCocoaTouchFramework 102 | NO 103 | 104 | 105 | 106 | 107 | 266 108 | {{0, 431}, {320, 49}} 109 | 110 | 111 | 112 | 3 113 | MCAwAA 114 | 115 | IBCocoaTouchFramework 116 | 117 | YES 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | YES 128 | 129 | 130 | delegate 131 | 132 | 133 | 134 | 4 135 | 136 | 137 | 138 | window 139 | 140 | 141 | 142 | 5 143 | 144 | 145 | 146 | tabBarController 147 | 148 | 149 | 150 | 23 151 | 152 | 153 | 154 | 155 | YES 156 | 157 | 0 158 | 159 | 160 | 161 | 162 | 163 | 2 164 | 165 | 166 | YES 167 | 168 | 169 | 170 | 171 | -1 172 | 173 | 174 | File's Owner 175 | 176 | 177 | 3 178 | 179 | 180 | 181 | 182 | -2 183 | 184 | 185 | 186 | 187 | 17 188 | 189 | 190 | YES 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 18 199 | 200 | 201 | 202 | 203 | 19 204 | 205 | 206 | YES 207 | 208 | 209 | 210 | 211 | 212 | 20 213 | 214 | 215 | YES 216 | 217 | 218 | 219 | 220 | 221 | 21 222 | 223 | 224 | 225 | 226 | 22 227 | 228 | 229 | 230 | 231 | 232 | 233 | YES 234 | 235 | YES 236 | -1.CustomClassName 237 | -2.CustomClassName 238 | 17.IBPluginDependency 239 | 18.IBPluginDependency 240 | 19.CustomClassName 241 | 19.IBPluginDependency 242 | 2.IBAttributePlaceholdersKey 243 | 2.IBEditorWindowLastContentRect 244 | 2.IBPluginDependency 245 | 20.CustomClassName 246 | 20.IBPluginDependency 247 | 3.CustomClassName 248 | 3.IBPluginDependency 249 | 250 | 251 | YES 252 | UIApplication 253 | UIResponder 254 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 255 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 256 | DataSourceViewController 257 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 258 | 259 | YES 260 | 261 | 262 | 263 | {{654, 676}, {320, 480}} 264 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 265 | DataProviderViewController 266 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 267 | AMSpringboardDemoAppDelegate 268 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 269 | 270 | 271 | 272 | YES 273 | 274 | 275 | 276 | 277 | 278 | YES 279 | 280 | 281 | 282 | 283 | 23 284 | 285 | 286 | 287 | YES 288 | 289 | AMSpringboardDemoAppDelegate 290 | NSObject 291 | 292 | YES 293 | 294 | YES 295 | tabBarController 296 | window 297 | 298 | 299 | YES 300 | UITabBarController 301 | UIWindow 302 | 303 | 304 | 305 | YES 306 | 307 | YES 308 | tabBarController 309 | window 310 | 311 | 312 | YES 313 | 314 | tabBarController 315 | UITabBarController 316 | 317 | 318 | window 319 | UIWindow 320 | 321 | 322 | 323 | 324 | IBProjectSource 325 | ./Classes/AMSpringboardDemoAppDelegate.h 326 | 327 | 328 | 329 | AMSpringboardView 330 | UIView 331 | 332 | YES 333 | 334 | YES 335 | dataSource 336 | delegate 337 | 338 | 339 | YES 340 | id 341 | id 342 | 343 | 344 | 345 | YES 346 | 347 | YES 348 | dataSource 349 | delegate 350 | 351 | 352 | YES 353 | 354 | dataSource 355 | id 356 | 357 | 358 | delegate 359 | id 360 | 361 | 362 | 363 | 364 | IBProjectSource 365 | ./Classes/AMSpringboardView.h 366 | 367 | 368 | 369 | DataProviderViewController 370 | UIViewController 371 | 372 | springboardView 373 | AMSpringboardView 374 | 375 | 376 | springboardView 377 | 378 | springboardView 379 | AMSpringboardView 380 | 381 | 382 | 383 | IBProjectSource 384 | ./Classes/DataProviderViewController.h 385 | 386 | 387 | 388 | DataSourceViewController 389 | UIViewController 390 | 391 | IBProjectSource 392 | ./Classes/DataSourceViewController.h 393 | 394 | 395 | 396 | 397 | 0 398 | IBCocoaTouchFramework 399 | 400 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 401 | 402 | 403 | 404 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 405 | 406 | 407 | YES 408 | 3 409 | 301 410 | 411 | 412 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Resources/Springboard.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | pages 6 | 7 | 8 | 9 | image 10 | beer-icon 11 | title 12 | one 13 | 14 | 15 | identifier 16 | Null 17 | 18 | 19 | image 20 | beer-icon 21 | title 22 | two 23 | 24 | 25 | identifier 26 | Null 27 | 28 | 29 | image 30 | beer-icon 31 | title 32 | three 33 | 34 | 35 | image 36 | beer-icon 37 | title 38 | four 39 | 40 | 41 | 42 | 43 | image 44 | beer-icon 45 | title 46 | one 47 | 48 | 49 | identifier 50 | Null 51 | 52 | 53 | image 54 | beer-icon 55 | title 56 | two 57 | 58 | 59 | image 60 | beer-icon 61 | title 62 | three 63 | 64 | 65 | identifier 66 | Null 67 | 68 | 69 | image 70 | beer-icon 71 | title 72 | four 73 | 74 | 75 | 76 | rowCount 77 | 3 78 | columnCount 79 | 2 80 | version 81 | 1 82 | 83 | 84 | -------------------------------------------------------------------------------- /AMSpringboardDemo/Resources/beer-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amrox/AMSpringboard/eec0f60f9794495b854ed416a35c9e635aaffb35/AMSpringboardDemo/Resources/beer-icon.png -------------------------------------------------------------------------------- /AMSpringboardDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AMSpringboardView 4 | // 5 | // Created by Andy Mroczkowski on 2/18/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /AMSpringboardTests/AMSpringboardTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 0.2 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /AMSpringboardTests/AMSpringboardTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'AMSpringboardTests' target in the 'AMSpringboardTests' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /AMSpringboardTests/AMSpringboardTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardTests.h 3 | // AMSpringboardTests 4 | // 5 | // Created by Andy Mroczkowski on 4/6/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AMSpringboardTests : SenTestCase { 13 | @private 14 | 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AMSpringboardTests/AMSpringboardTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // AMSpringboardTests.m 3 | // AMSpringboardTests 4 | // 5 | // Created by Andy Mroczkowski on 4/6/11. 6 | // Copyright 2011 Andy Mroczkowski. All rights reserved. 7 | // 8 | 9 | #import "AMSpringboardTests.h" 10 | 11 | 12 | @implementation AMSpringboardTests 13 | 14 | - (void)setUp 15 | { 16 | [super setUp]; 17 | 18 | // Set-up code here. 19 | } 20 | 21 | - (void)tearDown 22 | { 23 | // Tear-down code here. 24 | 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample 29 | { 30 | STFail(@"Unit tests are not implemented yet in AMSpringboardTests"); 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /AMSpringboardTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Andy Mroczkowski 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, "6.0" 2 | 3 | target :AMSpringboard, :exclusive => true do 4 | pod 'AMFoundation', :git => 'https://github.com/amrox/AMFoundation.git' 5 | podspec :path => 'AMSpringboard.podspec' 6 | link_with 'AMSpringboardDemo' 7 | end 8 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AMFoundation (0.2.0) 3 | 4 | DEPENDENCIES: 5 | - AMFoundation (from `https://github.com/amrox/AMFoundation.git`) 6 | - AMFoundation (~> 0.2.0) 7 | 8 | EXTERNAL SOURCES: 9 | AMFoundation: 10 | :git: https://github.com/amrox/AMFoundation.git 11 | 12 | SPEC CHECKSUMS: 13 | AMFoundation: 5b33a1460255ba6f9cd25877c3c27fec51669eae 14 | 15 | COCOAPODS: 0.25.0 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AMSpringboard 2 | 3 | * Version: 0.2.1 4 | 5 | ## Changelog 6 | 7 | ### 0.2.1 8 | * Modernizations 9 | 10 | ### 0.2.0 11 | * Project reorganization 12 | * Including Demo App 13 | * Configurable cell highlight delay 14 | * Bugfixes 15 | 16 | ### 0.1.6 17 | * Using CocoaPods 18 | 19 | ### 0.1.5 20 | * minor bug 21 | 22 | ### 0.1.4 23 | * exposing AMSpringboardDataProvider : itemSpecifierForPosition 24 | 25 | ### 0.1.3 26 | * Added alwaysBounceHorizontal to SpringboardView 27 | * Updated AMUtility 28 | 29 | ### 0.1.2 30 | * File reorganization 31 | 32 | ### 0.1.1 33 | * Changed pages property of AMSpringboardDataProvider to be mutable 34 | 35 | ### 0.1 36 | * Initial commit 37 | --------------------------------------------------------------------------------