Closed marbetschar closed 7 years ago
Any idea why it's not working as expected? Or am I doing something wrong?
just noticed it seems to work if I set the image after initialization of the imageView as follows:
imageView.image = UIImage(named: "my-image")
Seems like a bug.
For some reason this library does not compile for an archived app version when checked out via Carthage
. FWIW: I've subclassed your as follows - this refuses to compile for the app store:
import UIKit
import UIImageViewAlignedSwift
class ChartImageView: UIImageViewAligned{
var imageMaskingColorComponents: [CGFloat]?
var imageTintColor: UIColor?
override var image: UIImage?{
get{
return super.image
}
set{
var newImage = newValue
if let color = self.imageTintColor{
newImage = newImage?.applied(tintColor: color)
} else if let colorComponents = self.imageMaskingColorComponents{
newImage = newImage?.masked(withColorComponents: colorComponents)
}
super.image = newImage
}
}
}
I've just stepped into the same problem. Thanks for the hint. Seems like a bug.
@marbetschar @piotrros It's fixed since 0.4.0. In addition scaling
is not available, as long as it doesn't work as desired.
Not sure about Carthage, because I don't use it and my knowledge about this is really poor. Please PR if you know how to fix this 👍
I've tried to integrate your
UIImageViewAlignedSwift
class as follows, but unfortunately the UIImage itself is not rendered at all (see attached screenshot). What's wrong?And here is the result (the red box in the bottom right corner):