- ARC
- iOS 8.0+
YANScrollMenu
is available via Cocoapods, add this line in your podfile :
pod 'YANScrollMenu', '~> 0.9.1'
- Import the class :
#import "YANScrollMenu.h"
- Simply initialize a
YANScrollMenu
the same way you set up a regular UIView:
self.menu = [[YANScrollMenu alloc] initWithFrame:CGRectMake(0, 0, 375,150)];
[self.view addSubview:self.menu];
YANScrollMenuProtocol
must be adopted :- (NSUInteger)numberOfRowsForEachPageInScrollMenu:(YANScrollMenu *)scrollMenu; - (NSUInteger)numberOfItemsForEachRowInScrollMenu:(YANScrollMenu *)scrollMenu; - (NSUInteger)numberOfMenusInScrollMenu:(YANScrollMenu *)scrollMenu; - (id<YANMenuObject>)scrollMenu:(YANScrollMenu *)scrollMenu objectAtIndexPath:(NSIndexPath *)indexPath;
- Custom appearance :
The function in
[[YANMenuItem appearance] setIconSize:30]; [[YANMenuItem appearance] setIconCornerRadius:15]; [[YANMenuItem appearance] setTextFont:[UIFont systemFontOfSize:12]]; [[YANMenuItem appearance] setTextColor:[UIColor darkTextColor]];
YANScrollMenuProtocol
can be use to adjust the edgeInsets ofYANMenuItem
:- (YANEdgeInsets)edgeInsetsOfItemInScrollMenu:(YANScrollMenu *)scrollMenu;
YANScrollMenu depend on SDWebImage
and Masonry
.
- When the version of
SDWebImage
large than3.8.2
, gif will not be supported.
- V 0.9.1 Fix some bug and optimize the code
- V 0.9.0 The first version
YANScrollMenu is released under the MIT license. See LICENSE file for details.
Any suggestion or question? Please create a Github issue .