Latest 0.9.1
Homepage https://github.com/yanff/YANScrollMenu
License MIT
Platforms ios 8.0, requires ARC
Dependencies SDWebImage, Masonry
Authors

License MIT
CocoaPods
CocoaPods

GIF

Requirements

  • ARC
  • iOS 8.0+

Cocoapods

YANScrollMenu is available via Cocoapods, add this line in your podfile :

    pod 'YANScrollMenu', '~> 0.9.1'

Usage

  1. Import the class :

    #import "YANScrollMenu.h"
  2. 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];
  3. YANScrollMenuProtocol must be adopted :
    - (NSUInteger)numberOfRowsForEachPageInScrollMenu:(YANScrollMenu *)scrollMenu;
    - (NSUInteger)numberOfItemsForEachRowInScrollMenu:(YANScrollMenu *)scrollMenu;
    - (NSUInteger)numberOfMenusInScrollMenu:(YANScrollMenu *)scrollMenu;
    - (id<YANMenuObject>)scrollMenu:(YANScrollMenu *)scrollMenu objectAtIndexPath:(NSIndexPath *)indexPath;
  4. Custom appearance :
    [[YANMenuItem appearance] setIconSize:30];
    [[YANMenuItem appearance] setIconCornerRadius:15];
    [[YANMenuItem appearance] setTextFont:[UIFont systemFontOfSize:12]];
    [[YANMenuItem appearance] setTextColor:[UIColor darkTextColor]];

    The function in YANScrollMenuProtocol can be use to adjust the edgeInsets of YANMenuItem:

    - (YANEdgeInsets)edgeInsetsOfItemInScrollMenu:(YANScrollMenu *)scrollMenu;

    Dependency

YANScrollMenu depend on SDWebImage and Masonry.

  • When the version of SDWebImage large than 3.8.2 , gif will not be supported.

Release Notes

  • V 0.9.1 Fix some bug and optimize the code
  • V 0.9.0 The first version

License

YANScrollMenu is released under the MIT license. See LICENSE file for details.

Contact

Any suggestion or question? Please create a Github issue .

Latest podspec

{
    "name": "YANScrollMenu",
    "version": "0.9.1",
    "summary": "A scroll menu similar to MeiTuan",
    "description": "A scroll menu similar to the main page of Meituan app",
    "homepage": "https://github.com/yanff/YANScrollMenu",
    "license": "MIT",
    "authors": {
        "yanff": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/yanff/YANScrollMenu.git",
        "tag": "0.9.1"
    },
    "requires_arc": true,
    "dependencies": {
        "SDWebImage": [
            "3.8.2"
        ],
        "Masonry": [
            "1.0.2"
        ]
    },
    "subspecs": [
        {
            "name": "YANScrollMenu",
            "source_files": "YANScrollMenu/YANScrollMenu/YANScrollMenu/*.{h,m}"
        }
    ]
}

Pin It on Pinterest

Share This