• Stars
    star
    385
  • Rank 111,464 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A amazing and highly customized tabBarController! You could almost customize 100% properties with LCTabBarController!

LCTabBarController

Travis CocoaPods CocoaPods CocoaPods LeoDev Join the chat at https://gitter.im/iTofu/LCTabBarController

⚠️ Due to busy work, this library WON'T BE SUPPORTED for the moment, please carefully integrate the library.

A amazing and highly customized tabBarController! You could almost customize 100% properties with LCTabBarController! 😍

by http://LeoDev.me

In me the tiger sniffs the rose.

心有猛虎,细嗅蔷薇。

Welcome to my blog: http://LeoDev.me

中文介绍

Feature

  • Highly decoupled!

    Each control is a independent class! --> means "be possessed":

    LCTabBarBadge --> LCTabBarItem --> LCTabBar --> LCTabBarController

  • Simple integration!

    Integration takes only one step: Just replace the UITabBarController word in your AppDelegate.m with LCTabBarController to complete the integration!

  • Non-Pollution!

    LCTabBarController has all the functions of UITabBarController, and NO any intrusion behavior!

    So, even if your project is complete, you could integrated at any time! You could also change back to UITabBarController! (But I 200% believe you won't do it!)

  • Highly customized!

    You can freely set the following properties, you can also choose to modify the code directly!

    1. tabBar title color

    2. tabbar title font

    3. tabbar image ratio

    4. tabbar badge frame

    5. tabbar badge font

    6. ...

  • If you feel good, please give me a star, thank you very much! ⭐️

    I will keep update with new Issue, if you want to know my progress at any time, please click on the watch button in the upper right corner!

⚠️ NOTE: It doesn't support Storyboard for the time being!

Installation

CocoaPods

LCTabBarController is available on CocoaPods. Just add the following to your project Podfile:

pod 'LCTabBarController' # Podfile

Non-CocoaPods Installation

Just drag the LCTabBarController folder into your project.

Usage

  • Inside your AppDelegate.m:

    // 0. Import header file
    #import "LCTabBarController.h"
    
    // 1. If you have already started the project, even if it's already done.
    UITabBarController *tabBarC = [[UITabBarController alloc] init];
    ->
    LCTabBarController *tabBarC = [[LCTabBarController alloc] init];
    
    // 2. If you're just starting to write a new project
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
        self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    
        [self.window makeKeyAndVisible];
    
        // Other code
        HomeVC *vc1 = [[HomeVC alloc] init];
        vc1.view.backgroundColor = [UIColor whiteColor];
        vc1.tabBarItem.badgeValue = @"23";
        vc1.title = @"Home";
        vc1.tabBarItem.image = [UIImage imageNamed:@"tabbar_home"];
        vc1.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_home_selected"];
    
        // vc2 vc3 ...
    
        UIViewController *vc4 = [[UIViewController alloc] init];
        vc4.view.backgroundColor = [UIColor yellowColor];
        vc4.tabBarItem.badgeValue = @"99+";
        vc4.title = @"Profile";
        vc4.tabBarItem.image = [UIImage imageNamed:@"tabbar_profile"];
        vc4.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_profile_selected"];
    
    
        UINavigationController *navC1 = [[UINavigationController alloc] initWithRootViewController:vc1];
        UINavigationController *navC2 = [[UINavigationController alloc] initWithRootViewController:vc2];
        UINavigationController *navC3 = [[UINavigationController alloc] initWithRootViewController:vc3];
        UINavigationController *navC4 = [[UINavigationController alloc] initWithRootViewController:vc4];
    
    
    
        /**************************************** Key Code ****************************************/
    
        LCTabBarController *tabBarC = [[LCTabBarController alloc] init];
    
        tabBarC.viewControllers = @[navC1, navC2, navC3, navC4];
    
        self.window.rootViewController = tabBarC;
    
        /******************************************************************************************/
    
    
    
        return YES;
    }
  • Done!

  • You can change the following properties with LCTabBarController object, other more attributes can be directly read code changes!

    /**************************************** Key Code ****************************************/
    
    LCTabBarController *tabBarC    = [[LCTabBarController alloc] init];
    
    // look here, you should set this properties before `- setViewControllers:`
    tabBarC.itemTitleFont          = [UIFont boldSystemFontOfSize:11.0f];
    tabBarC.itemTitleColor         = [UIColor greenColor];
    tabBarC.selectedItemTitleColor = [UIColor redColor];
    tabBarC.itemImageRatio         = 0.5f;
    tabBarC.badgeTitleFont         = [UIFont boldSystemFontOfSize:12.0f];
    
    tabBarC.viewControllers        = @[navC1, navC2, navC3, navC4];
    
    self.window.rootViewController = tabBarC;
    
    /******************************************************************************************/

    Than you could see like this:

    by http://LeoDev.me

Example

by http://LeoDev.me


by http://LeoDev.me


by http://LeoDev.me


by http://LeoDev.me

ChangeLog

V 1.3.7

  • Adapt for iOS 11.

  • Improve framework with #27 by tbl00c.

V 1.3.6

  • About #15, public lcTabBar.

V 1.3.5

V 1.3.3

  • Update CocoaPods source URL.

