๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
IOS๐ŸŽ/WWDC

[WWDC 2021] Your guide to keyboard layout

by Jouureee 2022. 5. 26.

์˜ค๋Š˜์€ keyboard์— ๊ด€ํ•œ ์˜์ƒ์„ ์‚ดํŽด๋ณด์•˜์Šต๋‹ˆ๋‹ค. ์‚ฌ์‹ค ์ฒ˜์Œ ์˜์ƒ ์ œ๋ชฉ์„ ๋ณด์•˜์„๋•Œ ํ‚ค๋ณด๋“œ ?? ํ•˜ ๋ญ”๊ฐ€ ๋Œ๋ฆฐ๋‹ค .. ์‹ถ์—ˆ์Šต๋‹ˆ๋‹ค ใ…Žใ…Ž

์ฐฝ์—…ํŒ€์—์„œ ํ‚ค๋ณด๋“œ ์˜ฌ๋ฆฌ๊ณ , ๋‚ด๋ฆฌ๊ณ  ํ• ๋•Œ ๋ ˆ์ด์•„์›ƒ ๋ณ€๊ฒฝ ์ฝ”๋“œ๊ฐ€ ์ด๋ ‡๊ฒŒ ํ•˜๋Š”๊ฑฐ ๋งž๋‚˜ ..? ์•ผ๋งค ๊ฐ™์€๋ฐ ํ•˜๋Š” ์ฐœ์ฐœํ•จ์ด ์žˆ์—ˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ iOS 15์—์„œ ์–ด๋–ค ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์žˆ๋Š”์ง€ ์•Œ์•„๋ณด๊ณ ์ž ์˜์ƒ์„ ๋ณด๊ณ  ์ •๋ฆฌํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค !!

https://developer.apple.com/videos/play/wwdc2021/10259/

 

Your guide to keyboard layout - WWDC21 - Videos - Apple Developer

Discover how you can use the Keyboard Layout Guide to manage how keyboards work within your iOS or iPadOS app. Learn how you can avoid...

developer.apple.com

Layout guide

์˜ˆ์ „๋ถ€ํ„ฐ์˜ ๋ฐฉ์‹
1. Notification ๋“ฑ๋ก
2. notification์œผ๋กœ๋ถ€ํ„ฐ offset, animation ๊ฐ€์ ธ์™€

3. ๊ณ„์‚ฐ(math)

4. layout ์กฐ์ •

 

์ด ๋ฐฉ์‹์„ deprecatedํ•˜์ง„ ์•Š์•˜์ง€๋งŒ, ์ฝ”๋“œ๊ฐ€ ๋ฌด์ง€๋ง‰์ง€ํ•˜๊ฒŒ ๊ธด ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

Notification์„ ๋“ฑ๋กํ•˜๊ณ  View์˜ constraint๋ฅผ ์—…๋ฐ์ดํŠธ ํ•ด์ฃผ๊ธฐ ์œ„ํ•ด notification์œผ๋กœ๋ถ€ํ„ฐ ๋ฐ›์€ info๋ฅผ ์‚ฌ์šฉํ•ด layout ํ•ด์ค๋‹ˆ๋‹ค.

@objc func keyboardWillShow(notification: NSNotification) {
        if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
            let keyboardReactangle = keyboardFrame.cgRectValue
            let keyboardHeight = keyboardReactangle.height
            buttonBottomConstraint.constant = keyboardHeight - self.view.safeAreaInsets.bottom
                self.view.layoutIfNeeded()
                }
    }

    

    @objc func keyboardWillHide(notification: NSNotification) {
        buttonBottomConstraint.constant = 0//safe area
            self.view.layoutIfNeeded()
    }

์ด์— ์ƒˆ๋กœ์šด ๋ฐฉ์‹์„ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค. ๋ฐ”๋กœ UIKeyboardLayoutGuided์ธ๋ฐ์š” !

