设置CocoPod
touch Podfile
然后直接打开项目文件夹中的Podfile,在编辑器内输入
platform :ios, '9.0'
inhibit_all_warnings!
use_frameworks!
target 'gagaPhoneMall' do
pod 'Alamofire'
pod 'Moya/RxSwift'
pod 'SwiftyJSON'
pod 'RxSwift'
pod 'RxCocoa'
pod 'RxGesture'
pod 'IQKeyboardManagerSwift'
pod 'SnapKit'
pod 'Kingfisher'
pod 'EmptyDataSet-Swift' # tableView 空数据
pod 'SwiftyFitsize' # 字体适配
pod 'JXSegmentedView' # 分类滚动
pod 'SKPhotoBrowser' # 图片预览
# OC
pod 'MBProgressHUD'
pod 'MJRefresh'
pod 'TZImagePickerController' # 相册获取图片或视频
end
在终端输入
pod install
debug打印设置
TARGETS --> Build Settings --> Swift Complier - Custom Flags --> Other Swift Flags --> DEBUG(只需在这个加)
添加“ DEBUG”
func ddPrint<N>(_ message: N, fileName: String = #file, methodName: String = #function, lineNumber: Int = #line){
#if DEBUG // 若是Debug模式下,则打印
print("文件名:\(fileName as NSString)\n方法:\(methodName)\n行号:\(lineNumber)\n打印信息:\(message)");
#endif
}
Podfile设置
//设置app能上网https
App Transport Security Settings的 Allow Arbitrary Loads 为YES
网友评论