SlideShare a Scribd company logo
1 of 57
Download to read offline
T H E X C O D E S U R V I VA L G U I D E
K R I S T I N A F O X , S E N I O R I O S E N G I N E E R , I N T U I T
kristina.io @krstnfx
🛌
kristina.io @krstnfx
🖥
kristina.io @krstnfx
💦
👟
kristina.io @krstnfx
✨
kristina.io @krstnfx
🏃
kristina.io @krstnfx
P E T E ’ S V E RY S T R A N G E D AY
'
kristina.io @krstnfx
🖥
kristina.io @krstnfx
kristina.io @krstnfx
kristina.io @krstnfx
kristina.io @krstnfx
C O L O R A S S E T S
kristina.io @krstnfx
kristina.io @krstnfx
L O C K S T O RY B O A R D E L E M E N T S
Lock -> All Properties
kristina.io @krstnfx
🚨 20:00 🚨
kristina.io @krstnfx
kristina.io @krstnfx
M U LT I P L E A S S I S TA N T E D I T O R S
kristina.io @krstnfx
kristina.io @krstnfx
A S S I S TA N T E D I T O R V I E W M O D E
All Editors Stacked Horizontally
kristina.io @krstnfx
S E L E C T F I L E V I E W L O C AT I O N
Alt-shift-click
kristina.io @krstnfx
kristina.io @krstnfx
kristina.io @krstnfx
C H A N G E C O M M A N D - C L I C K O P T I O N
kristina.io @krstnfx
Q U I C K O P E N F U N C T I O N L I S T
Ctrl-6
kristina.io @krstnfx
S E A R C H F U N C T I O N S I G N AT U R E S
Ctrl-6
Just start typing
kristina.io @krstnfx
//
// DryExecutionHandler.swift
// Resin
//
import Foundation
class DryExecutionHandler: NSObject {
override init() {
let network = Network()
network.executeDrying()
}
}
//
// RinseExecutionHandler.swift
// Resin
//
import Foundation
class RinseExecutionHandler: NSObject {
override init() {
let network = Network()
network.executeRinsing()
}
}
//
// StickExecutionHandler.swift
// Resin
//
//
import Foundation
class StickExecutionHandler: NSObject {
override init() {
let network = Network()
network.executeStickiness()
}
}
kristina.io @krstnfx
//
// Network.swift
// Resin
//
import Foundation
class Network: NSObject {
func executeDrying() {
let url = "resin-prod.com/dry"
executeAction(url: url)
}
func executeStickiness() {
let url = "resin-prod.com/sticky"
executeAction(url: url)
}
func executeRinsing() {
let url = "resin-dev.com/rinse"
executeAction(url: url)
}
}
kristina.io @krstnfx
//
// Network.swift
// Resin
//
import Foundation
class Network: NSObject {
func executeDrying() {
let url = "resin-prod.com/dry"
executeAction(url: url)
}
func executeStickiness() {
let url = "resin-prod.com/sticky"
executeAction(url: url)
}
func executeRinsing() {
let url = "resin-dev.com/rinse"
executeAction(url: url)
}
}
kristina.io @krstnfx
//
// Network.swift
// Resin
//
import Foundation
class Network: NSObject {
func executeDrying() {
let url = "resin-prod.com/dry"
executeAction(url: url)
}
func executeStickiness() {
let url = "resin-prod.com/sticky"
executeAction(url: url)
}
func executeRinsing() {
let url = "resin-dev.com/rinse"
executeAction(url: url)
}
}
kristina.io @krstnfx
U S E R D E F I N E D B U I L D S E T T I N G S
Project file -> Build Settings -> User-Defined Settings
02:49
kristina.io @krstnfx
kristina.io @krstnfx
✅
First stage
complete
kristina.io @krstnfx
🚪
kristina.io @krstnfx
🧖
🎭
kristina.io @krstnfx
🖥
kristina.io @krstnfx
kristina.io @krstnfx
kristina.io @krstnfx
D E V I C E C R A S H L O G S
1. Windows -> Devices and Simulators
2. Choose Devices tab
3. View device logs
kristina.io @krstnfx
“ C AT C H A L L ” B R E A K P O I N T S
kristina.io @krstnfx
//
// Room.swift
// GasMask
//
import Foundation
class Room: NSObject, NSCoding {
var name: String?
var id: Int?
required init?(coder aDecoder: NSCoder) {
self.name = aDecoder.decodeObject(forKey: "names") as? String
self.id = aDecoder.decodeObject(forKey: "id") as? Int
}
func encode(with aCoder: NSCoder) {
aCoder.encode(self.name, forKey: "name")
aCoder.encode(self.id, forKey: "id")
}
}
kristina.io @krstnfx
//
// Room.swift
// GasMask
//
import Foundation
class Room: NSObject, NSCoding {
var name: String?
var id: Int?
required init?(coder aDecoder: NSCoder) {
self.name = aDecoder.decodeObject(forKey: "names") as? String
self.id = aDecoder.decodeObject(forKey: "id") as? Int
}
func encode(with aCoder: NSCoder) {
aCoder.encode(self.name, forKey: "name")
aCoder.encode(self.id, forKey: "id")
}
}
kristina.io @krstnfx
//
// Room.swift
// GasMask
//
import Foundation
class Room: NSObject, NSCoding {
var name: String?
var id: Int?
required init?(coder aDecoder: NSCoder) {
self.name = aDecoder.decodeObject(forKey: "names") as? String
self.id = aDecoder.decodeObject(forKey: "id") as? Int
}
func encode(with aCoder: NSCoder) {
aCoder.encode(self.name, forKey: "name")
aCoder.encode(self.id, forKey: "id")
}
}
kristina.io @krstnfx
struct Rooms: Codable {
var name: String
var id: Int
}
kristina.io @krstnfx
C U S T O M C O D E S N I P P E T S
1. Highlight code
2. Drag to code snippets window
3. Drop & fill completion shortcut
kristina.io @krstnfx
C U S T O M C O D E S N I P P E T S I N U S E
4. Profit 💵
kristina.io @krstnfx
kristina.io @krstnfx
💨
kristina.io @krstnfx
😪
kristina.io @krstnfx
✅
Second stage
complete
kristina.io @krstnfx
🚪
kristina.io @krstnfx
👏123
B A S E D O N A T R U E S T O RY
Just kidding 😁
kristina.io @krstnfx
X C O D E S U R V I VA L G U I D E C H E AT S H E E T
Name Location Shortcut
Color Assets Assets Folder Add Color Set
Lock Storyboard Identity Inspector Lock - All Properties
Side-By-Side Editors View -> Assistant Editor All Editors Stacked Horizontally
Place File In Editor Keyboard/Mouse Alt-Shift (Click On File)
Select Code Structure Keyboard/Mouse Command-Click (On Function)
kristina.io @krstnfx
X C O D E S U R V I VA L G U I D E C H E AT S H E E T
Name Location Shortcut
Pre-Xcode 8 Style Jump
Xcode Settings ->
Navigation
Command-Click On Code ->Jumps To
Definition
User Defined
Environment Variables
Project File -> Build
Settings
Add variables to User-Defined Settings
Device Logs For
Crashes
Window -> Devices And
Simulators
View Device Logs
Catch All Breakpoints Breakpoints Panel Plus Button On Bottom Left
Custom Code Snippets Code Snippet Library
Highlight Code, Drag & Drop Into Code
Snippet Library
kristina.io @krstnfx
R E S O U R C E S
• Paul Hudson’s Swift Knowledge Base

