我从CocoaPod更新了"Google/Analytics"并获得了FirebaseAnalytics.
之后,每次运行项目时,FirebaseAnalytics都会产生许多错误记录.
目前我不使用此库并想要删除它.不幸的是我找不到任何方法来禁用/删除它.
这是Podfile配置
target 'myApp' do
inhibit_all_warnings!
use_frameworks!
pod 'Google/Analytics'
end
Run Code Online (Sandbox Code Playgroud)
控制台日志:
<FIRAnalytics/DEBUG> Debug mode is on
<FIRAnalytics/INFO> Firebase Analytics v.3200000 started
<FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see 'https://developer.apple.com/library/ios/recipes/xcode_help-scheme_editor/Articles/SchemeRun.html')
<FIRAnalytics/DEBUG> Debug logging enabled
<FIRAnalytics/DEBUG> Firebase Analytics is monitoring the network status
<FIRAnalytics/DEBUG> Uploading data. Host: https://play.googleapis.com/log
<FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
<FIRAnalytics/INFO> Firebase Analytics disabled
... …
Run Code Online (Sandbox Code Playgroud) 目前,我正在使用枚举来定义API。我的一个api是发布带有图片或没有图片的笔记。
enum StoreAPI {
...
case newNote(String, Data?) /* note_description, note_image */
}
Run Code Online (Sandbox Code Playgroud)
据我所知,有两种方法:
// Option 1
switch api {
...
case let newNote(description, imageData):
if let imageData = imageData {
// Post with image
}
else {
// Post without image
}
...
}
// Option 2
switch api {
...
case let newNote(description, nil):
// Post without image
case let newNote(description, imageData):
let imageData = imageData!
...
}
Run Code Online (Sandbox Code Playgroud)
我想知道是否还有其他方法可以自动解开可选值,或者更好地处理它,或更清晰地处理它。