์šฐ์„  view์— keyboardlayoutGuide๋ฅผ ๋ถ™์—ฌ์ค๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ๋”์ด์ƒ notificationCenterr๊ฐ€ ํ•„์š” ์—†์œผ๋ฏ€๋กœ, boiler code๋ฅผ ๋‹ค ์ง€์›Œ์ฃผ๋ฉด ?
๋ฐ ?? ๋Œ€๋ฐ• ...

๋์ด๋„ค์š” ..?

์œ„ ์ฝ”๋“œ๋กœ username textfield ํ„ฐ์น˜์‹œ ์•„๋ž˜์™€ ๊ฐ™์ด login Button์„ ์œ„๋กœ ์˜ฌ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋ฉด ์ด ๋งค์ง ๊ฐ™์€ keyboardLayoutGuide์— ๋Œ€ํ•ด ๋” ์‚ดํŽด๋ณผ๊นŒ์š” ??
์šฐ์„  UIView์˜ property
๊ทธ๋ฆฌ๊ณ  ๊ธฐ๋ณธ์ ์ธ ๊ฒฝ์šฐ keyboard.topAnchor์— layout ๋˜๋„๋ก ํ•จ
๊ทธ์— ๋”ฐ๋ผ animation ํ•˜๊ณ 
keyboard์˜ ๋†’์ด๊ฐ€ ์ด๋ชจํ‹ฐ์ฝ˜, ์•ŒํŒŒ๋ฒณ ๋“ฑ์— ๋Œ€ํ•ด ๋‹ค๋ฅธ๋ฐ ์ด๋ฅผ ์ž๋™์œผ๋กœ ๊ณ„์‚ฐ
๋˜ํ•œ keyboard๊ฐ€ unlock์‹œ guide๋Š” safe area์˜ bottom์— ๋งž์ถฐ ์—…๋ฐ์ดํŠธ

 

์™œ normal layout guide๊ฐ€ ์•„๋‹Œ ์ƒˆ ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ์„ ํƒํ–ˆ์„๊นŒ์š” ?
ํ‚ค๋ณด๋“œ๋กœ ๋” ๋งŽ์€ ๊ฒƒ์„ ํ• ์ˆ˜ ์žˆ๊ฒŒ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„œ ,,?

์™œ๋ƒํ•˜๋ฉด ์šฐ๋ฆฌ์˜ ๋‹ค์Œ step์€ ์•ฑ์— full keyboard integration ํ•˜๋Š” ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์ด๋ผ๊ณ  ํ•˜๋„ค์š”.
์™œ integration ์ผ๊นŒ ?

๋‚˜๋Š” ์ž์ฃผ keyboard๊ฐ€ ์•ฑ์˜ ํ‰๋ฒ”ํ•œ ์ผ๋ถ€์ž„์—๋„ ํ”ผํ•˜๊ณ  ์‹ถ๊ณ , ์‹ธ์šฐ๊ณ  ์‹ถ๋‹ค๋Š” ์–˜๊ธฐ๋ฅผ ๋งŽ์ด ๋“ค์—ˆ์Œ. ์šฐ๋ฆฌ๊ฐ€ UIKeyboard layout guide๋ฅผ ์ƒˆ๋กญ๊ฒŒ ๊ณ ์•ˆํ•œ ์ด์œ ๋Š” ๋ฐ”๋กœ ์ด๊ฒƒ์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด์„œ์ž„. ๋งŽ์€ ๋””๋ฒจ๋กœํผ๊ฐ€ input text์— ๋‹ค์–‘ํ•œ ๋ฐฉ์‹์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๊ฒŒ๋” ์œ ๋„ํ•˜๊ณ  ์‹ถ์Œ. ๊ทธ๋ฆฌ๊ณ  ํ‚ค๋ณด๋“œ๋Š” ์ง€๊ธˆ๊นŒ์ง€ ์—†์—ˆ๋˜ ๋ ˆ์ด์•„์›ƒ์˜ ์ผ๋ถ€๋ผ๊ณ  ์ƒ๊ฐํ•˜๊ฒŒ๋” ํ•˜๊ณ  ์‹ถ์Œ !! 