https://www.hackingwithswift.com/example-code/
• API Endpoint Configuration

https://medium.com/@danielgalasko/change-your-api-endpoint-environment-using-xcode-
configurations-in-swift-c1ad2722200e
• Type Safe JSON in Swift

https://medium.com/grand-parade/creating-type-safe-json-in-swift-74a612991893
• WWDC-Style Code Snippets

https://kristina.io/tutorial-wwdc-style-live-code-snippets/
• Twitter iOS Community (@twostraws, @aligatr, @_inside & many more!)

https://twitter.com/krstnfx/status/940265683690180608
Thanks!
5
kristina.io | @krstnfx

More Related Content

What's hot (7)

Writing (Meteor) Code With Style
Writing (Meteor) Code With StyleWriting (Meteor) Code With Style
Writing (Meteor) Code With Style
 
test
testtest
test
 
Fluentd meetup intro
Fluentd meetup introFluentd meetup intro
Fluentd meetup intro
 
Xmind
XmindXmind
Xmind
 
Doing Horrible Things with DNS - Web Directions South
Doing Horrible Things with DNS - Web Directions SouthDoing Horrible Things with DNS - Web Directions South
Doing Horrible Things with DNS - Web Directions South
 
Text fabric
Text fabricText fabric
Text fabric
 
Getting groovy
Getting groovyGetting groovy
Getting groovy
 

