├── .gitignore ├── APHorizontalMenu.podspec ├── CHANGELOG.md ├── Classes ├── APHorizontalMenu.h └── APHorizontalMenu.m ├── Example ├── APHorizontalMenu.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── APHorizontalMenu.xcworkspace │ └── contents.xcworkspacedata ├── APHorizontalMenu │ ├── APHorizontalMenu-Info.plist │ ├── APHorizontalMenu-Prefix.pch │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── Main_iPad.storyboard │ │ └── Main_iPhone.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── APHorizontalMenuTests │ ├── APHorizontalMenuTests-Info.plist │ ├── APHorizontalMenuTests.m │ └── en.lproj │ │ └── InfoPlist.strings ├── Podfile ├── Podfile.lock └── Pods │ ├── APHorizontalMenu │ ├── Classes │ │ ├── APHorizontalMenu.h │ │ └── APHorizontalMenu.m │ ├── LICENSE │ └── README.md │ ├── BuildHeaders │ └── APHorizontalMenu │ │ └── APHorizontalMenu.h │ ├── Headers │ └── APHorizontalMenu │ │ └── APHorizontalMenu.h │ ├── Local Podspecs │ └── APHorizontalMenu.podspec │ ├── Manifest.lock │ ├── Pods-APHorizontalMenu-Private.xcconfig │ ├── Pods-APHorizontalMenu-dummy.m │ ├── Pods-APHorizontalMenu-prefix.pch │ ├── Pods-APHorizontalMenu.xcconfig │ ├── Pods-acknowledgements.markdown │ ├── Pods-acknowledgements.plist │ ├── Pods-dummy.m │ ├── Pods-environment.h │ ├── Pods-resources.sh │ ├── Pods.xcconfig │ └── Pods.xcodeproj │ └── project.pbxproj ├── Images ├── APHorizontalMenu.gif ├── iPad.png └── iPhone.png ├── LICENSE ├── README.md └── Rakefile /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | -------------------------------------------------------------------------------- /APHorizontalMenu.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint NAME.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 6 | # 7 | Pod::Spec.new do |s| 8 | s.name = "APHorizontalMenu" 9 | s.version = "1.5" 10 | s.summary = "Customizable horizontal menu" 11 | s.description = "APHorizontalMenu is a completely customizable horizontal menu that can be created in the Storyboard or directly by code." 12 | s.homepage = "https://github.com/apascual/APHorizontalMenu" 13 | s.screenshots = "https://raw.githubusercontent.com/apascual/APHorizontalMenu/master/Images/iPhone.png", "https://raw.githubusercontent.com/apascual/APHorizontalMenu/master/Images/iPad.png" 14 | s.license = 'MIT' 15 | s.author = { "Abel Pascual" => "abelpascual@gmail.com" } 16 | s.source = { :git => "https://github.com/apascual/APHorizontalMenu.git", :tag => s.version.to_s } 17 | s.social_media_url = 'https://twitter.com/Abel_Pascual' 18 | 19 | s.platform = :ios, "6.0" 20 | s.requires_arc = true 21 | 22 | s.source_files = 'Classes' 23 | 24 | end 25 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # APHorizontalMenu CHANGELOG 2 | 3 | ## 0.1.0 4 | 5 | Initial release. 6 | -------------------------------------------------------------------------------- /Classes/APHorizontalMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // APHorizontalMenu.h 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 17/03/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // Default values 12 | #define AP_HORIZONTAL_MENU_SELECTED_INDEX_DEFAULT 0 13 | #define AP_HORIZONTAL_MENU_CELL_BACKGROUND_COLOR_DEFAULT [UIColor grayColor] 14 | #define AP_HORIZONTAL_MENU_CELL_SELECTED_COLOR_DEFAULT [UIColor colorWithRed:150.0/255.0 green:200.0/255.0 blue:150.0/255.0 alpha:1.0] 15 | #define AP_HORIZONTAL_MENU_TEXT_COLOR_DEFAULT [UIColor whiteColor] 16 | #define AP_HORIZONTAL_MENU_TEXT_SELECTED_COLOR_DEFAULT [UIColor grayColor] 17 | #define AP_HORIZONTAL_MENU_TEXT_FONT [UIFont boldSystemFontOfSize:16.0] 18 | #define AP_HORIZONTAL_MENU_HMARGIN 0.0f 19 | #define AP_HORIZONTAL_MENU_VMARGIN 0.0f 20 | 21 | // Protocol to get the selected item 22 | @protocol APHorizontalMenuSelectDelegate 23 | 24 | @required 25 | - (void)horizontalMenu:(id)horizontalMenu didSelectPosition:(NSInteger)index; 26 | 27 | @end 28 | 29 | @interface APHorizontalMenu : UIView 30 | 31 | @property (nonatomic, weak) IBOutlet id delegate; 32 | @property (nonatomic, copy) NSArray *values; 33 | @property (nonatomic) NSInteger selectedIndex; 34 | 35 | @property (nonatomic) NSInteger visibleItems; 36 | 37 | @property (nonatomic, strong) UIColor *cellSelectedColor; 38 | @property (nonatomic, strong) UIColor *cellBackgroundColor; 39 | @property (nonatomic, strong) UIColor *textColor; 40 | @property (nonatomic, strong) UIColor *textSelectedColor; 41 | @property (nonatomic, strong) UIFont *textFont; 42 | 43 | @property (nonatomic) CGFloat horizontalMargin; 44 | @property (nonatomic) CGFloat verticalMargin; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Classes/APHorizontalMenu.m: -------------------------------------------------------------------------------- 1 | // 2 | // APHorizontalMenu.m 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 17/03/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import "APHorizontalMenu.h" 10 | 11 | @interface APHorizontalMenu () 12 | 13 | @property (nonatomic, strong) UITableView *tableView; 14 | @property (nonatomic) NSInteger cellWidth; 15 | @property (nonatomic) BOOL isTouchAnimation; 16 | 17 | @end 18 | 19 | @implementation APHorizontalMenu 20 | 21 | #pragma mark - Initialization 22 | 23 | - (id)initWithCoder:(NSCoder *)aDecoder { 24 | self = [super initWithCoder:aDecoder]; 25 | if(self) { 26 | [self customInit]; 27 | } 28 | return self; 29 | } 30 | 31 | - (id)initWithFrame:(CGRect)frame { 32 | self = [super initWithFrame:frame]; 33 | if (self) { 34 | [self customInit]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)customInit { 40 | 41 | _selectedIndex = AP_HORIZONTAL_MENU_SELECTED_INDEX_DEFAULT; 42 | _cellSelectedColor = AP_HORIZONTAL_MENU_CELL_SELECTED_COLOR_DEFAULT; 43 | _cellBackgroundColor = AP_HORIZONTAL_MENU_CELL_BACKGROUND_COLOR_DEFAULT; 44 | _textColor = AP_HORIZONTAL_MENU_TEXT_COLOR_DEFAULT; 45 | _textSelectedColor = AP_HORIZONTAL_MENU_TEXT_SELECTED_COLOR_DEFAULT; 46 | _textFont = AP_HORIZONTAL_MENU_TEXT_FONT; 47 | _horizontalMargin = AP_HORIZONTAL_MENU_HMARGIN; 48 | _verticalMargin = AP_HORIZONTAL_MENU_VMARGIN; 49 | 50 | // Number of items visibles in iPhone / iPod Touch 51 | _visibleItems = 3; 52 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 53 | // Number of items visible in iPad 54 | _visibleItems = 5; 55 | } 56 | } 57 | 58 | - (void)createMenuControl { 59 | [self.tableView removeFromSuperview]; 60 | self.tableView=nil; 61 | 62 | CGRect frame = CGRectMake(0, 0, self.frame.size.height,self.frame.size.width); 63 | self.tableView = [[UITableView alloc] initWithFrame:frame style:UITableViewStylePlain]; 64 | self.tableView.backgroundColor = [UIColor clearColor]; 65 | self.tableView.dataSource = self; 66 | self.tableView.delegate = self; 67 | [self addSubview:self.tableView]; 68 | 69 | CGPoint oldCenter = self.center; 70 | oldCenter.y = frame.size.width/2; 71 | self.tableView.transform=CGAffineTransformMakeRotation(-M_PI_2); 72 | self.tableView.center = oldCenter; 73 | self.tableView.showsVerticalScrollIndicator = NO; 74 | [self.tableView setDecelerationRate: UIScrollViewDecelerationRateNormal]; 75 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 76 | } 77 | 78 | - (void)layoutSubviews { 79 | [super layoutSubviews]; 80 | [self createMenuControl]; 81 | [self update]; 82 | } 83 | 84 | #pragma mark - Custom setters 85 | 86 | - (void)setSelectedIndex:(NSInteger)selectedIndex 87 | { 88 | if(_selectedIndex != selectedIndex) { 89 | [self setCurrentIndex:[NSIndexPath indexPathForRow:selectedIndex inSection:0] animated:YES]; 90 | } 91 | } 92 | 93 | - (void)setValues:(NSArray *)values 94 | { 95 | if(_values != values) { 96 | _values = values; 97 | [self update]; 98 | } 99 | } 100 | 101 | - (void)setCellSelectedColor:(UIColor *)cellSelectedColor { 102 | _cellSelectedColor = cellSelectedColor; 103 | [self update]; 104 | } 105 | 106 | - (void)setCellBackgroundColor:(UIColor *)cellBackgroundColor { 107 | _cellBackgroundColor = cellBackgroundColor; 108 | [self update]; 109 | } 110 | 111 | - (void)setTextColor:(UIColor *)textColor { 112 | _textColor = textColor; 113 | [self update]; 114 | } 115 | 116 | - (void)setTextSelectedColor:(UIColor *)textSelectedColor { 117 | _textSelectedColor = textSelectedColor; 118 | [self update]; 119 | } 120 | 121 | - (void)setVisibleItems:(NSInteger)visibleItems { 122 | _visibleItems = visibleItems; 123 | [self update]; 124 | } 125 | 126 | - (void)setTextFont:(UIFont *)textFont { 127 | _textFont = textFont; 128 | [self update]; 129 | } 130 | 131 | - (void)update { 132 | self.cellWidth = self.frame.size.width/self.visibleItems; 133 | self.backgroundColor = self.cellBackgroundColor; 134 | 135 | NSInteger viewWidth = self.frame.size.width; 136 | CGFloat f = (viewWidth-self.cellWidth)/2; 137 | [self.tableView setContentInset: UIEdgeInsetsMake(f, 0, f, 0)]; 138 | self.clipsToBounds = YES; 139 | 140 | [self.tableView reloadData]; 141 | if(self.values.count > self.selectedIndex) 142 | { 143 | [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:self.selectedIndex inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop]; 144 | } 145 | } 146 | 147 | #pragma mark - UITableView control 148 | 149 | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 150 | { 151 | return self.cellWidth; 152 | } 153 | 154 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 155 | { 156 | return self.values.count; 157 | } 158 | 159 | - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 160 | 161 | static NSString* reuseIdentifier = @"Cell"; 162 | 163 | UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; 164 | 165 | if(!cell) 166 | { 167 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; 168 | cell.transform = CGAffineTransformMakeRotation(M_PI_2); 169 | cell.backgroundColor = [UIColor clearColor]; 170 | 171 | UILabel* txtItemTitle = [[UILabel alloc] initWithFrame:CGRectMake(self.horizontalMargin, self.verticalMargin, self.cellWidth-(self.horizontalMargin*2), self.frame.size.height-(self.verticalMargin*2))]; 172 | txtItemTitle.font = self.textFont; 173 | txtItemTitle.textColor = self.textColor; 174 | txtItemTitle.highlightedTextColor = self.textSelectedColor; 175 | txtItemTitle.textAlignment = NSTextAlignmentCenter; 176 | txtItemTitle.tag = 1001; 177 | 178 | [cell.contentView addSubview:txtItemTitle]; 179 | } 180 | 181 | UIView *bgColorView = [[UIView alloc] init]; 182 | bgColorView.backgroundColor = self.cellSelectedColor; 183 | bgColorView.layer.masksToBounds = YES; 184 | [cell setSelectedBackgroundView:bgColorView]; 185 | 186 | UILabel* txtItemTitle = (UILabel *)[cell viewWithTag:1001]; 187 | txtItemTitle.text = [self.values objectAtIndex:indexPath.row]; 188 | txtItemTitle.numberOfLines = 0; 189 | 190 | return cell; 191 | } 192 | 193 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 194 | self.isTouchAnimation = YES; 195 | [self setCurrentIndex:indexPath animated:YES]; 196 | } 197 | 198 | #pragma mark - Scroll control 199 | 200 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 201 | if(!self.isTouchAnimation) 202 | { 203 | CGPoint point = [self convertPoint:CGPointMake(self.frame.size.width/2.0, self.frame.size.height/2.0) toView:self.tableView]; 204 | NSIndexPath* centerIndexPath = [self.tableView indexPathForRowAtPoint:point]; 205 | 206 | if(!UIAccessibilityIsVoiceOverRunning()) { 207 | [self.tableView selectRowAtIndexPath:centerIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; 208 | } 209 | } 210 | } 211 | 212 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { 213 | if (decelerate == NO) { 214 | [self centerTable]; 215 | } 216 | } 217 | 218 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { 219 | [self centerTable]; 220 | } 221 | 222 | - (void)centerTable { 223 | CGPoint point = [self convertPoint:CGPointMake(self.frame.size.width/2.0, self.frame.size.height/2.0) toView:self.tableView]; 224 | NSIndexPath* centerIndexPath = [self.tableView indexPathForRowAtPoint:point]; 225 | 226 | if(!UIAccessibilityIsVoiceOverRunning()) { 227 | [self setCurrentIndex:centerIndexPath animated:YES]; 228 | } 229 | } 230 | 231 | - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { 232 | self.isTouchAnimation = NO; 233 | } 234 | 235 | - (void) setCurrentIndex:(NSIndexPath *)indexPath animated:(BOOL)animated { 236 | if(self.isTouchAnimation || _selectedIndex != indexPath.row) { 237 | 238 | [self.tableView selectRowAtIndexPath:indexPath animated:animated scrollPosition:UITableViewScrollPositionTop]; 239 | 240 | if(_selectedIndex != indexPath.row) { 241 | _selectedIndex = indexPath.row; 242 | 243 | if ([self.delegate respondsToSelector:@selector(horizontalMenu:didSelectPosition:)]) { 244 | [self.delegate horizontalMenu:self didSelectPosition:indexPath.row]; 245 | } 246 | } 247 | } 248 | } 249 | 250 | @end 251 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | archiveVersion 6 | 1 7 | classes 8 | 9 | objectVersion 10 | 46 11 | objects 12 | 13 | 1CB420C95EC947029E4F1683 14 | 15 | includeInIndex 16 | 1 17 | isa 18 | PBXFileReference 19 | lastKnownFileType 20 | text.xcconfig 21 | name 22 | Pods.xcconfig 23 | path 24 | Pods/Pods.xcconfig 25 | sourceTree 26 | <group> 27 | 28 | 2F213C06519948DB80BB5F3E 29 | 30 | explicitFileType 31 | archive.ar 32 | includeInIndex 33 | 0 34 | isa 35 | PBXFileReference 36 | path 37 | libPods.a 38 | sourceTree 39 | BUILT_PRODUCTS_DIR 40 | 41 | 3535B372A2D048999872A883 42 | 43 | fileRef 44 | 2F213C06519948DB80BB5F3E 45 | isa 46 | PBXBuildFile 47 | 48 | 3C1AF7852C6B4F3F949EFC21 49 | 50 | buildActionMask 51 | 2147483647 52 | files 53 | 54 | inputPaths 55 | 56 | isa 57 | PBXShellScriptBuildPhase 58 | name 59 | Check Pods Manifest.lock 60 | outputPaths 61 | 62 | runOnlyForDeploymentPostprocessing 63 | 0 64 | shellPath 65 | /bin/sh 66 | shellScript 67 | diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null 68 | if [[ $? != 0 ]] ; then 69 | cat << EOM 70 | error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. 71 | EOM 72 | exit 1 73 | fi 74 | 75 | showEnvVarsInLog 76 | 0 77 | 78 | B2A4AFE84E3B4C71BF9089E1 79 | 80 | buildActionMask 81 | 2147483647 82 | files 83 | 84 | inputPaths 85 | 86 | isa 87 | PBXShellScriptBuildPhase 88 | name 89 | Copy Pods Resources 90 | outputPaths 91 | 92 | runOnlyForDeploymentPostprocessing 93 | 0 94 | shellPath 95 | /bin/sh 96 | shellScript 97 | "${SRCROOT}/Pods/Pods-resources.sh" 98 | 99 | showEnvVarsInLog 100 | 0 101 | 102 | E91604471912D2AC0025CC1B 103 | 104 | children 105 | 106 | E91604591912D2AC0025CC1B 107 | E916047B1912D2AC0025CC1B 108 | E91604521912D2AC0025CC1B 109 | E91604511912D2AC0025CC1B 110 | 1CB420C95EC947029E4F1683 111 | 112 | isa 113 | PBXGroup 114 | sourceTree 115 | <group> 116 | 117 | E91604481912D2AC0025CC1B 118 | 119 | attributes 120 | 121 | LastUpgradeCheck 122 | 0510 123 | ORGANIZATIONNAME 124 | Abel Pascual 125 | TargetAttributes 126 | 127 | E91604731912D2AC0025CC1B 128 | 129 | TestTargetID 130 | E916044F1912D2AC0025CC1B 131 | 132 | 133 | 134 | buildConfigurationList 135 | E916044B1912D2AC0025CC1B 136 | compatibilityVersion 137 | Xcode 3.2 138 | developmentRegion 139 | English 140 | hasScannedForEncodings 141 | 0 142 | isa 143 | PBXProject 144 | knownRegions 145 | 146 | en 147 | Base 148 | 149 | mainGroup 150 | E91604471912D2AC0025CC1B 151 | productRefGroup 152 | E91604511912D2AC0025CC1B 153 | projectDirPath 154 | 155 | projectReferences 156 | 157 | projectRoot 158 | 159 | targets 160 | 161 | E916044F1912D2AC0025CC1B 162 | E91604731912D2AC0025CC1B 163 | 164 | 165 | E916044B1912D2AC0025CC1B 166 | 167 | buildConfigurations 168 | 169 | E91604831912D2AC0025CC1B 170 | E91604841912D2AC0025CC1B 171 | 172 | defaultConfigurationIsVisible 173 | 0 174 | defaultConfigurationName 175 | Release 176 | isa 177 | XCConfigurationList 178 | 179 | E916044C1912D2AC0025CC1B 180 | 181 | buildActionMask 182 | 2147483647 183 | files 184 | 185 | E916046D1912D2AC0025CC1B 186 | E91604641912D2AC0025CC1B 187 | E91604601912D2AC0025CC1B 188 | 189 | isa 190 | PBXSourcesBuildPhase 191 | runOnlyForDeploymentPostprocessing 192 | 0 193 | 194 | E916044D1912D2AC0025CC1B 195 | 196 | buildActionMask 197 | 2147483647 198 | files 199 | 200 | E91604561912D2AC0025CC1B 201 | E91604581912D2AC0025CC1B 202 | E91604541912D2AC0025CC1B 203 | 3535B372A2D048999872A883 204 | 205 | isa 206 | PBXFrameworksBuildPhase 207 | runOnlyForDeploymentPostprocessing 208 | 0 209 | 210 | E916044E1912D2AC0025CC1B 211 | 212 | buildActionMask 213 | 2147483647 214 | files 215 | 216 | E916046A1912D2AC0025CC1B 217 | E916046F1912D2AC0025CC1B 218 | E91604671912D2AC0025CC1B 219 | E916045E1912D2AC0025CC1B 220 | 221 | isa 222 | PBXResourcesBuildPhase 223 | runOnlyForDeploymentPostprocessing 224 | 0 225 | 226 | E916044F1912D2AC0025CC1B 227 | 228 | buildConfigurationList 229 | E91604851912D2AC0025CC1B 230 | buildPhases 231 | 232 | 3C1AF7852C6B4F3F949EFC21 233 | E916044C1912D2AC0025CC1B 234 | E916044D1912D2AC0025CC1B 235 | E916044E1912D2AC0025CC1B 236 | B2A4AFE84E3B4C71BF9089E1 237 | 238 | buildRules 239 | 240 | dependencies 241 | 242 | isa 243 | PBXNativeTarget 244 | name 245 | APHorizontalMenu 246 | productName 247 | APHorizontalMenu 248 | productReference 249 | E91604501912D2AC0025CC1B 250 | productType 251 | com.apple.product-type.application 252 | 253 | E91604501912D2AC0025CC1B 254 | 255 | explicitFileType 256 | wrapper.application 257 | includeInIndex 258 | 0 259 | isa 260 | PBXFileReference 261 | path 262 | APHorizontalMenu.app 263 | sourceTree 264 | BUILT_PRODUCTS_DIR 265 | 266 | E91604511912D2AC0025CC1B 267 | 268 | children 269 | 270 | E91604501912D2AC0025CC1B 271 | E91604741912D2AC0025CC1B 272 | 273 | isa 274 | PBXGroup 275 | name 276 | Products 277 | sourceTree 278 | <group> 279 | 280 | E91604521912D2AC0025CC1B 281 | 282 | children 283 | 284 | E91604531912D2AC0025CC1B 285 | E91604551912D2AC0025CC1B 286 | E91604571912D2AC0025CC1B 287 | E91604751912D2AC0025CC1B 288 | 2F213C06519948DB80BB5F3E 289 | 290 | isa 291 | PBXGroup 292 | name 293 | Frameworks 294 | sourceTree 295 | <group> 296 | 297 | E91604531912D2AC0025CC1B 298 | 299 | isa 300 | PBXFileReference 301 | lastKnownFileType 302 | wrapper.framework 303 | name 304 | Foundation.framework 305 | path 306 | System/Library/Frameworks/Foundation.framework 307 | sourceTree 308 | SDKROOT 309 | 310 | E91604541912D2AC0025CC1B 311 | 312 | fileRef 313 | E91604531912D2AC0025CC1B 314 | isa 315 | PBXBuildFile 316 | 317 | E91604551912D2AC0025CC1B 318 | 319 | isa 320 | PBXFileReference 321 | lastKnownFileType 322 | wrapper.framework 323 | name 324 | CoreGraphics.framework 325 | path 326 | System/Library/Frameworks/CoreGraphics.framework 327 | sourceTree 328 | SDKROOT 329 | 330 | E91604561912D2AC0025CC1B 331 | 332 | fileRef 333 | E91604551912D2AC0025CC1B 334 | isa 335 | PBXBuildFile 336 | 337 | E91604571912D2AC0025CC1B 338 | 339 | isa 340 | PBXFileReference 341 | lastKnownFileType 342 | wrapper.framework 343 | name 344 | UIKit.framework 345 | path 346 | System/Library/Frameworks/UIKit.framework 347 | sourceTree 348 | SDKROOT 349 | 350 | E91604581912D2AC0025CC1B 351 | 352 | fileRef 353 | E91604571912D2AC0025CC1B 354 | isa 355 | PBXBuildFile 356 | 357 | E91604591912D2AC0025CC1B 358 | 359 | children 360 | 361 | E91604621912D2AC0025CC1B 362 | E91604631912D2AC0025CC1B 363 | E91604651912D2AC0025CC1B 364 | E91604681912D2AC0025CC1B 365 | E916046B1912D2AC0025CC1B 366 | E916046C1912D2AC0025CC1B 367 | E916046E1912D2AC0025CC1B 368 | E916045A1912D2AC0025CC1B 369 | 370 | isa 371 | PBXGroup 372 | path 373 | APHorizontalMenu 374 | sourceTree 375 | <group> 376 | 377 | E916045A1912D2AC0025CC1B 378 | 379 | children 380 | 381 | E916045B1912D2AC0025CC1B 382 | E916045C1912D2AC0025CC1B 383 | E916045F1912D2AC0025CC1B 384 | E91604611912D2AC0025CC1B 385 | 386 | isa 387 | PBXGroup 388 | name 389 | Supporting Files 390 | sourceTree 391 | <group> 392 | 393 | E916045B1912D2AC0025CC1B 394 | 395 | isa 396 | PBXFileReference 397 | lastKnownFileType 398 | text.plist.xml 399 | path 400 | APHorizontalMenu-Info.plist 401 | sourceTree 402 | <group> 403 | 404 | E916045C1912D2AC0025CC1B 405 | 406 | children 407 | 408 | E916045D1912D2AC0025CC1B 409 | 410 | isa 411 | PBXVariantGroup 412 | name 413 | InfoPlist.strings 414 | sourceTree 415 | <group> 416 | 417 | E916045D1912D2AC0025CC1B 418 | 419 | isa 420 | PBXFileReference 421 | lastKnownFileType 422 | text.plist.strings 423 | name 424 | en 425 | path 426 | en.lproj/InfoPlist.strings 427 | sourceTree 428 | <group> 429 | 430 | E916045E1912D2AC0025CC1B 431 | 432 | fileRef 433 | E916045C1912D2AC0025CC1B 434 | isa 435 | PBXBuildFile 436 | 437 | E916045F1912D2AC0025CC1B 438 | 439 | isa 440 | PBXFileReference 441 | lastKnownFileType 442 | sourcecode.c.objc 443 | path 444 | main.m 445 | sourceTree 446 | <group> 447 | 448 | E91604601912D2AC0025CC1B 449 | 450 | fileRef 451 | E916045F1912D2AC0025CC1B 452 | isa 453 | PBXBuildFile 454 | 455 | E91604611912D2AC0025CC1B 456 | 457 | isa 458 | PBXFileReference 459 | lastKnownFileType 460 | sourcecode.c.h 461 | path 462 | APHorizontalMenu-Prefix.pch 463 | sourceTree 464 | <group> 465 | 466 | E91604621912D2AC0025CC1B 467 | 468 | isa 469 | PBXFileReference 470 | lastKnownFileType 471 | sourcecode.c.h 472 | path 473 | AppDelegate.h 474 | sourceTree 475 | <group> 476 | 477 | E91604631912D2AC0025CC1B 478 | 479 | isa 480 | PBXFileReference 481 | lastKnownFileType 482 | sourcecode.c.objc 483 | path 484 | AppDelegate.m 485 | sourceTree 486 | <group> 487 | 488 | E91604641912D2AC0025CC1B 489 | 490 | fileRef 491 | E91604631912D2AC0025CC1B 492 | isa 493 | PBXBuildFile 494 | 495 | E91604651912D2AC0025CC1B 496 | 497 | children 498 | 499 | E91604661912D2AC0025CC1B 500 | 501 | isa 502 | PBXVariantGroup 503 | name 504 | Main_iPhone.storyboard 505 | sourceTree 506 | <group> 507 | 508 | E91604661912D2AC0025CC1B 509 | 510 | isa 511 | PBXFileReference 512 | lastKnownFileType 513 | file.storyboard 514 | name 515 | Base 516 | path 517 | Base.lproj/Main_iPhone.storyboard 518 | sourceTree 519 | <group> 520 | 521 | E91604671912D2AC0025CC1B 522 | 523 | fileRef 524 | E91604651912D2AC0025CC1B 525 | isa 526 | PBXBuildFile 527 | 528 | E91604681912D2AC0025CC1B 529 | 530 | children 531 | 532 | E91604691912D2AC0025CC1B 533 | 534 | isa 535 | PBXVariantGroup 536 | name 537 | Main_iPad.storyboard 538 | sourceTree 539 | <group> 540 | 541 | E91604691912D2AC0025CC1B 542 | 543 | isa 544 | PBXFileReference 545 | lastKnownFileType 546 | file.storyboard 547 | name 548 | Base 549 | path 550 | Base.lproj/Main_iPad.storyboard 551 | sourceTree 552 | <group> 553 | 554 | E916046A1912D2AC0025CC1B 555 | 556 | fileRef 557 | E91604681912D2AC0025CC1B 558 | isa 559 | PBXBuildFile 560 | 561 | E916046B1912D2AC0025CC1B 562 | 563 | isa 564 | PBXFileReference 565 | lastKnownFileType 566 | sourcecode.c.h 567 | path 568 | ViewController.h 569 | sourceTree 570 | <group> 571 | 572 | E916046C1912D2AC0025CC1B 573 | 574 | isa 575 | PBXFileReference 576 | lastKnownFileType 577 | sourcecode.c.objc 578 | path 579 | ViewController.m 580 | sourceTree 581 | <group> 582 | 583 | E916046D1912D2AC0025CC1B 584 | 585 | fileRef 586 | E916046C1912D2AC0025CC1B 587 | isa 588 | PBXBuildFile 589 | 590 | E916046E1912D2AC0025CC1B 591 | 592 | isa 593 | PBXFileReference 594 | lastKnownFileType 595 | folder.assetcatalog 596 | path 597 | Images.xcassets 598 | sourceTree 599 | <group> 600 | 601 | E916046F1912D2AC0025CC1B 602 | 603 | fileRef 604 | E916046E1912D2AC0025CC1B 605 | isa 606 | PBXBuildFile 607 | 608 | E91604701912D2AC0025CC1B 609 | 610 | buildActionMask 611 | 2147483647 612 | files 613 | 614 | E91604821912D2AC0025CC1B 615 | 616 | isa 617 | PBXSourcesBuildPhase 618 | runOnlyForDeploymentPostprocessing 619 | 0 620 | 621 | E91604711912D2AC0025CC1B 622 | 623 | buildActionMask 624 | 2147483647 625 | files 626 | 627 | E91604761912D2AC0025CC1B 628 | E91604781912D2AC0025CC1B 629 | E91604771912D2AC0025CC1B 630 | 631 | isa 632 | PBXFrameworksBuildPhase 633 | runOnlyForDeploymentPostprocessing 634 | 0 635 | 636 | E91604721912D2AC0025CC1B 637 | 638 | buildActionMask 639 | 2147483647 640 | files 641 | 642 | E91604801912D2AC0025CC1B 643 | 644 | isa 645 | PBXResourcesBuildPhase 646 | runOnlyForDeploymentPostprocessing 647 | 0 648 | 649 | E91604731912D2AC0025CC1B 650 | 651 | buildConfigurationList 652 | E91604881912D2AC0025CC1B 653 | buildPhases 654 | 655 | E91604701912D2AC0025CC1B 656 | E91604711912D2AC0025CC1B 657 | E91604721912D2AC0025CC1B 658 | 659 | buildRules 660 | 661 | dependencies 662 | 663 | E916047A1912D2AC0025CC1B 664 | 665 | isa 666 | PBXNativeTarget 667 | name 668 | APHorizontalMenuTests 669 | productName 670 | APHorizontalMenuTests 671 | productReference 672 | E91604741912D2AC0025CC1B 673 | productType 674 | com.apple.product-type.bundle.unit-test 675 | 676 | E91604741912D2AC0025CC1B 677 | 678 | explicitFileType 679 | wrapper.cfbundle 680 | includeInIndex 681 | 0 682 | isa 683 | PBXFileReference 684 | path 685 | APHorizontalMenuTests.xctest 686 | sourceTree 687 | BUILT_PRODUCTS_DIR 688 | 689 | E91604751912D2AC0025CC1B 690 | 691 | isa 692 | PBXFileReference 693 | lastKnownFileType 694 | wrapper.framework 695 | name 696 | XCTest.framework 697 | path 698 | Library/Frameworks/XCTest.framework 699 | sourceTree 700 | DEVELOPER_DIR 701 | 702 | E91604761912D2AC0025CC1B 703 | 704 | fileRef 705 | E91604751912D2AC0025CC1B 706 | isa 707 | PBXBuildFile 708 | 709 | E91604771912D2AC0025CC1B 710 | 711 | fileRef 712 | E91604531912D2AC0025CC1B 713 | isa 714 | PBXBuildFile 715 | 716 | E91604781912D2AC0025CC1B 717 | 718 | fileRef 719 | E91604571912D2AC0025CC1B 720 | isa 721 | PBXBuildFile 722 | 723 | E91604791912D2AC0025CC1B 724 | 725 | containerPortal 726 | E91604481912D2AC0025CC1B 727 | isa 728 | PBXContainerItemProxy 729 | proxyType 730 | 1 731 | remoteGlobalIDString 732 | E916044F1912D2AC0025CC1B 733 | remoteInfo 734 | APHorizontalMenu 735 | 736 | E916047A1912D2AC0025CC1B 737 | 738 | isa 739 | PBXTargetDependency 740 | target 741 | E916044F1912D2AC0025CC1B 742 | targetProxy 743 | E91604791912D2AC0025CC1B 744 | 745 | E916047B1912D2AC0025CC1B 746 | 747 | children 748 | 749 | E91604811912D2AC0025CC1B 750 | E916047C1912D2AC0025CC1B 751 | 752 | isa 753 | PBXGroup 754 | path 755 | APHorizontalMenuTests 756 | sourceTree 757 | <group> 758 | 759 | E916047C1912D2AC0025CC1B 760 | 761 | children 762 | 763 | E916047D1912D2AC0025CC1B 764 | E916047E1912D2AC0025CC1B 765 | 766 | isa 767 | PBXGroup 768 | name 769 | Supporting Files 770 | sourceTree 771 | <group> 772 | 773 | E916047D1912D2AC0025CC1B 774 | 775 | isa 776 | PBXFileReference 777 | lastKnownFileType 778 | text.plist.xml 779 | path 780 | APHorizontalMenuTests-Info.plist 781 | sourceTree 782 | <group> 783 | 784 | E916047E1912D2AC0025CC1B 785 | 786 | children 787 | 788 | E916047F1912D2AC0025CC1B 789 | 790 | isa 791 | PBXVariantGroup 792 | name 793 | InfoPlist.strings 794 | sourceTree 795 | <group> 796 | 797 | E916047F1912D2AC0025CC1B 798 | 799 | isa 800 | PBXFileReference 801 | lastKnownFileType 802 | text.plist.strings 803 | name 804 | en 805 | path 806 | en.lproj/InfoPlist.strings 807 | sourceTree 808 | <group> 809 | 810 | E91604801912D2AC0025CC1B 811 | 812 | fileRef 813 | E916047E1912D2AC0025CC1B 814 | isa 815 | PBXBuildFile 816 | 817 | E91604811912D2AC0025CC1B 818 | 819 | isa 820 | PBXFileReference 821 | lastKnownFileType 822 | sourcecode.c.objc 823 | path 824 | APHorizontalMenuTests.m 825 | sourceTree 826 | <group> 827 | 828 | E91604821912D2AC0025CC1B 829 | 830 | fileRef 831 | E91604811912D2AC0025CC1B 832 | isa 833 | PBXBuildFile 834 | 835 | E91604831912D2AC0025CC1B 836 | 837 | buildSettings 838 | 839 | ALWAYS_SEARCH_USER_PATHS 840 | NO 841 | CLANG_CXX_LANGUAGE_STANDARD 842 | gnu++0x 843 | CLANG_CXX_LIBRARY 844 | libc++ 845 | CLANG_ENABLE_MODULES 846 | YES 847 | CLANG_ENABLE_OBJC_ARC 848 | YES 849 | CLANG_WARN_BOOL_CONVERSION 850 | YES 851 | CLANG_WARN_CONSTANT_CONVERSION 852 | YES 853 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 854 | YES_ERROR 855 | CLANG_WARN_EMPTY_BODY 856 | YES 857 | CLANG_WARN_ENUM_CONVERSION 858 | YES 859 | CLANG_WARN_INT_CONVERSION 860 | YES 861 | CLANG_WARN_OBJC_ROOT_CLASS 862 | YES_ERROR 863 | CLANG_WARN__DUPLICATE_METHOD_MATCH 864 | YES 865 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 866 | iPhone Developer 867 | COPY_PHASE_STRIP 868 | NO 869 | GCC_C_LANGUAGE_STANDARD 870 | gnu99 871 | GCC_DYNAMIC_NO_PIC 872 | NO 873 | GCC_OPTIMIZATION_LEVEL 874 | 0 875 | GCC_PREPROCESSOR_DEFINITIONS 876 | 877 | DEBUG=1 878 | $(inherited) 879 | 880 | GCC_SYMBOLS_PRIVATE_EXTERN 881 | NO 882 | GCC_WARN_64_TO_32_BIT_CONVERSION 883 | YES 884 | GCC_WARN_ABOUT_RETURN_TYPE 885 | YES_ERROR 886 | GCC_WARN_UNDECLARED_SELECTOR 887 | YES 888 | GCC_WARN_UNINITIALIZED_AUTOS 889 | YES_AGGRESSIVE 890 | GCC_WARN_UNUSED_FUNCTION 891 | YES 892 | GCC_WARN_UNUSED_VARIABLE 893 | YES 894 | IPHONEOS_DEPLOYMENT_TARGET 895 | 7.1 896 | ONLY_ACTIVE_ARCH 897 | YES 898 | SDKROOT 899 | iphoneos 900 | TARGETED_DEVICE_FAMILY 901 | 1,2 902 | 903 | isa 904 | XCBuildConfiguration 905 | name 906 | Debug 907 | 908 | E91604841912D2AC0025CC1B 909 | 910 | buildSettings 911 | 912 | ALWAYS_SEARCH_USER_PATHS 913 | NO 914 | CLANG_CXX_LANGUAGE_STANDARD 915 | gnu++0x 916 | CLANG_CXX_LIBRARY 917 | libc++ 918 | CLANG_ENABLE_MODULES 919 | YES 920 | CLANG_ENABLE_OBJC_ARC 921 | YES 922 | CLANG_WARN_BOOL_CONVERSION 923 | YES 924 | CLANG_WARN_CONSTANT_CONVERSION 925 | YES 926 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 927 | YES_ERROR 928 | CLANG_WARN_EMPTY_BODY 929 | YES 930 | CLANG_WARN_ENUM_CONVERSION 931 | YES 932 | CLANG_WARN_INT_CONVERSION 933 | YES 934 | CLANG_WARN_OBJC_ROOT_CLASS 935 | YES_ERROR 936 | CLANG_WARN__DUPLICATE_METHOD_MATCH 937 | YES 938 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 939 | iPhone Developer 940 | COPY_PHASE_STRIP 941 | YES 942 | ENABLE_NS_ASSERTIONS 943 | NO 944 | GCC_C_LANGUAGE_STANDARD 945 | gnu99 946 | GCC_WARN_64_TO_32_BIT_CONVERSION 947 | YES 948 | GCC_WARN_ABOUT_RETURN_TYPE 949 | YES_ERROR 950 | GCC_WARN_UNDECLARED_SELECTOR 951 | YES 952 | GCC_WARN_UNINITIALIZED_AUTOS 953 | YES_AGGRESSIVE 954 | GCC_WARN_UNUSED_FUNCTION 955 | YES 956 | GCC_WARN_UNUSED_VARIABLE 957 | YES 958 | IPHONEOS_DEPLOYMENT_TARGET 959 | 7.1 960 | SDKROOT 961 | iphoneos 962 | TARGETED_DEVICE_FAMILY 963 | 1,2 964 | VALIDATE_PRODUCT 965 | YES 966 | 967 | isa 968 | XCBuildConfiguration 969 | name 970 | Release 971 | 972 | E91604851912D2AC0025CC1B 973 | 974 | buildConfigurations 975 | 976 | E91604861912D2AC0025CC1B 977 | E91604871912D2AC0025CC1B 978 | 979 | defaultConfigurationIsVisible 980 | 0 981 | defaultConfigurationName 982 | Release 983 | isa 984 | XCConfigurationList 985 | 986 | E91604861912D2AC0025CC1B 987 | 988 | baseConfigurationReference 989 | 1CB420C95EC947029E4F1683 990 | buildSettings 991 | 992 | ASSETCATALOG_COMPILER_APPICON_NAME 993 | AppIcon 994 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME 995 | LaunchImage 996 | GCC_PRECOMPILE_PREFIX_HEADER 997 | YES 998 | GCC_PREFIX_HEADER 999 | APHorizontalMenu/APHorizontalMenu-Prefix.pch 1000 | INFOPLIST_FILE 1001 | APHorizontalMenu/APHorizontalMenu-Info.plist 1002 | PRODUCT_NAME 1003 | $(TARGET_NAME) 1004 | WRAPPER_EXTENSION 1005 | app 1006 | 1007 | isa 1008 | XCBuildConfiguration 1009 | name 1010 | Debug 1011 | 1012 | E91604871912D2AC0025CC1B 1013 | 1014 | baseConfigurationReference 1015 | 1CB420C95EC947029E4F1683 1016 | buildSettings 1017 | 1018 | ASSETCATALOG_COMPILER_APPICON_NAME 1019 | AppIcon 1020 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME 1021 | LaunchImage 1022 | GCC_PRECOMPILE_PREFIX_HEADER 1023 | YES 1024 | GCC_PREFIX_HEADER 1025 | APHorizontalMenu/APHorizontalMenu-Prefix.pch 1026 | INFOPLIST_FILE 1027 | APHorizontalMenu/APHorizontalMenu-Info.plist 1028 | PRODUCT_NAME 1029 | $(TARGET_NAME) 1030 | WRAPPER_EXTENSION 1031 | app 1032 | 1033 | isa 1034 | XCBuildConfiguration 1035 | name 1036 | Release 1037 | 1038 | E91604881912D2AC0025CC1B 1039 | 1040 | buildConfigurations 1041 | 1042 | E91604891912D2AC0025CC1B 1043 | E916048A1912D2AC0025CC1B 1044 | 1045 | defaultConfigurationIsVisible 1046 | 0 1047 | defaultConfigurationName 1048 | Release 1049 | isa 1050 | XCConfigurationList 1051 | 1052 | E91604891912D2AC0025CC1B 1053 | 1054 | buildSettings 1055 | 1056 | BUNDLE_LOADER 1057 | $(BUILT_PRODUCTS_DIR)/APHorizontalMenu.app/APHorizontalMenu 1058 | FRAMEWORK_SEARCH_PATHS 1059 | 1060 | $(SDKROOT)/Developer/Library/Frameworks 1061 | $(inherited) 1062 | $(DEVELOPER_FRAMEWORKS_DIR) 1063 | 1064 | GCC_PRECOMPILE_PREFIX_HEADER 1065 | YES 1066 | GCC_PREFIX_HEADER 1067 | APHorizontalMenu/APHorizontalMenu-Prefix.pch 1068 | GCC_PREPROCESSOR_DEFINITIONS 1069 | 1070 | DEBUG=1 1071 | $(inherited) 1072 | 1073 | INFOPLIST_FILE 1074 | APHorizontalMenuTests/APHorizontalMenuTests-Info.plist 1075 | PRODUCT_NAME 1076 | $(TARGET_NAME) 1077 | TEST_HOST 1078 | $(BUNDLE_LOADER) 1079 | WRAPPER_EXTENSION 1080 | xctest 1081 | 1082 | isa 1083 | XCBuildConfiguration 1084 | name 1085 | Debug 1086 | 1087 | E916048A1912D2AC0025CC1B 1088 | 1089 | buildSettings 1090 | 1091 | BUNDLE_LOADER 1092 | $(BUILT_PRODUCTS_DIR)/APHorizontalMenu.app/APHorizontalMenu 1093 | FRAMEWORK_SEARCH_PATHS 1094 | 1095 | $(SDKROOT)/Developer/Library/Frameworks 1096 | $(inherited) 1097 | $(DEVELOPER_FRAMEWORKS_DIR) 1098 | 1099 | GCC_PRECOMPILE_PREFIX_HEADER 1100 | YES 1101 | GCC_PREFIX_HEADER 1102 | APHorizontalMenu/APHorizontalMenu-Prefix.pch 1103 | INFOPLIST_FILE 1104 | APHorizontalMenuTests/APHorizontalMenuTests-Info.plist 1105 | PRODUCT_NAME 1106 | $(TARGET_NAME) 1107 | TEST_HOST 1108 | $(BUNDLE_LOADER) 1109 | WRAPPER_EXTENSION 1110 | xctest 1111 | 1112 | isa 1113 | XCBuildConfiguration 1114 | name 1115 | Release 1116 | 1117 | 1118 | rootObject 1119 | E91604481912D2AC0025CC1B 1120 | 1121 | 1122 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/APHorizontalMenu-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.abelpascual.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/APHorizontalMenu-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 01/05/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 01/05/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/Base.lproj/Main_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /Example/APHorizontalMenu/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /Example/APHorizontalMenu/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 01/05/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "APHorizontalMenu.h" 11 | 12 | @interface ViewController : UIViewController 13 | 14 | @property (weak, nonatomic) IBOutlet APHorizontalMenu *horizontalMenu; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 01/05/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.horizontalMenu.values = @[@"Item 1", @"Item 2", @"Item 3", @"Item 4", @"Item 5", @"Item 6", @"Item 7", @"Item 8", @"Item 9", @"Item 10"]; 20 | self.horizontalMenu.delegate = self; 21 | 22 | // Optional settings 23 | //self.horizontalMenu.cellBackgroundColor = [UIColor brownColor]; 24 | //self.horizontalMenu.cellSelectedColor = [UIColor greenColor]; 25 | //self.horizontalMenu.textColor = [UIColor blackColor]; 26 | //self.horizontalMenu.textSelectedColor = [UIColor blueColor]; 27 | //self.horizontalMenu.selectedIndex = 2; 28 | //self.horizontalMenu.visibleItems = 3; 29 | 30 | APHorizontalMenu *menu2 = [[APHorizontalMenu alloc] initWithFrame:CGRectMake(0, 200, 320, 40)]; 31 | menu2.values = @[@"Item 1", @"Item 2", @"Item 3", @"Item 4", @"Item 5", @"Item 6", @"Item 7", @"Item 8", @"Item 9", @"Item 10"]; 32 | [self.view addSubview:menu2]; 33 | } 34 | 35 | - (void)horizontalMenu:(id)horizontalMenu didSelectPosition:(NSInteger)index { 36 | NSLog(@"APHorizontalMenu selection: %ld", (long)index); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/APHorizontalMenu/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 01/05/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/APHorizontalMenuTests/APHorizontalMenuTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.abelpascual.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/APHorizontalMenuTests/APHorizontalMenuTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // APHorizontalMenuTests.m 3 | // APHorizontalMenuTests 4 | // 5 | // Created by Abel Pascual on 01/05/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface APHorizontalMenuTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation APHorizontalMenuTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/APHorizontalMenuTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '6.0' 2 | 3 | pod "APHorizontalMenu", :git => 'https://github.com/apascual/APHorizontalMenu.git' 4 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - APHorizontalMenu (1.0) 3 | 4 | DEPENDENCIES: 5 | - APHorizontalMenu (from `https://github.com/apascual/APHorizontalMenu.git`) 6 | 7 | EXTERNAL SOURCES: 8 | APHorizontalMenu: 9 | :git: https://github.com/apascual/APHorizontalMenu.git 10 | 11 | SPEC CHECKSUMS: 12 | APHorizontalMenu: 4ff4cbedb39988502effb514d18c74d470638d6b 13 | 14 | COCOAPODS: 0.32.1 15 | -------------------------------------------------------------------------------- /Example/Pods/APHorizontalMenu/Classes/APHorizontalMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // APHorizontalMenu.h 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 17/03/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // Default values 12 | #define AP_HORIZONTAL_MENU_SELECTED_INDEX_DEFAULT 0 13 | #define AP_HORIZONTAL_MENU_CELL_BACKGROUND_COLOR_DEFAULT [UIColor grayColor] 14 | #define AP_HORIZONTAL_MENU_CELL_SELECTED_COLOR_DEFAULT [UIColor colorWithRed:150.0/255.0 green:200.0/255.0 blue:150.0/255.0 alpha:1.0] 15 | #define AP_HORIZONTAL_MENU_TEXT_COLOR_DEFAULT [UIColor whiteColor] 16 | #define AP_HORIZONTAL_MENU_TEXT_SELECTED_COLOR_DEFAULT [UIColor grayColor] 17 | #define AP_HORIZONTAL_MENU_TEXT_FONT [UIFont boldSystemFontOfSize:16.0] 18 | 19 | // Protocol to get the selected item 20 | @protocol APHorizontalMenuSelectDelegate 21 | 22 | @required 23 | - (void)horizontalMenu:(id)horizontalMenu didSelectPosition:(NSInteger)index; 24 | 25 | @end 26 | 27 | @interface APHorizontalMenu : UIView 28 | 29 | @property (nonatomic, weak) IBOutlet id delegate; 30 | @property (nonatomic, copy) NSArray *values; 31 | @property (nonatomic) NSInteger selectedIndex; 32 | 33 | @property (nonatomic) NSInteger visibleItems; 34 | 35 | @property (nonatomic, strong) UIColor *cellSelectedColor; 36 | @property (nonatomic, strong) UIColor *cellBackgroundColor; 37 | @property (nonatomic, strong) UIColor *textColor; 38 | @property (nonatomic, strong) UIColor *textSelectedColor; 39 | @property (nonatomic, strong) UIFont *textFont; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Example/Pods/APHorizontalMenu/Classes/APHorizontalMenu.m: -------------------------------------------------------------------------------- 1 | // 2 | // APHorizontalMenu.m 3 | // APHorizontalMenu 4 | // 5 | // Created by Abel Pascual on 17/03/14. 6 | // Copyright (c) 2014 Abel Pascual. All rights reserved. 7 | // 8 | 9 | #import "APHorizontalMenu.h" 10 | 11 | @interface APHorizontalMenu () 12 | 13 | @property (nonatomic, strong) UITableView *tableView; 14 | @property (nonatomic) NSInteger cellWidth; 15 | @property (nonatomic) BOOL isTouchAnimation; 16 | 17 | @end 18 | 19 | @implementation APHorizontalMenu 20 | 21 | #pragma mark - Initialization 22 | 23 | - (id)initWithCoder:(NSCoder *)aDecoder { 24 | self = [super initWithCoder:aDecoder]; 25 | if(self) { 26 | [self customInit]; 27 | } 28 | return self; 29 | } 30 | 31 | - (id)initWithFrame:(CGRect)frame { 32 | self = [super initWithFrame:frame]; 33 | if (self) { 34 | [self customInit]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)customInit { 40 | 41 | _selectedIndex = AP_HORIZONTAL_MENU_SELECTED_INDEX_DEFAULT; 42 | _cellSelectedColor = AP_HORIZONTAL_MENU_CELL_SELECTED_COLOR_DEFAULT; 43 | _cellBackgroundColor = AP_HORIZONTAL_MENU_CELL_BACKGROUND_COLOR_DEFAULT; 44 | _textColor = AP_HORIZONTAL_MENU_TEXT_COLOR_DEFAULT; 45 | _textSelectedColor = AP_HORIZONTAL_MENU_TEXT_SELECTED_COLOR_DEFAULT; 46 | _textFont = AP_HORIZONTAL_MENU_TEXT_FONT; 47 | 48 | // Number of items visibles in iPhone / iPod Touch 49 | _visibleItems = 3; 50 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 51 | // Number of items visible in iPad 52 | _visibleItems = 5; 53 | } 54 | } 55 | 56 | - (void)createMenuControl { 57 | [self.tableView removeFromSuperview]; 58 | self.tableView=nil; 59 | 60 | CGRect frame = CGRectMake(0, 0, self.frame.size.height,self.frame.size.width); 61 | self.tableView = [[UITableView alloc] initWithFrame:frame style:UITableViewStylePlain]; 62 | self.tableView.backgroundColor = [UIColor clearColor]; 63 | self.tableView.dataSource = self; 64 | self.tableView.delegate = self; 65 | [self addSubview:self.tableView]; 66 | 67 | CGPoint oldCenter = self.center; 68 | oldCenter.y = frame.size.width/2; 69 | self.tableView.transform=CGAffineTransformMakeRotation(-M_PI_2); 70 | self.tableView.center = oldCenter; 71 | self.tableView.showsVerticalScrollIndicator = NO; 72 | [self.tableView setDecelerationRate: UIScrollViewDecelerationRateNormal]; 73 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 74 | } 75 | 76 | - (void)layoutSubviews { 77 | [super layoutSubviews]; 78 | [self createMenuControl]; 79 | [self update]; 80 | } 81 | 82 | #pragma mark - Custom setters 83 | 84 | - (void)setSelectedIndex:(NSInteger)selectedIndex 85 | { 86 | if(_selectedIndex != selectedIndex) { 87 | [self setCurrentIndex:[NSIndexPath indexPathForRow:selectedIndex inSection:0] animated:YES]; 88 | } 89 | } 90 | 91 | - (void)setValues:(NSArray *)values 92 | { 93 | if(_values != values) { 94 | _values = values; 95 | [self update]; 96 | } 97 | } 98 | 99 | - (void)setCellSelectedColor:(UIColor *)cellSelectedColor { 100 | _cellSelectedColor = cellSelectedColor; 101 | [self update]; 102 | } 103 | 104 | - (void)setCellBackgroundColor:(UIColor *)cellBackgroundColor { 105 | _cellBackgroundColor = cellBackgroundColor; 106 | [self update]; 107 | } 108 | 109 | - (void)setTextColor:(UIColor *)textColor { 110 | _textColor = textColor; 111 | [self update]; 112 | } 113 | 114 | - (void)setTextSelectedColor:(UIColor *)textSelectedColor { 115 | _textSelectedColor = textSelectedColor; 116 | [self update]; 117 | } 118 | 119 | - (void)setVisibleItems:(NSInteger)visibleItems { 120 | _visibleItems = visibleItems; 121 | [self update]; 122 | } 123 | 124 | - (void)setTextFont:(UIFont *)textFont { 125 | _textFont = textFont; 126 | [self update]; 127 | } 128 | 129 | - (void)update { 130 | self.cellWidth = self.frame.size.width/self.visibleItems; 131 | self.backgroundColor = self.cellBackgroundColor; 132 | 133 | NSInteger viewWidth = self.frame.size.width; 134 | CGFloat f = (viewWidth-self.cellWidth)/2; 135 | [self.tableView setContentInset: UIEdgeInsetsMake(f, 0, f, 0)]; 136 | self.clipsToBounds = YES; 137 | 138 | [self.tableView reloadData]; 139 | if(self.values.count > self.selectedIndex) 140 | { 141 | [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:self.selectedIndex inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop]; 142 | } 143 | } 144 | 145 | #pragma mark - UITableView control 146 | 147 | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 148 | { 149 | return self.cellWidth; 150 | } 151 | 152 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 153 | { 154 | return self.values.count; 155 | } 156 | 157 | - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 158 | 159 | static NSString* reuseIdentifier = @"Cell"; 160 | 161 | UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; 162 | 163 | if(!cell) 164 | { 165 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; 166 | cell.transform = CGAffineTransformMakeRotation(M_PI_2); 167 | cell.backgroundColor = [UIColor clearColor]; 168 | 169 | UILabel* txtItemTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.cellWidth, self.frame.size.height)]; 170 | txtItemTitle.font = self.textFont; 171 | txtItemTitle.textColor = self.textColor; 172 | txtItemTitle.highlightedTextColor = self.textSelectedColor; 173 | txtItemTitle.textAlignment = NSTextAlignmentCenter; 174 | txtItemTitle.tag = 1001; 175 | 176 | [cell.contentView addSubview:txtItemTitle]; 177 | } 178 | 179 | UIView *bgColorView = [[UIView alloc] init]; 180 | bgColorView.backgroundColor = self.cellSelectedColor; 181 | bgColorView.layer.masksToBounds = YES; 182 | [cell setSelectedBackgroundView:bgColorView]; 183 | 184 | UILabel* txtItemTitle = (UILabel *)[cell viewWithTag:1001]; 185 | txtItemTitle.text = [self.values objectAtIndex:indexPath.row]; 186 | 187 | return cell; 188 | } 189 | 190 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 191 | self.isTouchAnimation = YES; 192 | [self setCurrentIndex:indexPath animated:YES]; 193 | } 194 | 195 | #pragma mark - Scroll control 196 | 197 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 198 | if(!self.isTouchAnimation) 199 | { 200 | CGPoint point = [self convertPoint:CGPointMake(self.frame.size.width/2.0, self.frame.size.height/2.0) toView:self.tableView]; 201 | NSIndexPath* centerIndexPath = [self.tableView indexPathForRowAtPoint:point]; 202 | [self.tableView selectRowAtIndexPath:centerIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; 203 | } 204 | } 205 | 206 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { 207 | if (decelerate == NO) { 208 | [self centerTable]; 209 | } 210 | } 211 | 212 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { 213 | [self centerTable]; 214 | } 215 | 216 | - (void)centerTable { 217 | CGPoint point = [self convertPoint:CGPointMake(self.frame.size.width/2.0, self.frame.size.height/2.0) toView:self.tableView]; 218 | NSIndexPath* centerIndexPath = [self.tableView indexPathForRowAtPoint:point]; 219 | [self setCurrentIndex:centerIndexPath animated:YES]; 220 | } 221 | 222 | - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { 223 | self.isTouchAnimation = NO; 224 | } 225 | 226 | - (void) setCurrentIndex:(NSIndexPath *)indexPath animated:(BOOL)animated { 227 | if(self.isTouchAnimation || _selectedIndex != indexPath.row) { 228 | 229 | [self.tableView selectRowAtIndexPath:indexPath animated:animated scrollPosition:UITableViewScrollPositionTop]; 230 | 231 | if(_selectedIndex != indexPath.row) { 232 | _selectedIndex = indexPath.row; 233 | 234 | if ([self.delegate respondsToSelector:@selector(horizontalMenu:didSelectPosition:)]) { 235 | [self.delegate horizontalMenu:self didSelectPosition:indexPath.row]; 236 | } 237 | } 238 | } 239 | } 240 | 241 | @end 242 | -------------------------------------------------------------------------------- /Example/Pods/APHorizontalMenu/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Abel Pascual 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 | -------------------------------------------------------------------------------- /Example/Pods/APHorizontalMenu/README.md: -------------------------------------------------------------------------------- 1 | # APHorizontalMenu 2 | 3 | [![Version](http://cocoapod-badges.herokuapp.com/v/APHorizontalMenu/badge.png)](http://cocoadocs.org/docsets/APHorizontalMenu) 4 | [![Platform](http://cocoapod-badges.herokuapp.com/p/APHorizontalMenu/badge.png)](http://cocoadocs.org/docsets/APHorizontalMenu) 5 | 6 | ## Usage 7 | 8 | To run the example project; clone the repo, and run `pod install` from the Example directory first. 9 | 10 | ## Requirements 11 | 12 | ## Installation 13 | 14 | APHorizontalMenu is available through [CocoaPods](http://cocoapods.org), to install 15 | it simply add the following line to your Podfile: 16 | 17 | pod "APHorizontalMenu" 18 | 19 | ## Author 20 | 21 | Abel Pascual, abelpascual@gmail.com 22 | 23 | ## License 24 | 25 | APHorizontalMenu is available under the MIT license. See the LICENSE file for more info. 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/BuildHeaders/APHorizontalMenu/APHorizontalMenu.h: -------------------------------------------------------------------------------- 1 | ../../APHorizontalMenu/Classes/APHorizontalMenu.h -------------------------------------------------------------------------------- /Example/Pods/Headers/APHorizontalMenu/APHorizontalMenu.h: -------------------------------------------------------------------------------- 1 | ../../APHorizontalMenu/Classes/APHorizontalMenu.h -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/APHorizontalMenu.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint NAME.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 6 | # 7 | Pod::Spec.new do |s| 8 | s.name = "APHorizontalMenu" 9 | s.version = "1.0" 10 | s.summary = "Customizable horizontal menu" 11 | s.description = "APHorizontalMenu is a completely customizable horizontal menu that can be created in the Storyboard or directly by code." 12 | s.homepage = "https://github.com/apascual/APHorizontalMenu" 13 | s.screenshots = "https://raw.githubusercontent.com/apascual/APHorizontalMenu/master/Images/iPhone.png", "https://raw.githubusercontent.com/apascual/APHorizontalMenu/master/Images/iPad.png" 14 | s.license = 'MIT' 15 | s.author = { "Abel Pascual" => "abelpascual@gmail.com" } 16 | s.source = { :git => "https://github.com/apascual/APHorizontalMenu.git", :tag => s.version.to_s } 17 | s.social_media_url = 'https://twitter.com/Abel_Pascual' 18 | 19 | s.platform = :ios, "6.0" 20 | s.requires_arc = true 21 | 22 | s.source_files = 'Classes' 23 | 24 | end 25 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - APHorizontalMenu (1.0) 3 | 4 | DEPENDENCIES: 5 | - APHorizontalMenu (from `https://github.com/apascual/APHorizontalMenu.git`) 6 | 7 | EXTERNAL SOURCES: 8 | APHorizontalMenu: 9 | :git: https://github.com/apascual/APHorizontalMenu.git 10 | 11 | SPEC CHECKSUMS: 12 | APHorizontalMenu: 4ff4cbedb39988502effb514d18c74d470638d6b 13 | 14 | COCOAPODS: 0.32.1 15 | -------------------------------------------------------------------------------- /Example/Pods/Pods-APHorizontalMenu-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-APHorizontalMenu.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/APHorizontalMenu" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/APHorizontalMenu" 4 | OTHER_LDFLAGS = -ObjC 5 | PODS_ROOT = ${SRCROOT} -------------------------------------------------------------------------------- /Example/Pods/Pods-APHorizontalMenu-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_APHorizontalMenu : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_APHorizontalMenu 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Pods-APHorizontalMenu-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Pods-APHorizontalMenu.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apascual/APHorizontalMenu/b245fa94ce3ec06d9d34af026c60711a07595e3c/Example/Pods/Pods-APHorizontalMenu.xcconfig -------------------------------------------------------------------------------- /Example/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## APHorizontalMenu 5 | 6 | Copyright (c) 2014 Abel Pascual 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014 Abel Pascual <abelpascual@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | APHorizontalMenu 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Pods-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // APHorizontalMenu 10 | #define COCOAPODS_POD_AVAILABLE_APHorizontalMenu 11 | #define COCOAPODS_VERSION_MAJOR_APHorizontalMenu 1 12 | #define COCOAPODS_VERSION_MINOR_APHorizontalMenu 0 13 | #define COCOAPODS_VERSION_PATCH_APHorizontalMenu 0 14 | 15 | -------------------------------------------------------------------------------- /Example/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 5 | > "$RESOURCES_TO_COPY" 6 | 7 | install_resource() 8 | { 9 | case $1 in 10 | *.storyboard) 11 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 12 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 13 | ;; 14 | *.xib) 15 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 16 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 17 | ;; 18 | *.framework) 19 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 21 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 22 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 23 | ;; 24 | *.xcdatamodel) 25 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 26 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 27 | ;; 28 | *.xcdatamodeld) 29 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 30 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 31 | ;; 32 | *.xcassets) 33 | ;; 34 | /*) 35 | echo "$1" 36 | echo "$1" >> "$RESOURCES_TO_COPY" 37 | ;; 38 | *) 39 | echo "${PODS_ROOT}/$1" 40 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 41 | ;; 42 | esac 43 | } 44 | 45 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 46 | if [[ "${ACTION}" == "install" ]]; then 47 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 48 | fi 49 | rm -f "$RESOURCES_TO_COPY" 50 | 51 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ `xcrun --find actool` ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] 52 | then 53 | case "${TARGETED_DEVICE_FAMILY}" in 54 | 1,2) 55 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 56 | ;; 57 | 1) 58 | TARGET_DEVICE_ARGS="--target-device iphone" 59 | ;; 60 | 2) 61 | TARGET_DEVICE_ARGS="--target-device ipad" 62 | ;; 63 | *) 64 | TARGET_DEVICE_ARGS="--target-device mac" 65 | ;; 66 | esac 67 | find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 68 | fi 69 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/APHorizontalMenu" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers" -isystem "${PODS_ROOT}/Headers/APHorizontalMenu" 4 | OTHER_LDFLAGS = -ObjC 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | archiveVersion 6 | 1 7 | classes 8 | 9 | objectVersion 10 | 46 11 | objects 12 | 13 | 03E8EC7C8ACF4ADCBA1F205B 14 | 15 | explicitFileType 16 | archive.ar 17 | includeInIndex 18 | 0 19 | isa 20 | PBXFileReference 21 | path 22 | libPods-APHorizontalMenu.a 23 | sourceTree 24 | BUILT_PRODUCTS_DIR 25 | 26 | 04783886BCA14573A5949E9C 27 | 28 | isa 29 | PBXTargetDependency 30 | target 31 | B5B47A169226404EBDF24F7D 32 | targetProxy 33 | 283D143E8E0240249AEA8460 34 | 35 | 056339F76BF44334A79873A6 36 | 37 | children 38 | 39 | 7B6694AC8154410694033FF3 40 | 5C9108CDB84C466E893D03B3 41 | 42B9AE2097E1472E984AC7C6 42 | B33FB21B0D614AD6854CA349 43 | 776668D991254B8EB29D3E66 44 | 142B3D33849D4BCCB3188D11 45 | 46 | isa 47 | PBXGroup 48 | name 49 | Pods 50 | sourceTree 51 | <group> 52 | 53 | 13028B0492034F5E8A0A799A 54 | 55 | includeInIndex 56 | 1 57 | isa 58 | PBXFileReference 59 | lastKnownFileType 60 | sourcecode.c.objc 61 | name 62 | APHorizontalMenu.m 63 | path 64 | Classes/APHorizontalMenu.m 65 | sourceTree 66 | <group> 67 | 68 | 142B3D33849D4BCCB3188D11 69 | 70 | includeInIndex 71 | 1 72 | isa 73 | PBXFileReference 74 | lastKnownFileType 75 | text.script.sh 76 | path 77 | Pods-resources.sh 78 | sourceTree 79 | <group> 80 | 81 | 1473A26A63C040CCA3FB7BB7 82 | 83 | buildActionMask 84 | 2147483647 85 | files 86 | 87 | 81ACFD51CDD24398A53FD676 88 | F6F00BA1BA384361A2D92886 89 | 90 | isa 91 | PBXFrameworksBuildPhase 92 | runOnlyForDeploymentPostprocessing 93 | 0 94 | 95 | 26692E837BFD4A2F8FDB8D69 96 | 97 | buildActionMask 98 | 2147483647 99 | files 100 | 101 | AFC96B47128644109852C290 102 | AD57D19DAD3B4C45A988C892 103 | 104 | isa 105 | PBXSourcesBuildPhase 106 | runOnlyForDeploymentPostprocessing 107 | 0 108 | 109 | 2704813F27EA41FE9B16ED6C 110 | 111 | buildActionMask 112 | 2147483647 113 | files 114 | 115 | 6FFBC8C503E241A88EA488E6 116 | 117 | isa 118 | PBXFrameworksBuildPhase 119 | runOnlyForDeploymentPostprocessing 120 | 0 121 | 122 | 281E90DBA005406D898B3A14 123 | 124 | children 125 | 126 | 056339F76BF44334A79873A6 127 | 128 | isa 129 | PBXGroup 130 | name 131 | Targets Support Files 132 | sourceTree 133 | <group> 134 | 135 | 283D143E8E0240249AEA8460 136 | 137 | containerPortal 138 | 7B33A19F47E040B0835021A7 139 | isa 140 | PBXContainerItemProxy 141 | proxyType 142 | 1 143 | remoteGlobalIDString 144 | B5B47A169226404EBDF24F7D 145 | remoteInfo 146 | Pods-APHorizontalMenu 147 | 148 | 2856E358FD08428CB5EDDCBC 149 | 150 | children 151 | 152 | B4C2D50040DC4BE4ACDD8876 153 | E46D128B6B03430D9AB2119E 154 | 50B691930BC841029A0A6A65 155 | C831D90BA84644D098469E1B 156 | 157 | isa 158 | PBXGroup 159 | name 160 | Support Files 161 | sourceTree 162 | SOURCE_ROOT 163 | 164 | 347A27ACA3404B6099320606 165 | 166 | buildActionMask 167 | 2147483647 168 | files 169 | 170 | 5974A7810FBB46A4A0314873 171 | 172 | isa 173 | PBXHeadersBuildPhase 174 | runOnlyForDeploymentPostprocessing 175 | 0 176 | 177 | 359828BD3ED9407EBE2E4824 178 | 179 | buildConfigurations 180 | 181 | C0CB19EE8BA5427DAD10D0B0 182 | F80D850402B8465395E7F5FD 183 | 184 | defaultConfigurationIsVisible 185 | 0 186 | defaultConfigurationName 187 | Release 188 | isa 189 | XCConfigurationList 190 | 191 | 428397966BDB490DA6A9FB05 192 | 193 | children 194 | 195 | E32CC3A81B874F3698C23D33 196 | 197 | isa 198 | PBXGroup 199 | name 200 | iOS 201 | sourceTree 202 | <group> 203 | 204 | 42B9AE2097E1472E984AC7C6 205 | 206 | includeInIndex 207 | 1 208 | isa 209 | PBXFileReference 210 | lastKnownFileType 211 | text.plist.xml 212 | path 213 | Pods-acknowledgements.plist 214 | sourceTree 215 | <group> 216 | 217 | 4ECEEA976A2245559646243E 218 | 219 | children 220 | 221 | 5351B0F2FDAD4A61A7CD3691 222 | 9AFEA4D57B9E4E5E8647490B 223 | 96BFE5A3F31B4B0CBB247297 224 | 529470912B8E4C19B7A6E22A 225 | 281E90DBA005406D898B3A14 226 | 227 | isa 228 | PBXGroup 229 | sourceTree 230 | <group> 231 | 232 | 50B691930BC841029A0A6A65 233 | 234 | includeInIndex 235 | 1 236 | isa 237 | PBXFileReference 238 | lastKnownFileType 239 | sourcecode.c.objc 240 | path 241 | Pods-APHorizontalMenu-dummy.m 242 | sourceTree 243 | <group> 244 | 245 | 529470912B8E4C19B7A6E22A 246 | 247 | children 248 | 249 | B9BB155702964728A2E866F9 250 | 03E8EC7C8ACF4ADCBA1F205B 251 | 252 | isa 253 | PBXGroup 254 | name 255 | Products 256 | sourceTree 257 | <group> 258 | 259 | 5351B0F2FDAD4A61A7CD3691 260 | 261 | includeInIndex 262 | 1 263 | isa 264 | PBXFileReference 265 | lastKnownFileType 266 | text 267 | name 268 | Podfile 269 | path 270 | ../Podfile 271 | sourceTree 272 | SOURCE_ROOT 273 | xcLanguageSpecificationIdentifier 274 | xcode.lang.ruby 275 | 276 | 5974A7810FBB46A4A0314873 277 | 278 | fileRef 279 | E31AA29413D34FF5A07E15CD 280 | isa 281 | PBXBuildFile 282 | 283 | 5C9108CDB84C466E893D03B3 284 | 285 | includeInIndex 286 | 1 287 | isa 288 | PBXFileReference 289 | lastKnownFileType 290 | text 291 | path 292 | Pods-acknowledgements.markdown 293 | sourceTree 294 | <group> 295 | 296 | 65D40EB3F4B44B28AD112BB6 297 | 298 | children 299 | 300 | E31AA29413D34FF5A07E15CD 301 | 13028B0492034F5E8A0A799A 302 | 2856E358FD08428CB5EDDCBC 303 | 304 | isa 305 | PBXGroup 306 | name 307 | APHorizontalMenu 308 | path 309 | APHorizontalMenu 310 | sourceTree 311 | <group> 312 | 313 | 66FD0E4271234EF2A08459C3 314 | 315 | buildConfigurations 316 | 317 | BD525D4FA78247F7AAF3BBC7 318 | 802CB38B67B346A0A82EFA1E 319 | 320 | defaultConfigurationIsVisible 321 | 0 322 | defaultConfigurationName 323 | Release 324 | isa 325 | XCConfigurationList 326 | 327 | 695E7F29BBC149EB8189AEAF 328 | 329 | buildActionMask 330 | 2147483647 331 | files 332 | 333 | 9386821E4B0B4BACBE6419A9 334 | 335 | isa 336 | PBXSourcesBuildPhase 337 | runOnlyForDeploymentPostprocessing 338 | 0 339 | 340 | 6FFBC8C503E241A88EA488E6 341 | 342 | fileRef 343 | E32CC3A81B874F3698C23D33 344 | isa 345 | PBXBuildFile 346 | 347 | 776668D991254B8EB29D3E66 348 | 349 | includeInIndex 350 | 1 351 | isa 352 | PBXFileReference 353 | lastKnownFileType 354 | sourcecode.c.h 355 | path 356 | Pods-environment.h 357 | sourceTree 358 | <group> 359 | 360 | 7B33A19F47E040B0835021A7 361 | 362 | attributes 363 | 364 | LastUpgradeCheck 365 | 0510 366 | 367 | buildConfigurationList 368 | 359828BD3ED9407EBE2E4824 369 | compatibilityVersion 370 | Xcode 3.2 371 | developmentRegion 372 | English 373 | hasScannedForEncodings 374 | 0 375 | isa 376 | PBXProject 377 | knownRegions 378 | 379 | en 380 | 381 | mainGroup 382 | 4ECEEA976A2245559646243E 383 | productRefGroup 384 | 529470912B8E4C19B7A6E22A 385 | projectDirPath 386 | 387 | projectReferences 388 | 389 | projectRoot 390 | 391 | targets 392 | 393 | BFBDF029310644A299AD7548 394 | B5B47A169226404EBDF24F7D 395 | 396 | 397 | 7B6694AC8154410694033FF3 398 | 399 | includeInIndex 400 | 1 401 | isa 402 | PBXFileReference 403 | lastKnownFileType 404 | text.xcconfig 405 | path 406 | Pods.xcconfig 407 | sourceTree 408 | <group> 409 | 410 | 802CB38B67B346A0A82EFA1E 411 | 412 | baseConfigurationReference 413 | E46D128B6B03430D9AB2119E 414 | buildSettings 415 | 416 | ALWAYS_SEARCH_USER_PATHS 417 | NO 418 | COPY_PHASE_STRIP 419 | YES 420 | DSTROOT 421 | /tmp/xcodeproj.dst 422 | GCC_C_LANGUAGE_STANDARD 423 | gnu99 424 | GCC_PRECOMPILE_PREFIX_HEADER 425 | YES 426 | GCC_PREFIX_HEADER 427 | Pods-APHorizontalMenu-prefix.pch 428 | GCC_VERSION 429 | com.apple.compilers.llvm.clang.1_0 430 | INSTALL_PATH 431 | $(BUILT_PRODUCTS_DIR) 432 | IPHONEOS_DEPLOYMENT_TARGET 433 | 6.0 434 | OTHER_CFLAGS 435 | 436 | -DNS_BLOCK_ASSERTIONS=1 437 | $(inherited) 438 | 439 | OTHER_CPLUSPLUSFLAGS 440 | 441 | -DNS_BLOCK_ASSERTIONS=1 442 | $(inherited) 443 | 444 | OTHER_LDFLAGS 445 | 446 | PRODUCT_NAME 447 | $(TARGET_NAME) 448 | PUBLIC_HEADERS_FOLDER_PATH 449 | $(TARGET_NAME) 450 | SDKROOT 451 | iphoneos 452 | SKIP_INSTALL 453 | YES 454 | VALIDATE_PRODUCT 455 | YES 456 | 457 | isa 458 | XCBuildConfiguration 459 | name 460 | Release 461 | 462 | 81ACFD51CDD24398A53FD676 463 | 464 | fileRef 465 | E32CC3A81B874F3698C23D33 466 | isa 467 | PBXBuildFile 468 | 469 | 9386821E4B0B4BACBE6419A9 470 | 471 | fileRef 472 | B33FB21B0D614AD6854CA349 473 | isa 474 | PBXBuildFile 475 | 476 | 96BFE5A3F31B4B0CBB247297 477 | 478 | children 479 | 480 | 65D40EB3F4B44B28AD112BB6 481 | 482 | isa 483 | PBXGroup 484 | name 485 | Pods 486 | sourceTree 487 | <group> 488 | 489 | 991DDB0E4FE8436F854B4420 490 | 491 | baseConfigurationReference 492 | 7B6694AC8154410694033FF3 493 | buildSettings 494 | 495 | ALWAYS_SEARCH_USER_PATHS 496 | NO 497 | COPY_PHASE_STRIP 498 | NO 499 | DSTROOT 500 | /tmp/xcodeproj.dst 501 | GCC_C_LANGUAGE_STANDARD 502 | gnu99 503 | GCC_DYNAMIC_NO_PIC 504 | NO 505 | GCC_OPTIMIZATION_LEVEL 506 | 0 507 | GCC_PRECOMPILE_PREFIX_HEADER 508 | YES 509 | GCC_PREPROCESSOR_DEFINITIONS 510 | 511 | DEBUG=1 512 | $(inherited) 513 | 514 | GCC_SYMBOLS_PRIVATE_EXTERN 515 | NO 516 | GCC_VERSION 517 | com.apple.compilers.llvm.clang.1_0 518 | INSTALL_PATH 519 | $(BUILT_PRODUCTS_DIR) 520 | IPHONEOS_DEPLOYMENT_TARGET 521 | 6.0 522 | OTHER_LDFLAGS 523 | 524 | PRODUCT_NAME 525 | $(TARGET_NAME) 526 | PUBLIC_HEADERS_FOLDER_PATH 527 | $(TARGET_NAME) 528 | SDKROOT 529 | iphoneos 530 | SKIP_INSTALL 531 | YES 532 | 533 | isa 534 | XCBuildConfiguration 535 | name 536 | Debug 537 | 538 | 9AFEA4D57B9E4E5E8647490B 539 | 540 | children 541 | 542 | 428397966BDB490DA6A9FB05 543 | 544 | isa 545 | PBXGroup 546 | name 547 | Frameworks 548 | sourceTree 549 | <group> 550 | 551 | A92A999AD49D4ED9B72096C4 552 | 553 | baseConfigurationReference 554 | 7B6694AC8154410694033FF3 555 | buildSettings 556 | 557 | ALWAYS_SEARCH_USER_PATHS 558 | NO 559 | COPY_PHASE_STRIP 560 | YES 561 | DSTROOT 562 | /tmp/xcodeproj.dst 563 | GCC_C_LANGUAGE_STANDARD 564 | gnu99 565 | GCC_PRECOMPILE_PREFIX_HEADER 566 | YES 567 | GCC_VERSION 568 | com.apple.compilers.llvm.clang.1_0 569 | INSTALL_PATH 570 | $(BUILT_PRODUCTS_DIR) 571 | IPHONEOS_DEPLOYMENT_TARGET 572 | 6.0 573 | OTHER_CFLAGS 574 | 575 | -DNS_BLOCK_ASSERTIONS=1 576 | $(inherited) 577 | 578 | OTHER_CPLUSPLUSFLAGS 579 | 580 | -DNS_BLOCK_ASSERTIONS=1 581 | $(inherited) 582 | 583 | OTHER_LDFLAGS 584 | 585 | PRODUCT_NAME 586 | $(TARGET_NAME) 587 | PUBLIC_HEADERS_FOLDER_PATH 588 | $(TARGET_NAME) 589 | SDKROOT 590 | iphoneos 591 | SKIP_INSTALL 592 | YES 593 | VALIDATE_PRODUCT 594 | YES 595 | 596 | isa 597 | XCBuildConfiguration 598 | name 599 | Release 600 | 601 | AD57D19DAD3B4C45A988C892 602 | 603 | fileRef 604 | 50B691930BC841029A0A6A65 605 | isa 606 | PBXBuildFile 607 | 608 | AFC96B47128644109852C290 609 | 610 | fileRef 611 | 13028B0492034F5E8A0A799A 612 | isa 613 | PBXBuildFile 614 | settings 615 | 616 | COMPILER_FLAGS 617 | -fobjc-arc 618 | 619 | 620 | B33FB21B0D614AD6854CA349 621 | 622 | includeInIndex 623 | 1 624 | isa 625 | PBXFileReference 626 | lastKnownFileType 627 | sourcecode.c.objc 628 | path 629 | Pods-dummy.m 630 | sourceTree 631 | <group> 632 | 633 | B4C2D50040DC4BE4ACDD8876 634 | 635 | includeInIndex 636 | 1 637 | isa 638 | PBXFileReference 639 | lastKnownFileType 640 | text.xcconfig 641 | path 642 | Pods-APHorizontalMenu.xcconfig 643 | sourceTree 644 | <group> 645 | 646 | B5B47A169226404EBDF24F7D 647 | 648 | buildConfigurationList 649 | 66FD0E4271234EF2A08459C3 650 | buildPhases 651 | 652 | 26692E837BFD4A2F8FDB8D69 653 | 2704813F27EA41FE9B16ED6C 654 | 347A27ACA3404B6099320606 655 | 656 | buildRules 657 | 658 | dependencies 659 | 660 | isa 661 | PBXNativeTarget 662 | name 663 | Pods-APHorizontalMenu 664 | productName 665 | Pods-APHorizontalMenu 666 | productReference 667 | 03E8EC7C8ACF4ADCBA1F205B 668 | productType 669 | com.apple.product-type.library.static 670 | 671 | B9BB155702964728A2E866F9 672 | 673 | explicitFileType 674 | archive.ar 675 | includeInIndex 676 | 0 677 | isa 678 | PBXFileReference 679 | path 680 | libPods.a 681 | sourceTree 682 | BUILT_PRODUCTS_DIR 683 | 684 | BB7C2CF2A28C4492B536CBAE 685 | 686 | buildConfigurations 687 | 688 | 991DDB0E4FE8436F854B4420 689 | A92A999AD49D4ED9B72096C4 690 | 691 | defaultConfigurationIsVisible 692 | 0 693 | defaultConfigurationName 694 | Release 695 | isa 696 | XCConfigurationList 697 | 698 | BD525D4FA78247F7AAF3BBC7 699 | 700 | baseConfigurationReference 701 | E46D128B6B03430D9AB2119E 702 | buildSettings 703 | 704 | ALWAYS_SEARCH_USER_PATHS 705 | NO 706 | COPY_PHASE_STRIP 707 | NO 708 | DSTROOT 709 | /tmp/xcodeproj.dst 710 | GCC_C_LANGUAGE_STANDARD 711 | gnu99 712 | GCC_DYNAMIC_NO_PIC 713 | NO 714 | GCC_OPTIMIZATION_LEVEL 715 | 0 716 | GCC_PRECOMPILE_PREFIX_HEADER 717 | YES 718 | GCC_PREFIX_HEADER 719 | Pods-APHorizontalMenu-prefix.pch 720 | GCC_PREPROCESSOR_DEFINITIONS 721 | 722 | DEBUG=1 723 | $(inherited) 724 | 725 | GCC_SYMBOLS_PRIVATE_EXTERN 726 | NO 727 | GCC_VERSION 728 | com.apple.compilers.llvm.clang.1_0 729 | INSTALL_PATH 730 | $(BUILT_PRODUCTS_DIR) 731 | IPHONEOS_DEPLOYMENT_TARGET 732 | 6.0 733 | OTHER_LDFLAGS 734 | 735 | PRODUCT_NAME 736 | $(TARGET_NAME) 737 | PUBLIC_HEADERS_FOLDER_PATH 738 | $(TARGET_NAME) 739 | SDKROOT 740 | iphoneos 741 | SKIP_INSTALL 742 | YES 743 | 744 | isa 745 | XCBuildConfiguration 746 | name 747 | Debug 748 | 749 | BFBDF029310644A299AD7548 750 | 751 | buildConfigurationList 752 | BB7C2CF2A28C4492B536CBAE 753 | buildPhases 754 | 755 | 695E7F29BBC149EB8189AEAF 756 | 1473A26A63C040CCA3FB7BB7 757 | 758 | buildRules 759 | 760 | dependencies 761 | 762 | 04783886BCA14573A5949E9C 763 | 764 | isa 765 | PBXNativeTarget 766 | name 767 | Pods 768 | productName 769 | Pods 770 | productReference 771 | B9BB155702964728A2E866F9 772 | productType 773 | com.apple.product-type.library.static 774 | 775 | C0CB19EE8BA5427DAD10D0B0 776 | 777 | buildSettings 778 | 779 | ALWAYS_SEARCH_USER_PATHS 780 | NO 781 | CLANG_CXX_LANGUAGE_STANDARD 782 | gnu++0x 783 | CLANG_CXX_LIBRARY 784 | libc++ 785 | CLANG_ENABLE_MODULES 786 | YES 787 | CLANG_ENABLE_OBJC_ARC 788 | NO 789 | CLANG_WARN_BOOL_CONVERSION 790 | YES 791 | CLANG_WARN_CONSTANT_CONVERSION 792 | YES 793 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 794 | YES 795 | CLANG_WARN_EMPTY_BODY 796 | YES 797 | CLANG_WARN_ENUM_CONVERSION 798 | YES 799 | CLANG_WARN_INT_CONVERSION 800 | YES 801 | CLANG_WARN_OBJC_ROOT_CLASS 802 | YES 803 | COPY_PHASE_STRIP 804 | YES 805 | GCC_C_LANGUAGE_STANDARD 806 | gnu99 807 | GCC_DYNAMIC_NO_PIC 808 | NO 809 | GCC_OPTIMIZATION_LEVEL 810 | 0 811 | GCC_PREPROCESSOR_DEFINITIONS 812 | 813 | DEBUG=1 814 | $(inherited) 815 | 816 | GCC_SYMBOLS_PRIVATE_EXTERN 817 | NO 818 | GCC_WARN_64_TO_32_BIT_CONVERSION 819 | YES 820 | GCC_WARN_ABOUT_RETURN_TYPE 821 | YES 822 | GCC_WARN_UNDECLARED_SELECTOR 823 | YES 824 | GCC_WARN_UNINITIALIZED_AUTOS 825 | YES 826 | GCC_WARN_UNUSED_FUNCTION 827 | YES 828 | GCC_WARN_UNUSED_VARIABLE 829 | YES 830 | IPHONEOS_DEPLOYMENT_TARGET 831 | 6.0 832 | ONLY_ACTIVE_ARCH 833 | YES 834 | STRIP_INSTALLED_PRODUCT 835 | NO 836 | 837 | isa 838 | XCBuildConfiguration 839 | name 840 | Debug 841 | 842 | C831D90BA84644D098469E1B 843 | 844 | includeInIndex 845 | 1 846 | isa 847 | PBXFileReference 848 | lastKnownFileType 849 | sourcecode.c.h 850 | path 851 | Pods-APHorizontalMenu-prefix.pch 852 | sourceTree 853 | <group> 854 | 855 | E31AA29413D34FF5A07E15CD 856 | 857 | includeInIndex 858 | 1 859 | isa 860 | PBXFileReference 861 | lastKnownFileType 862 | sourcecode.c.h 863 | name 864 | APHorizontalMenu.h 865 | path 866 | Classes/APHorizontalMenu.h 867 | sourceTree 868 | <group> 869 | 870 | E32CC3A81B874F3698C23D33 871 | 872 | isa 873 | PBXFileReference 874 | lastKnownFileType 875 | wrapper.framework 876 | name 877 | Foundation.framework 878 | path 879 | Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework 880 | sourceTree 881 | DEVELOPER_DIR 882 | 883 | E46D128B6B03430D9AB2119E 884 | 885 | includeInIndex 886 | 1 887 | isa 888 | PBXFileReference 889 | lastKnownFileType 890 | text.xcconfig 891 | path 892 | Pods-APHorizontalMenu-Private.xcconfig 893 | sourceTree 894 | <group> 895 | 896 | F6F00BA1BA384361A2D92886 897 | 898 | fileRef 899 | 03E8EC7C8ACF4ADCBA1F205B 900 | isa 901 | PBXBuildFile 902 | 903 | F80D850402B8465395E7F5FD 904 | 905 | buildSettings 906 | 907 | ALWAYS_SEARCH_USER_PATHS 908 | NO 909 | CLANG_CXX_LANGUAGE_STANDARD 910 | gnu++0x 911 | CLANG_CXX_LIBRARY 912 | libc++ 913 | CLANG_ENABLE_MODULES 914 | YES 915 | CLANG_ENABLE_OBJC_ARC 916 | NO 917 | CLANG_WARN_BOOL_CONVERSION 918 | YES 919 | CLANG_WARN_CONSTANT_CONVERSION 920 | YES 921 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 922 | YES 923 | CLANG_WARN_EMPTY_BODY 924 | YES 925 | CLANG_WARN_ENUM_CONVERSION 926 | YES 927 | CLANG_WARN_INT_CONVERSION 928 | YES 929 | CLANG_WARN_OBJC_ROOT_CLASS 930 | YES 931 | COPY_PHASE_STRIP 932 | NO 933 | ENABLE_NS_ASSERTIONS 934 | NO 935 | GCC_C_LANGUAGE_STANDARD 936 | gnu99 937 | GCC_WARN_64_TO_32_BIT_CONVERSION 938 | YES 939 | GCC_WARN_ABOUT_RETURN_TYPE 940 | YES 941 | GCC_WARN_UNDECLARED_SELECTOR 942 | YES 943 | GCC_WARN_UNINITIALIZED_AUTOS 944 | YES 945 | GCC_WARN_UNUSED_FUNCTION 946 | YES 947 | GCC_WARN_UNUSED_VARIABLE 948 | YES 949 | IPHONEOS_DEPLOYMENT_TARGET 950 | 6.0 951 | STRIP_INSTALLED_PRODUCT 952 | NO 953 | VALIDATE_PRODUCT 954 | YES 955 | 956 | isa 957 | XCBuildConfiguration 958 | name 959 | Release 960 | 961 | 962 | rootObject 963 | 7B33A19F47E040B0835021A7 964 | 965 | 966 | -------------------------------------------------------------------------------- /Images/APHorizontalMenu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apascual/APHorizontalMenu/b245fa94ce3ec06d9d34af026c60711a07595e3c/Images/APHorizontalMenu.gif -------------------------------------------------------------------------------- /Images/iPad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apascual/APHorizontalMenu/b245fa94ce3ec06d9d34af026c60711a07595e3c/Images/iPad.png -------------------------------------------------------------------------------- /Images/iPhone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apascual/APHorizontalMenu/b245fa94ce3ec06d9d34af026c60711a07595e3c/Images/iPhone.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Abel Pascual 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # APHorizontalMenu 2 | 3 | [![Version](http://cocoapod-badges.herokuapp.com/v/APHorizontalMenu/badge.png)](http://cocoadocs.org/docsets/APHorizontalMenu) 4 | [![Platform](http://cocoapod-badges.herokuapp.com/p/APHorizontalMenu/badge.png)](http://cocoadocs.org/docsets/APHorizontalMenu) 5 | 6 | ## Usage 7 | 8 | To run the example project; clone the repo, and run `pod install` from the Example directory first. 9 | 10 | ## Installation 11 | 12 | APHorizontalMenu is available through [CocoaPods](http://cocoapods.org), to install 13 | it simply add the following line to your Podfile: 14 | 15 | pod "APHorizontalMenu" 16 | 17 | ## Example 18 | 19 | ![iPhone](https://raw.githubusercontent.com/apascual/APHorizontalMenu/master/Images/APHorizontalMenu.gif) 20 | 21 | ## Usage 22 | 23 | Using APHorizontalMenu is really easy, there is an Example project that you can check, but here are the basics. 24 | 25 | You can add APHorizontalMenu programmatically or using Storyboards. 26 | 27 | ### Programmatically 28 | 29 | Just init the APHorizontalMenu, fill it with values and add it to an existing view. 30 | 31 | ```objc 32 | APHorizontalMenu *horizontalMenu = [[APHorizontalMenu alloc] initWithFrame:CGRectMake(0, 200, 320, 40)]; 33 | horizontalMenu.delegate = self; 34 | horizontalMenu.values = @[@"Item 1", @"Item 2", @"Item 3", @"Item 4", @"Item 5", @"Item 6", @"Item 7", @"Item 8", @"Item 9", @"Item 10"]; 35 | [self.view addSubview:horizontalMenu]; 36 | ``` 37 | 38 | ### Storyboards 39 | 40 | In this case, create a new UIView using the Storyboards UI designer and set the position, size and layout restrictions as desired. Then, go to the Utilities -> Identity inspector -> Custom class -> Class and write down "APHorizontalMenu". 41 | 42 | Then, create an outlet as follows in your Controller. 43 | 44 | ```objc 45 | @property (weak, nonatomic) IBOutlet APHorizontalMenu *horizontalMenu; 46 | ```` 47 | 48 | And in the implementation file of your controller add at least this. 49 | 50 | ```objc 51 | self.horizontalMenu.delegate = self; 52 | ```` 53 | 54 | ### Delegate 55 | 56 | Do not forget to add implement the APHorizontalMenuDelegate as follows. First add the Delegate in the header file of your controller, for example: 57 | 58 | ```objc 59 | @interface ViewController : UIViewController 60 | ```` 61 | 62 | And conform the protocol by creating the method in the implementation file of your controller so you can receive messages: 63 | 64 | ```objc 65 | - (void)horizontalMenu:(id)horizontalMenu didSelectPosition:(NSInteger)index { 66 | NSLog(@"APHorizontalMenu selection: %d", index); 67 | // Do whatever 68 | } 69 | ```` 70 | 71 | ### Customization 72 | 73 | You can customize some of the properties of APHorizontalMenu like this: 74 | 75 | ```objc 76 | self.horizontalMenu.cellBackgroundColor = [UIColor brownColor]; 77 | self.horizontalMenu.cellSelectedColor = [UIColor greenColor]; 78 | self.horizontalMenu.textColor = [UIColor blackColor]; 79 | self.horizontalMenu.textSelectedColor = [UIColor blueColor]; 80 | self.horizontalMenu.selectedIndex = 2; 81 | self.horizontalMenu.visibleItems = 3; 82 | ``` 83 | 84 | ## Contact 85 | 86 | Abel Pascual 87 | 88 | * Mail: [abelpascual@gmail.com](mailto:abelpascual@gmail.com) 89 | * Twitter: [@Abel_Pascual](https://twitter.com/Abel_Pascual) 90 | 91 | ## License 92 | 93 | APHorizontalMenu is available under the MIT license. See the LICENSE file for more info. 94 | 95 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | desc "Runs the specs [EMPTY]" 2 | task :spec do 3 | # Provide your own implementation 4 | end 5 | 6 | task :version do 7 | git_remotes = `git remote`.strip.split("\n") 8 | 9 | if git_remotes.count > 0 10 | puts "-- fetching version number from github" 11 | sh 'git fetch' 12 | 13 | remote_version = remote_spec_version 14 | end 15 | 16 | if remote_version.nil? 17 | puts "There is no current released version. You're about to release a new Pod." 18 | version = "0.0.1" 19 | else 20 | puts "The current released version of your pod is " + 21 | remote_spec_version.to_s() 22 | version = suggested_version_number 23 | end 24 | 25 | puts "Enter the version you want to release (" + version + ") " 26 | new_version_number = $stdin.gets.strip 27 | if new_version_number == "" 28 | new_version_number = version 29 | end 30 | 31 | replace_version_number(new_version_number) 32 | end 33 | 34 | desc "Release a new version of the Pod (append repo=name to push to a private spec repo)" 35 | task :release do 36 | # Allow override of spec repo name using `repo=private` after task name 37 | repo = ENV["repo"] || "master" 38 | 39 | puts "* Running version" 40 | sh "rake version" 41 | 42 | unless ENV['SKIP_CHECKS'] 43 | if `git symbolic-ref HEAD 2>/dev/null`.strip.split('/').last != 'master' 44 | $stderr.puts "[!] You need to be on the `master' branch in order to be able to do a release." 45 | exit 1 46 | end 47 | 48 | if `git tag`.strip.split("\n").include?(spec_version) 49 | $stderr.puts "[!] A tag for version `#{spec_version}' already exists. Change the version in the podspec" 50 | exit 1 51 | end 52 | 53 | puts "You are about to release `#{spec_version}`, is that correct? [y/n]" 54 | exit if $stdin.gets.strip.downcase != 'y' 55 | end 56 | 57 | puts "* Running specs" 58 | sh "rake spec" 59 | 60 | puts "* Linting the podspec" 61 | sh "pod lib lint" 62 | 63 | # Then release 64 | sh "git commit #{podspec_path} CHANGELOG.md -m 'Release #{spec_version}' --allow-empty" 65 | sh "git tag -a #{spec_version} -m 'Release #{spec_version}'" 66 | sh "git push origin master" 67 | sh "git push origin --tags" 68 | sh "pod push #{repo} #{podspec_path}" 69 | end 70 | 71 | # @return [Pod::Version] The version as reported by the Podspec. 72 | # 73 | def spec_version 74 | require 'cocoapods' 75 | spec = Pod::Specification.from_file(podspec_path) 76 | spec.version 77 | end 78 | 79 | # @return [Pod::Version] The version as reported by the Podspec from remote. 80 | # 81 | def remote_spec_version 82 | require 'cocoapods-core' 83 | 84 | if spec_file_exist_on_remote? 85 | remote_spec = eval(`git show origin/master:#{podspec_path}`) 86 | remote_spec.version 87 | else 88 | nil 89 | end 90 | end 91 | 92 | # @return [Bool] If the remote repository has a copy of the podpesc file or not. 93 | # 94 | def spec_file_exist_on_remote? 95 | test_condition = `if git rev-parse --verify --quiet origin/master:#{podspec_path} >/dev/null; 96 | then 97 | echo 'true' 98 | else 99 | echo 'false' 100 | fi` 101 | 102 | 'true' == test_condition.strip 103 | end 104 | 105 | # @return [String] The relative path of the Podspec. 106 | # 107 | def podspec_path 108 | podspecs = Dir.glob('*.podspec') 109 | if podspecs.count == 1 110 | podspecs.first 111 | else 112 | raise "Could not select a podspec" 113 | end 114 | end 115 | 116 | # @return [String] The suggested version number based on the local and remote 117 | # version numbers. 118 | # 119 | def suggested_version_number 120 | if spec_version != remote_spec_version 121 | spec_version.to_s() 122 | else 123 | next_version(spec_version).to_s() 124 | end 125 | end 126 | 127 | # @param [Pod::Version] version 128 | # the version for which you need the next version 129 | # 130 | # @note It is computed by bumping the last component of 131 | # the version string by 1. 132 | # 133 | # @return [Pod::Version] The version that comes next after 134 | # the version supplied. 135 | # 136 | def next_version(version) 137 | version_components = version.to_s().split("."); 138 | last = (version_components.last.to_i() + 1).to_s 139 | version_components[-1] = last 140 | Pod::Version.new(version_components.join(".")) 141 | end 142 | 143 | # @param [String] new_version_number 144 | # the new version number 145 | # 146 | # @note This methods replaces the version number in the podspec file 147 | # with a new version number. 148 | # 149 | # @return void 150 | # 151 | def replace_version_number(new_version_number) 152 | text = File.read(podspec_path) 153 | text.gsub!(/(s.version( )*= ")#{spec_version}(")/, 154 | "\\1#{new_version_number}\\3") 155 | File.open(podspec_path, "w") { |file| file.puts text } 156 | end 157 | --------------------------------------------------------------------------------