Deep_Dev
[iOS][Swift] Dismiss Live Activities on App Termination ( feat. Semaphore )
๐ŸŽ iOS/Swift 2025. 1. 9. 20:23

๐Ÿ“š Semaphore (์„ธ๋งˆํฌ์–ด )  ์ผ๋‹จ ์„ธ๋งˆํฌ์–ด์— ๋Œ€ํ•ด์„œ ํฌ์ŠคํŒ…ํ•˜๊ธฐ์ „์— ๊ด€๋ จ๋œ ์ด์Šˆ์ธ, ์ด์ „ ํฌ์ŠคํŒ… 'LiveActivity' ํฌ์ŠคํŒ…์„ ๋ณด๊ณ ์˜ค๋ฉด ์ดํ•ดํ•˜๋Š”๋ฐ ๋„์›€์ด ๋  ๊ฒƒ์ด๋‹ค.  https://leesangdo.tistory.com/310 [SwiftUI] LiveActivity ๊ตฌํ˜„ํ•  ๋•Œ, ์•ฑ ๊ฐ•์ œ์ข…๋ฃŒ์‹œ LiveAcivity ์ข…๋ฃŒ์— ๋Œ€ํ•ด๐Ÿ“š Live Activity ์ข…๋ฃŒ   '์˜ฌ๋ผ์ž‡' ์•ฑ ๊ฐœ๋ฐœ์„ ํ•  ๋•Œ, LiveActivity ๊ตฌํ˜„์„ ๋‹ด๋‹นํ–ˆ์—ˆ๋Š”๋ฐ ๋‹น์‹œ์— ๊ฒช์—ˆ๋˜ ์ด์Šˆ์™€ ๊ด€๋ จํ•˜์—ฌ ๋…ธ์…˜์— ๊ธฐ๋กํ•ด๋‘์—ˆ๋˜๊ฒƒ์„ ํ‹ฐ์Šคํ† ๋ฆฌ์—๋„ ์˜ฎ๊ฒจ์ ์–ด๋ณด๊ณ ์ž ํ•œ๋‹ค. ์ดํ›„ ์„ธ๋งˆํฌ์–ดleesangdo.tistory.com ์œ„ ํฌ์ŠคํŒ…์„ ๋ณด๋ฉด ์•Œ๋‹ค์‹œํ”ผ, LiveActivity ์ข…๋ฃŒ๋ฅผ Dynamic Island Expanded ์˜์—ญ์—์„œ X ๋ฒ„..

article thumbnail
[SwiftUI] LiveActivity ๊ตฌํ˜„ํ•  ๋•Œ, ์•ฑ ๊ฐ•์ œ์ข…๋ฃŒ์‹œ LiveAcivity ์ข…๋ฃŒ์— ๋Œ€ํ•ด
๐ŸŽ iOS/SwiftUI 2025. 1. 9. 19:51

