-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXcode.txt
executable file
·59 lines (50 loc) · 2.6 KB
/
Xcode.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Scheme: Different variations of your app that you can run in simulator
Ex: iPhone vs Watch, or different iPhone screen sizes
Storyboards: What building of the UI.
LaunchScreen storyboard: what you see when you launch
Main: The rest of the app.
Canvas: where your GUI goes
Scenes: Views and the code to manipulate them.
Each scene references some viewcontroller class (ex: ViewController.swift)
Look in the identity inspector to see which one.
View Controller Scene: How your view is controlled. Look for red error messages.
Editors:
Standard
Assistant: Shows to files: one primary and one that it relates or refferences. Will
pick it's relation automatically, but can be set manually.
Version: sees file and previous versions side by side.
Jump Bar: Jump to file instantly.
Inspectors: Inspect different elements of your code or storyboard objects
File
Quick help
identity: info about the id of object, what class it's inheriting from or refferencing.
Attributes: different attributes of the object you can change. (size font color for ex.)
Size
Connections
Size: you can view how your view looks at different sizes.
Scaling rules: use the buttons on the bottem right.
Allign: set rules for when the screen size or orientation swithces.
Add contraints: Set auto layout contraint, based on other objects.
Code:
Option click: see some description of classes/function
Command click: goto declaration
Search: for full descrition and methods/attributes.
### Tutorial WWDC Xcode 2016 ###
Make button that says hello in a label:
Go to object library in the bottom right of xcode: you can add these to your scene
Place button at center of scene, name it: "Say Hello"
Add Label above button and allign it horizontally.
Make the button both horizontally and vertically alligned.
Error lable: y pos: contrain it or pin it to be above the button.
Check if it worked by rotating in simulator.
Add attributes to the viewcontroller file for the label and button.
Edit the file that your view controller is refferencing (ViewController.swift)
Use Assitant editor
Control-drag the label to top of ViewController class.
Make it an action name it sayHello
Do for label as well.
Make it an outlet (refference you can manipulate)
Add code to the action atribute of the button to do stuff
The Label is an instance of UIlabel, which has a text attribute
Code: If button is clicked (action) set label.text to "hello"
Run in simulator.