Questions tagged [iboutletcollection]

The type qualifier IBOutletCollection is a tag applied to an instance-variable declaration so that the Interface Builder application can recognize the instance variable as an outlet and synchronize the display and connection of it with Xcode. It works in a similar way to IBOutlet except it allows a collection of objects

101 questions
0
votes
1 answer

Swift IBOutlet collections and retain cycle safety

I’ve been trying to use Swift outlet collections in a MacOS project for some time, and have only just learned this isn’t currently possible. I’m still puzzled why not, but presuming this is amended at some point, I have another concern. I understand…
Jeff J
  • 139
  • 8
0
votes
2 answers

How can we add a UIGestureRecognizer to Outlet Collection?

I'm trying to add a tap gesture to an outlet collection of labels [UILabel], like this: @IBOutlet var subLabels: [UILabel]! override func viewDidLoad() { super.viewDidLoad() let tap = UITapGestureRecognizer(target:…
0
votes
1 answer

Can't add UIImageView to to the IBOutletCollection

I tried to find the solution, but I couldn't find anyone with the same problem. I'm using Xcode 8.2.1, writing in Objective-C. I'm actually having a problem with adding a UIImageView to IBOutletCollection. I'm trying to do it using the Interface…
Rafał M
  • 391
  • 3
  • 4
0
votes
2 answers

How to drag images

I can move a single UIView using the code below but how do I move multiple UIView's individually using IBOutletCollection and tag values? class TeamSelection: UIViewController { var location = CGPoint(x: 0, y: 0) @IBOutlet weak var…
Chet
  • 53
  • 1
  • 13
0
votes
1 answer

Nested for loops in swift 3 for uibuttons title

I have an outlet collection of UIButtons: @IBOutlet var categoriesButtonLabels: [UIButton]! each button has a different tag (set in the storyboard). I want to change their titles filling with an array of strings (the categories which I retrieve…
Alex
  • 271
  • 2
  • 4
  • 18
0
votes
1 answer

access to elements in IBOutletCollection

I have an IBOutletCollection of UIImageView now I need to access to imges in it, how I can do it? I just can access to the first and the list by this code myCollection.first?.image myCollection.last?.image I need to access to other images
joda
  • 711
  • 2
  • 8
  • 16
0
votes
1 answer

swift - Unable to create IBOutletCollection of UILabels

The above screenshot shows the assistant editor to my view controller displayed. I want to make an IBOutletCollection for the 'artist' labels and link them to the specific title but I'm unable to do so.
0
votes
1 answer

Swift - Cast [AnyObject]! to [Protocol]! directly

I am trying to overcome the limitation explained here about not being able to directly connect IB elements to outlets with protocol types. The workaround mentioned is not ideal because what I need an Outlet Collection and connecting a new element…
RobertoCuba
  • 881
  • 9
  • 25
0
votes
0 answers

How to access a random element from IBOutletCollection array

I need to access a random element from IBOutletCollection array. I have 4 letter imageViews that needs to be dragged on to another imageView and change the image depending on how many were dragged. Im testing with 2 at the moment. I have this but it…
Laury
  • 53
  • 11
0
votes
1 answer

Unable to make outlets

I'm not able to create an outlet on the view controller. I started out with the single view application template, and added another view controller to my storyboard. Now, when I try to create an outlet from the second view controller to the file,…
0
votes
0 answers

Why Tap Gesture Recognizer to dismiss keyboard has Referencing Outlet Collection gestureRecognizers-View?

The purpose of my Tap Gesture Recognizer is to dismiss the keyboard if the user touches any part of the screen outside the keyboard. The Tap Gesture Recognizer has a referencing outlet collection named gestureRecognizer connected to the root View of…
0
votes
1 answer

How to assign a gesture recognizer to a collection?

My goal is to simply send the correct button.titleLabel.text to the handleLongPress function of my view controller. This is my function: - (IBAction)handleLongPress:(UILongPressGestureRecognizer *)sender { UILongPressGestureRecognizer *lpgr =…
JZ.
  • 21,147
  • 32
  • 115
  • 192
0
votes
1 answer

Can't create a new IBOutlet connection; Ctrl+dragging doesn't work

This solution "Can't Ctrl drag views to header file" didn't work for me because even if the assistant is in Automatic mode I don't see my file. I am trying to create a new IBOutlet connection, but this doesn't work. I open the xib file at the left…
0
votes
0 answers

IBOutletCollection doesn't show up in interface builder in Xcode 6

In my appdelegate.h I have a pretty humble IBOutletCollection of NSViews as such: @property (nonatomic, strong) IBOutletCollection(NSView) NSArray *views; However whenever I go to my mainmenu.xib, the Outlet Collections sublist is nowhere to be…
Luke
  • 4,908
  • 1
  • 37
  • 59
0
votes
1 answer

Outlet collections, i want to access the properties(hidden) for my UIimageview

I can only access the id of my outlet collection and an id does not have a hidden property This is my outlet collection @property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *hearts; and this is when I try to call it, and change it…
tnek316
  • 630
  • 1
  • 5
  • 16