SlideShare a Scribd company logo
1 of 62
LET'S MAKE YOUR DATA LOOK SEXY!
sunshinejr
thesunshinejr
WHAT IS AN APP?
BEAR
''APPS ARE JUST PRETTY
PICTURES OF JSON''
(ORTA THEROX)
DATA
7b22777764635f73657373696f6e73223a205ba7b226964223a
203432302c20226465736372697074696f6e223a2022496e7472
6f647563696e67204d61727a6970616e2e227d2c207b22696422
3a203432312c20226465736372697074696f6e223a2022576879
206469642077652064656369646520746f2062757920526561637
4204e617469766520616e642063616c6c206974204d61727a6970
616e202d2074686520627573696e657373207065727370656374
6976652e227d2c207b226964223a203432322c20226465736372
697074696f6e223a2022576861742773206e657720696e20456c
JSON
{"wwdc_sessions": [
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."},
{"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}
]}
PRETTY PRINTED
{
"wwdc_sessions": [
{
"id": 420,
"description": "Introducing Marzipan."
},
{
"id": 421,
"description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."
},
{
"id": 422,
"description": "What's new in Electron."
}
]
}
''PRETTY PRINTED JSON IS NOT A
PRETTY PICTURE OF JSON''
(ME)
AT LEAST IT'S NOT PRETTY FOR USERS
!
WHAT DEVELOPERS SAY ABOUT JSON:
WHAT DEVELOPERS SAY ABOUT JSON:
> JSON is awesome boring
WHAT DEVELOPERS SAY ABOUT JSON:
> JSON is awesome boring
> JSON is increcidbly fast slow as FK
WHAT DEVELOPERS SAY ABOUT JSON:
> JSON is awesome boring
> JSON is increcidbly fast slow as FK
> JSON is a good friend (???)
JSON IS A CHALLENGE!
If you don't love me at my
if let jsonResponse = data as? NSDictionary {
if let feed = jsonResponse["feed"] as? NSDictionary {
if let entry = feed["entry"] as? NSArray {
if let firstEntry = entry[0] as? NSDictionary {
if let name = firstEntry["name"] as? NSDictionary {
if let label = name["label"] as? NSString {
println("label: (label)")
}
}
}
}
}
}
Then you don't deserve me at my
let decoder = JSONDecoder()
let product = try decoder.decode(Product.self, from: data)
https://twitter.com/harlanhaskins/status/982249952154824704
(140 PAGES) BOOK ABOUT CODABLE
PERFORMANCE OF JSON DECODING
https://github.com/bwhiteley/JSONShootout
''JSON PARSERS'' ???
WE SHOULD CARE MORE ABOUT OUR DATA!
IS YOUR JSON PAYLOAD FROM THE API TOO BIG?
TRY TO CHANGE IT!
TREAT YOUR DATA LIKE A PRINCESS!!
UNDERSTAND HER DOMAIN!
ASK QUESTIONS!
> How do you split the works if you are not working
alone?
> How do you split the works if you are not working
alone?
> When do you migrate dependencies?
> How do you split the works if you are not working
alone?
> When do you migrate dependencies?
> What if one dependency does not work in newer
version?
> How do you split the works if you are not working
alone?
> When do you migrate dependencies?
> What if one dependency does not work in newer
version?
> What if you are 2 major versions behind?
> How do you split the works if you are not working
alone?
> When do you migrate dependencies?
> What if one dependency does not work in newer
version?
> What if you are 2 major versions behind?
> Do you use migrator?
> How do you split the works if you are not working
alone?
> When do you migrate dependencies?
> What if one dependency does not work in newer
version?
> What if you are 2 major versions behind?
> Do you use migrator?
> How do you test your app after the migration?
> How do you split the works if you are not working
alone?
> When do you migrate dependencies?
> What if one dependency does not work in newer
version?
> What if you are 2 major versions behind?
> Do you use migrator?
> How do you test your app after the migration?
> Do you do refactor while migrating the codebase?
HANDLE ALL THE STATES SHE MIGHT BE IN!
func viewDidLoad(animated: Bool) {
super.viewDidLoad(animated: animated)
loadData()
}
func loadData() {
api.fetchData { [weak self] data in
self?.data = data
self?.tableView.reloadData()
}
}
func viewDidLoad(animated: Bool) {
super.viewDidLoad(animated: animated)
loadData()
}
func loadData() {
tableView.isHidden = true
loadingView.isHidden = false
api.fetchData { [weak self] data in
self?.data = data
self?.loadingView.isHidden = true
self?.tableView.isHidden = false
self?.tableView.reloadData()
}
}
func viewDidLoad(animated: Bool) {
super.viewDidLoad(animated: animated)
loadData()
}
func loadData() {
tableView.isHidden = true
loadingView.isHidden = false
api.fetchData { [weak self] data, error in
if let error = error {
let alertController = UIAlertController(...)
self?.present(alertController, animated: true, completion: nil)
} else {
self?.data = data
self?.loadingView.isHidden = true
self?.tableView.isHidden = false
self?.tableView.reloadData()
}
}
}
INTRODUCE EXPLICIT STATE!
enum Layout {
case empty
case loading
case content
}
private func updateLayout(to: Layout) {
switch to {
case .empty:
contentView.alpha = 0.0
loadingView.alpha = 0.0
case .loading:
contentView.alpha = 0.0
loadingView.alpha = 1.0
case .content:
contentView.alpha = 1.0
loadingView.alpha = 0.0
}
}
LET HER KNOW YOU CARE ABOUT HER
LET HER KNOW YOU CARE ABOUT HER
EVEN WHEN SHE'S OFFLINE
> caching responses & policies
var request = URLRequest(url: url)
request.cachePolicy = .reloadIgnoringLocalCacheData
> recording & using stubbed responses
(OHHTTPStubs/Moya)
DON'T PASS HER TO THE WRONG GUY!
> Intermediate objects like View Model or Redenerable
> Intermediate objects like View Model or Redenerable
> Think about who is responsible for the data
HANDLE HER ERRORS PROPERLY!
provider.request(GitHub.repos(repo)) { (result) in
if case .success(let response) = result {
do {
let repos = try response.map(to: [Repository].self)
print(repos)
} catch let error {
print("There was something wrong with the request! Error: (error)")
}
}
}
???
WE CAN DO
BETTER!
SORTED BY EFFORT:
SORTED BY EFFORT:
1. Alert
SORTED BY EFFORT:
1. Alert
2. Smooth UI component that fits the screen
SORTED BY EFFORT:
1. Alert
2. Smooth UI component that fits the screen
3. Silent retries & cache fetching
SORTED BY EFFORT:
1. Alert
2. Smooth UI component that fits the screen
3. Silent retries & cache fetching
4. 2 & 3 at once
AND THE LAST BUT NOT LEAST...
THINK ABOUT HER ALL THE TIME
THANKS SO MUCH!
ANY QUESTIONS?
sunshinejr
thesunshinejr

More Related Content

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Mobile Fest 2018. Łukasz Mróz. Let’s make your DATA sexy

  • 1. LET'S MAKE YOUR DATA LOOK SEXY! sunshinejr thesunshinejr
  • 2. WHAT IS AN APP?
  • 4. ''APPS ARE JUST PRETTY PICTURES OF JSON'' (ORTA THEROX)
  • 6. JSON {"wwdc_sessions": [ {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."}, {"id": 420, "description": "Introducing Marzipan."}, {"id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective."}, {"id": 422, "description": "What's new in Electron."} ]}
  • 7. PRETTY PRINTED { "wwdc_sessions": [ { "id": 420, "description": "Introducing Marzipan." }, { "id": 421, "description": "Why did we decide to buy React Native and call it Marzipan - the business perspective." }, { "id": 422, "description": "What's new in Electron." } ] }
  • 8.
  • 9. ''PRETTY PRINTED JSON IS NOT A PRETTY PICTURE OF JSON'' (ME)
  • 10. AT LEAST IT'S NOT PRETTY FOR USERS !
  • 11. WHAT DEVELOPERS SAY ABOUT JSON:
  • 12. WHAT DEVELOPERS SAY ABOUT JSON: > JSON is awesome boring
  • 13. WHAT DEVELOPERS SAY ABOUT JSON: > JSON is awesome boring > JSON is increcidbly fast slow as FK
  • 14. WHAT DEVELOPERS SAY ABOUT JSON: > JSON is awesome boring > JSON is increcidbly fast slow as FK > JSON is a good friend (???)
  • 15. JSON IS A CHALLENGE!
  • 16. If you don't love me at my if let jsonResponse = data as? NSDictionary { if let feed = jsonResponse["feed"] as? NSDictionary { if let entry = feed["entry"] as? NSArray { if let firstEntry = entry[0] as? NSDictionary { if let name = firstEntry["name"] as? NSDictionary { if let label = name["label"] as? NSString { println("label: (label)") } } } } } } Then you don't deserve me at my let decoder = JSONDecoder() let product = try decoder.decode(Product.self, from: data) https://twitter.com/harlanhaskins/status/982249952154824704
  • 17. (140 PAGES) BOOK ABOUT CODABLE
  • 18. PERFORMANCE OF JSON DECODING https://github.com/bwhiteley/JSONShootout
  • 20. WE SHOULD CARE MORE ABOUT OUR DATA!
  • 21. IS YOUR JSON PAYLOAD FROM THE API TOO BIG?
  • 23. TREAT YOUR DATA LIKE A PRINCESS!!
  • 25.
  • 26.
  • 28.
  • 29. > How do you split the works if you are not working alone?
  • 30. > How do you split the works if you are not working alone? > When do you migrate dependencies?
  • 31. > How do you split the works if you are not working alone? > When do you migrate dependencies? > What if one dependency does not work in newer version?
  • 32. > How do you split the works if you are not working alone? > When do you migrate dependencies? > What if one dependency does not work in newer version? > What if you are 2 major versions behind?
  • 33. > How do you split the works if you are not working alone? > When do you migrate dependencies? > What if one dependency does not work in newer version? > What if you are 2 major versions behind? > Do you use migrator?
  • 34. > How do you split the works if you are not working alone? > When do you migrate dependencies? > What if one dependency does not work in newer version? > What if you are 2 major versions behind? > Do you use migrator? > How do you test your app after the migration?
  • 35. > How do you split the works if you are not working alone? > When do you migrate dependencies? > What if one dependency does not work in newer version? > What if you are 2 major versions behind? > Do you use migrator? > How do you test your app after the migration? > Do you do refactor while migrating the codebase?
  • 36. HANDLE ALL THE STATES SHE MIGHT BE IN!
  • 37.
  • 38. func viewDidLoad(animated: Bool) { super.viewDidLoad(animated: animated) loadData() } func loadData() { api.fetchData { [weak self] data in self?.data = data self?.tableView.reloadData() } }
  • 39.
  • 40. func viewDidLoad(animated: Bool) { super.viewDidLoad(animated: animated) loadData() } func loadData() { tableView.isHidden = true loadingView.isHidden = false api.fetchData { [weak self] data in self?.data = data self?.loadingView.isHidden = true self?.tableView.isHidden = false self?.tableView.reloadData() } }
  • 41. func viewDidLoad(animated: Bool) { super.viewDidLoad(animated: animated) loadData() } func loadData() { tableView.isHidden = true loadingView.isHidden = false api.fetchData { [weak self] data, error in if let error = error { let alertController = UIAlertController(...) self?.present(alertController, animated: true, completion: nil) } else { self?.data = data self?.loadingView.isHidden = true self?.tableView.isHidden = false self?.tableView.reloadData() } } }
  • 43. enum Layout { case empty case loading case content } private func updateLayout(to: Layout) { switch to { case .empty: contentView.alpha = 0.0 loadingView.alpha = 0.0 case .loading: contentView.alpha = 0.0 loadingView.alpha = 1.0 case .content: contentView.alpha = 1.0 loadingView.alpha = 0.0 } }
  • 44. LET HER KNOW YOU CARE ABOUT HER
  • 45. LET HER KNOW YOU CARE ABOUT HER EVEN WHEN SHE'S OFFLINE
  • 46. > caching responses & policies var request = URLRequest(url: url) request.cachePolicy = .reloadIgnoringLocalCacheData > recording & using stubbed responses (OHHTTPStubs/Moya)
  • 47. DON'T PASS HER TO THE WRONG GUY!
  • 48.
  • 49. > Intermediate objects like View Model or Redenerable
  • 50. > Intermediate objects like View Model or Redenerable > Think about who is responsible for the data
  • 51. HANDLE HER ERRORS PROPERLY!
  • 52. provider.request(GitHub.repos(repo)) { (result) in if case .success(let response) = result { do { let repos = try response.map(to: [Repository].self) print(repos) } catch let error { print("There was something wrong with the request! Error: (error)") } } }
  • 53. ???
  • 57. SORTED BY EFFORT: 1. Alert 2. Smooth UI component that fits the screen
  • 58. SORTED BY EFFORT: 1. Alert 2. Smooth UI component that fits the screen 3. Silent retries & cache fetching
  • 59. SORTED BY EFFORT: 1. Alert 2. Smooth UI component that fits the screen 3. Silent retries & cache fetching 4. 2 & 3 at once
  • 60. AND THE LAST BUT NOT LEAST...
  • 61. THINK ABOUT HER ALL THE TIME
  • 62. THANKS SO MUCH! ANY QUESTIONS? sunshinejr thesunshinejr