Similar to Xcode Survival Guide

File encryption. [32] Write a program which accepts a filename as a .pdf
File encryption. [32] Write a program which accepts a filename as a .pdfFile encryption. [32] Write a program which accepts a filename as a .pdf
File encryption. [32] Write a program which accepts a filename as a .pdf
jyothimuppasani1
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
HamletDRC
 
AST Transformations
AST TransformationsAST Transformations
AST Transformations
HamletDRC
 
So I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdfSo I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdf
ezonesolutions
 
Cross platform Objective-C Strategy
Cross platform Objective-C StrategyCross platform Objective-C Strategy
Cross platform Objective-C Strategy
Graham Lee
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
Sergio Bossa
 

Similar to Xcode Survival Guide (20)

Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2Leap Ahead with Redis 6.2
Leap Ahead with Redis 6.2
 
PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!
 
File encryption. [32] Write a program which accepts a filename as a .pdf
File encryption. [32] Write a program which accepts a filename as a .pdfFile encryption. [32] Write a program which accepts a filename as a .pdf
File encryption. [32] Write a program which accepts a filename as a .pdf
 
Solving the Riddle of Search: Using Sphinx with Rails
Solving the Riddle of Search: Using Sphinx with RailsSolving the Riddle of Search: Using Sphinx with Rails
Solving the Riddle of Search: Using Sphinx with Rails
 
Ajax и будущее Java Script
Ajax и будущее Java ScriptAjax и будущее Java Script
Ajax и будущее Java Script
 
File Handling in C++ full ppt slide presentation.ppt
File Handling in C++ full ppt slide presentation.pptFile Handling in C++ full ppt slide presentation.ppt
File Handling in C++ full ppt slide presentation.ppt
 
Embedding perl
Embedding perlEmbedding perl
Embedding perl
 
Powershell for Log Analysis and Data Crunching
 Powershell for Log Analysis and Data Crunching Powershell for Log Analysis and Data Crunching
Powershell for Log Analysis and Data Crunching
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
 
AST Transformations
AST TransformationsAST Transformations
AST Transformations
 
IO::Iron
IO::IronIO::Iron
IO::Iron
 
So I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdfSo I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdf
 
Cross platform Objective-C Strategy
Cross platform Objective-C StrategyCross platform Objective-C Strategy
Cross platform Objective-C Strategy
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
 
Cool bonsai cool - an introduction to ElasticSearch
Cool bonsai cool - an introduction to ElasticSearchCool bonsai cool - an introduction to ElasticSearch
Cool bonsai cool - an introduction to ElasticSearch
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018
 
Rails in the enterprise
Rails in the enterpriseRails in the enterprise
Rails in the enterprise
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)
 
Agile Iphone Development
Agile Iphone DevelopmentAgile Iphone Development
Agile Iphone Development
 

More from Kristina Fox

More from Kristina Fox (10)

Embracing Change
Embracing ChangeEmbracing Change
Embracing Change
 
Apple Watch In-Depth
Apple Watch In-DepthApple Watch In-Depth
Apple Watch In-Depth
 
Challenging Your Assumptions
Challenging Your AssumptionsChallenging Your Assumptions
Challenging Your Assumptions
 
Hello Watch! Build your First Apple Watch App
Hello Watch! Build your First Apple Watch AppHello Watch! Build your First Apple Watch App
Hello Watch! Build your First Apple Watch App
 
Driving User Engagement with watchOS 3
Driving User Engagement with watchOS 3Driving User Engagement with watchOS 3
Driving User Engagement with watchOS 3
 
How to Build a Compelling Apple Watch App/Complication
How to Build a Compelling Apple Watch App/ComplicationHow to Build a Compelling Apple Watch App/Complication
How to Build a Compelling Apple Watch App/Complication
 
Become a Better Engineer Through Writing
Become a Better Engineer Through WritingBecome a Better Engineer Through Writing
Become a Better Engineer Through Writing
 
Awesome Mobile App Experiences
Awesome Mobile App ExperiencesAwesome Mobile App Experiences
Awesome Mobile App Experiences
 
How to Build a Compelling Apple Watch App
How to Build a Compelling Apple Watch AppHow to Build a Compelling Apple Watch App
How to Build a Compelling Apple Watch App
 
Native Reusable Mobile Components
Native Reusable Mobile ComponentsNative Reusable Mobile Components
Native Reusable Mobile Components
 

Recently uploaded

Recently uploaded (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Xcode Survival Guide