Skip to content

Commit

Permalink
update pod
Browse files Browse the repository at this point in the history
  • Loading branch information
lovemo committed May 12, 2017
2 parents 07adeac + 0f7224f commit 2227861
Showing 1 changed file with 76 additions and 11 deletions.
87 changes: 76 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,87 @@
# SMKFoldingTabBar
SMKFoldingTabBar - A Awesome Folding Custom View
SMKFoldingTabBar - An Awesome Folding Custom View

![image](https://github.com/lovemo/SMKFoldingTabBar/raw/master/demo.gif)

---

![image](https://github.com/lovemo/SMKFoldingTabBar/raw/master/test.gif)
### Code
```objc
typedef struct {

// 按钮收缩动画周期
CFTimeInterval animationForCenterButtonCollapseDuration;

// 按钮展开动画周期
CFTimeInterval animationForCenterButtonExpandDuration;

// 其他按钮展开动画周期
CFTimeInterval animationForExtraItemShowDuration;

// 其他按钮缩放动画周期
CFTimeInterval animationForExtraItemScaleDuration;

// 其他按钮抖动动画周期
CFTimeInterval animationForExtraItemRotationDuration;

---
} SMKAnimationParameters;


@class SMKFoldingTabBar;

NS_ASSUME_NONNULL_BEGIN

@protocol SMKFoldingTabBarDelegate <NSObject>

@optional

- (void)tabBarWillCollapse:(SMKFoldingTabBar *)tabBar;
- (void)tabBarWillExpand:(SMKFoldingTabBar *)tabBar;

- (void)tabBarDidCollapse:(SMKFoldingTabBar *)tabBar;
- (void)tabBarDidExpand:(SMKFoldingTabBar *)tabBar;

- (void)tabBarDidSelectCenterItem:(SMKFoldingTabBar *)tabBar;

- (void)tabBar:(SMKFoldingTabBar *)tabBar didSelectLeftItemAtIndex:(NSUInteger)index;
- (void)tabBar:(SMKFoldingTabBar *)tabBar didSelectRightItemAtIndex:(NSUInteger)index;


@end

typedef NS_ENUM(NSUInteger, SMKFoldingTabBarState) {
SMKFoldingTabBarStateExpanded,
SMKFoldingTabBarStateCollapsed
};


@interface SMKFoldingTabBar : UIView

// ......

@end
```
### Demo
```objc
SMKFoldingTabBar *foldingTabBar = [SMKFoldingTabBar foldingTabBar];
SMKFoldingTabBar *foldingTabBar = [SMKFoldingTabBar foldingTabBar];
[self.view addSubview:foldingTabBar];
[foldingTabBar mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
make.height.mas_equalTo(49);
make.centerY.mas_equalTo(self.view).multipliedBy(1.5);
}];
foldingTabBar.animationParameters = (SMKAnimationParameters) {
.animationForCenterButtonExpandDuration = 0.4,
.animationForCenterButtonCollapseDuration = 0.4,
.animationForExtraItemShowDuration = 0.3,
};
foldingTabBar.leftItemLength = foldingTabBar.rightItemLength
= foldingTabBar.leftButtonHeight
= foldingTabBar.rightButtonHeight
= 36;
= foldingTabBar.leftButtonHeight
= foldingTabBar.rightButtonHeight
= 36;
foldingTabBar.leftImagesArray = @[
@"new_umsocial_sina",
@"new_umsocial_wechat",
Expand Down Expand Up @@ -55,12 +117,15 @@ SMKFoldingTabBar *foldingTabBar = [SMKFoldingTabBar foldingTabBar];
[foldingTabBar setDidSelectRightItemBlock:^(NSUInteger index) {
self.showTextLabel.text = [NSString stringWithFormat:@"我是右边第 %zd 个", index];
NSLog(@"%zd", index);
}];
}];
```

---

## 期待
* 如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的代码看看BUG修复没有)
* 如果在使用过程中发现功能不够用,希望你能Issues我,我非常想为这个框架增加更多好用的功能,谢谢
# Contributing to Tinker
Welcome to [report Issues](https://github.com/lovemo/SMKFoldingTabBar/issues) or [pull requests](https://github.com/lovemo/SMKFoldingTabBar/pulls) to SMKFoldingTabBar.

## License

SMKFoldingTabBar is released under the MIT license. See LICENSE for details.

0 comments on commit 2227861

Please sign in to comment.