├── .gitignore ├── NavigationMenu.xcodeproj └── project.pbxproj ├── NavigationMenu ├── Default-568h@2x.png ├── Default.png ├── Default@2x.png ├── HAAppDelegate.h ├── HAAppDelegate.m ├── HAViewController.h ├── HAViewController.m ├── NavigationMenu-Info.plist ├── NavigationMenu-Prefix.pch ├── NavigationMenuView │ ├── SICellSelection.h │ ├── SICellSelection.m │ ├── SIMenuButton.h │ ├── SIMenuButton.m │ ├── SIMenuCell.h │ ├── SIMenuCell.m │ ├── SIMenuConfiguration.h │ ├── SIMenuConfiguration.m │ ├── SIMenuTable.h │ ├── SIMenuTable.m │ ├── SINavigationMenuView.h │ ├── SINavigationMenuView.m │ ├── UIColor+Extension.h │ ├── UIColor+Extension.m │ └── images │ │ ├── arrow_down.png │ │ ├── arrow_down1.png │ │ ├── arrow_down1@2x.png │ │ └── arrow_down@2x.png ├── en.lproj │ ├── HAViewController.xib │ └── InfoPlist.strings ├── logo.png └── main.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /NavigationMenu.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D706CD6116D3E76D005D2B53 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D706CD6016D3E76D005D2B53 /* UIKit.framework */; }; 11 | D706CD6316D3E76D005D2B53 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D706CD6216D3E76D005D2B53 /* Foundation.framework */; }; 12 | D706CD6516D3E76D005D2B53 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D706CD6416D3E76D005D2B53 /* CoreGraphics.framework */; }; 13 | D706CD6B16D3E76D005D2B53 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D706CD6916D3E76D005D2B53 /* InfoPlist.strings */; }; 14 | D706CD6D16D3E76D005D2B53 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D706CD6C16D3E76D005D2B53 /* main.m */; }; 15 | D706CD7116D3E76D005D2B53 /* HAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D706CD7016D3E76D005D2B53 /* HAAppDelegate.m */; }; 16 | D706CD7316D3E76D005D2B53 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = D706CD7216D3E76D005D2B53 /* Default.png */; }; 17 | D706CD7516D3E76D005D2B53 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D706CD7416D3E76D005D2B53 /* Default@2x.png */; }; 18 | D706CD7716D3E76D005D2B53 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D706CD7616D3E76D005D2B53 /* Default-568h@2x.png */; }; 19 | D706CD7A16D3E76D005D2B53 /* HAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D706CD7916D3E76D005D2B53 /* HAViewController.m */; }; 20 | D706CD7D16D3E76D005D2B53 /* HAViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D706CD7B16D3E76D005D2B53 /* HAViewController.xib */; }; 21 | D706CD8616D3E857005D2B53 /* SINavigationMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = D706CD8516D3E857005D2B53 /* SINavigationMenuView.m */; }; 22 | D706CD8916D3F214005D2B53 /* SIMenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D706CD8816D3F214005D2B53 /* SIMenuButton.m */; }; 23 | D706CD8C16D3FB0C005D2B53 /* SIMenuTable.m in Sources */ = {isa = PBXBuildFile; fileRef = D706CD8B16D3FB0C005D2B53 /* SIMenuTable.m */; }; 24 | D706CD8F16D40097005D2B53 /* SIMenuCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D706CD8E16D40097005D2B53 /* SIMenuCell.m */; }; 25 | D721F09316D4E2D900397C1F /* arrow_down.png in Resources */ = {isa = PBXBuildFile; fileRef = D721F09116D4E2D900397C1F /* arrow_down.png */; }; 26 | D721F09416D4E2D900397C1F /* arrow_down@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D721F09216D4E2D900397C1F /* arrow_down@2x.png */; }; 27 | D721F09616D4E53600397C1F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D721F09516D4E53600397C1F /* QuartzCore.framework */; }; 28 | D721F09916D4F27B00397C1F /* SIMenuConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = D721F09816D4F27B00397C1F /* SIMenuConfiguration.m */; }; 29 | D75952C616D5123F001B694F /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = D75952C516D5123F001B694F /* logo.png */; }; 30 | D75D641D16D62C7200B524FD /* arrow_down1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D75D641B16D62C7200B524FD /* arrow_down1@2x.png */; }; 31 | D75D641E16D62C7200B524FD /* arrow_down1.png in Resources */ = {isa = PBXBuildFile; fileRef = D75D641C16D62C7200B524FD /* arrow_down1.png */; }; 32 | D75D642016D6351200B524FD /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = D75D641F16D6351200B524FD /* README.md */; }; 33 | D75D642316D65EB100B524FD /* UIColor+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = D75D642216D65EB100B524FD /* UIColor+Extension.m */; }; 34 | D75D642616D668AB00B524FD /* SICellSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = D75D642516D668AB00B524FD /* SICellSelection.m */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | D706CD5D16D3E76D005D2B53 /* NavigationMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationMenu.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | D706CD6016D3E76D005D2B53 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 40 | D706CD6216D3E76D005D2B53 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | D706CD6416D3E76D005D2B53 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | D706CD6816D3E76D005D2B53 /* NavigationMenu-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NavigationMenu-Info.plist"; sourceTree = ""; }; 43 | D706CD6A16D3E76D005D2B53 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | D706CD6C16D3E76D005D2B53 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | D706CD6E16D3E76D005D2B53 /* NavigationMenu-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NavigationMenu-Prefix.pch"; sourceTree = ""; }; 46 | D706CD6F16D3E76D005D2B53 /* HAAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HAAppDelegate.h; sourceTree = ""; }; 47 | D706CD7016D3E76D005D2B53 /* HAAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HAAppDelegate.m; sourceTree = ""; }; 48 | D706CD7216D3E76D005D2B53 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 49 | D706CD7416D3E76D005D2B53 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 50 | D706CD7616D3E76D005D2B53 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 51 | D706CD7816D3E76D005D2B53 /* HAViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HAViewController.h; sourceTree = ""; }; 52 | D706CD7916D3E76D005D2B53 /* HAViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HAViewController.m; sourceTree = ""; }; 53 | D706CD7C16D3E76D005D2B53 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/HAViewController.xib; sourceTree = ""; }; 54 | D706CD8416D3E857005D2B53 /* SINavigationMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SINavigationMenuView.h; sourceTree = ""; }; 55 | D706CD8516D3E857005D2B53 /* SINavigationMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SINavigationMenuView.m; sourceTree = ""; }; 56 | D706CD8716D3F214005D2B53 /* SIMenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SIMenuButton.h; sourceTree = ""; }; 57 | D706CD8816D3F214005D2B53 /* SIMenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SIMenuButton.m; sourceTree = ""; }; 58 | D706CD8A16D3FB0C005D2B53 /* SIMenuTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SIMenuTable.h; sourceTree = ""; }; 59 | D706CD8B16D3FB0C005D2B53 /* SIMenuTable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SIMenuTable.m; sourceTree = ""; }; 60 | D706CD8D16D40097005D2B53 /* SIMenuCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SIMenuCell.h; sourceTree = ""; }; 61 | D706CD8E16D40097005D2B53 /* SIMenuCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SIMenuCell.m; sourceTree = ""; }; 62 | D721F09116D4E2D900397C1F /* arrow_down.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow_down.png; sourceTree = ""; }; 63 | D721F09216D4E2D900397C1F /* arrow_down@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow_down@2x.png"; sourceTree = ""; }; 64 | D721F09516D4E53600397C1F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 65 | D721F09716D4F27B00397C1F /* SIMenuConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SIMenuConfiguration.h; sourceTree = ""; }; 66 | D721F09816D4F27B00397C1F /* SIMenuConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SIMenuConfiguration.m; sourceTree = ""; }; 67 | D75952C516D5123F001B694F /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; 68 | D75D641B16D62C7200B524FD /* arrow_down1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow_down1@2x.png"; sourceTree = ""; }; 69 | D75D641C16D62C7200B524FD /* arrow_down1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow_down1.png; sourceTree = ""; }; 70 | D75D641F16D6351200B524FD /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = ""; }; 71 | D75D642116D65EB000B524FD /* UIColor+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Extension.h"; sourceTree = ""; }; 72 | D75D642216D65EB100B524FD /* UIColor+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Extension.m"; sourceTree = ""; }; 73 | D75D642416D668AB00B524FD /* SICellSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SICellSelection.h; sourceTree = ""; }; 74 | D75D642516D668AB00B524FD /* SICellSelection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SICellSelection.m; sourceTree = ""; }; 75 | /* End PBXFileReference section */ 76 | 77 | /* Begin PBXFrameworksBuildPhase section */ 78 | D706CD5A16D3E76D005D2B53 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | D721F09616D4E53600397C1F /* QuartzCore.framework in Frameworks */, 83 | D706CD6116D3E76D005D2B53 /* UIKit.framework in Frameworks */, 84 | D706CD6316D3E76D005D2B53 /* Foundation.framework in Frameworks */, 85 | D706CD6516D3E76D005D2B53 /* CoreGraphics.framework in Frameworks */, 86 | ); 87 | runOnlyForDeploymentPostprocessing = 0; 88 | }; 89 | /* End PBXFrameworksBuildPhase section */ 90 | 91 | /* Begin PBXGroup section */ 92 | D706CD5416D3E76D005D2B53 = { 93 | isa = PBXGroup; 94 | children = ( 95 | D75D641F16D6351200B524FD /* README.md */, 96 | D706CD6616D3E76D005D2B53 /* NavigationMenu */, 97 | D706CD5F16D3E76D005D2B53 /* Frameworks */, 98 | D706CD5E16D3E76D005D2B53 /* Products */, 99 | ); 100 | sourceTree = ""; 101 | }; 102 | D706CD5E16D3E76D005D2B53 /* Products */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | D706CD5D16D3E76D005D2B53 /* NavigationMenu.app */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | D706CD5F16D3E76D005D2B53 /* Frameworks */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | D721F09516D4E53600397C1F /* QuartzCore.framework */, 114 | D706CD6016D3E76D005D2B53 /* UIKit.framework */, 115 | D706CD6216D3E76D005D2B53 /* Foundation.framework */, 116 | D706CD6416D3E76D005D2B53 /* CoreGraphics.framework */, 117 | ); 118 | name = Frameworks; 119 | sourceTree = ""; 120 | }; 121 | D706CD6616D3E76D005D2B53 /* NavigationMenu */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | D75952C516D5123F001B694F /* logo.png */, 125 | D706CD8316D3E7A0005D2B53 /* NavigationMenuView */, 126 | D706CD6F16D3E76D005D2B53 /* HAAppDelegate.h */, 127 | D706CD7016D3E76D005D2B53 /* HAAppDelegate.m */, 128 | D706CD7816D3E76D005D2B53 /* HAViewController.h */, 129 | D706CD7916D3E76D005D2B53 /* HAViewController.m */, 130 | D706CD7B16D3E76D005D2B53 /* HAViewController.xib */, 131 | D706CD6716D3E76D005D2B53 /* Supporting Files */, 132 | ); 133 | path = NavigationMenu; 134 | sourceTree = ""; 135 | }; 136 | D706CD6716D3E76D005D2B53 /* Supporting Files */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | D706CD6816D3E76D005D2B53 /* NavigationMenu-Info.plist */, 140 | D706CD6916D3E76D005D2B53 /* InfoPlist.strings */, 141 | D706CD6C16D3E76D005D2B53 /* main.m */, 142 | D706CD6E16D3E76D005D2B53 /* NavigationMenu-Prefix.pch */, 143 | D706CD7216D3E76D005D2B53 /* Default.png */, 144 | D706CD7416D3E76D005D2B53 /* Default@2x.png */, 145 | D706CD7616D3E76D005D2B53 /* Default-568h@2x.png */, 146 | ); 147 | name = "Supporting Files"; 148 | sourceTree = ""; 149 | }; 150 | D706CD8316D3E7A0005D2B53 /* NavigationMenuView */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | D721F09016D4E2D900397C1F /* images */, 154 | D75D642116D65EB000B524FD /* UIColor+Extension.h */, 155 | D75D642216D65EB100B524FD /* UIColor+Extension.m */, 156 | D706CD8416D3E857005D2B53 /* SINavigationMenuView.h */, 157 | D706CD8516D3E857005D2B53 /* SINavigationMenuView.m */, 158 | D721F09716D4F27B00397C1F /* SIMenuConfiguration.h */, 159 | D721F09816D4F27B00397C1F /* SIMenuConfiguration.m */, 160 | D706CD8A16D3FB0C005D2B53 /* SIMenuTable.h */, 161 | D706CD8B16D3FB0C005D2B53 /* SIMenuTable.m */, 162 | D706CD8D16D40097005D2B53 /* SIMenuCell.h */, 163 | D706CD8E16D40097005D2B53 /* SIMenuCell.m */, 164 | D75D642416D668AB00B524FD /* SICellSelection.h */, 165 | D75D642516D668AB00B524FD /* SICellSelection.m */, 166 | D706CD8716D3F214005D2B53 /* SIMenuButton.h */, 167 | D706CD8816D3F214005D2B53 /* SIMenuButton.m */, 168 | ); 169 | path = NavigationMenuView; 170 | sourceTree = ""; 171 | }; 172 | D721F09016D4E2D900397C1F /* images */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | D75D641B16D62C7200B524FD /* arrow_down1@2x.png */, 176 | D75D641C16D62C7200B524FD /* arrow_down1.png */, 177 | D721F09116D4E2D900397C1F /* arrow_down.png */, 178 | D721F09216D4E2D900397C1F /* arrow_down@2x.png */, 179 | ); 180 | path = images; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXGroup section */ 184 | 185 | /* Begin PBXNativeTarget section */ 186 | D706CD5C16D3E76D005D2B53 /* NavigationMenu */ = { 187 | isa = PBXNativeTarget; 188 | buildConfigurationList = D706CD8016D3E76D005D2B53 /* Build configuration list for PBXNativeTarget "NavigationMenu" */; 189 | buildPhases = ( 190 | D706CD5916D3E76D005D2B53 /* Sources */, 191 | D706CD5A16D3E76D005D2B53 /* Frameworks */, 192 | D706CD5B16D3E76D005D2B53 /* Resources */, 193 | ); 194 | buildRules = ( 195 | ); 196 | dependencies = ( 197 | ); 198 | name = NavigationMenu; 199 | productName = NavigationMenu; 200 | productReference = D706CD5D16D3E76D005D2B53 /* NavigationMenu.app */; 201 | productType = "com.apple.product-type.application"; 202 | }; 203 | /* End PBXNativeTarget section */ 204 | 205 | /* Begin PBXProject section */ 206 | D706CD5516D3E76D005D2B53 /* Project object */ = { 207 | isa = PBXProject; 208 | attributes = { 209 | CLASSPREFIX = SA; 210 | LastUpgradeCheck = 0460; 211 | ORGANIZATIONNAME = "Ivan Sapozhnik"; 212 | }; 213 | buildConfigurationList = D706CD5816D3E76D005D2B53 /* Build configuration list for PBXProject "NavigationMenu" */; 214 | compatibilityVersion = "Xcode 3.2"; 215 | developmentRegion = English; 216 | hasScannedForEncodings = 0; 217 | knownRegions = ( 218 | en, 219 | ); 220 | mainGroup = D706CD5416D3E76D005D2B53; 221 | productRefGroup = D706CD5E16D3E76D005D2B53 /* Products */; 222 | projectDirPath = ""; 223 | projectRoot = ""; 224 | targets = ( 225 | D706CD5C16D3E76D005D2B53 /* NavigationMenu */, 226 | ); 227 | }; 228 | /* End PBXProject section */ 229 | 230 | /* Begin PBXResourcesBuildPhase section */ 231 | D706CD5B16D3E76D005D2B53 /* Resources */ = { 232 | isa = PBXResourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | D706CD6B16D3E76D005D2B53 /* InfoPlist.strings in Resources */, 236 | D706CD7316D3E76D005D2B53 /* Default.png in Resources */, 237 | D706CD7516D3E76D005D2B53 /* Default@2x.png in Resources */, 238 | D706CD7716D3E76D005D2B53 /* Default-568h@2x.png in Resources */, 239 | D706CD7D16D3E76D005D2B53 /* HAViewController.xib in Resources */, 240 | D721F09316D4E2D900397C1F /* arrow_down.png in Resources */, 241 | D721F09416D4E2D900397C1F /* arrow_down@2x.png in Resources */, 242 | D75952C616D5123F001B694F /* logo.png in Resources */, 243 | D75D641D16D62C7200B524FD /* arrow_down1@2x.png in Resources */, 244 | D75D641E16D62C7200B524FD /* arrow_down1.png in Resources */, 245 | D75D642016D6351200B524FD /* README.md in Resources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | /* End PBXResourcesBuildPhase section */ 250 | 251 | /* Begin PBXSourcesBuildPhase section */ 252 | D706CD5916D3E76D005D2B53 /* Sources */ = { 253 | isa = PBXSourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | D706CD6D16D3E76D005D2B53 /* main.m in Sources */, 257 | D706CD7116D3E76D005D2B53 /* HAAppDelegate.m in Sources */, 258 | D706CD7A16D3E76D005D2B53 /* HAViewController.m in Sources */, 259 | D706CD8616D3E857005D2B53 /* SINavigationMenuView.m in Sources */, 260 | D706CD8916D3F214005D2B53 /* SIMenuButton.m in Sources */, 261 | D706CD8C16D3FB0C005D2B53 /* SIMenuTable.m in Sources */, 262 | D706CD8F16D40097005D2B53 /* SIMenuCell.m in Sources */, 263 | D721F09916D4F27B00397C1F /* SIMenuConfiguration.m in Sources */, 264 | D75D642316D65EB100B524FD /* UIColor+Extension.m in Sources */, 265 | D75D642616D668AB00B524FD /* SICellSelection.m in Sources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | /* End PBXSourcesBuildPhase section */ 270 | 271 | /* Begin PBXVariantGroup section */ 272 | D706CD6916D3E76D005D2B53 /* InfoPlist.strings */ = { 273 | isa = PBXVariantGroup; 274 | children = ( 275 | D706CD6A16D3E76D005D2B53 /* en */, 276 | ); 277 | name = InfoPlist.strings; 278 | sourceTree = ""; 279 | }; 280 | D706CD7B16D3E76D005D2B53 /* HAViewController.xib */ = { 281 | isa = PBXVariantGroup; 282 | children = ( 283 | D706CD7C16D3E76D005D2B53 /* en */, 284 | ); 285 | name = HAViewController.xib; 286 | sourceTree = ""; 287 | }; 288 | /* End PBXVariantGroup section */ 289 | 290 | /* Begin XCBuildConfiguration section */ 291 | D706CD7E16D3E76D005D2B53 /* Debug */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ALWAYS_SEARCH_USER_PATHS = NO; 295 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 296 | CLANG_CXX_LIBRARY = "libc++"; 297 | CLANG_ENABLE_OBJC_ARC = YES; 298 | CLANG_WARN_CONSTANT_CONVERSION = YES; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 303 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 304 | COPY_PHASE_STRIP = NO; 305 | GCC_C_LANGUAGE_STANDARD = gnu99; 306 | GCC_DYNAMIC_NO_PIC = NO; 307 | GCC_OPTIMIZATION_LEVEL = 0; 308 | GCC_PREPROCESSOR_DEFINITIONS = ( 309 | "DEBUG=1", 310 | "$(inherited)", 311 | ); 312 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 314 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 317 | ONLY_ACTIVE_ARCH = YES; 318 | SDKROOT = iphoneos; 319 | }; 320 | name = Debug; 321 | }; 322 | D706CD7F16D3E76D005D2B53 /* Release */ = { 323 | isa = XCBuildConfiguration; 324 | buildSettings = { 325 | ALWAYS_SEARCH_USER_PATHS = NO; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_OBJC_ARC = YES; 329 | CLANG_WARN_CONSTANT_CONVERSION = YES; 330 | CLANG_WARN_EMPTY_BODY = YES; 331 | CLANG_WARN_ENUM_CONVERSION = YES; 332 | CLANG_WARN_INT_CONVERSION = YES; 333 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 334 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 335 | COPY_PHASE_STRIP = YES; 336 | GCC_C_LANGUAGE_STANDARD = gnu99; 337 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 338 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 339 | GCC_WARN_UNUSED_VARIABLE = YES; 340 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 341 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 342 | SDKROOT = iphoneos; 343 | VALIDATE_PRODUCT = YES; 344 | }; 345 | name = Release; 346 | }; 347 | D706CD8116D3E76D005D2B53 /* Debug */ = { 348 | isa = XCBuildConfiguration; 349 | buildSettings = { 350 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 351 | GCC_PREFIX_HEADER = "NavigationMenu/NavigationMenu-Prefix.pch"; 352 | INFOPLIST_FILE = "NavigationMenu/NavigationMenu-Info.plist"; 353 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 354 | PRODUCT_NAME = "$(TARGET_NAME)"; 355 | TARGETED_DEVICE_FAMILY = "1,2"; 356 | WRAPPER_EXTENSION = app; 357 | }; 358 | name = Debug; 359 | }; 360 | D706CD8216D3E76D005D2B53 /* Release */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 364 | GCC_PREFIX_HEADER = "NavigationMenu/NavigationMenu-Prefix.pch"; 365 | INFOPLIST_FILE = "NavigationMenu/NavigationMenu-Info.plist"; 366 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | TARGETED_DEVICE_FAMILY = "1,2"; 369 | WRAPPER_EXTENSION = app; 370 | }; 371 | name = Release; 372 | }; 373 | /* End XCBuildConfiguration section */ 374 | 375 | /* Begin XCConfigurationList section */ 376 | D706CD5816D3E76D005D2B53 /* Build configuration list for PBXProject "NavigationMenu" */ = { 377 | isa = XCConfigurationList; 378 | buildConfigurations = ( 379 | D706CD7E16D3E76D005D2B53 /* Debug */, 380 | D706CD7F16D3E76D005D2B53 /* Release */, 381 | ); 382 | defaultConfigurationIsVisible = 0; 383 | defaultConfigurationName = Release; 384 | }; 385 | D706CD8016D3E76D005D2B53 /* Build configuration list for PBXNativeTarget "NavigationMenu" */ = { 386 | isa = XCConfigurationList; 387 | buildConfigurations = ( 388 | D706CD8116D3E76D005D2B53 /* Debug */, 389 | D706CD8216D3E76D005D2B53 /* Release */, 390 | ); 391 | defaultConfigurationIsVisible = 0; 392 | defaultConfigurationName = Release; 393 | }; 394 | /* End XCConfigurationList section */ 395 | }; 396 | rootObject = D706CD5516D3E76D005D2B53 /* Project object */; 397 | } 398 | -------------------------------------------------------------------------------- /NavigationMenu/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iSapozhnik/NavigationMenu/ed922ea5fdb4044bfd70bf7342aeb00a6e73c855/NavigationMenu/Default-568h@2x.png -------------------------------------------------------------------------------- /NavigationMenu/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iSapozhnik/NavigationMenu/ed922ea5fdb4044bfd70bf7342aeb00a6e73c855/NavigationMenu/Default.png -------------------------------------------------------------------------------- /NavigationMenu/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iSapozhnik/NavigationMenu/ed922ea5fdb4044bfd70bf7342aeb00a6e73c855/NavigationMenu/Default@2x.png -------------------------------------------------------------------------------- /NavigationMenu/HAAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // HAAppDelegate.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class HAViewController; 12 | 13 | @interface HAAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) HAViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /NavigationMenu/HAAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // HAAppDelegate.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "HAAppDelegate.h" 10 | #import "HAViewController.h" 11 | 12 | @implementation HAAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | self.viewController = [[HAViewController alloc] initWithNibName:@"HAViewController" bundle:nil]; 18 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:self.viewController]; 19 | [self.window makeKeyAndVisible]; 20 | return YES; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /NavigationMenu/HAViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HAViewController.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SINavigationMenuView.h" 11 | 12 | @interface HAViewController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /NavigationMenu/HAViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HAViewController.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "HAViewController.h" 10 | 11 | @interface HAViewController () 12 | 13 | @end 14 | 15 | @implementation HAViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | if (self.navigationItem) { 21 | CGRect frame = CGRectMake(0.0, 0.0, 200.0, self.navigationController.navigationBar.bounds.size.height); 22 | SINavigationMenuView *menu = [[SINavigationMenuView alloc] initWithFrame:frame title:@"Menu"]; 23 | [menu displayMenuInView:self.navigationController.view]; 24 | menu.items = @[@"News", @"Top Articles", @"Messages", @"Account", @"Settings", @"Top Articles", @"Messages"]; 25 | menu.delegate = self; 26 | self.navigationItem.titleView = menu; 27 | } 28 | 29 | UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain]; 30 | tableView.delegate = self; 31 | tableView.dataSource = self; 32 | [self.view addSubview:tableView]; 33 | } 34 | 35 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 36 | { 37 | return 20; 38 | } 39 | 40 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 41 | { 42 | static NSString *cellId = @"CellId"; 43 | 44 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; 45 | 46 | if (nil == cell) 47 | { 48 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; 49 | } 50 | 51 | cell.textLabel.text = [NSString stringWithFormat:@"Cell %d",indexPath.row]; 52 | 53 | return cell; 54 | } 55 | 56 | - (void)didSelectItemAtIndex:(NSUInteger)index 57 | { 58 | NSLog(@"did selected item at index %d", index); 59 | } 60 | 61 | - (void)didReceiveMemoryWarning 62 | { 63 | [super didReceiveMemoryWarning]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenu-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.heavylightapps.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenu-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NavigationMenu' target in the 'NavigationMenu' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SICellSelection.h: -------------------------------------------------------------------------------- 1 | // 2 | // SICellSelection.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/21/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SICellSelection : UIView 12 | - (id)initWithFrame:(CGRect)frame andColor:(UIColor *)baseColor_; 13 | @end 14 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SICellSelection.m: -------------------------------------------------------------------------------- 1 | // 2 | // SICellSelection.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/21/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "SICellSelection.h" 10 | #import 11 | 12 | @interface SICellSelection () 13 | @property (nonatomic, strong) UIColor *baseColor; 14 | @end 15 | 16 | @implementation SICellSelection 17 | 18 | - (id)initWithFrame:(CGRect)frame andColor:(UIColor *)baseColor_ 19 | { 20 | self = [super initWithFrame:frame]; 21 | if (self) { 22 | self.baseColor = baseColor_; 23 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)drawRect:(CGRect)rect 29 | { 30 | [super drawRect:rect]; 31 | 32 | CGFloat hue; 33 | CGFloat saturation; 34 | CGFloat brightness; 35 | CGFloat alpha; 36 | 37 | if([self.baseColor getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha]){ 38 | brightness -= 0.35; 39 | } 40 | 41 | UIColor * highColor = self.baseColor; 42 | UIColor * lowColor = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:alpha]; 43 | 44 | CAGradientLayer * gradient = [CAGradientLayer layer]; 45 | [gradient setFrame:[self bounds]]; 46 | [gradient setColors:[NSArray arrayWithObjects:(id)[highColor CGColor], (id)[lowColor CGColor], nil]]; 47 | [[self layer] addSublayer:gradient]; 48 | 49 | [self setNeedsDisplay]; 50 | } 51 | 52 | - (void)dealloc 53 | { 54 | self.baseColor = nil; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SIMenuButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // SAMenuButton.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SIMenuButton : UIControl 12 | 13 | @property (nonatomic, unsafe_unretained) BOOL isActive; 14 | @property (nonatomic) CGGradientRef spotlightGradientRef; 15 | @property (unsafe_unretained) CGFloat spotlightStartRadius; 16 | @property (unsafe_unretained) float spotlightEndRadius; 17 | @property (unsafe_unretained) CGPoint spotlightCenter; 18 | @property (nonatomic, strong) UILabel *title; 19 | @property (nonatomic, strong) UIImageView *arrow; 20 | 21 | - (UIImageView *)defaultGradient; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SIMenuButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // SAMenuButton.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "SIMenuButton.h" 10 | #import "SIMenuConfiguration.h" 11 | 12 | @implementation SIMenuButton 13 | 14 | - (id)initWithFrame:(CGRect)frame 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | if ([self defaultGradient]) { 19 | 20 | } else { 21 | [self setSpotlightCenter:CGPointMake(frame.size.width/2, frame.size.height*(-1)+10)]; 22 | [self setBackgroundColor:[UIColor clearColor]]; 23 | [self setSpotlightStartRadius:0]; 24 | [self setSpotlightEndRadius:frame.size.width/2]; 25 | } 26 | 27 | frame.origin.y -= 2.0; 28 | self.title = [[UILabel alloc] initWithFrame:frame]; 29 | self.title.textAlignment = NSTextAlignmentCenter; 30 | self.title.backgroundColor = [UIColor clearColor]; 31 | NSDictionary *currentStyle = [[UINavigationBar appearance] titleTextAttributes]; 32 | self.title.textColor = currentStyle[UITextAttributeTextColor]; 33 | self.title.font = currentStyle[UITextAttributeFont]; 34 | self.title.shadowColor = currentStyle[UITextAttributeTextShadowColor]; 35 | NSValue *shadowOffset = currentStyle[UITextAttributeTextShadowOffset]; 36 | self.title.shadowOffset = shadowOffset.CGSizeValue; 37 | [self addSubview:self.title]; 38 | 39 | self.arrow = [[UIImageView alloc] initWithImage:[SIMenuConfiguration arrowImage]]; 40 | [self addSubview:self.arrow]; 41 | } 42 | return self; 43 | } 44 | 45 | - (UIImageView *)defaultGradient 46 | { 47 | return nil; 48 | } 49 | 50 | - (void)layoutSubviews 51 | { 52 | [self.title sizeToFit]; 53 | self.title.center = CGPointMake(self.frame.size.width/2, (self.frame.size.height-2.0)/2); 54 | self.arrow.center = CGPointMake(CGRectGetMaxX(self.title.frame) + [SIMenuConfiguration arrowPadding], self.frame.size.height / 2); 55 | } 56 | 57 | #pragma mark - 58 | #pragma mark Handle taps 59 | - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event 60 | { 61 | self.isActive = !self.isActive; 62 | CGGradientRef defaultGradientRef = [[self class] newSpotlightGradient]; 63 | [self setSpotlightGradientRef:defaultGradientRef]; 64 | CGGradientRelease(defaultGradientRef); 65 | return YES; 66 | } 67 | - (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event 68 | { 69 | return YES; 70 | } 71 | - (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event 72 | { 73 | self.spotlightGradientRef = nil; 74 | } 75 | - (void)cancelTrackingWithEvent:(UIEvent *)event 76 | { 77 | self.spotlightGradientRef = nil; 78 | } 79 | 80 | #pragma mark - Drawing Override 81 | - (void)drawRect:(CGRect)rect 82 | { 83 | CGContextRef context = UIGraphicsGetCurrentContext(); 84 | CGGradientRef gradient = self.spotlightGradientRef; 85 | float radius = self.spotlightEndRadius; 86 | float startRadius = self.spotlightStartRadius; 87 | CGContextDrawRadialGradient (context, gradient, self.spotlightCenter, startRadius, self.spotlightCenter, radius, kCGGradientDrawsAfterEndLocation); 88 | } 89 | 90 | 91 | #pragma mark - Factory Method 92 | 93 | + (CGGradientRef)newSpotlightGradient 94 | { 95 | size_t locationsCount = 2; 96 | CGFloat locations[2] = {1.0f, 0.0f,}; 97 | CGFloat colors[12] = {0.0f,0.0f,0.0f,0.0f, 98 | 0.0f,0.0f,0.0f,0.55f}; 99 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 100 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); 101 | CGColorSpaceRelease(colorSpace); 102 | 103 | return gradient; 104 | } 105 | 106 | - (void)setSpotlightGradientRef:(CGGradientRef)newSpotlightGradientRef 107 | { 108 | CGGradientRelease(_spotlightGradientRef); 109 | _spotlightGradientRef = nil; 110 | 111 | _spotlightGradientRef = newSpotlightGradientRef; 112 | CGGradientRetain(_spotlightGradientRef); 113 | 114 | [self setNeedsDisplay]; 115 | } 116 | 117 | #pragma mark - Deallocation 118 | 119 | - (void)dealloc 120 | { 121 | [self setSpotlightGradientRef:nil]; 122 | } 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SIMenuCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // SAMenuCell.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SIMenuCell : UITableViewCell 12 | - (void)setSelected:(BOOL)selected withCompletionBlock:(void (^)())completion; 13 | @end 14 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SIMenuCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // SAMenuCell.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "SIMenuCell.h" 10 | #import "SIMenuConfiguration.h" 11 | #import "UIColor+Extension.h" 12 | #import "SICellSelection.h" 13 | #import 14 | 15 | @interface SIMenuCell () 16 | @property (nonatomic, strong) SICellSelection *cellSelection; 17 | @end 18 | 19 | @implementation SIMenuCell 20 | 21 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 22 | { 23 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 24 | if (self) { 25 | self.contentView.backgroundColor = [UIColor color:[SIMenuConfiguration itemsColor] withAlpha:[SIMenuConfiguration menuAlpha]]; 26 | self.textLabel.textColor = [SIMenuConfiguration itemTextColor]; 27 | self.textLabel.textAlignment = NSTextAlignmentCenter; 28 | self.textLabel.shadowColor = [UIColor darkGrayColor]; 29 | self.textLabel.shadowOffset = CGSizeMake(0.0, -1.0); 30 | 31 | self.selectionStyle = UITableViewCellEditingStyleNone; 32 | 33 | self.cellSelection = [[SICellSelection alloc] initWithFrame:self.bounds andColor:[SIMenuConfiguration selectionColor]]; 34 | [self.cellSelection.layer setCornerRadius:6.0]; 35 | [self.cellSelection.layer setMasksToBounds:YES]; 36 | 37 | self.cellSelection.alpha = 0.0; 38 | [self.contentView insertSubview:self.cellSelection belowSubview:self.textLabel]; 39 | } 40 | return self; 41 | } 42 | 43 | - (void)drawRect:(CGRect)rect { 44 | [super drawRect:rect]; 45 | 46 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 47 | CGContextSetLineWidth(ctx, 2.0f); 48 | 49 | CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); 50 | CGContextMoveToPoint(ctx, 0, self.contentView.bounds.size.height); 51 | CGContextAddLineToPoint(ctx, self.contentView.bounds.size.width, self.contentView.bounds.size.height); 52 | CGContextStrokePath(ctx); 53 | 54 | CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 1.0f, 0.7f); 55 | 56 | CGContextMoveToPoint(ctx, 0, 0); 57 | CGContextAddLineToPoint(ctx, self.contentView.bounds.size.width, 0); 58 | CGContextStrokePath(ctx); 59 | 60 | } 61 | 62 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 63 | { 64 | [super setSelected:selected animated:animated]; 65 | } 66 | 67 | - (void)setSelected:(BOOL)selected withCompletionBlock:(void (^)())completion 68 | { 69 | float alpha = 0.0; 70 | if (selected) { 71 | alpha = 1.0; 72 | } else { 73 | alpha = 0.0; 74 | } 75 | [UIView animateWithDuration:[SIMenuConfiguration selectionSpeed] animations:^{ 76 | self.cellSelection.alpha = alpha; 77 | } completion:^(BOOL finished) { 78 | completion(); 79 | }]; 80 | } 81 | 82 | - (void)dealloc 83 | { 84 | self.cellSelection = nil; 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SIMenuConfiguration.h: -------------------------------------------------------------------------------- 1 | // 2 | // SIMenuConfiguration.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/20/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SIMenuConfiguration : NSObject 12 | //Menu width 13 | + (float)menuWidth; 14 | 15 | //Menu item height 16 | + (float)itemCellHeight; 17 | 18 | //Animation duration of menu appearence 19 | + (float)animationDuration; 20 | 21 | //Menu substrate alpha value 22 | + (float)backgroundAlpha; 23 | 24 | //Menu alpha value 25 | + (float)menuAlpha; 26 | 27 | //Value of bounce 28 | + (float)bounceOffset; 29 | 30 | //Arrow image near title 31 | + (UIImage *)arrowImage; 32 | 33 | //Distance between Title and arrow image 34 | + (float)arrowPadding; 35 | 36 | //Items color in menu 37 | + (UIColor *)itemsColor; 38 | 39 | //Menu color 40 | + (UIColor *)mainColor; 41 | 42 | //Item selection animation speed 43 | + (float)selectionSpeed; 44 | 45 | //Menu item text color 46 | + (UIColor *)itemTextColor; 47 | 48 | //Selection color 49 | + (UIColor *)selectionColor; 50 | @end 51 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SIMenuConfiguration.m: -------------------------------------------------------------------------------- 1 | // 2 | // SIMenuConfiguration.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/20/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "SIMenuConfiguration.h" 10 | 11 | @implementation SIMenuConfiguration 12 | //Menu width 13 | + (float)menuWidth 14 | { 15 | UIWindow *window = [[UIApplication sharedApplication] keyWindow]; 16 | return window.frame.size.width; 17 | } 18 | 19 | //Menu item height 20 | + (float)itemCellHeight 21 | { 22 | return 44.0f; 23 | } 24 | 25 | //Animation duration of menu appearence 26 | + (float)animationDuration 27 | { 28 | return 0.3f; 29 | } 30 | 31 | //Menu substrate alpha value 32 | + (float)backgroundAlpha 33 | { 34 | return 0.6; 35 | } 36 | 37 | //Menu alpha value 38 | + (float)menuAlpha 39 | { 40 | return 0.8; 41 | } 42 | 43 | //Value of bounce 44 | + (float)bounceOffset 45 | { 46 | return -7.0; 47 | } 48 | 49 | //Arrow image near title 50 | + (UIImage *)arrowImage 51 | { 52 | return [UIImage imageNamed:@"arrow_down.png"]; 53 | } 54 | 55 | //Distance between Title and arrow image 56 | + (float)arrowPadding 57 | { 58 | return 13.0; 59 | } 60 | 61 | //Items color in menu 62 | + (UIColor *)itemsColor 63 | { 64 | return [UIColor blackColor]; 65 | } 66 | 67 | + (UIColor *)mainColor 68 | { 69 | return [UIColor blackColor]; 70 | } 71 | 72 | + (float)selectionSpeed 73 | { 74 | return 0.15; 75 | } 76 | 77 | + (UIColor *)itemTextColor 78 | { 79 | return [UIColor whiteColor]; 80 | } 81 | 82 | + (UIColor *)selectionColor 83 | { 84 | return [UIColor colorWithRed:45.0/255.0 green:105.0/255.0 blue:166.0/255.0 alpha:1.0]; 85 | } 86 | @end 87 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SIMenuTable.h: -------------------------------------------------------------------------------- 1 | // 2 | // SAMenuTable.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol SIMenuDelegate 12 | - (void)didBackgroundTap; 13 | - (void)didSelectItemAtIndex:(NSUInteger)index; 14 | @end 15 | 16 | @interface SIMenuTable : UIView 17 | 18 | @property (nonatomic, weak) id menuDelegate; 19 | 20 | - (id)initWithFrame:(CGRect)frame items:(NSArray *)items; 21 | - (void)show; 22 | - (void)hide; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SIMenuTable.m: -------------------------------------------------------------------------------- 1 | // 2 | // SAMenuTable.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "SIMenuTable.h" 10 | #import "SIMenuCell.h" 11 | #import "SIMenuConfiguration.h" 12 | #import 13 | #import "UIColor+Extension.h" 14 | #import "SICellSelection.h" 15 | 16 | @interface SIMenuTable () { 17 | CGRect endFrame; 18 | CGRect startFrame; 19 | NSIndexPath *currentIndexPath; 20 | } 21 | @property (nonatomic, strong) UITableView *table; 22 | @property (nonatomic, strong) NSArray *items; 23 | @end 24 | 25 | @implementation SIMenuTable 26 | 27 | - (id)initWithFrame:(CGRect)frame items:(NSArray *)items 28 | { 29 | self = [super initWithFrame:frame]; 30 | if (self) { 31 | self.items = [NSArray arrayWithArray:items]; 32 | 33 | self.layer.backgroundColor = [UIColor color:[SIMenuConfiguration mainColor] withAlpha:0.0].CGColor; 34 | self.clipsToBounds = YES; 35 | 36 | endFrame = self.bounds; 37 | startFrame = endFrame; 38 | startFrame.origin.y -= self.items.count*[SIMenuConfiguration itemCellHeight]; 39 | 40 | self.table = [[UITableView alloc] initWithFrame:startFrame style:UITableViewStylePlain]; 41 | self.table.delegate = self; 42 | self.table.dataSource = self; 43 | self.table.backgroundColor = [UIColor clearColor]; 44 | self.table.separatorStyle = UITableViewCellSeparatorStyleNone; 45 | self.table.autoresizingMask = UIViewAutoresizingFlexibleWidth; 46 | 47 | UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f - self.table.bounds.size.height, [SIMenuConfiguration menuWidth], self.table.bounds.size.height)]; 48 | header.backgroundColor = [UIColor color:[SIMenuConfiguration itemsColor] withAlpha:[SIMenuConfiguration menuAlpha]]; 49 | header.autoresizingMask = UIViewAutoresizingFlexibleWidth; 50 | [self.table addSubview:header]; 51 | 52 | } 53 | return self; 54 | } 55 | 56 | - (void)show 57 | { 58 | [self addSubview:self.table]; 59 | if (!self.table.tableFooterView) { 60 | [self addFooter]; 61 | } 62 | [UIView animateWithDuration:[SIMenuConfiguration animationDuration] animations:^{ 63 | self.layer.backgroundColor = [UIColor color:[SIMenuConfiguration mainColor] withAlpha:[SIMenuConfiguration backgroundAlpha]].CGColor; 64 | self.table.frame = endFrame; 65 | self.table.contentOffset = CGPointMake(0, [SIMenuConfiguration bounceOffset]); 66 | } completion:^(BOOL finished) { 67 | [UIView animateWithDuration:[self bounceAnimationDuration] animations:^{ 68 | self.table.contentOffset = CGPointMake(0, 0); 69 | }]; 70 | }]; 71 | } 72 | 73 | - (void)hide 74 | { 75 | [UIView animateWithDuration:[self bounceAnimationDuration] animations:^{ 76 | self.table.contentOffset = CGPointMake(0, [SIMenuConfiguration bounceOffset]); 77 | } completion:^(BOOL finished) { 78 | [UIView animateWithDuration:[SIMenuConfiguration animationDuration] animations:^{ 79 | self.layer.backgroundColor = [UIColor color:[SIMenuConfiguration mainColor] withAlpha:0.0].CGColor; 80 | self.table.frame = startFrame; 81 | } completion:^(BOOL finished) { 82 | // [self.table deselectRowAtIndexPath:currentIndexPath animated:NO]; 83 | SIMenuCell *cell = (SIMenuCell *)[self.table cellForRowAtIndexPath:currentIndexPath]; 84 | [cell setSelected:NO withCompletionBlock:^{ 85 | 86 | }]; 87 | currentIndexPath = nil; 88 | [self removeFooter]; 89 | [self.table removeFromSuperview]; 90 | [self removeFromSuperview]; 91 | }]; 92 | }]; 93 | } 94 | 95 | - (float)bounceAnimationDuration 96 | { 97 | float percentage = 28.57; 98 | return [SIMenuConfiguration animationDuration]*percentage/100.0; 99 | } 100 | 101 | - (void)addFooter 102 | { 103 | UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [SIMenuConfiguration menuWidth], self.table.bounds.size.height - (self.items.count * [SIMenuConfiguration itemCellHeight]))]; 104 | self.table.tableFooterView = footer; 105 | 106 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onBackgroundTap:)]; 107 | [footer addGestureRecognizer:tap]; 108 | } 109 | 110 | - (void)removeFooter 111 | { 112 | self.table.tableFooterView = nil; 113 | } 114 | 115 | - (void)onBackgroundTap:(id)sender 116 | { 117 | [self.menuDelegate didBackgroundTap]; 118 | } 119 | 120 | - (void)dealloc 121 | { 122 | self.items = nil; 123 | self.table = nil; 124 | self.menuDelegate = nil; 125 | } 126 | 127 | #pragma mark - Table view data source 128 | 129 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 130 | { 131 | return 1; 132 | } 133 | 134 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 135 | { 136 | return [SIMenuConfiguration itemCellHeight]; 137 | } 138 | 139 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 140 | { 141 | return self.items.count; 142 | } 143 | 144 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 145 | { 146 | static NSString *CellIdentifier = @"Cell"; 147 | 148 | SIMenuCell *cell = (SIMenuCell *)[tableView dequeueReusableCellWithIdentifier:@"Cell"]; 149 | if (cell == nil) { 150 | cell = [[SIMenuCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 151 | } 152 | 153 | cell.autoresizingMask = UIViewAutoresizingFlexibleWidth; 154 | 155 | cell.textLabel.text = [self.items objectAtIndex:indexPath.row]; 156 | 157 | return cell; 158 | } 159 | 160 | #pragma mark - Table view delegate 161 | 162 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 163 | { 164 | currentIndexPath = indexPath; 165 | 166 | SIMenuCell *cell = (SIMenuCell *)[tableView cellForRowAtIndexPath:indexPath]; 167 | [cell setSelected:YES withCompletionBlock:^{ 168 | [self.menuDelegate didSelectItemAtIndex:indexPath.row]; 169 | }]; 170 | 171 | } 172 | 173 | - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath 174 | { 175 | SIMenuCell *cell = (SIMenuCell *)[tableView cellForRowAtIndexPath:indexPath]; 176 | [cell setSelected:NO withCompletionBlock:^{ 177 | 178 | }]; 179 | } 180 | 181 | @end 182 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SINavigationMenuView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SINavigationMenuView.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SIMenuTable.h" 11 | 12 | @protocol SINavigationMenuDelegate 13 | 14 | - (void)didSelectItemAtIndex:(NSUInteger)index; 15 | 16 | @end 17 | 18 | @interface SINavigationMenuView : UIView 19 | 20 | @property (nonatomic, weak) id delegate; 21 | @property (nonatomic, strong) NSArray *items; 22 | 23 | - (id)initWithFrame:(CGRect)frame title:(NSString *)title; 24 | - (void)displayMenuInView:(UIView *)view; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/SINavigationMenuView.m: -------------------------------------------------------------------------------- 1 | // 2 | // SINavigationMenuView.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "SINavigationMenuView.h" 10 | #import "SIMenuButton.h" 11 | #import "QuartzCore/QuartzCore.h" 12 | #import "SIMenuConfiguration.h" 13 | 14 | @interface SINavigationMenuView () 15 | @property (nonatomic, strong) SIMenuButton *menuButton; 16 | @property (nonatomic, strong) SIMenuTable *table; 17 | @property (nonatomic, strong) UIView *menuContainer; 18 | @end 19 | 20 | @implementation SINavigationMenuView 21 | 22 | - (id)initWithFrame:(CGRect)frame title:(NSString *)title 23 | { 24 | self = [super initWithFrame:frame]; 25 | if (self) { 26 | frame.origin.y += 1.0; 27 | self.menuButton = [[SIMenuButton alloc] initWithFrame:frame]; 28 | self.menuButton.title.text = title; 29 | [self.menuButton addTarget:self action:@selector(onHandleMenuTap:) forControlEvents:UIControlEventTouchUpInside]; 30 | [self addSubview:self.menuButton]; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)displayMenuInView:(UIView *)view 36 | { 37 | self.menuContainer = view; 38 | } 39 | 40 | #pragma mark - 41 | #pragma mark Actions 42 | - (void)onHandleMenuTap:(id)sender 43 | { 44 | if (self.menuButton.isActive) { 45 | NSLog(@"On show"); 46 | [self onShowMenu]; 47 | } else { 48 | NSLog(@"On hide"); 49 | [self onHideMenu]; 50 | } 51 | } 52 | 53 | - (void)onShowMenu 54 | { 55 | if (!self.table) { 56 | UIWindow *mainWindow = [[UIApplication sharedApplication] keyWindow]; 57 | CGRect frame = mainWindow.frame; 58 | frame.origin.y += self.frame.size.height + [[UIApplication sharedApplication] statusBarFrame].size.height; 59 | self.table = [[SIMenuTable alloc] initWithFrame:frame items:self.items]; 60 | self.table.menuDelegate = self; 61 | } 62 | [self.menuContainer addSubview:self.table]; 63 | [self rotateArrow:M_PI]; 64 | [self.table show]; 65 | } 66 | 67 | - (void)onHideMenu 68 | { 69 | [self rotateArrow:0]; 70 | [self.table hide]; 71 | } 72 | 73 | - (void)rotateArrow:(float)degrees 74 | { 75 | [UIView animateWithDuration:[SIMenuConfiguration animationDuration] delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ 76 | self.menuButton.arrow.layer.transform = CATransform3DMakeRotation(degrees, 0, 0, 1); 77 | } completion:NULL]; 78 | } 79 | 80 | #pragma mark - 81 | #pragma mark Delegate methods 82 | - (void)didSelectItemAtIndex:(NSUInteger)index 83 | { 84 | self.menuButton.isActive = !self.menuButton.isActive; 85 | [self onHandleMenuTap:nil]; 86 | [self.delegate didSelectItemAtIndex:index]; 87 | } 88 | 89 | - (void)didBackgroundTap 90 | { 91 | self.menuButton.isActive = !self.menuButton.isActive; 92 | [self onHandleMenuTap:nil]; 93 | } 94 | 95 | #pragma mark - 96 | #pragma mark Memory management 97 | - (void)dealloc 98 | { 99 | self.items = nil; 100 | self.menuButton = nil; 101 | self.menuContainer = nil; 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/UIColor+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Extension.h 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/21/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (Extension) 12 | + (UIColor *)color:(UIColor *)color_ withAlpha:(float)alpha_; 13 | @end 14 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/UIColor+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Extension.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/21/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Extension.h" 10 | 11 | @implementation UIColor (Extension) 12 | + (UIColor *)color:(UIColor *)color_ withAlpha:(float)alpha_ 13 | { 14 | UIColor *uicolor = color_; 15 | CGColorRef colorRef = [uicolor CGColor]; 16 | 17 | int numComponents = CGColorGetNumberOfComponents(colorRef); 18 | 19 | CGFloat red = 0.0; 20 | CGFloat green = 0.0; 21 | CGFloat blue = 0.0; 22 | CGFloat alpha = 0.0; 23 | if (numComponents == 4) 24 | { 25 | const CGFloat *components = CGColorGetComponents(colorRef); 26 | red = components[0]; 27 | green = components[1]; 28 | blue = components[2]; 29 | alpha = components[3]; 30 | } 31 | 32 | return [UIColor colorWithRed:red green:green blue:blue alpha:alpha_]; 33 | } 34 | @end 35 | -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/images/arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iSapozhnik/NavigationMenu/ed922ea5fdb4044bfd70bf7342aeb00a6e73c855/NavigationMenu/NavigationMenuView/images/arrow_down.png -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/images/arrow_down1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iSapozhnik/NavigationMenu/ed922ea5fdb4044bfd70bf7342aeb00a6e73c855/NavigationMenu/NavigationMenuView/images/arrow_down1.png -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/images/arrow_down1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iSapozhnik/NavigationMenu/ed922ea5fdb4044bfd70bf7342aeb00a6e73c855/NavigationMenu/NavigationMenuView/images/arrow_down1@2x.png -------------------------------------------------------------------------------- /NavigationMenu/NavigationMenuView/images/arrow_down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iSapozhnik/NavigationMenu/ed922ea5fdb4044bfd70bf7342aeb00a6e73c855/NavigationMenu/NavigationMenuView/images/arrow_down@2x.png -------------------------------------------------------------------------------- /NavigationMenu/en.lproj/HAViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /NavigationMenu/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NavigationMenu/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iSapozhnik/NavigationMenu/ed922ea5fdb4044bfd70bf7342aeb00a6e73c855/NavigationMenu/logo.png -------------------------------------------------------------------------------- /NavigationMenu/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // NavigationMenu 4 | // 5 | // Created by Ivan Sapozhnik on 2/19/13. 6 | // Copyright (c) 2013 Ivan Sapozhnik. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "HAAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([HAAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [DEPRECATED] Navigation Menu for iOS 2 | ============= 3 | *Version 1.0* 4 | 5 | Navigation Menu is an Objective-C component that adds possibility to show menu from navigation bar. 6 | Inspired by Vkontakte app. Minimum iOS target is 5.0 7 | 8 | *TODO: add Pod* 9 | 10 | Customization 11 | --------- 12 | - Menu item height *+ (float)itemCellHeight;* 13 | - Animation duration of menu appearence *+ (float)animationDuration;* 14 | - Menu substrate alpha value *+ (float)backgroundAlpha;* 15 | - Menu alpha value *+ (float)menuAlpha;* 16 | - Value of bounce *+ (float)bounceOffset;* 17 | - Arrow image near title *+ (UIImage *)arrowImage;* 18 | - Distance between Title and arrow image *+ (float)arrowPadding;* 19 | - Items color in menu *+ (UIColor *)itemsColor;* 20 | - Menu color *+ (UIColor *)mainColor;* 21 | - Item selection animation speed *+ (float)selectionSpeed;* 22 | - Menu item text color *+ (UIColor *)itemTextColor;* 23 | - Selection color (will create a gradiend with provided color at the top and 35% darker in the bottom) *+ (UIColor *)selectionColor;* 24 | 25 | Example 26 | --------- 27 | //In your header (.h) file 28 | #import "SINavigationMenuView.h" 29 | 30 | @interface HAViewController : UIViewController 31 | 32 | @end 33 | 34 | //In your implementation (.m) file 35 | - (void)viewDidLoad 36 | { 37 | [super viewDidLoad]; 38 | // check if we have a navigationItem 39 | if (self.navigationItem) { 40 | CGRect frame = CGRectMake(0.0, 0.0, 200.0, self.navigationController.navigationBar.bounds.size.height); 41 | SINavigationMenuView *menu = [[SINavigationMenuView alloc] initWithFrame:frame title:@"Menu"]; 42 | //Set in which view we will display a menu 43 | [menu displayMenuInView:self.view]; 44 | //Create array of items 45 | menu.items = @[@"News", @"Top Articles", @"Messages"]; 46 | menu.delegate = self; 47 | self.navigationItem.titleView = menu; 48 | } 49 | } 50 | 51 | //Delegate method 52 | - (void)didSelectItemAtIndex:(NSUInteger)index 53 | { 54 | NSLog(@"did selected item at index %d", index); 55 | } 56 | 57 | You will need to add QuartzCore framework. This component use ARC. 58 | For cusomization see SIMenuConfiguration .h/.m files. 59 | --------------------------------------------------------------------------------