blockchainethereumblockchain-walleterc20erc721walletxdaidappdecentralizederc1155erc875iosswifttokens
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
565 B
17 lines
565 B
7 years ago
|
// Copyright SIX DAY LLC. All rights reserved.
|
||
|
|
||
|
import Foundation
|
||
|
import UIKit
|
||
|
|
||
|
extension UIButton {
|
||
|
func setBackgroundColor(_ color: UIColor, forState: UIControlState) {
|
||
|
UIGraphicsBeginImageContext(CGSize(width: 1, height: 1))
|
||
|
UIGraphicsGetCurrentContext()!.setFillColor(color.cgColor)
|
||
|
UIGraphicsGetCurrentContext()!.fill(CGRect(x: 0, y: 0, width: 1, height: 1))
|
||
|
let colorImage = UIGraphicsGetImageFromCurrentImageContext()
|
||
|
UIGraphicsEndImageContext()
|
||
|
|
||
|
self.setBackgroundImage(colorImage, for: forState)
|
||
|
}
|
||
|
}
|