My button is
flButton
alpha
0
has no memberValue of type '(Any) -> ()
".alpha
Any
@IBAction
import UIKit
class FirstLaunchView: UIViewController {
@IBOutlet weak var logo1: UIImageView!
@IBOutlet weak var smiley1: UIImageView!
@IBOutlet weak var subHapp1: UILabel!
@IBOutlet weak var happ1: UILabel!
@IBAction func flButton(_ sender: Any) {
UserDefaults.standard.set(false, forKey: "name")
//launchDetector = false
performSegue(withIdentifier: "toMain", sender: self)
}
@IBOutlet weak var firstLaunch: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
logo1.alpha = 0
smiley1.alpha = 0
subHapp1.alpha = 0
happ1.alpha = 0
flButton.alpha = 0
}
Your flButton
is an @IBAction function
. You should either create an @IBOutlet
for your button or do this in your function
if you want to keep it:
if let button = sender as? UIButton {
button.alpha = 0
}
Or you could just change the type of you @IBAction function
from:
@IBAction func flButton(_ sender: Any)
To:
@IBAction func flButton(_ sender: UIButton)
And then just set sender.alpha = 0
.