Skip to content

Instantly share code, notes, and snippets.

View yong076's full-sized avatar
:octocat:

DanielKim yong076

:octocat:
View GitHub Profile
import UIKit
extension UIImage {
func tint(tintColor: UIColor) -> UIImage {
return modifiedImage { context, rect in
// draw black background - workaround to preserve color of partially transparent pixels
context.setBlendMode(.normal)
UIColor.black.setFill()