-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 위젯 통해서 앱 열기 (#470) #492
Conversation
- cardUUID 로 수정
- cardID 에서 cardUUID 로 수정.
- result.data 를 옵셔널 바인딩하여 바로 사용.
IntentsExtension/IntentHandler.swift
Outdated
if let result { | ||
self?.cardItems = result.data | ||
myCard = MyCard(identifier: self?.cardItems?[0].cardUUID ?? "", display: self?.cardItems?[0].cardName ?? "") | ||
myCard?.userName = self?.cardItems?[0].userName | ||
myCard?.cardImage = self?.cardItems?[0].cardImage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
교수님! 참고사항에 적힌 내용이 여기에서 return을 하려고 했는데 못한다는 얘기일까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그쳐.. 서버통신이 비동기라서 리턴이랑은 별개로 알아서 되는거라 nil 값이 리턴됩디다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dlwns33
dispatch group 으로 해결했심더!
- 서버통신의 결과를 동기적으로 사용하기 위해서 DispatchGroup 을 사용.
- 비동기 통신이기 때문에 group 의 enter,leave 사용.
- 60초까지만 기다리기로 함.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 액세스 토큰인 있는 경우에 위젯의 기본값 설정
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-05-08.at.14.25.39.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 액세스 토큰이 있는 경우에 위젯의 기본값 설정
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-05-08.at.14.38.15.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 액세스 토큰이 없어서 명함을 선택할 수 없는 경우
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-05-08.at.14.42.05.mov
- 서버통신의 결과를 동기적으로 사용하기 위해서 DispatchGroup 을 사용. - 비동기 통신이기 때문에 group 의 enter,leave 사용. - 60초까지만 기다리기로 함.
🌴 PR 요약
🌱 작업한 브랜치
🌱 작업한 내용
🚨 참고사항
IntentHandler 의 defaultMyCard 메서드가 이제 위젯을 추가할때 호출되는데 이때 서버통신을 통해서 대표명함을 찾고, 이를 기본값으로 설정해주도록 구현하려고 했습니다.
즉, 서버통신을 통해서 결과데이터를 가져오면 그때 리턴하려고했는데 completion handler 내부에서 return 할 수 없기 때문에 고민입니다.. 방법이 있을까요?
📸 스크린샷
📮 관련 이슈