๐Ÿ“š Live Activity ์ข…๋ฃŒ   '์˜ฌ๋ผ์ž‡' ์•ฑ ๊ฐœ๋ฐœ์„ ํ•  ๋•Œ, LiveActivity ๊ตฌํ˜„์„ ๋‹ด๋‹นํ–ˆ์—ˆ๋Š”๋ฐ ๋‹น์‹œ์— ๊ฒช์—ˆ๋˜ ์ด์Šˆ์™€ ๊ด€๋ จํ•˜์—ฌ ๋…ธ์…˜์— ๊ธฐ๋กํ•ด๋‘์—ˆ๋˜๊ฒƒ์„ ํ‹ฐ์Šคํ† ๋ฆฌ์—๋„ ์˜ฎ๊ฒจ์ ์–ด๋ณด๊ณ ์ž ํ•œ๋‹ค. ์ดํ›„ ์„ธ๋งˆํฌ์–ด์— ๋Œ€ํ•œ ํฌ์ŠคํŒ…์„ ํ• ๊ฑด๋ฐ, ์„ธ๋งˆํฌ์–ด์™€ ๊ด€๋ จํ•œ ์ด์Šˆ์ด๊ณ , ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.  ๐Ÿ’ฌ Background ์ƒํƒœ์—์„œ ์•ฑ ๊ฐ•์ œ์ข…๋ฃŒ์‹œ LiveActivity๋„ ์ข…๋ฃŒํ•˜๊ฒŒ ํ•˜๋ ค๋ฉด ?  ์ฆ‰, DynamicIsland(LiveActivity)๊ฐ€ ๋™์ž‘์ค‘์— ์•ฑ์„ ์Šค์™€์ดํ”„ํ•˜์—ฌ ๊ฐ•์ œ์ข…๋ฃŒํ•˜๋ฉด LiveActivity๋Š” ์ข…๋ฃŒ๋˜์ง€ ์•Š๊ณ  ๋ทฐ๊ฐ€ ๊ทธ๋Œ€๋กœ ๋‚จ์•„์žˆ๋Š” ๊ฒƒ์ด๋‹ค. ํ•˜์ง€๋งŒ ๊ธฐ๋Šฅ์ž์ฒด๋Š” ์ข…๋ฃŒ๋œ๋‹ค.์š”์•ฝํ•˜๋ฉด, ์œ„์ฒ˜๋Ÿผ ์•ฑ์„ ์ข…๋ฃŒ์‹œํ‚ด์œผ๋กœ์จ ํ•จ์ˆ˜๋Š” ๋™์ž‘ํ•˜์ง€ ์•Š๊ธฐ์— ๊ธฐ๋Šฅ์€ ๋ฉˆ์ถ”์ง€๋งŒ, LiveActivity ๋˜ํ•œ ์ข…๋ฃŒ๊ฐ€ ๋˜์–ด์•ผํ•˜๋Š”๋ฐ ์•ฑ์ด ๊ฐ•์ œ์ข…๋ฃŒ..

article thumbnail
[์•ฑ์Šคํ† ์–ด ๋ฆฌ์ ] Performance - Accurate Metadata ๋ฆฌ์  ๋Œ€์‘

์ตœ๊ทผ์— ์˜›๋‚ ์— ๋ฐฐํฌํ•ด๋†จ๋˜ ์ž‘์€ ๊ฐœ์ธํ”„๋กœ์ ํŠธ ์•ฑ์„ ์—…๋ฐ์ดํŠธ ํ•˜๊ณ  ์žˆ๋Š”๋ฐ.. ์ด ์•ฑ์—์„  ๊ฑฐ์˜ ์ฒ˜์Œ ๋ฆฌ์ ์„ ๋งŒ๋‚ฌ๋‹ค. ๊ทผ๋ฐ ๊ธฐ๋Šฅ์ƒ ๋ฆฌ์ ์€ ์•„๋‹ˆ๊ณ , ์Šคํฌ๋ฆฐ์ƒท ๊ด€๋ จ ๋ฌธ์ œ์˜€๋Š”๋ฐ ํฌ์ŠคํŒ…์„ ํ•ด๋ณด๊ณ ์ž ํ•จ. ๋ฆฌ์ ์˜ ์ •ํ™•ํ•œ ๋‚ด์šฉ์€ ์ด๋Ÿฌํ•˜๋‹ค.  Guideline 2.3.3 - Performance - Accurate MetadataIssue DescriptionThe 5.5-inch iPhone screenshots do not show the current version of the app in use. Screenshots should highlight the app's core concept to help users understand the app’s functionality and value.   ํ•ด์„ํ•˜๋ฉด, ์ดˆ๊ธฐ 5...

article thumbnail
[SwiftUI] ์ปค์Šคํ…€ ํฐํŠธ ๋” ์‰ฝ๊ฒŒ ์ถ”๊ฐ€ํ•˜๊ธฐ
๐ŸŽ iOS/SwiftUI 2024. 12. 21. 17:05

