I have a Master-DetailView project and i need to change a button's title by an array like i do here :
import UIKit
import AVFoundation
import MapKit
class TemplateTestViewController: UIViewController,MKMapViewDelegate {
@IBOutlet var ProfileMapView: MKMapView!
@IBOutlet var BarOrClubLabel: UILabel!
@IBOutlet var HeaderProfileName: UILabel!
@IBOutlet var HeaderprofileImage: UIImageView!
@IBOutlet var StreetProfileLabel: UILabel!
@IBOutlet var ProfilePhoneNumberLabel: UIButton!
@IBOutlet var WorkTimeLabel: UILabel!
@IBOutlet var AgeLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
//Set Ups the Image Template :
HeaderprofileImage.image = UIImage(named: ProfileImages[MyIndex])
//Sets Up The BIG Name Template :
HeaderProfileName.text = ProfileNames[MyIndex]
//Sets Up The Navigation Bar Name :
navigationItem.title = ProfileNames[MyIndex]
//Sets Up Street Text :
StreetProfileLabel.text = ProfileStreets[MyIndex]
//Sets Up Bar Or Club Text :
BarOrClubLabel.text = ProfileBarOrClub[MyIndex]
//Sets Up Age Text :
AgeLabel.text = AgeText[MyIndex]
ProfilePhoneNumberLabel.setTitle(ProfilePhoneNumbers[MyIndex], for: UIControlState.normal)
AND IT DIDNT CHANGE.
is there a way to do something like that ? and if so can someone show me how to ? thanks ahead
Well....This is awkward but you have to set your UIButton title to Plain in storyboard to have it changed
ProfilePhoneNumberLabel.setTitle(PhoneNumbers[MyIndex], for: .normal)
+
Plain UIButton
Title
=
Happy Camper