SlideShare uma empresa Scribd logo
1 de 60
Baixar para ler offline
김예원 / 리이오
SwiftUI가 UIKit품기
 

vs UIKit이 SwiftUI품기
🐓🥚🥚🐓🥚🥚🐓
목차
목차
개요
- 발표 소개
- 발표자 소개 및 audience
- UIKit 또는 SwiftUI로 개발하다가 겪는 상황들
- UIKit과 SwiftUI의 차이?
- UIkit에서 SwiftUI 사용해보기
- UIkit에서 SwiftUI로 Swift Charts 사용하기!
- SwiftUI에서 UIkit 사용해보기(리이오)
- SwiftUI에서 UICalanderView 사용하기!
- 발표를 마치며..
목차
개요
- 발표 소개
- 발표자 소개 및 audience
- UIKit 또는 SwiftUI로 개발하다가 겪는 상황들
- UIKit과 SwiftUI의 차이?
- UIkit에서 SwiftUI 사용해보기
- UIkit에서 SwiftUI로 Swift Charts 사용하기!
- SwiftUI에서 UIkit 사용해보기(리이오)
- SwiftUI에서 UICalanderView 사용하기!
- 발표를 마치며..
목차
개요
- 발표 소개
- 발표자 소개 및 audience
- UIKit 또는 SwiftUI로 개발하다가 겪는 상황들
- UIKit과 SwiftUI의 차이?
- UIkit에서 SwiftUI 사용해보기
- UIkit에서 SwiftUI로 Swift Charts 사용하기!
- SwiftUI에서 UIkit 사용해보기(리이오)
- SwiftUI에서 UICalanderView 사용하기!
- 발표를 마치며..
목차
개요
- 발표 소개
- 발표자 소개 및 audience
- UIKit 또는 SwiftUI로 개발하다가 겪는 상황들
- UIKit과 SwiftUI의 차이?
- UIkit에서 SwiftUI 사용해보기
- UIkit에서 SwiftUI로 Swift Charts 사용하기!
- SwiftUI에서 UIkit 사용해보기(리이오)
- SwiftUI에서 UICalanderView 사용하기!
- 발표를 마치며..
발표자 소개
스피커
- Swift 입문 1년차 새내기
- UIKit 과 SwiftUI 학습 중..!
- adios 발표
- iOS초보개발자 입문을 망설인 이유?
김예원
리이오
- 포항공대 iOS 개발자
- 인플루언서
발표자 소개
서포터
• UIKit을 쓰고 있지만 SwiftUI를 붙여서 써보고 싶으신 분
• SwiftUI에서 UIKit을 어쩔 수 없이 써야하는 분
• UI를 그리는 두 방법의 차이가 궁금하신 분
• 콜라보 발표가 궁금하신 분
청중
audience
• UIKit을 쓰고 있지만 SwiftUI를 붙여서 써보고 싶으신 분
• SwiftUI에서 UIKit을 어쩔 수 없이 써야하는 분
• UI를 그리는 두 방법의 차이가 궁금하신 분
• 콜라보 발표가 궁금하신 분
청중
audience
• UIKit을 쓰고 있지만 SwiftUI를 붙여서 써보고 싶으신 분
• SwiftUI에서 UIKit을 어쩔 수 없이 써야하는 분
• UI를 그리는 두 방법의 차이가 궁금하신 분
• 콜라보 발표가 궁금하신 분
청중
audience
• UIKit을 쓰고 있지만 SwiftUI를 붙여서 써보고 싶으신 분
• SwiftUI에서 UIKit을 어쩔 수 없이 써야하는 분
• UI를 그리는 두 방법의 차이가 궁금하신 분
• 콜라보 발표가 궁금하신 분
청중
audience
뷰를 그리다 보면 겪는 상황
Problem
• UIKit으로 앱개발 중..
• 차트를 사용하고 싶다!
→ SwiftUI를 사용해볼까?
• SwiftUI로 앱개발 중..
• 캘린더를 사용하고 싶다!
→ UIKit을 사용해볼까?
- 두가지 모두 사용하고 싶은 상황이 온다면..?!
뷰를 그리다 보면 겪는 상황
Problem
• UIKit으로 앱개발 중..
• 차트를 사용하고 싶다!
→ SwiftUI를 사용해볼까?
• SwiftUI로 앱개발 중..
• 캘린더를 사용하고 싶다!
→ UIKit을 사용해볼까?
- 두가지 모두 사용하고 싶은 상황이 온다면..?!
뷰를 그리다 보면 겪는 상황
Problem
• UIKit으로 앱개발 중..
• 차트를 사용하고 싶다!
→ SwiftUI를 사용해볼까?
• SwiftUI로 앱개발 중..
• 캘린더를 사용하고 싶다!
→ UIKit을 사용해볼까?
- 두가지 모두 사용하고 싶은 상황이 온다면..?!
SwiftUI와 UIKit의 차이
Problem
UIKit
• UIKit의 특징
• StoryBoard를 사용하여 화면 구축 및
흐름 생성
• StoryBoard에서 작업한 내용을 코드에서
볼 수 없고 코드에서 작업한 내용은
StoryBoard에 나타나지 않음
• 명령형 구문
“어떻게” 동작하는 지를 중심으로 구문을 작성
SwiftUI와 UIKit의 차이
Problem
UIKit
• UIKit의 특징
• StoryBoard를 사용하여 화면 구축 및
흐름 생성
• StoryBoard에서 작업한 내용을 코드에서
볼 수 없고 코드에서 작업한 내용은
StoryBoard에 나타나지 않음
• 명령형 구문
“어떻게” 동작하는 지를 중심으로 구문을 작성
• SwiftUI의 특징
• livepreview 제공
• 작성한 코드를 preview로 보여줌
• 선언적 구문
• “무엇을” 하는 지를 중심으로 구문을 작성
• 더 적은 코드로 개발을 할 수 있음
•
SwiftUI와 UIKit의 차이
Problem
SwiftUI
• SwiftUI의 특징
• livepreview 제공
• 작성한 코드를 preview로 보여줌
• 선언적 구문
• “무엇을” 하는 지를 중심으로 구문을 작성
• 더 적은 코드로 개발을 할 수 있음
SwiftUI와 UIKit의 차이
Problem
SwiftUI
UIKit에서 SwiftUI 품기?!
• ProgressView
• 원하는 디자인으로 표현하기 어렵다..
• Swift Charts
• 커스텀이 쉽고 다양한 디자인으로
표현할 수 있다!
UIkit에서 차트를 추가하고 싶다.
내가 가지고있는 앱의 데이터를 차트로 표현해보면 어떨까?
0
50
100
150
200
ANTIFRAGILE Impurities No Celestial Good Parts
• ProgressView
• 원하는 디자인으로 표현하기 어렵다..
• Swift Charts
• 커스텀이 쉽고 다양한 디자인으로
표현할 수 있다!
UIkit에서 차트를 추가하고 싶다.
내가 가지고있는 앱의 데이터를 차트로 표현해보면 어떨까?
0
50
100
150
200
ANTIFRAGILE Impurities No Celestial Good Parts
UIKit에서 SwiftUI을 품어 봅시다
Swift Charts
- Swift Charts
- iOS16부터 지원
- SwiftUI 프레임워크
UIKit에서 SwiftUI을 품어 봅시다
Swift Charts
- Swift Charts
- iOS16부터 지원
- SwiftUI 프레임워크
UIKit에서 SwiftUI을 품어 봅시다
Swift Charts
- Swift Charts
- iOS16부터 지원
- SwiftUI 프레임워크
그럼 UIKit 과 SwiftUI를 어떻게 올리지?
UIHostingController
UIViewController
View
SwiftUI Content
0
25
50
75
100
4월 5월 6월 7월
- SwiftUIView를 UIViewController와
연결해줄 수 있는 역할의 View임.
UIHostingController
- UIHostingController 위에 SwiftUIView를
넘겨주면 해당 SwiftUIView를 나타낼 수 있음.
- SwiftUIView를 생성하고나면 SwiftUI로
개발하는 것처럼 사용가능함.
SwiftUIView를 나타내보자!
View 구성
SwiftUIView를 나타내보자!
View 구성
UIHostingController
SwiftUIView
ChartView
SwiftUICell
Navigation
으로 연결
데이터를 Chart로 표현해볼까?
데이터 구성
Songdata : ObservableObject
- songs : [[String]]
- playCounts : [[Int]]
- singer : [String]
- currentSinger : String
SwiftUIView를 나타내보자!
UIHostingConfiguration
SwiftUIView를 나타내보자!
UIHostingConfiguration
데이터를 Chart로 표현해볼까?
SwiftUI Chart
그럼 본격적으로 Chart를 그려보자!
SwiftUI Chart를 뷰에 올리기
그럼 본격적으로 Chart를 그려보자!
SwiftUI Chart를 뷰에 올리기
실행
최종 실행 결과
SwiftUI에서 UIKit품기?!
• UIKit에서만 지원해주는 뷰
• 이미 UIKit으로 구현된 뷰를 붙일 때
• 아직은 SwiftUI에 버그가 많아서 쓰고 싶지 않을때
SwiftUI에서 UIKit을 품을 일이 있나
Problem
• UIKit에서만 지원해주는 뷰
• 이미 UIKit으로 구현된 뷰를 붙일 때
• 아직은 SwiftUI에 버그가 많아서 쓰고 싶지 않을때
SwiftUI에서 UIKit을 품을 일이 있나
Problem
• UIKit에서만 지원해주는 뷰
• 이미 UIKit으로 구현된 뷰를 붙일 때
• 아직은 SwiftUI에 버그가 많아서 쓰고 싶지 않을때
SwiftUI에서 UIKit을 품을 일이 있나
Problem
SwiftUI에서 UIKit을 품어 봅시다
- UICalanderView
- iOS16 부터 지원
- UIKit에서만 지원
SwiftUI에서 UIKit을 품어 봅시다
- UICalanderView
- iOS16 부터 지원
- UIKit에서만 지원
SwiftUI에서 UIKit을 품어 봅시다
- UICalanderView
- iOS16 부터 지원
- UIKit에서만 지원
따라해보기
- 아주 기본적인 SwiftUI 화면에서
시작합시다
따라해보기
- UIViewPresentable을 채택할껍니다
따라해보기
- UIViewPresentable을 채택할껍니다
- 에러가 발생하죠!
따라해보기
- 프로토콜을 채택하고 준수하지 않았죠
따라해보기
- Fix를 눌러 준수 해봅시다
따라해보기
- 나머지도 준수해봅시다
따라해보기
- UIKit 화면을 가져옵니다
따라해보기
- SwiftUI에 뷰를 그립니다
따라합니다
따라해보기
- Delegate는 어떻게 할까요?
따라해보기
- Delegate는 어떻게 할까요?
- makeCoordinator()
따라해보기
- 이런식으로 구현되어 있습니다
따라해보기
- 이런식으로 구현되어 있습니다
- 느낌이 오시나요?
따라해보기
- 실행 결과 입니다
따라해보기
- 실행 결과 입니다
- SwiftUI에서 UIKit 품기!
발표를 마치며
뷰를 그리다 보면 겪는 상황
Problem
• UIKit으로 앱개발 중..
• 차트를 사용하고 싶다!
SwiftUI를 사용해볼까?
• SwiftUI로 앱개발 중..
• 캘린더를 사용하고 싶다!
UIKit을 사용해볼까?
- 두가지 모두가 사용하고 싶은 상황이 온다면..?!
질문 있으신 분!
네트워킹 세션에서도 만나요
- 메일로도 질문해주세요!
- leeo@kakao.com - 리이오
- kywk1234@naver.com - 김예원

Mais conteúdo relacionado

Destaque

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
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Destaque (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

SwiftUI가 UIKit품기 vs UIKit이 SwiftUI품기(김예원,리이오).pdf