Created
August 28, 2019 07:55
-
-
Save HassanElDesouky/aa258f4a48cb6666e9368df3a0bf8a14 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListIconController: UIViewController { | |
@IBOutlet weak var chooseColorView: UIView! | |
@IBOutlet weak var chooseOtherView: UIView! | |
@IBOutlet weak var chooseGlyphView: UIView! | |
fileprivate func setupViews() { | |
switchViews(firstView: 1.0, secondView: 0.0, thirdView: 0.0) | |
} | |
private func switchViews(firstView: CGFloat, secondView: CGFloat, thirdView: CGFloat) { | |
chooseColorView.alpha = firstView | |
chooseOtherView.alpha = thirdView | |
chooseGlyphView.alpha = secondView | |
} | |
@IBAction func handleSelectView(_ sender: UISegmentedControl) { | |
switch sender.selectedSegmentIndex { | |
case 0: | |
switchViews(firstView: 1.0, secondView: 0.0, thirdView: 0.0) | |
break | |
case 1: | |
switchViews(firstView: 0.0, secondView: 1.0, thirdView: 0.0) | |
break | |
case 2: | |
switchViews(firstView: 0.0, secondView: 0.0, thirdView: 1.0) | |
break | |
default: | |
break | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment