綜合項目 iOSProjectphp
國內優秀框架 YYKitcss
YYKit 是一組龐大、功能豐富的 iOS 組件。
爲了儘可能複用代碼,這個項目中的某些組件之間有比較強的依賴關係。爲了方便其餘開發者使用,我從中拆分出如下獨立組件:html
DZNEmptyDataSet:UITableView無數據提示框架處理.ios
RATreeView :UITableView的cell的多層展現git
AMScrollingVavbar: 表格上推下拉是導航欄跟着顯示或隱藏github
AsyncDisplayKit 異步處理視圖,但此項目已經遷移和移動到Texture(AsyncDisplayKit has been moved and renamed: Texture)正則表達式
pop: 動畫框架,範例能夠參考poppingjson
AFNetworking: oc網絡請求框架swift
Alamofire :swift網絡請求框架segmentfault
網絡監聽
MJExtension
JsonModel
YYModel
xml解析
NSXMLParser: SAX方式解析,蘋果原生
GDataXML: DOM方式解析,google開發
ZIP解壓縮:
SSZipArchive: 文件加壓縮,此框架依賴動態庫libz.dylib
https://github.com/ZipArchive/ZipArchive
ESJsonFormat插件
把jsonString生成OC模型中的屬性
音頻視頻框架
ijk框架IJKMediaPlayer
FFMPEG和libx264
1. Mantle
Mantle 讓咱們能簡化 Cocoa 和 Cocoa Touch 應用的 model 層。簡單點說,程序中常常要進行網絡請求,請求到得通常是 json 字符串,咱們通常會建一個 Model 類來存放這些數據。這就要求咱們編寫一系列的序列化代碼,來把 json 轉換爲 Model 。這很費時間,容易錯,不容易修改。 Mantle 很好的解決了這個問題,並且更易用。
GitHub : https://github.com/Mantle/Mantle
參考:
CocoaPod 集成: pod 'Mantle', '~> 1.5.4'
2. Masonry
IB 時代,若是你還在用代碼絕對佈局就太 low 了。隨着蘋果發佈 iPhone6 、 iPhone 6 plus 。 iOS 設備將會出現愈來愈豐富的屏幕尺寸,咱們不可能根據每一個尺寸作一套佈局。因此,使用 autolayout 就頗有必要了。在 storyboard 中,能夠很是方便的使用 autolayout ,可是爲了更好的協做開發,有些公司依然在手寫佈局,使人沮喪的是蘋果提供的 autolayout 語法晦澀難懂,很是影響效率(你能夠在 這裏 動態查看 autolayout 的語法)。 Masonry 就是設計來解決複雜的手寫 autolayout 。如何優雅的使用 autolayout ,且看 Masonry 。
GitHub : https://github.com/Masonry/Masonry
參考:使用方法,請看 README
CocoaPod 集成: pod 'Masonry', '~> 0.6.1'
3. Reachability
移動互聯網時代,應該不多有應用是不須要網絡鏈接的吧。監測網絡鏈接狀態幾乎是必不可少的一部分。 Reachability 能夠完美的完成這一任務
參考:使用方法很是簡單,請看 README
CocoaPod 集成: pod 'Reachability', '~> 3.2'
4. BlocksKit
BlocksKit絕對是 Objective-C 的知心伴侶,它爲 OC 經常使用類提供了強大的 Block 語法支持,使得編寫 OC 代碼變得溫馨、快速、優雅。反正我是絕對離不開它。
CocoaPod 集成: pod 'BlocksKit', '~> 2.2.5'
5. KVOController
若是你在項目中有使用 KVO ,那麼 KVOController 絕對是個好選擇。它是 facebook 開源的一個 KVO 加強框架。有如下幾個特性:
使用 Blocks 、自定義 Actions 或者 NSKeyValueObserving 回調進行通知 .
觀測者移除時無異常
控制器 dealloc 時隱式的觀測者移除
提高使用 NSKeyValueObservingInitial 的性能
線程安全並提供在觀測者恢復時額外的保護
還有什麼理由不使用 KVOController 呢?
參考: KVOController : facebook 開源的 KVO ( Key-value Observing )工具
CocoaPod : pod 'KVOController', '~> 1.0.3'
6. MBProgressHUD
一個老牌、經典的通知組件,若是大家美工沒有專門設計等待和通知視圖,那就用它吧!
GitHub : https://github.com/jdg/MBProgressHUD
參考
CocoaPod : pod 'MBProgressHUD', '~> 0.9'
7. ODRefreshControl
不少公司都本身設計下拉刷新視圖,好比網易新聞 iOS 客戶端,下拉的時候會有廣告出現。若是你只是須要一個下拉刷新,那麼能夠考慮 ODRefreshControl ,它是原 iOS6 上的橡皮糖刷新樣式,頗有意思。如今也不少大的 App 在用,好比蝦米音樂和 QQ 客戶端。
參考
CocoaPod : pod 'ODRefreshControl', '~> 1.1.0'
8. pop
又是 Facebook 開源的。大名鼎鼎的 pop ,作動畫的不二之選。收下它吧。
GitHub : https://github.com/facebook/pop
CocoaPod : pod 'pop', '~> 1.0.7'
9. AFNetworking
Objective-C下網絡請求庫。
參考
CocoaPod : pod 'AFNetworking', '~> 2.5.0'
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
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];
官方: http://sbjson.org/
GitHub:https://github.com/stig/json-framework
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;
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/
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大小
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];}
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];}
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;}
GitHub:https://github.com/vicpenap/PrettyKit
定製了一些UI組件如UITableViewCell、UINavigationBar、UITabBar、UIToolBar等,比系統自帶的更加美觀。
GitHub:https://github.com/sobri909/MGBox2
提供一些定製的UI組件能夠更簡單快速的建立表格、網格佈局,以及豐富的文本呈現,基於block的事件機制等,包含:MGBox、MGTableBox、MGTableBoxStyled、MGScrollView、MGButton、MGEvents、MGEasyFrame、MGLine等,其中MGBox還支持screenshot方法用於截圖。
GitHub:https://github.com/jverkoey/nimbus
著名的框架,提供了一套很是豐富的UI組件,可使開發變得更加簡單、有效率。
GitHub:https://github.com/Grouper/FlatUIKit
扁平化設計的UI組件,相似於WP或者iOS7的風格。
GitHub:https://github.com/muccy/MUKMediaGallery
媒體庫效果,支持圖片、視頻及音頻。
GitHub:https://github.com/exalted/PTShowcaseViewController
一樣是一個媒體庫效果,支持的格式更多,包括:圖片、視頻、PDF等.
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;}
GitHub:https://github.com/esilverberg/ios-image-filters
提供多種圖片濾鏡效果。
GitHub:https://github.com/vfr/Reader
PDF閱讀器核心。
GitHub:https://github.com/Cocoanetics/DTCoreText
支持富文本的顯示如HTML。
GitHub:https://github.com/FuerteInternational/FTCoreText
富文本視圖
GitHub:https://github.com/akosma/CoreTextWrapper
支持多列的文本視圖
GitHub:https://github.com/nicklockwood/Base64
提供對字符串的Base64編碼
GitHub:https://github.com/rnapier/RNCryptor
提供AES加密方法
開發幾個經常使用的開源類庫及下載地址:
1.jsonjson編碼解碼
2.GTMBase64 base64編碼解碼
3.TouchXML 解析
4.SFHFKeychainUtils 安全保存用戶密碼到keychain中
5.MBProgressHUD很棒的一個加載等待特效框架
6.ASIHTTPRequest 等相關協議封裝
7.EGORefreshTableHeaderView 下拉刷新代碼
8.AsyncImageView 異步加載圖片並緩存代碼
9.相似setting的豎立也分欄程序
10.MBProgressHUD——進展指示符庫
11.Flurry——詳盡的使用統計
12.CorePlot——2D圖形繪圖儀
13.GData client——iPhone上全部Google相關服務的類庫
14.SDWebImage——簡化網絡圖片處理
15.RegexKitLite——正則表達式支持
可能會用到的庫:
1.exif:svn checkout http://iphone-exif.google.code.com/svn/trunk/ iphone-exif
2.圖像處理:svn checkout http://simple-iphone-image-processing.googlecode.com/svn/trunk/ simple-iphone-image-processing-read-only
AppStore軟件排名相關,工欲善其事,必先利其器。
1.下載排名相關:appannie
2.用戶行爲分析:flurry
3.majicrank-各國排名查詢工具 (推薦)
4.AppViz-App銷售統計軟件 (推薦)
5.PodViz-用戶評論等查看工具
6.appfigures-報表統計分析工具
開發幾個經常使用的開源類庫及下載地址:引用1.json json編碼解碼2.GTMBase64 base64編碼解碼3.TouchXML xml解析4.SFHFKeychainUtils 安全保存用戶密碼到keychain中5.MBProgressHUD 很棒的一個加載等待特效框架6.ASIHTTPRequest http等相關協議封裝7.EGORefreshTableHeaderView 下拉刷新代碼8.AsyncImageView 異步加載圖片並緩存代碼9.相似setting的豎立也分欄程序
掃描wifi信息:
http://code.google.com/p/uwecaugmentedrealityproject/
http://code.google.com/p/iphone-wireless/
條形碼掃描:http://zbar.sourceforge.net/iphone/sdkdoc/install.html
tcp/ip的通信協議:http://code.google.com/p/cocoaasyncsocket/
voip/sip:
http://code.google.com/p/siphon/
http://code.google.com/p/asterisk-voicemail-for-iphone/
http://code.google.com/p/voiphone/
three20:https://github.com/facebook/three20
google gdata:http://code.google.com/p/gdata-objectivec-client/
720全景顯示panoramagl:http://code.google.com/p/panoramagl/
jabber client:http://code.google.com/p/ichabber/
PLBlocks:http://code.google.com/p/plblocks/
image processing
http://code.google.com/p/simple-iphone-image-processing/
json編碼解碼:http://code.google.com/p/json-framework
base64編碼解碼:http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/?r=87
xml解析:https://github.com/schwa/TouchXML
安全保存用戶密碼到keychain中:https://github.com/ldandersen/scifihifi-iphone
加載等待特效框架(private api):https://github.com/jdg/MBProgressHUD
http等相關協議封裝:http://allseeing-i.com/ASIHTTPRequest
下拉刷新代碼:https://github.com/enormego/EGOTableViewPullRefresh
異步加載圖片並緩存代碼:http://www.markj.net/iphone-asynchronous-table-image/
iphone TTS:https://bitbucket.org/sfoster/iphone-tts
iphone cook book 源碼:https://github.com/erica/iphone-3.0-cookbook-
iphone 正則表達式:http://regexkit.sourceforge.net/RegexKitLite/
OAuth認證: http://code.google.com/p/oauth/
http://code.google.com/p/oauthconsumer/