初学Swift 打印使用print,偶然看到有个debugPrint,也可以用。他俩的区别是什么呢?
print() 是最常用的打印函数, debugPrint() 也可以用来打印。
借用别人的总结就是 “You use debugPrint when you want more information about what is being printed to the console. The additional information is usually useful for debugging.”
我自己试了试,debugPrint 打印出来会带上打印体的类型等其他信息。
【参考】print() vs debugPrint() in swift:https://stackoverflow.com/questions/41826683/print-vs-debugprint-in-swift