-2
A
回答
1
let image = NSImage(data: Data(contentsOf: url))
+0
這將阻止主線程並使您的應用程序非常無響應。 –
+0
你可以隨時使用後臺線程,如果它變得沒有反應 –
相關問題
- 1. Swift 3:如何將[String:AnyObject]轉換爲[String:String]?
- 2. 如何將RAW8轉換爲RGB8 NSImage
- 3. 將URL轉換爲AVAsset - Swift
- 4. 將NSImage *轉換爲CGImageRef?
- 5. 轉換爲Swift 3
- 6. 如何將Swift 2中的Singleton類轉換爲Swift 3?
- 7. 將字符串轉換爲NSObject Swift 3
- 8. 將UIView轉換爲UIImage Swift 3
- 9. Swift 3將Double轉換爲字符串
- 10. 在Swift 3中將NSData轉換爲NSString?
- 11. 在[swift]中將[AnyObject]轉換爲[Int] 3
- 12. 將UIImage的NSData表示轉換爲NSImage
- 13. Swift 3轉換
- 14. 如何將任何轉換爲Swift 3中的CGFloat
- 15. 如何將`git:`url轉換爲`http:`url
- 16. 如何將Swift 3中的apns數據轉換爲字符串?
- 17. 如何將毫秒轉換爲日期字符串在swift 3
- 18. 如何將字符轉換爲Swift中的整數3
- 19. 如何將UInt16轉換爲Swift 3中的UInt8?
- 20. 如何在Swift 3中將字符串從TextField轉換爲Int?
- 21. 如何在Swift 3中將__NSMallocBlock__轉換爲其基礎類型?
- 22. 如何將NSData轉換爲Swift 3中的數據?
- 23. 如何將JSON轉換爲Swift 3蒸氣字典
- 24. 如何在Swift 3中將數據轉換爲Int?
- 25. 如何將其轉換爲Swift?
- 26. 如何將MYSQL DateTime轉換爲NSDate - Swift
- 27. 如何將這個objc轉換爲SWIFT
- 28. 轉換NSImage到IplImage
- 29. 將指針從Swift 2轉換爲Swift 3
- 30. Alamofire - 將錯誤從Swift 2轉換爲Swift 3
使用nsimage init與數據 –