let searchBtn = UIBarButtonItem(image: UIImage(named: "ic_search"), style: .plain, target: self, action: #selector(self.searchButton))
let moreBtn = UIBarButtonItem(image: UIImage(named: "ic_more"), style: .plain, target: self, action: #selector(self.moreButton))
self.navigationItem.rightBarButtonItems = [moreBtn, searchBtn]
moreBtn.alpha = 0 //something like this not working
class CodeToPass: QualityStandarts {
let doesnt = "meanAnything"
}
I have two UIBarButtonItems. Which made manually. And i wanna animate alpha, when i click one of them. How can i do it?
moreBtn.tintColor = UIColor.red.withAlphaComponent(0.2)
but first make sure your image "ic_more" renders as default in the attributes inspector, go to Assets.xcassets, select your image and from attributes inspector - under "Renders As" select "Default"
note that if you want it invisible change 0.2 to 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With