I'm setting UImageViews within table cells using setImageWithUrl from the AFNetworking library, but I need the images to be greyscale... is there any way I can do this. I've tried a few UIImage greyscale converters, but I guess they don't work because I'm setting something that hasn't downloaded yet.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
instead of a uiimageView, subclass a UIView, give it
with
override the setter
somewhere else you can set the image with your NSURLRequest:
This thread is a bit old but I came across it on my search. In this post I've pointed out 2 different methods in Swift to create a grayscale image that can be displayed in an imageView considering the alpha and scale of the image.
Try this method:
I found it here: http://mobiledevelopertips.com/graphics/convert-an-image-uiimage-to-grayscale.html
I took the code from @Jesse Gumpo's example, above, but here it is as an interface.
Now you can just do this: