Latest 1.0.1
Homepage https://github.com/DargonLee/HLMain
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

概述

此项目简单封装了 iOS开发常用的基础框架 解决了 系统导航栏 当有导航栏透明度为0或者隐藏的情况下,滑动控制器返回有bug
HLNavigationController 使用了当前APP市场主流的实现效果 滑动返回的时候全屏滚动

HLTabBarController提供了两种方式创建方式

//链式编程
+ (instancetype)tabBarControllerWithAddChildVCsBlock: (void(^)(HLTabBarController *tabBarC))addVCBlock;
//对象方法创建
- (void)addChildVC:(UIViewController *)vc title:(NSString *)title normalImageName:(NSString *)normalImageName selectedImageName:(NSString *)selectedImageName;

具体实现看源码 里面有大量的注释 这里就不写了

例子

git clone 项目

pod install

查看项目运行结果

运行效果

demo

手动安装安装

  • 下载项目 然后把HLMain文件夹下的所有文件拖到你的项目中就com+b编译下 看有没有报错

    使用

  • 方式一
    导入#import "HLTabBarController.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

HLTabBarController *rootVC = [HLTabBarController tabBarControllerWithAddChildVCsBlock:^(HLTabBarController *tabBarC) {
[tabBarC addChildVC:[HotViewController new] title:@"首页" normalImageName:@"home" selectedImageName:@"home_press"];
[tabBarC addChildVC:[TopLineViewController new] title:@"我的" normalImageName:@"me" selectedImageName:@"me_press"];
}];
[rootVC tabBarConfigWithBarBackground:[UIColor colorWithRed:1.00f green:1.00f blue:1.00f alpha:1.00f]
titleFont:[UIFont systemFontOfSize:12]
normalTitleColor:[UIColor colorWithRed:0.56f green:0.60f blue:0.70f alpha:1.00f]
selectedColor:[UIColor colorWithRed:0.21f green:0.39f blue:0.93f alpha:1.00f]];
self.window.rootViewController = rootVC;
[self.window makeKeyAndVisible];

return YES;
}
  • 方式二
    导入你想要使用的控制器
    如果只想使用导航栏控制器 可以新建一个导航栏控制器 继承HLNavigationController
    HLTabBarControllerHLNavigationController 不相互依赖 都可以单独使用
    注意:HLNavigationController依赖的文件有AnimationContollerUINavigationBar+AlphaUIImage+Extension

CocoaPods 安装

HLMain is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'HLMain'

使用

导入#import "HLTabBarController.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

HLTabBarController *rootVC = [HLTabBarController tabBarControllerWithAddChildVCsBlock:^(HLTabBarController *tabBarC) {
[tabBarC addChildVC:[HotViewController new] title:@"首页" normalImageName:@"home" selectedImageName:@"home_press"];
[tabBarC addChildVC:[TopLineViewController new] title:@"我的" normalImageName:@"me" selectedImageName:@"me_press"];
}];
[rootVC tabBarConfigWithBarBackground:[UIColor colorWithRed:1.00f green:1.00f blue:1.00f alpha:1.00f]
titleFont:[UIFont systemFontOfSize:12]
normalTitleColor:[UIColor colorWithRed:0.56f green:0.60f blue:0.70f alpha:1.00f]
selectedColor:[UIColor colorWithRed:0.21f green:0.39f blue:0.93f alpha:1.00f]];
self.window.rootViewController = rootVC;
[self.window makeKeyAndVisible];

return YES;
}

Author

[email protected]

License

HLMain is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "HLMain",
    "version": "1.0.1",
    "summary": "iOSu5f00u53d1u57fau7840u6846u67b6",
    "description": "iOSu5f00u53d1u57fau7840u6846u67b6 u5305u542bTabbarController u548c NavController  u5e76u4e14u81eau5b9au4e49u5bfcu822au680fu6ed1u52a8u8fd4u56deu662fu5168u5c4fu8fd4u56de u901au8fc7u5bfcu822au680fu5206u7c7bu53efu4ee5u5b9eu73b0u4e00u884cu4ee3u7801u8bbeu7f6eu5bfcu822au680fu7684u900fu660eu5ea6",
    "homepage": "https://github.com/DargonLee/HLMain",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "DargonLee": "[email protected]"
    },
    "source": {
        "git": "https://github.com/DargonLee/HLMain.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "HLMain/Classes/**/*"
}

Pin It on Pinterest

Share This