์š” ์ด์•ผ๊ธฐ๊ฐ€ ์ฐธ ๊ฐ€์Šด์— ์™€๋‹ฟ๋Š”๊ฒƒ  ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ œ๊ฐ€ ๋ฒˆ์—ญํ•ด์„œ ์Œ์Šด์ฒด์ด์ง€๋งŒ ใ…Ž ํ‚ค๋ณด๋“œ๋Š” ์•ฑ๋‚ด ๋ถ€์ˆ˜์ ์ธ ์š”์†Œ๋กœ ์น˜์šฐ์ณ ๋งŽ์€ ๊ณ ๋ฏผ์„ ํ•ด๋ณด์ง€ ์•Š์•˜๋˜๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์•„์ดํŒจ๋“œ์— split, floating ํ‚ค๋ณด๋“œ๊ฐ€ ์žˆ๋‹ค๋Š” ์‚ฌ์‹ค๋„ ์ฒ˜์Œ ์•Œ์•˜๊ตฌ์š” !, ํ‚ค๋ณด๋“œ ์œ„์— inputAccessoryView๋„ ๋ฐ‘์œผ๋กœ ๋‚ด๋ ค๊ฐˆ ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค๋Š” ๊ฒƒ๋„ ์ฒ˜์Œ ์•Œ์•˜์Šต๋‹ˆ๋‹ค. 



Integrating the keyboard

.followUndockedKeyboard
keyboard layout guide๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ƒˆ property์„ ์‚ฌ์šฉํ•˜์—ฌ ํ‚ค๋ณด๋“œ์˜ ๋ชจ๋“  ๊ธฐ๋Šฅ์„ ์™„๋ฒฝํ•˜๊ฒŒ ๋”ฐ๋ผ๊ฐˆ ์ˆ˜ ์žˆ์Œ
๊ธฐ๋ณธ ๊ฐ’์€ false๊ณ  true๋กœ ํ•œ๋‹ค๋ฉด undocked ๋˜์–ด ์žˆ๊ฑฐ๋‚˜ floating ๋˜์–ด ์žˆ์„๋•Œ guide๊ฐ€ ํ‚ค๋ณด๋“œ๋ฅผ ๋”ฐ๋ผ layout์— ๊ด€ํ•ด ๋งŽ์€ ํ†ต์ œ๋ฅผ ์ค„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

UI keyboard layout guide๋Š” ๋˜ ๋‹ค๋ฅธ layoutGuide(UI tracking layout guide)์˜ sub class์ž…๋‹ˆ๋‹ค. 

ํ™”๋ฉด์—์„œ ๋ณ€๊ฒฝํ•  constraints๋ฅผ ์ถ”์ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— tracking layout guide๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

ํŠน์ • ๊ฐ€์žฅ์ž๋ฆฌ ๊ทผ์ฒ˜์— ์žˆ์„๋•Œ ํ™œ์„ฑํ™”ํ•˜๊ณ  ๋– ๋‚ ๋•Œ ๋น„ํ™œ์„ฑํ™”ํ•˜๋Š” constraints์˜ ๋ฐฐ์—ด์„ ์ง€์ •ํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 
๋˜๋Š” ๊ฐ€์žฅ์ž๋ฆฌ์—์„œ ๋–จ์–ด์ ธ ์žˆ์„๋•Œ(awayFrom) ํ™œ์„ฑํ™”ํ•˜๊ณ  ๊ทผ์ฒ˜์— ์žˆ์„๋•Œ ๋น„ํ™œ์„ฑํ™”ํ•˜๋Š” ๋ฐฐ์—ด์„ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์˜ˆ์‹œ ํ™”๋ฉด๊ณผ ์ฝ”๋“œ๋ฅผ ๋ด…์‹œ๋‹ค

๊ทธ๋ฆฌ๊ณ  ํ‚ค๋ณด๋“œ๋ฅผ ํ™”๋ฉด ๊ฐ€๋ฆฌ์ง€ ์•Š๊ธฐ ์œ„ํ•ด์„œ ์ด๋ฆฌ ์ €๋ฆฌ ์›€์ง์ด๋ฉด 

