uilabel.text from array string
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:
- custom binding swiftui
- swift and xcode and convert "Int to Int16"
- swift play audio file
- setting a local notification at specific time every day swift
- swift convert decimal to string
- uilabel.text from array string
- Blinking effect on UILabel
- get keyboard height swift
- swiftui foreach
- if statement swfit
- show back button in navbar swift
- uicolor from hex swift
- swift compare strings
- how to disable uitableview scrolling in swift
- swift completion handler
- Loading/Downloading image from URL on Swift
- fizbuzz in swift
- one line if statement swift
- button sizetofit not working swift
- round up swift
- swift check if string contains string
- fade anumation swift
- screen recorder swift
- displaying button title swift stackoverflow