Giter Site home page Giter Site logo

mohsinalimat / lctabbarcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itofu/lctabbarcontroller

1.0 2.0 0.0 337 KB

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

Home Page: http://LeoDev.me

License: MIT License

Ruby 4.21% Objective-C 95.79%

lctabbarcontroller's Introduction

LCTabBarController

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

LCTabBarController

In me the tiger sniffs the rose.

εΏƒζœ‰ηŒ›θ™ŽοΌŒη»†ε—…θ”·θ–‡γ€‚

Welcome to visit 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!

Installation

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:
// 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 in LCTabBarCONST.h/.m, other more attributes can be directly read code changes!

#define LC_TABBAR_ITEM_TITLE_COLOR      // tabBar title color
#define LC_TABBAR_ITEM_TITLE_COLOR_SEL  // tabBar title color (selected)

const CGFloat LCTabBarItemImageRatio     = 0.70f;   // tabBar image ratio
const CGFloat LCTabBarItemTitleFontSize  = 10.0f;   // tabBar title font size
const CGFloat LCTabBarBadgeTitleFontSize = 11.0f;   // tabBar badge title font size

Example

LCTabBarController

LCTabBarController

LCTabBarController

LCTabBarController

Release

V 1.2.2

  • 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

  • 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 questions, please commit a Issues! Thx!

Email: [email protected] & [email protected]

Blog: http://LeoDev.me & http://www.leodong.com

License

MIT License

lctabbarcontroller's People

Contributors

itofu avatar

Stargazers

MohsinAli avatar

Watchers

MohsinAli avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.