Lecture 9.1- SWIFT Environment-Summary-iOS10-Udemy Flashcards
Which part of the code we should find to put our objects there
viewdidload( )
How do we put our objects into the code
First we drag and drop our file such as image into assets.xcassets folder—>Then we go to Main.storyboard and add one image view from object library—>From Inspector viewer choose the uploaded image for dragged image—> Activate Assistant Editor—>Finally drag+ctrl the elements above viewdidload( ) segment.
3 Main folders on left side of the SWIFT
Main.storyboard(Graphical elements), viewController(Codes), Assets.xcassets: Uploading files to the elements.
What kind of adjustment we should do if we change the name of an object
For avoiding errors go to Main.story.board and on write view controller and write click and remove the yellow exclamation mark.
Where to find images, buttons or other objects
Right down click on Object library and search image… or button…after dragging the image to screen—> Select the image name from top left from a list inside Attributes Inspector
What is IBOutlet
Any object which is dragged above the viewdidload is an outlet. Meanwhile, Outlet is just a show and there is no action behind.
What is IBAction and how to give action to object
For giving action to an object weshould ctrl+drag the object to the end point before the closing segment and change the connection to action instead of outlet. So, once that object is inserted above the viewdidload for show in IBOutlet and once end of the code for giving action in IBAction.
How to bring one object front of another
Inside the MainStoryBoard—> View—> drag the up front to lower inside the list of objects.
We want that two objects be hidden and when click on Welcome button two imagesappear and the button be hidden when the app is launched what should we do
Make the objects hidden as default. Add all IBOutlets above Override and add one IBAction of button to last segment of code before closing. Inside the IBAction add commands: button.isHidden = true …. other hidden objects.isHidden = false….
Write the codes for our first iPhone app
First drag+ctrl objects to above the viewdidload—> Second, ctrl+drag the button to closing segment of code down before {. —> Third: below that { object1 isHidden = false, object2 isHidden = True….}