ํ™”๋ฉด์ด ์นœ์ ˆํžˆ ๋น„์ผœ์ค€๋‹ค .. ์šฐ์™€ 
์–ด๋–ป๊ฒŒ ๊ตฌํ˜„ํ–ˆ๋Š”์ง€ ์ฝ”๋“œ๋ฅผ ์‚ดํŽด๋ณด์ž
์šฐ์„  editView(์ „์ฒด view)์˜ bottonAnchor์— keyboard view์˜ topanchor๋ฅผ ๋ฌถ์€ ๋ฐฐ์—ด์„ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค.
๊ทธ๋ฆฌ๊ณ  keyboard layoutguide๊ฐ€ top์—์„œ ๋ฉ€์–ด์งˆ๋•Œ๋งŒ ์ œ์•ฝ ์กฐ๊ฑด์„ ์ฃผ์—ˆ๊ณ , top ๊ทผ์ฒ˜์ผ ๊ฒฝ์šฐ ๋น„ํ™œ์„ฑํ™” ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  keyboard๊ฐ€ top์— ๊ฐ€๊นŒ์›Œ์งˆ ๊ฒฝ์šฐ๋ฅผ ์œ„ํ•œ ๋ถ„๋ฆฌ๋œ constraint ๋ฐฐ์—ด์„ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค.

์ด๋•Œ Keyboard layout guide์˜ top ๋Œ€์‹ ์— safe area bottom์„ ์‚ฌ์šฉํ•  ๊ฒƒ
์˜ˆ์‹œ๋ฅผ ๋ด ๋ด…์‹œ๋‹ค.

ํ˜„์žฌ keyboard๋Š” editView์˜ top์œผ๋กœ๋ถ€ํ„ฐ ๋ฉ€๋ฆฌ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฏ€๋กœ awayFromTopConstraints๊ฐ€ ํ™œ์„ฑํ™” ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ layoutGuide๋ฅผ top ๊ทผ์ฒ˜๋กœ ์˜ฎ๊ธธ ๊ฒฝ์šฐ, awayFromTopConstraints๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋˜๊ณ 

 

๊ทผ๋ฐ ์ € ํ•˜๋Š˜์ƒ‰์€ ๋ชจ์ง€ ..

ํ•˜๋Š˜์ƒ‰ view๋ฅผ view์˜ bottom์œผ๋กœ ๋‚ฎ์ถฐ nearTopConstraints๊ฐ€ ํ™œ์„ฑํ™” ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค. 

(ํ•˜๋Š˜์ƒ‰์€ ์š”๊ณ ์˜€๋‹ค .. ใ…Ž)


๋‹ค์Œ์€ ์ˆ˜ํ‰ ์ด๋™์„ ์‚ดํŽด๋ด…์‹œ๋‹ค.

keyboard๊ฐ€ leading or trailing์œผ๋กœ๋ถ€ํ„ฐ ๋ฉ€์–ด์ง€๋ฉด, editView๋ฅผ center์— ๋‘˜๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋˜ํ•œ imageView๋„ view์˜ center์— ๋‘๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. 

๊ทธ๋ฆฌ๊ณ  ๊ฐ€์žฅ์ž๋ฆฌ์ชฝ์œผ๋กœ ๊ฐˆ ๊ฒฝ์šฐ๋„ ๋ด๋ด…์‹œ๋‹ค.

nearTrailingConstraints๋Š” keyboard๊ฐ€ trailing์œผ๋กœ ๊ฐˆ๋•Œ imageView๋ฅผ leading์œผ๋กœ constraintํ•˜๋ฉฐ nearLeadingConstraints๋Š” ๊ทธ ๋ฐ˜๋Œ€์ž…๋‹ˆ๋‹ค.

ํ‚ค๋ณด๋“œ๋ฅผ ์œ„๋กœ ์›€์ง์ด๋ฉด ?

bottom์œผ๋กœ ๋–จ์–ด์ง‘๋‹ˆ๋‹ค.

 

๊ทธ๋ฆฌ๊ณ  ์–‘ ์˜†์œผ๋กœ ์›€์ง์ด๋ฉด ? ํ”ผํ•˜๋Š” ๊ผด์ด ๋ฉ๋‹ˆ๋‹ค ใ…Žใ…Ž

