Moo - Moo - Moo | Moo - Moo - Moo | Moo - Moo - Moo
An Objective-C Library Toolkit
For helping GUI programming with iOS, I design a toolkit for engineers help them with their DAILY CODING.
为辅助 iOS 和 OSX 的 GUI 图形编程,我设计了一套工具面向工程师方便他们进行日常编码。
There are 3 parts of MooTive:
这里MooTive有三大部分:
- Common Classes - 公共类
- MooCommon - 一些日常函数
- MooData - 数据元
- MooModel - 数据模型
- MooWeb - 用于替代 AFNetwork 作为网络底层
- MooUI - 界面类
- MooBadge - 徽章图形元素
- MooButton - 按钮元素
- MooCalendar - 日历界面
- MooClearView - 遮罩透明元素
- MooDing - 下弹式提示元素
- MooEmpty - 置于列表视图表示列表为空的元素
- MooLoader - 列表底部下拉以加载更多的元素
- MooPage - 分页元素
- MooPicture - 图片元素
- MooPictureDisplay - 多图片可组合切换界面
- MooShare - 分享至社交平台元素(支持微信、QQ)
- MooSlider - 幻灯片元素
- MooUnlock - 解锁界面
- MooWait - 等待刷新元素
- MooZoomPicture - 图片可拉伸预览元素
- Component - 组件类
- MooCalendarBody - 日历界面主体组件
- MooCalendarCell - 日历界面细胞单元
- MooDataValue - 数据值
- MooDeviceInfo - 设备信息
- MooJSONResponse - JSON 请求返回信息
- MooShareMessage - 分享界面消息
- MooUnlockButton - 解锁按钮
MooTive is released under the GPL Lincense.
MooTive 使用开源 GPL 协议。
Object Stucture
对象结构
@interface MooWeb : NSObject
- (NSData *)curl:(NSString *)strUrl withMethod:(NSString *)method withParam:(NSMutableData *)param;
- (void)curl:(NSString *)strUrl withMethod:(NSString *)method withParam:(NSMutableData *)param completion:(void (^)(NSURLResponse * response, NSData * data, NSError * connectionError))completion;
@end
- (NSData *)curl:(NSString *)strUrl withMethod:(NSString *)method withParam:(NSMutableData *)param;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
strUrl | NSString | @"http://localhost" |
method | NSString | @"POST" |
param | NSMutableData | N / A |
- (void)curl:(NSString *)strUrl withMethod:(NSString *)method withParam:(NSMutableData *)param completion:(void (^)(NSURLResponse * response, NSData * data, NSError * connectionError))completion;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
strUrl | NSString | @"http://localhost" |
method | NSString | @"POST" |
param | NSMutableData | N / A |
completion | Block | N / A |
Object Structure
对象模型
@interface MooModel : NSObject
- (void)get:(NSString *)path completion:(void (^)(NSData *data))completion;
- (void)post:(NSString *)path withParam:(NSMutableData *)param completion:(void (^)(NSData *data))completion;
- (void)getJSON:(NSString *)path completion:(void (^)(NSString *status, NSDictionary *data))completion;
- (void)postJSON:(NSString *)path withParam:(NSMutableData *)param completion:(void (^)(NSString *status, NSDictionary *data))completion;
@end
- (void)get:(NSString *)path completion:(void (^)(NSData *data))completion;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
path | NSString | @"http://localhost" |
completion | Block | N / A |
- (void)post:(NSString *)path withParam:(NSMutableData *)param completion:(void (^)(NSData *data))completion;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
path | NSString | @"http://localhost" |
param | NSMutableData | N / A |
completion | Block | N / A |
- (void)getJSON:(NSString *)path completion:(void (^)(NSString *status, NSDictionary *data))completion;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
path | NSString | @"http://localhost" |
completion | Block | N / A |
- (void)postJSON:(NSString *)path withParam:(NSMutableData *)param completion:(void (^)(NSString *status, NSDictionary *data))completion;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
path | NSString | @"http://localhost" |
param | NSMutableData | N / A |
completion | Block | N / A |
Objective Struct
对象结构
@interface MooCommon : NSObject
- (UIColor *)colorFromRGBA:(int)rgbValue withAlphaValue:(int)alphaValue;
- (float)getRadian:(float)degree;
- (UIImage *)imageWithColor:(UIColor *)color withWidth:(CGFloat)width withHeight:(CGFloat)height;
@end
- (UIColor *)colorFromRGBA:(int)rgbValue withAlphaValue:(int)alphaValue;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
rgbValue | int | 0x00FFAA |
alphaValue | int | 1 |
- (float)getRadian:(float)degree;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
degree | float | 45 |
- (UIImage *)imageWithColor:(UIColor *)color withWidth:(CGFloat)width withHeight:(CGFloat)height;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
color | UIColor | [UIColor blueColor] |
width | CGFloat | 100 |
height | CGFloat | 100 |
- (void)alertInfo:(NSString *)title withMessage:(NSString *)message;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
title | NSString | @"Title" |
message | NSString | @"Some Message" |
- (NSArray *)splitByDot:(NSString *)number withOffset:(NSUInteger)offset;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
number | NSString | @"1.123" |
offset | NSUInteger | 0 / 1 |
- (NSString *)splitByThousand:(NSString *)number;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
number | NSString | @"123456" |
- (NSString *)stringConverFromDate:(NSDate *)date withFormat:(NSString *)format;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
date | NSDate | [NSDate date] |
format | NSString | @"yyyy-MM-dd" |
- (NSString *)HmacMD5:(NSString *)str WithKey:(NSString *)key;
Details 详细:
Param 参数 | Type 类型 | Example 示例 |
---|---|---|
str | NSString | @"abcdef" |
key | NSString | @"HelloWorld" |
用法:
MooButton *btnMyButton = [[MooButton alloc] init];
[btnMyButton setMid:1];
[btnMyButton setData:[@{@"name": @"Jakit"}]];
[btnMyButton setInfo:@"Hello Jakit!"];
用法:
MooLoader *loader = [[MooLoader alloc] init];
[self.tableview setFooterview:loader];
[loader startDrag]; // 准备状态
[loader startLoading:^{
// Some Code...
}]; // 开始状态
[loader endLoading]; // 结束状态
This is a Toolkit wrote in ObjectiveC and is of Moo Series. Document wrote in hurry so please don't mind. Thank you for your support!
这是 Moo 系列的 Objective-C 工具箱,文档赶时间写着比较急,^_^ 别介意,好用就 OK!感谢各位支持!