Giter Club home page Giter Club logo

mangotools's Introduction

MangoTools

个人收集整理与编写维护的一个iOS开发工具库

###1.UIView+Tools recognizer封装

封装了UITapGestureRecognizer等Recognizer,使用Block作为动作触发的回调。

layer 便捷地修改UIView的layer属性,添加不同方向的border,裁剪为圆

###2.NSDate+Utilities

便捷的时间对比与计算。 例如:

- (BOOL) isToday;
- (BOOL) isTomorrow;
- (BOOL) isYesterday;
- (BOOL) isTheDayAfterTomorrow;

###3.JZLocationConverter

便捷的地理位置坐标转换器,将火星坐标转到地球坐标等便捷**特色功能

###4.HudTools 便捷的hud通知调用,全部通过类方法调用。方便快捷。

###5.NSString+Tools.h 一些检测String的便捷方法 封装了正则匹配等一些匹配。

- (BOOL)isMobileNumber:(NSString *)mobileNum
- (BOOL)isCarNumber;
- (BOOL)isURL;
+ (NSURL *)HTTPURLFromString:(NSString *)string;

###6.NSObject+Macro 一些常用的宏:

例如检测设备

#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)

定制NSLog:

#ifdef DEBUG
#   define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__,  ##__VA_ARGS__);
#else
#   define DLog(...)
#endif

###7.EXTScope 来自libextobjc中的一个模块。感谢它为我们带来方便打破block循环引用的工具。

用法:

@weakify(self)
[self.context performBlock:^{
    // Analog to strongSelf in previous code snippet.
    @strongify(self)

    // You can just reference self as you normally would. Hurray.
    NSError *error;
    [self.context save:&error];

    // Do something
}];

延伸: iOS夯实:ARC时代的内存管理

###8.MangoLog

简单的日志工具。直接通过LOG保存Debug信息到文件。

已确保线程安全,简单易扩展。

mangotools's People

Contributors

100mango avatar

Watchers

 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.