V 1.3.0

  • Bug fixed: Can't find right bundle when using Swift & CocoaPods.

  • building support.

V 1.2.7

  • Bug fixed: #3, thanks for Sesadev's commit!

V 1.2.6

  • Bug fixed:

    When I call the popToRootViewController; method, the origin controls of the system's tabBar is displayed again.

    Now, You should call [lcTabBarController removeOriginControls]; method after popToRootViewController;, like this:

    [self.navigationController popToRootViewControllerAnimated:YES];
    
    [lcTabBarController removeOriginControls];

V 1.2.5

  • Change custom way, experience better!

V 1.2.2

  • Change imageView's contentModel:

    tabBarItem.imageView.contentModel == UIViewContentModeScaleAspectFit;
    
    -->
    
    tabBarItem.imageView.contentModel == UIViewContentModeCenter;

V 1.2.1

  • Fix frame: tabBarBadge's x.

V 1.2.0

  • for you!

V 1.1.0

  • for LanMeng Tec.

  • V 1.1.x will for LanMeng Tec. only.

V 1.0.6

  • for LanMeng Tec.

V 1.0.5

  • Change something:

    tabBarItem.imageView.contentModel == UIViewContentModeCenter;
    
    -->
    
    tabBarItem.imageView.contentModel == UIViewContentModeScaleAspectFit;

V 1.0.3

  • Delete some logs.

  • Update demo images.

V 1.0.2

  • UI adjustment.

V 1.0.1

  • Bug fixed.

V 1.0.0

Support

  • If you have any question, just commit a issue.

  • Mail: echo bGVvZGF4aWFAZ21haWwuY29tCg== | base64 -D

  • Blog: https://LeoDev.me

  • Donations:

    • PayPal:

      Donate

    • Alipay or Wechat Pay:

      Donate with Alipay or Wechat Pay

    Please note: donation does not imply any type of service contract.

License

LCTabBarController is released under the MIT License.

More Repositories

1

LCActionSheet

一款简约而不失强大的 ActionSheet,微博、微信和 QQ 都采用了极其类似的样式,完全支持 Swift。
Objective-C
821
star
2

LCNavigationController

除 UINavigationController 外最流行的 NavigationController!
Objective-C
226
star
3

LCDownloadManager

一个简单易用的下载助手。基于AFN,实现断点续传,采取Block方式回调下载进度、文件大小、下载是否完成等。
Objective-C
183
star
4

LCBannerView

A very popular and highly customized banner view! Infinite loop support!
Objective-C
159
star
5

LCNewFeature

几行代码快速集成新特性界面!
Objective-C
108
star
6

LCProgressHUD

一个超简单的活动指示器。适配横屏。
Objective-C
102
star
7

XXWB

当初学习 iOS 开发时写的小小微博,高仿新浪微博首页!仅供学习哈!请阅读下方必读!!!!
Objective-C
59
star
8

LCCoolHUD

一款酷酷的 HUD。
Objective-C
28
star
9

ReusableProtocol

A helpful and pure Swift implemented library for registering and reusing cells or views in the table view and collection view.
Swift
27
star
10

LCPaintView

🖌 Paint view for iOS.
Objective-C
20
star
11

Xia

🌟 Naughty flexible alert view above the navigation bar.
Swift
19
star
12

LCBlur

Quick way to add blur effect ~
Objective-C
18
star
13

ShakeDemo

摇一摇Demo
Objective-C
17
star
14

ApplePayDemo

 Pay Demo with Swift.
Swift
17
star
15

LCLoadingHUD

彩虹加载指示器。
Objective-C
16
star
16

WeChat

基于XMPP模仿微信App进行IM(即时聊天)开发,并适配iPad、iOS7。(暂停开发,有空再讲……)
Objective-C
14
star
17

SearchBarDemo

Objective-C
13
star
18

LCTipView

An individuality tip view.
Objective-C
11
star
19

LCUtils

个人在开发中使用的工具类。
Objective-C
10
star
20

Grids

⚠️ UIStackView IS A BETTER SOLUTION. 🏁 Grids layout, making views equidistant. Base on SnapKit.
Swift
7
star
21

Da

🌟 Naughty flexible alert view. Like QQ's.
Swift
5
star
22

LCAlertView

Using UIAlertView with Block!
Objective-C
3
star
23

FMDBDemo

A demo for FMDB.
Objective-C
3
star
24

DaXia

🍰 Naughty flexible alert view :) Contains Da and Xia.
Ruby
3
star
25

WebVC

UIWebView + 自定义 Request 的 Header 中添加键值对 KeyValues
Objective-C
1
star
26

UIAlertViewDemo

How to implement the UIAlertView of the system?
Objective-C
1
star
27

FileShareDemo

Demo for share files with iTunes.
Swift
1
star
28

LEONetworkKit

LEONetworkKit is a part of LEOKit. Have fun!
Objective-C
1
star
29

XcodeConfigs

Inspiration from: https://github.com/johnil/xcode_configs
1
star
30

LCCalendarView

For LanMeng Tec.
Objective-C
1
star
31

LCWebViewController

一个带进度条、带工具条、可高度自定义的浏览器!
Objective-C
1
star