Swiftで開発をする上で(備忘録)
開発においての一つの方法
・Storyboardは画面遷移を定義するためだけに使う
・各コントローラーのUI構成は、xibで作る
・画面の遷移処理はperformSegueWithIDでやる
・delegate callback notificationの使い分け
リリース時でのログの排除
デバック時のみログを出力し、リリース時にはログを出さないようにするには、
// リリースビルドでprint, debugPrintを無効化
func print(object: Any) {
#if DEBUG
Swift.print(object, terminator: "")
#endif
}
func debugPrint(object: Any) {
#if DEBUG
Swift.debugPrint(object, terminator: "")
#endif
}
// リリースビルドでNSLog無効化
func NSLog(message:String){
#if DEBUG
Foundation.NSLog(message)
#endif
}
func NSLog(format:String, _ args:CVarArgType...){
#if DEBUG
Foundation.NSLog(String(format: format, arguments: args))
#endif
}
Author And Source
この問題について(Swiftで開発をする上で(備忘録)), 我々は、より多くの情報をここで見つけました https://qiita.com/YuukiWatanabe/items/743af61918a403b77d02著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .