-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zsm
committed
Apr 14, 2016
1 parent
6dabe61
commit fd6d805
Showing
25 changed files
with
2,494 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# | ||
# Be sure to run `pod spec lint MinScrollMenu.podspec' to ensure this is a | ||
# valid spec and to remove all comments including this before submitting the spec. | ||
# | ||
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html | ||
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ | ||
# | ||
|
||
Pod::Spec.new do |s| | ||
|
||
s.name = "MinScrollMenu" | ||
s.version = "1.0.0" | ||
s.summary = "A custom horizontal scroll menu." | ||
s.description = <<-DESC | ||
模仿tableview写的一个横向滚动的menu,操作方式类似tableview,实现delegate方法即可 | ||
DESC | ||
|
||
s.homepage = "https://github.com/zsmzhu/MinScrollMenu.git" | ||
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" | ||
s.license = "MIT" | ||
s.author = { "zsm" => "[email protected]" } | ||
# s.social_media_url = "http://twitter.com/zsm" | ||
s.platform = :ios, "7.0" | ||
s.source = { :git => "https://github.com/zsmzhu/MinScrollMenu.git", :tag => "1.0.0" } | ||
s.source_files = "MinScrollMenu/**/*.{h,m}" | ||
s.framework = "UIKit", "Foundation" | ||
s.requires_arc = true | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// MinScrollMenu.h | ||
// SimpleDemo | ||
// | ||
// Created by songmin.zhu on 16/4/14. | ||
// Copyright © 2016年 zhusongmin. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
#define ScreenWidth [UIScreen mainScreen].bounds.size.width | ||
|
||
@class MinScrollMenuItem, MinScrollMenu; | ||
|
||
@protocol MinScrollMenuDelegate <NSObject> | ||
|
||
@required | ||
/** | ||
* 提供item个数,必须实现 | ||
* | ||
* @param menu MinScrollMenu实例 | ||
* | ||
* @return item个数,NSInteger类型 | ||
*/ | ||
- (NSInteger)numberOfMenuCount:(MinScrollMenu *)menu; | ||
/** | ||
* 提供index位置的item宽度,必须实现 | ||
* | ||
* @param menu MinScrollMenu实例 | ||
* @param index 索引 | ||
* | ||
* @return item宽度,CGFloat类型 | ||
*/ | ||
- (CGFloat)scrollMenu:(MinScrollMenu*)menu widthForItemAtIndex:(NSInteger)index; | ||
/** | ||
* 提供index位置的item,必须实现 | ||
* | ||
* @param menu MinScrollMenu实例 | ||
* @param index 索引 | ||
* | ||
* @return 返回MinScrollMenuItem实例 | ||
*/ | ||
- (MinScrollMenuItem *)scrollMenu:(MinScrollMenu*)menu itemAtIndex:(NSInteger)index; | ||
|
||
@optional | ||
/** | ||
* 点击index位置的item响应方法,可选方法 | ||
* | ||
* @param menu MinScrollMenu实例 | ||
* @param item MinScrollMenuItem实例 | ||
* @param index 索引 | ||
*/ | ||
- (void)scrollMenu:(MinScrollMenu*)menu didSelectedItem: (MinScrollMenuItem *)item atIndex: (NSInteger)index; | ||
|
||
@end | ||
|
||
@interface MinScrollMenu : UIView | ||
@property (nonatomic, assign) id<MinScrollMenuDelegate> delegate; | ||
|
||
|
||
/** | ||
* 刷新数据 | ||
*/ | ||
- (void)reloadData; | ||
/** | ||
* 获取重用的item | ||
* | ||
* @param identifer 重用符 | ||
* | ||
* @return 重用的item | ||
*/ | ||
- (MinScrollMenuItem *)dequeueItemWithIdentifer:(NSString *)identifer; | ||
@end |
Oops, something went wrong.