ConsolePrint
这个想法来自 这里。已经使用了多年,我决定开源它。
安装
…
pod 'ConsolePrint'
…
# Enable ConsolePrint manually. Default not print anything
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['ConsolePrint'].include? target.name
target.build_configurations.each do |config|
if config.name == "Debug"
config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] += "ConsolePrint"
end
end
end
end
end
使用
// e.g.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
consolePrint("Hello, World!")
return true
}
// ^ AppDelegate.swift[36], application(_:didFinishLaunchingWithOptions:): Hello, World!