Code Monkey home page Code Monkey logo

hlkit's Introduction

HLKit

开发小工具

使用方法

pod 'HLKit', '~>0.1'
如果没找到, 请先pod setup

也可以直接在本网页下载,然后把WHKit文件加入到工程中使用

在使用的地方:#import "HLKit.h"
推荐直接在pch文件中:#import "HLKit.h"

这个文件中包含了如下内容

/************* 分类 *************/
#import "NSArray+HLKit.h"
#import "NSDate+HLKit.h"
#import "NSDictionary+HLKit.h"
#import "NSFileManager+HLKit.h"
#import "NSNumber+HLKit.h"
#import "NSObject+HLKit.h"
#import "NSObject+HLRuntime.h"
#import "NSString+HLKit.h"
#import "NSTimer+HLKit.h"
#import "UIBarButtonItem+HLKit.h"
#import "UIButton+HLKit.h"
#import "UIColor+HLKit.h"
#import "UIDevice+HLKit.h"
#import "UIImage+HLKit.h"
#import "UILabel+HLKit.h"
#import "UINavigationController+HLKit.h"
#import "UIScrollView+HLKit.h"
#import "UITableView+HLKit.h"
#import "UIView+HLKit.h"
#import "UIViewController+HLKit.h"
#import "HLMethods.h"
#import "HLSerializeKit.h"
#import "HLSingleton.h"
#import "CALayer+HLLayer.h"
#import "UIAlertController+HLKit.h"
#import "Foundation+HLSafe.h"
/******************************/



/************* 宏 *************/
#import "HLMacro.h"
/******************************/

例子 Example

//点击按钮
[button hl_addActionHandler:^{
NSLog(@"我被点击了");
}];

//是否为iPhone X的宏,返回BOOL值
#define kIs_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

//快速创建单例
HLSingletonH(ClassName)
HLSingletonM(ClassName)

//快速创建一个Button, 其中KBLACK_COLOR是颜色的宏
UIButton *button = [UIButton HL_buttonWithTitle:@"Test" backColor:KBLACK_COLOR backImageName:nil titleColor:KWHITE_COLOR fontSize:14 frame:CGRectMake(100, 100, 50, 50) cornerRadius:7];

//改变手机状态栏的颜色
[HLMethods hl_setStatusBarBackgroundColor:[UIColor lightGrayColor]];

//高效添加圆角图片
- (UIImage*)hl_imageAddCornerWithRadius:(CGFloat)radius andSize:(CGSize)size;

/** mac地址*/
NSString *macAddress = [UIDevice macAddress];

/**反转数组*/
- (NSArray *)hl_reverseArray;

//获得一般模型属性
-(void)hl_createProperty;

/**根据左边和右边的字符串,获得中间特定字符串*/
- (NSString*)hl_substringWithinBoundsLeft:(NSString*)strLeft right:(NSString*)strRight;

/**@brief  渐变颜色*/
+ (UIColor*)hl_gradientFromColor:(UIColor*)fromColor toColor:(UIColor*)toColor withHeight:(CGFloat)height;

MIT LICENSE

hlkit's People

Contributors

leohou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.