0
因此,我已經安裝了一個名爲'KTSpectrum'的庫,我在圖像上調用一個擴展dominantColors以返回一個UIColor對象。UIImage類型的值沒有成員dominantColors
import KTSpectrum // this import the kMeans clustering library
@IBOutlet var tempImageView: UIImageView! // this hold a temporary image to be displayed in the view
let image = UIImage(CGImage: cgImageRef!, scale: 1.0, orientation: UIImageOrientation.Right)
self.tempImageView.image = image
self.tempImageView.hidden = false
let colors = self.tempImageView.image!.dominantColors()
// this gives me the error Value of type UIImage has no member dominantColors
我已經鏈接了框架並將其構建在項目中。仍然不確定錯誤告訴我什麼。
plz告訴我們鏈接到KTSpectrum –
你是什麼意思的鏈接? https://github.com/kylry/KTSpectrum – user3288619
根據文檔,我已經完成了我需要的一切。其他有類似錯誤的用戶表示需要解開圖像等,等等。 – user3288619