-
Notifications
You must be signed in to change notification settings - Fork 81
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
Leo
committed
Mar 20, 2017
1 parent
6bb32f1
commit 600a676
Showing
15 changed files
with
281 additions
and
48 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
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 |
---|---|---|
|
@@ -3,8 +3,27 @@ | |
// LCTabBarControllerDemo | ||
// | ||
// Created by Leo on 15/12/2. | ||
// Copyright © 2015年 Leo. All rights reserved. | ||
// Copyright © 2015 Leo <[email protected]> | ||
// | ||
// Copyright (c) 2015-2017 Leo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
|
@@ -15,6 +34,9 @@ | |
|
||
@optional | ||
|
||
/** | ||
TabBar's item be selected handler | ||
*/ | ||
- (void)tabBar:(LCTabBar *)tabBarView didSelectedItemFrom:(NSInteger)from to:(NSInteger)to; | ||
|
||
@end | ||
|
@@ -24,38 +46,53 @@ | |
@interface LCTabBar : UIView | ||
|
||
/** | ||
* Tabbar item title color | ||
* TabBar item title color | ||
*/ | ||
@property (nonatomic, strong) UIColor *itemTitleColor; | ||
|
||
/** | ||
* Tabbar selected item title color | ||
* TabBar selected item title color | ||
*/ | ||
@property (nonatomic, strong) UIColor *selectedItemTitleColor; | ||
|
||
/** | ||
* Tabbar item title font | ||
* TabBar item title font | ||
*/ | ||
@property (nonatomic, strong) UIFont *itemTitleFont; | ||
|
||
/** | ||
* Tabbar item's badge title font | ||
* TabBar item's badge title font | ||
*/ | ||
@property (nonatomic, strong) UIFont *badgeTitleFont; | ||
|
||
/** | ||
* Tabbar item image ratio | ||
* TabBar item image ratio | ||
*/ | ||
@property (nonatomic, assign) CGFloat itemImageRatio; | ||
|
||
/** | ||
* TabBar's item count | ||
*/ | ||
@property (nonatomic, assign) NSInteger tabBarItemCount; | ||
|
||
/** | ||
* TabBar's selected item | ||
*/ | ||
@property (nonatomic, strong) LCTabBarItem *selectedItem; | ||
|
||
/** | ||
* TabBar items array | ||
*/ | ||
@property (nonatomic, strong) NSMutableArray *tabBarItems; | ||
|
||
/** | ||
* TabBar delegate | ||
*/ | ||
@property (nonatomic, weak) id<LCTabBarDelegate> delegate; | ||
|
||
/** | ||
* Add tabBar item | ||
*/ | ||
- (void)addTabBarItem:(UITabBarItem *)item; | ||
|
||
@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 |
---|---|---|
|
@@ -3,8 +3,27 @@ | |
// LCTabBarControllerDemo | ||
// | ||
// Created by Leo on 15/12/2. | ||
// Copyright © 2015年 Leo. All rights reserved. | ||
// Copyright © 2015 Leo <[email protected]> | ||
// | ||
// Copyright (c) 2015-2017 Leo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import "LCTabBar.h" | ||
#import "LCTabBarItem.h" | ||
|
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 |
---|---|---|
|
@@ -3,19 +3,44 @@ | |
// LCTabBarControllerDemo | ||
// | ||
// Created by Leo on 15/12/2. | ||
// Copyright © 2015年 Leo. All rights reserved. | ||
// Copyright © 2015 Leo <[email protected]> | ||
// | ||
// Copyright (c) 2015-2017 Leo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface LCTabBarBadge : UIButton | ||
|
||
/** | ||
* TabBar item badge value | ||
*/ | ||
@property (nonatomic, copy) NSString *badgeValue; | ||
|
||
/** | ||
* TabBar's item count | ||
*/ | ||
@property (nonatomic, assign) NSInteger tabBarItemCount; | ||
|
||
/** | ||
* Tabbar item's badge title font | ||
* TabBar item's badge title font | ||
*/ | ||
@property (nonatomic, strong) UIFont *badgeTitleFont; | ||
|
||
|
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 |
---|---|---|
|
@@ -3,8 +3,27 @@ | |
// LCTabBarControllerDemo | ||
// | ||
// Created by Leo on 15/12/2. | ||
// Copyright © 2015年 Leo. All rights reserved. | ||
// Copyright © 2015 Leo <[email protected]> | ||
// | ||
// Copyright (c) 2015-2017 Leo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import "LCTabBarBadge.h" | ||
#import "LCTabBarCONST.h" | ||
|
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 |
---|---|---|
|
@@ -3,8 +3,27 @@ | |
// LCTabBarControllerDemo | ||
// | ||
// Created by Leo on 15/12/2. | ||
// Copyright © 2015年 Leo. All rights reserved. | ||
// Copyright © 2015 Leo <[email protected]> | ||
// | ||
// Copyright (c) 2015-2017 Leo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
|
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 |
---|---|---|
|
@@ -3,44 +3,66 @@ | |
// LCTabBarControllerDemo | ||
// | ||
// Created by Leo on 15/12/2. | ||
// Copyright © 2015年 Leo. All rights reserved. | ||
// Copyright © 2015 Leo <[email protected]> | ||
// | ||
// GitHub: https://github.com/iTofu/LCTabBarController | ||
// Blog: http://LeoDev.me | ||
// Copyright (c) 2015-2017 Leo | ||
// | ||
// V 1.3.5 | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "LCTabBar.h" | ||
|
||
@interface LCTabBarController : UITabBarController | ||
|
||
/** | ||
* Tabbar item title color | ||
* TabBar | ||
*/ | ||
@property (nonatomic, strong) LCTabBar *lcTabBar; | ||
|
||
/** | ||
* TabBar item title color | ||
*/ | ||
@property (nonatomic, strong) UIColor *itemTitleColor; | ||
|
||
/** | ||
* Tabbar selected item title color | ||
* TabBar selected item title color | ||
*/ | ||
@property (nonatomic, strong) UIColor *selectedItemTitleColor; | ||
|
||
/** | ||
* Tabbar item title font | ||
* TabBar item title font | ||
*/ | ||
@property (nonatomic, strong) UIFont *itemTitleFont; | ||
|
||
/** | ||
* Tabbar item's badge title font | ||
* TabBar item's badge title font | ||
*/ | ||
@property (nonatomic, strong) UIFont *badgeTitleFont; | ||
|
||
/** | ||
* Tabbar item image ratio | ||
* TabBar item image ratio | ||
*/ | ||
@property (nonatomic, assign) CGFloat itemImageRatio; | ||
|
||
/** | ||
* Remove origin controls, for `- popToRootViewController` | ||
* System will display the original controls so you should call this line when you change any tabBar item, like: `- popToRootViewController`, `someViewController.tabBarItem.title = xx`, etc. | ||
* Remove origin controls | ||
*/ | ||
- (void)removeOriginControls; | ||
|
||
|
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 |
---|---|---|
|
@@ -3,18 +3,34 @@ | |
// LCTabBarControllerDemo | ||
// | ||
// Created by Leo on 15/12/2. | ||
// Copyright © 2015年 Leo. All rights reserved. | ||
// Copyright © 2015 Leo <[email protected]> | ||
// | ||
// Copyright (c) 2015-2017 Leo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import "LCTabBarController.h" | ||
#import "LCTabBar.h" | ||
#import "LCTabBarCONST.h" | ||
#import "LCTabBarItem.h" | ||
|
||
@interface LCTabBarController () <LCTabBarDelegate> | ||
|
||
@property (nonatomic, strong) LCTabBar *lcTabBar; | ||
|
||
@end | ||
|
||
@implementation LCTabBarController | ||
|
Oops, something went wrong.