iOS開發常用的第三方類庫
轉自:https://blog.csdn.net/pleasecallmewhy/article/details/17149623
在iOS開發中不可避免的會用到一些第三方類庫,它們提供了很多實用的功能,使我們的開發變得更有效率;同時,也可以從它們的原始碼中學習到很多有用的東西。
Reachability 檢測網路連線
用來檢查網路連線是否可用:包括WIFI和WWAN(3G/EDGE/CDMA等)兩種工作模式。
現在有更好的替代品:https://github.com/tonymillion/Reachability,比Apple提供的相容性更好,而且更加好用,更具體的使用方法請看它提供的例子。
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];reach.reachableBlock = ^(Reachability*reach) { NSLog(@"網路可用!");};reach.unreachableBlock = ^(Reachability*reach) { NSLog(@"網路不可用!");};// 開始監聽[reach startNotifier];
ASIHTTPRequest 網路請求
ASIHTTPRequest是對CFNetwork API的一個包裝,它提供了一套更加簡潔的API,使用起來也更加簡單。
官方網站:http://allseeing-i.com/ASIHTTPRequest/
GitHub:https://github.com/pokeb/asi-http-request
它不僅僅支援基本的HTTP請求,而且支援基於REST的服務(GET/POST/PUT/DELETE)。
最讓人喜歡的是,它支援block語法:
NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setCompletionBlock:^{ // Use when fetching text data NSString *responseString = [request responseString]; // Use when fetching binary data NSData *responseData = [request responseData]; }]; [request setFailedBlock:^{ NSError *error = [request error]; }]; [request startAsynchronous];
它的ASIFormDataRequest子類可以橫容易的提交表單資料和檔案:
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];[request setPostValue:@"Ben" forKey:@"first_name"];[request setPostValue:@"Copsey" forKey:@"last_name"];// Upload a file on disk[request setFile:@"/Users/ben/Desktop/ben.jpg" withFileName:@"myphoto.jpg" andContentType:@"image/jpeg"forKey:@"photo"]; // Upload an NSData instance[request setData:imageData withFileName:@"myphoto.jpg" andContentType:@"image/jpeg" forKey:@"photo"];
詳細的使用方法請下載相應的原始碼及例子,或者從官方的使用說明http://allseeing-i.com/ASIHTTPRequest/How-to-use開始。
MBProgressHUD 提示效果
支援各種狀態載入的提示效果,以及帶進度的提示效果。
GitHub:https://github.com/matej/MBProgressHUD
一般會在.m檔案實現MBProgressHUDDelegate協議,並宣告HUD變數:
@interface SampleViewController ()<MBProgressHUDDelegate>{ MBProgressHUD *HUD;}#pragma mark -#pragma mark MBProgressHUDDelegate methods- (void)hudWasHidden:(MBProgressHUD *)hud { // Remove HUD from screen when the HUD was hidded [HUD removeFromSuperview]; HUD = nil;}
在執行某個非同步請求時開始呼叫:
HUD = [MBProgressHUD showHUDAddedTo:self.webView animated:YES]; HUD.labelText = @"正在請求..."; // mode引數可以控制顯示的模式 //HUD.mode = MBProgressHUDModeText; HUD.delegate = self;
請求完成時隱藏提示效果:
[HUD hide:YES];
對於同步方法一般都是用showWhileExecuting方法,方法執行完成之後會自動隱藏提示效果:
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
SVProgressHUD 提示效果
GitHub:https://github.com/samvermette/SVProgressHUD
SVProgressHUD和MBProgressHUD效果差不多,不過不需要使用協議,同時也不需要宣告例項。
直接通過類方法進行呼叫即可:
[SVProgressHUD method]
可以使用以下方法來顯示狀態:
+ (void)show;+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;+ (void)showWithStatus:(NSString*)string;+ (void)showWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)maskType;
如果需要明確的進度,則使用以下方法:
+ (void)showProgress:(CGFloat)progress;+ (void)showProgress:(CGFloat)progress status:(NSString*)status;+ (void)showProgress:(CGFloat)progress status:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
通過dismiss方法來隱藏提示:
+ (void)dismiss;
另外提供了以下方法用於顯示狀態,並在1秒後自動隱藏提示(使用的圖示來源於Glyphish:http://www.glyphish.com/):
+ (void)showSuccessWithStatus:(NSString*)string;+ (void)showErrorWithStatus:(NSString *)string;+ (void)showImage:(UIImage*)image status:(NSString*)string; // use 28x28 white pngs
ZAActivityBar 提示效果
GitHub:https://github.com/zacaltman/ZAActivityBar
ZAActivityBar和SVProgressHUD非常相似,它提供了更加簡潔的API來顯示提示效果。
ZAActivityBar使用的動畫效果來源於ZKBounceAnimation(https://github.com/khanlou/SKBounceAnimation),成功、失敗的狀態圖示來源於Pictos(http://pictos.cc/)。
顯示載入狀態:
[ZAActivityBar showWithStatus:@"載入中..."];
顯示成功、失敗狀態:
[ZAActivityBar showSuccessWithStatus:@"成功!"];[ZAActivityBar showErrorWithStatus:@"失敗!"];
隱藏提示:
[ZAActivityBar dismiss];
SBJson JSON解析
官方: http://sbjson.org/
GitHub:https://github.com/stig/json-framework
API使用起來稍顯繁瑣,特別是初始化的時候:
@interface TestViewController ()<SBJsonStreamParserAdapterDelegate> { SBJsonStreamParser *parser; SBJsonStreamParserAdapter *adapter;}// 冗長的初始化方法足以嚇到一大片人- (void)initSBJSON{ // We don't want *all* the individual messages from the // SBJsonStreamParser, just the top-level objects. The stream // parser adapter exists for this purpose. adapter = [[SBJsonStreamParserAdapter alloc] init]; // Set ourselves as the delegate, so we receive the messages // from the adapter. adapter.delegate = self; // Create a new stream parser.. parser = [[SBJsonStreamParser alloc] init]; // .. and set our adapter as its delegate. parser.delegate = adapter; // Normally it's an error if JSON is followed by anything but // whitespace. Setting this means that the parser will be // expecting the stream to contain multiple whitespace-separated // JSON documents. parser.supportMultipleDocuments = YES;}#pragma mark SBJsonStreamParserAdapterDelegate methods- (void)parser:(SBJsonStreamParser *)parser foundArray:(NSArray *)array { [NSException raise:@"unexpected" format:@"Should not get here"];}- (void)parser:(SBJsonStreamParser *)parser foundObject:(NSDictionary *)dict { NSLog(@"SBJson parser foundObject"); // 處理返回的資料}// 使用ASIHTTPRequest請求測試- (void) loadData { __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setRequestMethod:@"POST"]; [request setCompletionBlock:^{ // Use when fetching text data //NSString *responseString = [request responseString]; // Use when fetching binary data NSData *responseData = [request responseData]; NSLog(@"Connection didReceiveData of length: %u", responseData.length); // Parse the new chunk of data. The parser will append it to // its internal buffer, then parse from where it left off in // the last chunk. SBJsonStreamParserStatus status = [parser parse:responseData]; if (status == SBJsonStreamParserError) { NSLog(@"Parser error: %@", parser.error); } else if (status == SBJsonStreamParserWaitingForData) { NSLog(@"Parser waiting for more data"); } }]; [request setFailedBlock:^{ NSError *error = [request error]; NSLog(@"failed - %@ %@", [error localizedDescription], error); }]; [request startAsynchronous];}
JSONKit JSON解析
GitHub:https://github.com/johnezang/JSONKit
提供比SBJson更優異的效能以及更加簡便的使用方法,但是中文最好使用utf-8格式(/uXXXX),否則容易造成亂碼。
API呼叫起來非常簡單,省去了SBJson那麼一大堆的方法:
JSONDecoder* decoder = [[JSONDecoder alloc] initWithParseOptions:JKParseOptionNone];id result = [decoder objectWithData:jsonData];
詳細的使用方法請看它的GitHub主頁。
SDWebImage 圖片非同步載入及快取
SDWebImage用於非同步下載網路上的圖片,並支援對圖片的快取等。
多數情況下是使用UIImageView+WebCache為UIImageView非同步載入圖片:
#import <SDWebImage/UIImageView+WebCache.h>// ...[cell.imageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
需要注意的是,pladeholderImage的大小一定要大於UIImageView的大小,否則可能不顯示placeholderImage圖片。
它還支援block語法用於在載入完成時做一些操作:
[cell.imageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] placeholderImage:[UIImage imageNamed:@"placeholder.png"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {... completion code here ...}];
SDWebImage並不侷限於UIImageView上,使用SDWebImageManager完成更多的操作:
SDWebImageManager *manager = [SDWebImageManager sharedManager];[manager downloadWithURL:imageURL options:0 progress:^(NSUInteger receivedSize, long long expectedSize) { // 下載進度 } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) { if (image) { // 下載完成 } }];
或者使用Image Downloader也是一樣的效果:
[SDWebImageDownloader.sharedDownloader downloadImageWithURL:imageURL options:0 progress:^(NSUInteger receivedSize, long long expectedSize) { // 進度 } completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) { if (image && finished) { // 下載完成 } }];
UIActivityIndicator-for-SDWebImage 為SDWebImage顯示載入效果
GitHub:https://github.com/JJSaccolo/UIActivityIndicator-for-SDWebImage
用於為SDWebImage在UIImageView載入圖片時,顯示載入效果(UIActivityIndicatorView實現),它提供以下方法:
- (void)setImageWithURL:(NSURL *)url usingActivityIndicatorStyle:(UIActivityIndicatorViewStyle)activityStyle;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder usingActivityIndicatorStyle:(UIActivityIndicatorViewStyle)activityStyle;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options usingActivityIndicatorStyle:(UIActivityIndicatorViewStyle)activityStyle;- (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock usingActivityIndicatorStyle:(UIActivityIndicatorViewStyle)activityStyle;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock usingActivityIndicatorStyle:(UIActivityIndicatorViewStyle)activityStyle;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock usingActivityIndicatorStyle:(UIActivityIndicatorViewStyle)activityStyle;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock usingActivityIndicatorStyle:(UIActivityIndicatorViewStyle)activityStyle;
UIImage+Resize 調整圖片大小
GitHub:https://github.com/coryalder/UIImage_Resize
提供多種方法為圖片設定透明度、圓角、裁剪、調整大小等:
- (UIImage *)imageWithAlpha;- (UIImage *)transparentBorderImage:(NSUInteger)borderSize;- (UIImage *)roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize;- (UIImage *)croppedImage:(CGRect)bounds;- (UIImage *)thumbnailImage:(NSInteger)thumbnailSize transparentBorder:(NSUInteger)borderSize cornerRadius:(NSUInteger)cornerRadius interpolationQuality:(CGInterpolationQuality)quality;- (UIImage *)resizedImage:(CGSize)newSize interpolationQuality:(CGInterpolationQuality)quality;- (UIImage *) resizedImageWithContentMode:(UIViewContentMode)contentMode bounds:(CGSize)bounds interpolationQuality:(CGInterpolationQuality)quality;
更詳細使用見:http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/
ImageCacheResize 非同步載入圖片、快取及調整大小
GitHub:https://github.com/toptierlabs/ImageCacheResize
整合了SDWebImage和UIImage+Resize的功能,用於圖片的非同步載入、快取、以及下載完成後調整大小並顯示在UIImageView上。
提供了以下API用於載入圖片以及載入完成後調整圖片大小:
- (void)setImageWithURL:(NSURL *)url andCropToBounds:(CGRect)bounds;- (void)setImageWithURL:(NSURL *)url andResize:(CGSize)size withContentMode:(UIViewContentMode)mode;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder andCropToBounds:(CGRect)bounds;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options andResize:(CGSize)size;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options andResize:(CGSize)size withContentMode:(UIViewContentMode)mode;- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options andCropToBounds:(CGRect)bounds;
使用方法和SDWebImage一樣簡單,如以下官方例子:
[imageview setImageWithURL:[NSURL URLWithString:@"http://t0.gstatic.com/images?q=tbn:ANd9GcQfraHpiabjEY8iDdBe9OUQYHMtwfuAv9ZRR0RYKuoVF_EpE8Fp5A"] andResize:CGSizeMake(30, 30) withContentMode:UIViewContentModeScaleAspectFit]; // 按比例縮放[imageview setImageWithURL:[NSURL URLWithString:@"http://t0.gstatic.com/images?q=tbn:ANd9GcQfraHpiabjEY8iDdBe9OUQYHMtwfuAv9ZRR0RYKuoVF_EpE8Fp5A"] andCropToBounds:CGRectMake(0, 0, 100, 100)]; // 裁剪成100x100大小
EGOTableViewPullRefresh 下拉重新整理
GitHub:https://github.com/enormego/EGOTableViewPullRefresh
這是最早出現的為UITableView提供下拉重新整理功能的類庫,使用起來稍顯麻煩,需要實現諸多協議(程式碼取自官方DEMO):
#import "EGORefreshTableHeaderView.h"@interface RootViewController : UITableViewController <EGORefreshTableHeaderDelegate, UITableViewDelegate, UITableViewDataSource>{ EGORefreshTableHeaderView *_refreshHeaderView; // 是否正在載入中 BOOL _reloading;}- (void)viewDidLoad { [super viewDidLoad]; if (_refreshHeaderView == nil) { EGORefreshTableHeaderView *view = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f - self.tableView.bounds.size.height, self.view.frame.size.width, self.tableView.bounds.size.height)]; view.delegate = self; [self.tableView addSubview:view]; _refreshHeaderView = view; [view release]; } // 更新最後載入時間 [_refreshHeaderView refreshLastUpdatedDate];}#pragma mark -#pragma mark Data Source Loading / Reloading Methods- (void)reloadTableViewDataSource{ // 在這裡加入程式碼用於獲取資料 _reloading = YES;}- (void)doneLoadingTableViewData{ // 資料載入完成時呼叫這個方法 _reloading = NO; [_refreshHeaderView egoRefreshScrollViewDataSourceDidFinishedLoading:self.tableView];}#pragma mark -#pragma mark UIScrollViewDelegate Methods- (void)scrollViewDidScroll:(UIScrollView *)scrollView{ [_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView];}- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ [_refreshHeaderView egoRefreshScrollViewDidEndDragging:scrollView];}#pragma mark -#pragma mark EGORefreshTableHeaderDelegate Methods- (void)egoRefreshTableHeaderDidTriggerRefresh:(EGORefreshTableHeaderView*)view{ [self reloadTableViewDataSource]; [self performSelector:@selector(doneLoadingTableViewData) withObject:nil afterDelay:3.0];}- (BOOL)egoRefreshTableHeaderDataSourceIsLoading:(EGORefreshTableHeaderView*)view{ return _reloading; // should return if data source model is reloading}- (NSDate*)egoRefreshTableHeaderDataSourceLastUpdated:(EGORefreshTableHeaderView*)view{ return [NSDate date]; // should return date data source was last changed}
PullToRefresh 下拉重新整理
GitHub:https://github.com/leah/PullToRefresh
PullToRefresh提供比EGOTableViewPullRefresh更加簡單的使用方法,只要繼承自PullRefreshTableViewController,再實現refresh方法即可:
- (void)refresh { // 載入資料 [self.tableView reloadData]; // 重新載入UITableView [self stopLoading]; //停止動畫}
STableViewController 下拉重新整理、上拉載入更多
GitHub:https://github.com/shiki/STableViewController
STableViewController比PullToRefresh多了一個上拉載入更多功能,使用上也差不多簡單,需要繼承自STableViewController,再實現一些方法:
- (void) viewDidLoad{ [super viewDidLoad]; self.title = @"STableViewController Demo"; [self.tableView setBackgroundColor:[UIColor lightGrayColor]]; // 需要建立兩個自定義檢視用於顯示"下拉重新整理"、"上拉載入更多" self.headerView = headerView; self.footerView = footerView; }#pragma mark - Pull to Refresh- (void) pinHeaderView{ [super pinHeaderView]; // 下拉重新整理檢視顯示一些載入動畫}- (void) unpinHeaderView{ [super unpinHeaderView]; // 下拉重新整理檢視停止動畫}- (void) headerViewDidScroll:(BOOL)willRefreshOnRelease scrollView:(UIScrollView *)scrollView{ // 下拉重新整理檢視顯示狀態資訊 if (willRefreshOnRelease) //hv.title.text = @"鬆開後重新整理..."; else //hv.title.text = @"下拉重新整理...";}- (BOOL) refresh{ if (![super refresh]) return NO; // 下拉重新整理載入資料 [self performSelector:@selector(addItemsOnTop) withObject:nil afterDelay:2.0]; return YES;}#pragma mark - Load More- (void) willBeginLoadingMore{ // 上拉載入更多檢視載入動畫}- (void) loadMoreCompleted{ [super loadMoreCompleted]; // 上拉載入更多檢視停止動畫 if (!self.canLoadMore) { //沒有更多資料的時候執行程式碼... }}- (BOOL) loadMore{ if (![super loadMore]) return NO; // 上拉載入更多資料 [self performSelector:@selector(addItemsOnBottom) withObject:nil afterDelay:2.0]; return YES;}// - (void) addItemsOnTop{ // 載入資料... [self.tableView reloadData]; // 資料載入完成通知上拉檢視 [self refreshCompleted];}- (void) addItemsOnBottom{ // 載入更多資料... [self.tableView reloadData]; // 通過判斷設定是否可以載入更多 //self.canLoadMore = NO; // 資料載入完成通知下拉檢視 [self loadMoreCompleted];}
SVPullToRefresh 下拉重新整理、上拉載入更多
GitHub:https://github.com/samvermette/SVPullToRefresh
包含SVPullToRefresh + SVInfiniteScrolling為UITableView提供下拉重新整理、上拉載入更多功能。
使用起來也相當簡單,只要在UITableViewController裡實現以下方法:
- (void)viewDidLoad { [super viewDidLoad]; __weak SVViewController *weakSelf = self; // 設定下拉重新整理 [self.tableView addPullToRefreshWithActionHandler:^{ [weakSelf insertRowAtTop]; }]; // 設定上拉載入更多 [self.tableView addInfiniteScrollingWithActionHandler:^{ [weakSelf insertRowAtBottom]; }];}- (void)viewDidAppear:(BOOL)animated { [tableView triggerPullToRefresh];}- (void)insertRowAtTop { // 獲取資料.... // 停止動畫 [self.tableView.pullToRefreshView stopAnimating];}- (void)insertRowAtBottom { // 獲取資料.... // 停止動畫 [weakSelf.tableView.infiniteScrollingView stopAnimating];}
CMPopTipView 提示資訊
GitHub:https://github.com/chrismiles/CMPopTipView
CMPopTipView用於在一些檢視上顯示提示資訊:
self.tipView = [[CMPopTipView alloc] initWithMessage:@"提示訊息"];self.tipView.delegate = self;[self.tipView presentPointingAtView:anyButton inView:self.view animated:YES]; // 點選按鈕顯示[self.tipView presentPointingAtBarButtonItem:barButtonItem animated:YES]; // 點選導航欄按鈕顯示 #pragma mark CMPopTipViewDelegate methods- (void)popTipViewWasDismissedByUser:(CMPopTipView *)popTipView { // 清理資源 self.tipView = nil;}
PrettyKit
GitHub:https://github.com/vicpenap/PrettyKit
定製了一些UI元件如UITableViewCell、UINavigationBar、UITabBar、UIToolBar等,比系統自帶的更加美觀。
MGBox2
GitHub:https://github.com/sobri909/MGBox2
提供一些定製的UI元件可以更簡單快速的建立表格、網格佈局,以及豐富的文字呈現,基於block的事件機制等,包含:MGBox、MGTableBox、MGTableBoxStyled、MGScrollView、MGButton、MGEvents、MGEasyFrame、MGLine等,其中MGBox還支援screenshot方法用於截圖。
Nimbus
GitHub:https://github.com/jverkoey/nimbus
著名的框架,提供了一套非常豐富的UI元件,可以使開發變得更加簡單、有效率。
FlatUIKit
GitHub:https://github.com/Grouper/FlatUIKit
扁平化設計的UI元件,類似於WP或者iOS7的風格。
MUKMediaGallery
GitHub:https://github.com/muccy/MUKMediaGallery
媒體庫效果,支援圖片、視訊及音訊。
PTShowcaseViewController
GitHub:https://github.com/exalted/PTShowcaseViewController
同樣是一個媒體庫效果,支援的格式更多,包括:圖片、視訊、PDF等.
MWPhotoBrowser
GitHub:https://github.com/mwaterfall/MWPhotoBrowser
圖片展示效果,支援本地及遠端的圖片,使用也比較簡單,只要實現MWPhotoBrowserDelegate協議:
@interface TestViewController ()<MWPhotoBrowserDelegate>{ NSArray *_photos;}-(void) doAction { NSMutableArray *photos = [[NSMutableArray alloc] init]; for (...) { MWPhoto* photo = [MWPhoto photoWithURL:[NSURL URLWithString:url]]; // 設定圖片地址 photo.caption = description; // 設定描述 [photos addObject:photo]; } _photos = photos; MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self]; browser.displayActionButton = YES; UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:browser]; nc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:nc animated:YES];}#pragma mark - MWPhotoBrowserDelegate- (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser { return _photos.count;}- (MWPhoto *)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index { if (index < _photos.count) return [_photos objectAtIndex:index]; return nil;}
ios-image-filters
GitHub:https://github.com/esilverberg/ios-image-filters
提供多種圖片濾鏡效果。
PDF Reader Core for iOS
GitHub:https://github.com/vfr/Reader
PDF閱讀器核心。
DTCoreText
GitHub:https://github.com/Cocoanetics/DTCoreText
支援富文字的顯示如HTML。
FTCoreText
GitHub:https://github.com/FuerteInternational/FTCoreText
富文字檢視
CoreTextWrapper
GitHub:https://github.com/akosma/CoreTextWrapper
支援多列的文字檢視
Base64
GitHub:https://github.com/nicklockwood/Base64
提供對字串的Base64編碼
RNCryptor
GitHub:https://github.com/rnapier/RNCryptor
提供AES加密方法
--------------------- 本文來自 請叫我汪海 的CSDN 部落格 ,全文地址請點選:https://blog.csdn.net/pleasecallmewhy/article/details/17149623?utm_source=copy