๊ทธ๋Ÿฌ๋ฉด near๊ณผ awayFrom์ด ์ •ํ™•ํžˆ ์˜๋ฏธํ•˜๋Š” ๋ฐ”๋ฅผ ์ƒ๊ฐํ•ด๋ด…์‹œ๋‹ค !
docked๋œ ํ‚ค๋ณด๋“œ(์ผ๋ฐ˜ ํ‚ค๋ณด๋“œ, ์ •์ฐฉ๋œ ํ‚ค๋ณด๋“œ)๋Š” bottom์— ๊ฐ€๊น๊ฒŒ ์žˆ๊ณ  ๋‹ค๋ฅธ leading, trailing, top๊ณผ๋Š” ๋–จ์–ด์ ธ์žˆ์Šต๋‹ˆ๋‹ค.

๋งŒ์•ฝ ์ด๋Ÿฐ์‹์˜ ๋ถ„๋ฆฌ๋œ ํ‚ค๋ณด๋“œ๊ฐ€ ์žˆ์„๋•Œ top์„ ์ œ์™ธํ•œ ๋ชจ๋“  edge๋กœ๋ถ€ํ„ฐ ๋–จ์–ด์ ธ ์žˆ์œผ๋ฉฐ top์—๋งŒ ๊ฐ€๊น๊ฒŒ ์žˆ์Šต๋‹ˆ๋‹ค.

Floating ํ‚ค๋ณด๋“œ ์ผ ๊ฒฝ์šฐ, ์ดˆ๊ธฐ์—” ํ•œ edge๋งŒ near์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

keyboard๋ฅผ ์›€์ง์ด๋ฉด, ๋™์‹œ์— ๋‘๊ฐœ์˜ ์ธ์ ‘ํ•œ near์„ ๊ฐ–์Šต๋‹ˆ๋‹ค. 

์ž ๋‹ค์‹œ ๋Œ์•„์™€์„œ, ๋ชจ๋“  ์ด๋Ÿฌํ•œ ์†์„ฑ์€ .followUndockedKeyboard๋ฅผ true๋กœ ํ–ˆ์„๋•Œ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.

Types of keyboards


Floating keyboard๋Š” ๋ชจ๋“  edge๋กœ๋ถ€ํ„ฐ ๋–จ์–ด์ ธ ์žˆ์„ ์ˆ˜ ์žˆ๋‹ค๋Š” ์ ์„ ์ฃผ์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. 
๋ชจ๋“  edge์—์„œ ๋–จ์–ด์ ธ ์žˆ์œผ๋ฉด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๋ฐฐ์น˜๋  ์ˆ˜ ์žˆ๋Š” ์ถฉ๋ถ„ํ•œ ์ •๋ณด๊ฐ€ ์žˆ์Šต๋‹ˆ๊นŒ? ๋˜ํ•œ ํ‚ค๋ณด๋“œ๊ฐ€ ์•„๋ž˜์ชฝ edge์—์„œ ๋–จ์–ด์ ธ ์žˆ๊ฑฐ๋‚˜ ์œ„์ชฝ edge ๊ทผ์ฒ˜์— ์žˆ์„ ๋•Œ ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ• ๊นŒ์š”? ํ‚ค๋ณด๋“œ์˜ topAnchor์— ์—ฐ๊ฒฐ๋œ ํ•ญ๋ชฉ๋„ ์ฃผ์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์œ„๋กœ ์˜ฌ๋ผ๊ฐˆ ์ˆ˜ ์žˆ์œผ๋‹ˆ ๋ง์ž…๋‹ˆ๋‹ค.

