user3288619
user3288619

Reputation: 11

Value of type UIImage has no member dominantColors

So with a library that I have installed called 'KTSpectrum' I am calling an extension dominantColors on an image to return a UIColor object.

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

I have linked the framework and built it within the project. Still not sure what the error is telling me.

Upvotes: 0

Views: 1434

Answers (1)

Jamal
Jamal

Reputation: 229

Just copy the files directly into your Project:

  • kMeans.swift
  • Spectrum+UIImage.swift
  • SpectrumDataTypes.swift
  • SpectrumSettings.swift

and don't use CocoaPods. You don't have to use the "import KTSpectrum" row and everything will work fine, I just tried it myself.

Upvotes: 1

Related Questions