Code Monkey home page Code Monkey logo

ircommontools's Introduction

IRCommonTools

  • IRCommonTools is a useful common tools/utilities for iOS.

Functions:

#pragma mark - Library Info
//Get libary version
+ (NSString*) getLibraryVersion;

#pragma mark - About System
//Get iOS version with int number
+ (NSInteger) getIosVersionNumber;
//Get iOS version with string
+ (NSString*) getIosVersionString;
//Get device screen size
+ (CGRect) getScreenSize;

#pragma mark - About Network
//Get current network interface
+ (NetworkStatus)detectNetworkInterface;
//Get current wifi info
+ (WifiInfoClass*)fetchWifiInfo;
//Get current local ip info
+ (LocalIPInfoClass*)getLocalIPInfo;
//Get IP segment by subnet mask
+ (NSString*)getIPNetworkSegment:(NSString*)ip WithSubnetMask:(NSString*)subnetMask;
//Get IP broadcastIP by subnet mask
+(NSString*)getIPBroadcast:(NSString *)ip WithSubnetMask:(NSString *)subnetMask;

#pragma mark - About Image
//Resize image
+ (UIImage*)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize;
//Filter image to circcle
+ (UIImage*)circleImage:(UIImage*)image withParm:(CGFloat)inset;
//Crop image with rect
+ (UIImage*)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect;
//Create image with color and size
+ (UIImage*)imageWithColor:(UIColor*)color Size:(CGSize)size;

#pragma mark - About Convert
+(NSString *)decToBinary:(NSInteger)decInt;

#pragma mark - About Format Check
//Check is numeric value
+ (BOOL)checkIsAllDigits:(NSString*)str;
//Check UID format valid
+ (BOOL)checkUIDFormateValid:(NSString*)uid;
//Check E-mail format vaild
+ (BOOL)checkEmailFormateValid:(NSString*)mail;
//Check WPA key valid
+ (WPAInvalidType)checkWPAKeyValid:(NSString*)key;
//Check WEP key valid
+ (WEPInvalidType)checkWEPKeyValid:(NSString*)key;
//Check subnet mask valid
+ (BOOL)checkSubnetMaskValid:(NSString*)subnetMask;
//Check Port valid
+ (BOOL)checkPortValid:(NSInteger)port MinValue:(NSInteger)minValue MaxValue:(NSInteger)maxValue;
//Check IPAddress valid
+ (BOOL)checkIPV4AddressValid:(NSString*)ipaddr;
+ (BOOL)checkStaticIPInfo:(NSString*)ip Type:(StaticIPInfoType)type;
//Check Hostname Valid
+ (BOOL)checkHostnameValid:(NSString*)hostname;
//Check Has Full Width Word
+ (BOOL)checkHasFullWidthWord:(NSString*)string;
//Regular check function
+ (BOOL)regularCheck:(NSString*)pattern checkStr:(NSString*)checkStr;

#pragma mark - About Web View
//Load file with file name(Auto check type with file extension)
+ (void)loadDocument:(NSString*)documentName inView:(UIWebView*)documentWebView;
//Load file with file name and file type
+ (void)loadDocument:(NSString*)documentName withType:(NSString*)type inView:(UIWebView*)documentWebView;
//Load file with file path
+ (void)loadDocumentPath:(NSString*)path inView:(UIWebView*)documentWebView;

#pragma mark - About Version Number
//Check version is newer than standardVersion
+ (BOOL)checkVersionNumber:(NSString*)version isNewerThan:(NSString*)standardVersion;
//Check version is lower than standardVersion
+ (BOOL)checkVersionNumber:(NSString*)version isLowerThan:(NSString*)standardVersion;
//Check version is same with standardVersion
+ (BOOL)checkVersionNumber:(NSString*)version isSameWith:(NSString*)standardVersion;

#pragma mark - About Geocode
//Reverse Geocode with google API
//https://developers.google.com/maps/documentation/geocoding/intro#ReverseGeocoding
+ (void)reverseGeocodeLocation:(CLLocationCoordinate2D)location Language:(GoogleSuppotLanguages)language CompleteHandler:(void (^)(NSString* address, NSError* error))completionHandler;

ircommontools's People

Contributors

irons163 avatar

Stargazers

 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.