Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set tag referenced in code, storyboard?

I'm updated an iOS app I did not initially build, and the tags from the storyboard where somehow used which I'm not familiar with how to set - are used to identify buttons within a scrollview. Could I get some help on how to setup in XCode 5 storyboards (if that is where it's set)?

     //Set fonts for button 1
for(UIButton *button in view1.subviews){
    if(button.tag == 1 || button.tag == 8 || button.tag == 13 || button.tag == 18){button.titleLabel.font = [UIFont fontWithName:@"Cachet-Bold" size:20];}
    else{button.titleLabel.font = [UIFont fontWithName:@"Cachet-Book" size:18];}
}
like image 937
Bachzen Avatar asked Dec 12 '13 23:12

Bachzen


People also ask

How do I create a storyboard reference in Xcode?

Select the Note View Controller scene in Main. storyboard and choose Refactor to Storyboard ... from Xcode's Editor menu. Xcode prompts you to name the storyboard which the Note View Controller scene is moved to. Name the storyboard NoteViewController.

Is storyboard better than SwiftUI?

After looking at the pros and cons of both Storyboard and SwiftUI, according to my opinion building app UI using storyboard is comparatively easier for a beginner, and has been there was a very long time, but there are some flaws with it and that flaws have been taken care of in Swift UI.


2 Answers

The tag is a field under the view category in the preferences tab of the right pane of interface builder.

like image 60
Linuxios Avatar answered Sep 21 '22 17:09

Linuxios


View > Utilities > Attribute inspector and under View set tag there.

Another is

View > Utilities > Identity inspector like:

enter image description here

like image 30
0yeoj Avatar answered Sep 21 '22 17:09

0yeoj