๐Ÿ“š Custom Font ์ถ”๊ฐ€   ๊ธฐ์กด์— Xcode์— ์ปค์Šคํ…€ ํฐํŠธ๋ฅผ ์ถ”๊ฐ€ํ•  ๋•Œ,์ด๋ ‡๊ฒŒ ํฐํŠธํŒŒ์ผ๋“ค์„ ๋“œ๋ž˜๊ทธํ•˜์—ฌ ์ถ”๊ฐ€ํ•˜๊ณ , info์—์„œ ํฐํŠธ๋“ค์„ Target ์„ค์ •ํ•˜์—ฌ ์‚ฌ์šฉํ–ˆ๋‹จ๋ง์ด์—์š”? ๋งˆ์ง€๋ง‰์œผ๋กœ, Font Extension ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜์˜€๊ณ ์š” !extension Font { // Bold static let pretendardBold28: Font = .custom("Pretendard-Bold", size: 16) static let pretendardBold24: Font = .custom("Pretendard-Bold", size: 20) // SemiBold static let pretendardSemiBold16: Font = .custom("Pretend..

[iOS][Xcode] can not preview in this file ๋ฌธ์ œ ํ•ด๊ฒฐ
๐ŸŽ iOS/SwiftUI 2024. 11. 12. 00:46

์˜ค๋Š˜ ๊ฐœ๋ฐœํ•  ๋•Œ ๊ฒช์—ˆ๋˜ ๋ฌธ์ œ์ธ๋ฐ, ์ฐพ์•„๋ณด๋‹ˆ ๊ฐ„ํ˜น ์ƒ๊ธธ ์ˆ˜ ์žˆ๋Š” ๋ฒ„๊ทธ์ธ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. Xcode์—์„œ Preview์ชฝ์—์„œ 'can not preview in thie file'์ด๋ผ๊ณ  ๋œจ๊ณ  ํ”„๋ฆฌ๋ทฐ๊ฐ€ ๋‚˜์˜ค์ง€ ์•Š๋Š”๊ฒƒ์ž…๋‹ˆ๋‹ค.( fatal error ~~๋„ ์žˆ์—ˆ๋˜ ๊ฒƒ๊ฐ™์€๋ฐ ์ •ํ™•ํžˆ ๊ธฐ์–ต์€ ์•ˆ๋‚˜๋„ค์š” ! ) Xcode๋ฅผ ๊ป๋‹ค์ผฐ๋Š”๋ฐ๋„ ํ•ด๊ฒฐ๋˜์ง€ ์•Š์•˜์ง€๋งŒ,๋‹ค์Œ ์†”๋ฃจ์…˜์œผ๋กœ ๋ฐ”๋กœ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์—ˆ์–ด์š”. 1. Xcode ์ข…๋ฃŒ2. ํ„ฐ๋ฏธ๋„์— ๋‹ค์Œ ๋ช…๋ น์–ด ์ž…๋ ฅ xcrun simctl --set previews delete all3. ๋‹ค์‹œ Xcodeํ‚ค๋ฉด ํ•ด๊ฒฐ ์™„๋ฃŒ

[SwiftUI] onTapGesture์—์„œ ํŠน์ • ๋ถ€๋ถ„์—์„œ ํƒญ์ด ์ž‘๋™ํ•˜์ง€ ์•Š๋Š” ๊ฒƒ
๐ŸŽ iOS/SwiftUI 2024. 11. 12. 00:42

์ผ๋ฐ˜์ ์ธ Text๋‚˜ Image๋‚˜ ์ปดํฌ๋„ŒํŠธ์— ํƒญ ์ œ์Šค์ฒ˜๋ฅผ ์ถ”๊ฐ€ํ•ด์„œ, ์‚ฌ์šฉ์ž๊ฐ€ ํƒญ ํ–ˆ์„๋•Œ ์•ก์…˜์„ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ œ๊ฐ€ ๊ตฌํ˜„ํ•˜๋ฉด์„œ ๊ฒช์—ˆ๋˜, ๊ฐ€์žฅ ํ”ํžˆ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์˜ˆ์‹œ๋กœ ๋ฐ”๋กœ์‚ฌ์šฉ์ž๊ฐ€ ํ…์ŠคํŠธ๋ฅผ ์ž…๋ ฅํ•˜๊ธฐ์œ„ํ•ด Keyboard๊ฐ€ ์ผœ์ง€๊ณ , ๋นˆ ํ™”๋ฉด์„ ํ„ฐ์น˜์‹œ ํ‚ค๋ณด๋“œ๊ฐ€ ๋‹ซ๊ฒŒํ•˜๋Š” ์ƒํ™ฉ์„ ๋“ค ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์€๋ฐ์š”. VStack { // View Code}.onTapGesture { print("ํ‚ค๋ณด๋“œ๋ฅผ ๋‹ซ์Šต๋‹ˆ๋‹ค.")}์ €๋Š” ๋ถ„๋ช… ์ด๋ ‡๊ฒŒ ๊ฐ€์žฅ ํฌ๊ฒŒ ๊ฐ์‹ธ๊ณ  ์žˆ๋Š” VStack์— ํƒญ ์ œ์Šค์ฒ˜๋ฅผ ๋„ฃ์—ˆ์Šต๋‹ˆ๋‹ค.์ด๋Ÿฌ๋ฉด ํ™”๋ฉด์˜ ๋นˆ๋ถ€๋ถ„์„ ํ„ฐ์น˜ํ•˜๋ฉด ํ•ด๋‹น print๋ฌธ์ด ๋‚˜์™€์•ผํ•˜์ง€์•Š์Šต๋‹ˆ๊นŒ ?  ๊ทผ๋ฐ ํŠน์ • ๋ถ€๋ถ„์—์„œ๋Š” ์•„์˜ˆ ์ž‘๋™์„ ํ•˜์ง€ ์•Š๋Š”๊ฑฐ์—์š” ? ๊ทธ๋ž˜์„œ,, Stack๊ฐ™์€๊ฒŒ ๊ฒน์ณ์„œ ์ž‘๋™์ด ์•ˆ๋˜๋Š”๊ฒƒ์ธ๊ฐ€ ? ์˜ˆ์ƒํ•˜๊ณ  ์ฐพ์•„๋ดค๋Š”๋ฐ ๊ทธ ๋ฌธ์ œ๋Š” ์•„๋‹ˆ..

[SwiftUI] TextField์—์„œ ๋‹ค์ค‘๋ผ์ธ์„ ๋งŒ๋“ค๊ธฐ
๐ŸŽ iOS/SwiftUI 2024. 11. 12. 00:34

๐Ÿ“š TextField ๋‹ค์ค‘๋ผ์ธ ๋งŒ๋“ค๊ธฐ   ํ”„๋กœ์ ํŠธ์—์„œ ์‚ฌ์šฉ์ž ์ž…๋ ฅ์„ ๋ฐ›๋Š” Text Field๋ฅผ ๊ตฌํ˜„ํ•˜๊ณ  ์žˆ์—ˆ๋Š”๋ฐ, ๋””์ž์ธ์ด ์กฐ๊ธˆ์”ฉ ๋ฐ”๋€Œ๋ฉด์„œ ํ…์ŠคํŠธ ํ•„๋“œ์— ์ž…๋ ฅํ•œ ํ…์ŠคํŠธ๋“ค์ด ์—ฌ๋Ÿฌ ์ค„๋กœ ๋‚˜์™€์•ผํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทผ๋ฐ ์ €๋Š” TextField์™€ TextEditor์˜ ์ฐจ์ด์ ์ด, TextField๋Š” ํ•œ ์ค„ ๊ทธ๋ฆฌ๊ณ  TextEditor๋Š” ์—ฌ๋Ÿฌ ์ค„๋กœ ๋ช…ํ™•ํ•œ์ค„ ์•Œ์•˜์Šต๋‹ˆ๋‹ค.๊ทธ๋Ÿฌ๋‹ˆ๊นŒ, ์—ฌ๋Ÿฌ์ค„๋กœ ํ•ด์•ผํ•œ๋‹ค๋ฉด ๋ฌด์กฐ๊ฑด TextEditor๋ฅผ ์‚ฌ์šฉํ•ด์•ผํ•˜๊ณ  ์—๋””ํ„ฐ์—๋Š” Placeholder๊ฐ€ ์—†์œผ๋ฏ€๋กœ ์ด๊ฒƒ๋„ ๋งŒ๋“ค์–ด์ค˜์•ผํ•œ๋‹ค ...placeholder๋ฅผ ์–น์œผ๋ ค๋ฉด zstack์„ ์“ฐ๋“ , overlayํ•˜๋“  ๋„ˆ๋ฌด ๋ณ€๊ฒฝํ•˜๊ธฐ ๊ท€์ฐฎ์•„์„œ,, ์Šฅ ๊ตฌ๊ธ€๋ง์„ ํ•ด๋ณด์•˜๋Š”๋ฐ์š”. TextField์—์„œ๋„ ๋‹ค์ค‘๋ผ์ธ์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ๊ฒƒ...์ด์—ˆ์Šต๋‹ˆ๋‹ค. iOS 16์—์„œ๋ถ€ํ„ฐ ๋˜์—ˆ๋˜๊ฒƒ์ด๋ผ๊ณ ..

[SwiftUI] TabBar ํŠน์ • ๋ทฐ์—์„œ๋Š” Hide ํ•˜๊ธฐ !
๐ŸŽ iOS/SwiftUI 2024. 11. 4. 23:29

๐Ÿ“š Tabbar Hide ๐Ÿ˜Ž   ํ”„๋กœ์ ํŠธ๋ฅผ ํ•˜๋ฉด์„œ Tabbar๊ฐ€ ์žˆ์—ˆ๋Š”๋ฐ ๋ฉ”์ธ ํƒญ๋ฐ” ํ™”๋ฉด์—์„œ ๋„ค๋น„๊ฒŒ์ด์…˜์œผ๋กœ View๋ฅผ ์ด๋™ํ•˜๋ฉด์ด๋™๋œ View๋ถ€ํ„ฐ๋Š” Tabbar๊ฐ€ ์•ˆ๋‚˜์˜ค๊ฒŒ ํ•ด์•ผํ–ˆ์Šต๋‹ˆ๋‹ค. ์ •๋ง ๊ฐ„๋‹จํžˆ ํ•ด๊ฒฐ๋˜๋”๊ตฐ์š” ? ๐Ÿ‘A View๊ฐ€ Tabbar์˜ ๋ฉ”์ธ๋ทฐ์ด๊ณ ,A View์—์„œ Navigation์„ ํ†ตํ•ด B View๋กœ ์ง„์ž…ํ–ˆ์„๋•Œ, B View์—์„œ ํƒญ๋ฐ”๋Š” ์‚ฌ๋ผ์ง€๊ฒŒ ํ•˜๊ณ  ์‹ถ๋‹ค. ํ•œ๋‹ค๋ฉด B ํŒŒ์ผ์˜ View ์ฝ”๋“œ์—  .toolbar(.hidden, for: .tabBar) ์ด ๋ชจ๋””ํŒŒ์ด์–ด๋ฅผ ์ ์šฉํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค ! ๋”ฑ ๋ด๋„ tabbar๋ฅผ hiddenํ•ด์ฃผ๋Š”๊ฑฐ๊ฒ ์ฃ  ?  โŒ๊ทผ๋ฐ ๋ฌธ์ œ๊ฐ€ ๋ญ์˜€๋ƒ .. โŒ  A ์—์„œ B๋กœ ๊ฐˆ๋•Œ ํƒญ๋ฐ”๋Š” ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ์‚ฌ๋ผ์กŒ์ง€๋งŒ, B์—์„œ ๋‹ค์‹œ A๋ทฐ๋กœ ๋‚˜๊ฐˆ๋•Œ Tabbar๊ฐ€ ๋ฐ”๋กœ ๋– ์žˆ์–ด์•ผํ–ˆ๋Š”๋ฐ๋”œ๋ ˆ์ด๊ฐ€ ์žˆ์–ด ..