How to Create Outlets and Actions in Xcode using Swift - Swift Tips 6

preview_player
Показать описание
How to Create Outlets and Actions in Xcode using Swift - Swift Tips 6

Xcode with the Assistant Editor (Venn Diagram button) let's you connect code and UI (user interface) files together.

In order for you to make your UI interactive, you need to create connections from the UI to your related code files. These connections give Xcode names that you can use in your code file to modify how something looks programmatically or to respond to user input (button tabs, sliders, switches, etc). There are two primary connections you will create in Xcode: outlets and actions.

You will see @IBAction and @IBOutlet in code when you create connections. Xcode 7 will auto insert the necessary code to link your storyboard file to your code file.

--

A wholistic approach to creating, designing, coding, marketing, and selling your app on the App Store.

Рекомендации по теме
Комментарии
Автор

Perfect, exactly what I was looking for. Really well explained! Thank you so much!

powerofpizzazz
Автор

please make videos on basics of storyboard. thank you for your efforts..🤗

KTV-
Автор

The insert outlet doesn appear in my view controller.swift when I drag it

ZeoPvPs
Автор

Hi, Paul. Didn't saw any of your videos for a while. What happen?

denniszhaunerchyk
Автор

+Paul Solt i have a question about buttons. I am doing everything in code including scrollview pinch and zoom features and my buttons as well. I even have all the constraints in code only. So i have not touched the storyboard at all and would like to give programmatically created buttons IBActions to go from once view controller to another. here is my code for the buttons i made.

let nextPage = UIButton(type: UIButtonType.System) as UIButton
nextPage.frame = CGRect(x: 225, y: 610, width: 50, height: 50)
"Blue Next Page Button"), forState: UIControlState.Normal)
nextPage.addTarget(self, action: "buttonAction:", forControlEvents:
//dropshadow
nextPage.layer.masksToBounds = false
nextPage.layer.shadowColor = UIColor(white: alpha: 1.0).CGColor
nextPage.layer.shadowOpacity = 3.0
nextPage.layer.shadowRadius = 0
nextPage.layer.shadowOffset = CGSizeMake(0, 2.0)


So please help to programmatically give it an IBAction. i don't want to use a navigation controller or tab bar or storyboard

jeffreycarl
Автор

I noticed you didn't use the "self" reference for your "count" property. Do you feel strongly about not using it? And if so, why? :)

DavidHelloWorld
Автор

Assuming that's not a random nature playlist, I'm jealous you get to program somewhere you can hear birds!

barbaravanaki
join shbcf.ru