iOS空項目地址:
https://github.com/11dd/gitTestProjectOne
使用cocoapods導入主流的開源類庫;
算是一個項目的空模板吧,不用重新創(chuàng)建,下載即可使用;
省去重新創(chuàng)建項目,重新去寫每個項目必然存在的一些模塊;
例如登錄注冊,一些常用的宏,一些常用的工具類等等...
這樣做減少了開發(fā)時間沒有逼格,
僅僅是小項目常規(guī)的碼代碼;
(一)常用的第三方庫
*AFNetWorking --網(wǎng)絡請求--
https://github.com/AFNetworking/AFNetworking
*MJRefresh --刷新--
https://github.com/CoderMJLee/MJRefresh
*SDWebImage --圖片加載--
https://github.com/rs/SDWebImage
*IQKeyBoardManager--用于解決輸入框被鍵盤遮擋的問題--
https://github.com/hackiftekhar/IQKeyboardManager
*Masonry --用于布局約束--
https://github.com/SnapKit/Masonry
*MBProgressHUD --用于加載的loading和類似Android的toast提示框--
https://github.com/jdg/MBProgressHUD
(二)我是第二梯隊已添加如下功能:
--添加輪播--(支付工具合集)查看該類,集成蘋果支付,支付寶,微信支付,銀聯(lián)支付--
(分頁)查看SegmentPageHead.h可查看使用示例
NullSafe.m--加在程序中,解決NUll問題--
宏定義單例,使用示例:查看DDSingleData.h與DDSingleData.m 直接創(chuàng)建出單例
**Helper.h --工具幫助類,將常用方法寫在這里方便調用
(三)常用宏合集提示請查看:
http://www.reibang.com/p/dbd260b3eb8c
(四)常用方法合集提示,
***還有很多擴展類,程序里查看吧
1.//顯示loading加載中[Helper showLoadingWithView:self.view];
//隱藏loading[Helper hiddonLoadingWithView:self.view];
2.//提示語[Helper showMessageWithHud:@"我只是提示語" addTo:self yOffset:0];
3.//解決鍵盤遮擋住輸入框的問題[Helper setKeyboardManagerEnable:YES];
/請求示例:這里都是使用post請求/
NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
[dic setValue:@"" forKey:@"username"];
[NetworkTool POSTWithURLString:@"URL" parameters:dic isLoading:self.view success:^(id responseObject) {
NSDictionary * dic = responseObject;
[self.tempTableView reloadData];
[self.tempTableView.mj_header endRefreshing];
[self.tempTableView.mj_footer endRefreshing];
}
} faile:^(NSError *error) {
//當出錯時統(tǒng)一打印錯誤信息,無需再此打印報錯信息
}];