swift update uilabel text button
import UIKit
class ViewController: UIViewController {
var arrays = ["A", "b", "C", "D", "E", "F"]
var currentIndex = 0
@IBOutlet weak var ChangeText: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
ChangeText.text = arrays[currentIndex]
}
@IBAction func Button() {
currentIndex++
if (currentIndex == arrays.count {
currentIndex = 0
}
ChangeText.text = arrays[currentIndex]
}
}
Also in Swift:
- displaying button title swift stackoverflow
- predicate realm bool swift
- fnb swift code
- convert string to int swift
- swift uitableview cell spacing
- remove child from firebase swift
- one line if statement swift
- swift dispatch after
- how to swift pie chart quartzcore framework
- switch statements swift
- get device height spritekit
- swift update uilabel text button
- verilog monitor
- application tried to present a nil modal view controller on target
- swift how to add a completion block to a function
- swift wait 5 seconds
- swift temporary directory
- Library not loaded: @rpath/App.framework/App
- swift out of bound elelemnt
- swift ns_enum generic name
- set image width and height swiftui
- set button programmatically swift
- get item filter count swift
- swift add horizontal line uiview programmatically