美文网首页iOS收藏
Swift创建新项目

Swift创建新项目

作者: Look2021 | 来源:发表于2018-07-02 18:06 被阅读152次

设置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

与OC的桥接文件Bridging-Header.h

https://blog.csdn.net/freezingxu/article/details/75331602

相关文章

网友评论

    本文标题:Swift创建新项目

    本文链接:https://www.haomeiwen.com/subject/hsgluftx.html