์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ•์€ ํ‚ค๋ณด๋“œ๊ฐ€ bottom edge๋กœ๋ถ€ํ„ฐ ๋ฉ€์–ด์งˆ๋•Œ, ํ•˜๋Š˜์ƒ‰ view๋ฅผ ํ‚ค๋ณด๋“œ์˜ topAnchor์—์„œ ๋ฒ—์–ด๋‚˜ safeAreaLayoutGuide์˜ button์œผ๋กœ ์ด๋™์‹œํ‚ค๋Š” constraints๋ฅผ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ด๋ฒˆ์—๋Š” split undocked ํ‚ค๋ณด๋“œ์ž…๋‹ˆ๋‹ค.

๋‹ค์Œ์€ camera๋ฅผ ์‚ฌ์šฉํ• ๋•Œ ์ž…๋‹ˆ๋‹ค.
์ด๊ฒƒ์€ ์—ฌ์ „ํžˆ ํ‚ค๋ณด๋“œ์ž…๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ guide๋ฅผ ์‚ฌ์šฉ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Docked ํ‚ค๋ณด๋“œ์™€ ๊ฐ™์ง€๋งŒ ์กฐ๊ธˆ ๋‹ค๋ฅธ ์ ์€ ํ’€ ์Šคํฌ๋ฆฐ์ด๋ผ๋Š” ์ ์ž…๋‹ˆ๋‹ค. 

์ด์— ๋Œ€ํ•ด์„  https://developer.apple.com/videos/play/wwdc2021/10276 ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”

 

ํ’€์‚ฌ์ด์ฆˆ๊ฐ€ ์•„๋‹Œ Shortcut bar 

๊ธฐ๋ณธ์ ์œผ๋กœ botton ๊ฐ€๊นŒ์ด ์žˆ์ง€๋งŒ

๋„ˆ๋น„๊ฐ€ ์กฐ์ • ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋™์‹œ์— ๋‘๊ฐœ์˜ near๋ฅผ ๊ฐ€์งˆ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์ฃผ์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. 

 

๋ฉ€ํ‹ฐ ํƒœ์Šคํ‚น์˜ ๊ฒฝ์šฐ์ž…๋‹ˆ๋‹ค.
window๋ฅผ ์ ์ฐจ ๋Š˜๋ฆฌ๊ฒŒ ๋˜๋ฉด ํ‚ค๋ณด๋Š๋Š” ๋ชจ๋“  edge๋กœ๋ถ€ํ„ฐ ๋ฉ€์–ด์ง€๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. 

๊ทธ๋Ÿฌ๋‚˜ ์—ฌ์ „ํžˆ top, buttom์— ๋Œ€ํ•ด near์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์‹œ docked ํ‚ค๋ณด๋“œ๋กœ ํ™•์žฅํ•˜๋ฉด botton์— near์„ ๊ฐ€์ง€๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

ํ”„๋ ˆ์  ํ„ฐ๋ถ„์ด ์ •๋ง ์ž๋ถ€์‹ฌ์„ ๊ฐ€์ง€๊ณ  ๊น”๋”ํ•˜๊ฒŒ ์„ค๋ช…ํ•ด์ฃผ์…”์„œ ์ด๋ฒˆ ์˜์ƒ์„ ํ†ตํ•ด ํ‚ค๋ณด๋“œ๋ฅผ ์กฐ๊ธˆ ๋” ๊ณ ๋ คํ•  ์ค„ ์•„๋Š” ๋””๋ฒจ๋กœํผ๊ฐ€ ๋˜๊ณ  ์‹ถ๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. 

https://developer.apple.com/documentation/uikit/keyboards_and_input/adjusting_your_layout_with_keyboard_layout_guide ๋„ ์ฐธ๊ณ ํ•ด์„œ ํ•œ๋ฒˆ ๋ณต์Šตํ•ด๋ด์•ผ๊ฒ ์Šต๋‹ˆ๋‹ค !!

'IOS๐ŸŽ > WWDC' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[WWDC 2021] Meet AsyncSequence  (0) 2022.12.18
[WWDC 2021] Make blazing fast lists and collection views  (0) 2022.05.27
[WWDC 2021] Protect mutable state with Swift actors  (0) 2022.05.24
[WWDC 2021] Meet async/await in Swift  (0) 2022.05.17
[WWDC 2020] Advances in diffable data sources  (0) 2022.05.12

๋Œ“๊ธ€