Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outlet vs outlet collection

Tags:

swift

xcode6

In xcode 6.1 when i drag a button from the main.storyboard to the specified viewcontroller.swift file i get 3 options. 2 of which are outlet & outlet collection. Can somebody explain to me what's the difference between them ?

like image 681
Wassim Seifeddine Avatar asked Nov 08 '14 12:11

Wassim Seifeddine


Video Answer


1 Answers

OutletCollection is collection of outlets!

Guess You have multiple label All which Have same text to display!then you just have to define one outletCollection and connecting all outlets to that outlet. whenever you change text of your outletCollection All label's text are changed and so on!

if you are making simple game(like game of ZombieHunt),then you need multiple images for every zombie!

In short by changing only outlet collection you can change state of all outlets! i hope you understand what i want to say!

possibly Duplicate of this question

like image 99
Saurabh Prajapati Avatar answered Oct 21 '22 01:10

Saurabh Prajapati