You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varnumberSet:Set=[2,4,6,8,10]varnumberSet2:Set=[1,2,3,4,5]
numberSet.subtract(numberSet2)// ๋ฐํ๊ฐ X
numberSet.subtracting(numberSet2)// ๋ฐํ๊ฐ OvarnumberArray=[1,2,3,4,5,6,7,8,9,10]
numberArray.shuffle()// ๋ฐํ๊ฐ X
numberArray.shuffled()// ๋ฐํ๊ฐ O
The text was updated successfully, but these errors were encountered:
๐ชด Summary
๐ Memo
TIL์ ๋๋ฌด ๋ง์ ๋ฆฌ์์ค๋ฅผ ๋ค์ด์ง ๋ง์๋ค.
AutoLayout Priority
์ฐ์ ์์๋ ์ดํ์ ๋ค๋ฅธ ์ํฐํด์์ ๋ ์์ธํ ์ ๋ฆฌํ๋๋ก ํ๊ฒ ๋ค.
View ๋๋ Button์ Tag ๊ฐ ๋ถ์ฌ
UIView์๋ tag๋ผ๋ ํ๋กํผํฐ๊ฐ ์กด์ฌํ๋ค. ํด๋น ํ๋กํผํฐ๋ก ๊ฐ๊ฐ์ ์์๋ฅผ ๊ตฌ๋ถํ ์ ์๋๋ฐ ์ฌ๋ฌ ๊ฐ์ ๋์ผํ ์์๋ฅผ ๊ฐ์ด ์ฌ์ฉํ๊ฑฐ๋ ์ก์ ์ ์ฒ๋ฆฌํ ๋ ์ ์ฉํ๊ฒ ์ฌ์ฉํ ์ ์๋ค.
๋นจ๊ฐ์ ๋ฐ์ค ๋ถ๋ถ์ด UIButton ํ์ ์ด๋ผ๊ณ ํ๋ค๋ฉด ๊ฐ๊ฐ์ ๊ตฌ๋ถํ๊ธฐ ์ํด ๊ผฌ๋ฆฌํ๋ฅผ ๋ถ์ธ๋ค๊ณ ์ดํดํ๋ฉด ํธํ ๊ฒ ๊ฐ๋ค. ์ง๊ธ์ tag ๊ฐ์ 1๋ถํฐ ์์ฐจ์ ์ผ๋ก ๋ถ์์ง๋ง 0๋ถํฐ ์์ํ๋ค๋ฉด ๋ฐฐ์ด์ ์ธ๋ฑ์ค์ ์ ๊ทผํ๊ฑฐ๋ ๊ฐ์ ๊บผ๋ด์ ์ฌ์ฉํ ๋ ์ ์ฉํ๊ฒ ์ฌ์ฉํ ์ ์๋ค.
์๋ฅผ ๋ค์ด์ ๊ฐ๊ฐ์ Button์ ์๋์ ๊ฐ์ด emotionButtonDidTapped์ด๋ผ๋ ๋์ผํ IBAction์ ์ฐ๊ฒฐํด์ฃผ์๋ค๊ณ ๊ฐ์ ํด๋ณด์. ๊ทธ๋ผ ์ด๋ป๊ฒ ๊ตฌ๋ถ์ ํด์ผ ํ ๊น? ์ฌ๋ฌ ๋ฐฉ๋ฒ์ด ์๊ฒ ์ง๋ง tag๋ฅผ ์ด์ํ๋ฉด ํธํ๋ค. sender๋ผ๋ ๋งค๊ฐ๋ณ์์ ์ ํธ๊ฐ ์ ๋ฌ๋์ด ๋์ด์ฌํ ๋ฐ sender.tag๋ก ์ ๊ทผํด๋ณด๋ฉด ์ด๋ ๋ฒํผ์ด ๋๋ ธ๋์ง tag ๋ฒํธ๋ก ๊ตฌ๋ถํ ์ ์๋ค. ์์ ๊ทธ๋ฆผ์ผ๋ก ์๊ฐํด๋ณด๋ฉด ์ฒซ ๋ฒ์งธ ๋ฒํผ์ ๋๋ฅด๋ฉด sender.tag์ 1์ด ๋ด๊ฒจ ์์ ๊ฒ์ด๋ค. ํด๋น ์ ๋ณด๋ก ์ ํธ๋ฅผ ๋ณด๋ธ ๊ฐ์ฒด๋ฅผ ๊ตฌ๋ถํ๊ณ ์ํ๋ ์ฒ๋ฆฌ๋ฅผ ํด์ฃผ๋ฉด ๋ ๊ฒ์ด๋ค.
ViewController ์ข ๋ฅ
UIAlertController (Alert, Action Sheet)
Human Interface Guidelines์ ์ ์ฎ์ด์ ๋ณด์.
Alert Action Style
Alert Action๊ฐ ๋ฉ๋ด ํ๋ํ๋๋ฅผ ์๋ฏธํ๋ค๊ณ ๋ด๋ ๊ด์ฐฎ์ ๊ฒ ๊ฐ๋ค. cancel ์คํ์ผ์ ๊ฒฝ์ฐ ์๊ธฐ ์๋ฆฌ์ ์์์ ๋ถ๋๋ค. 2๊ฐ์ ๊ฒฝ์ฐ ์ผ์ชฝ์ ๋ถ๊ณ , 2๊ฐ ์ด์์ ๊ฒฝ์ฐ ๊ฐ์ฅ ์๋์ ๋ถ๋๋ค. cancel ์คํ์ผ์ 2๊ฐ ์ด์ ์ค์ ํ ์ ์๋ค.
UIImagePickerController
UIActivityViewController
UIMenuController
UIDocumentPickerViewController
UIFontPickerViewController
UIColorPickerViewController
Literal
๋ฆฌํฐ๋ด์ ์ ํํ ์ ์๋ฅผ ๊ณต์ ๋ฌธ์์์ ์ฐพ์๋ณด๋ฉด ๋ค์๊ณผ ๊ฐ๋ค. ์๋์ ๊ฐ์ ๋๋์ด๋ผ๊ณ ๋ณด๋ฉด ๋ ๊ฒ ๊ฐ๋ค.
๋ฆฌํฐ๋ด์ ์ซ์ ๋๋ ๋ฌธ์์ด๊ณผ ๊ฐ์ ์ ํ ๊ฐ์ ์์ค ์ฝ๋ ํํ์ ๋๋ค. ๋ฆฌํฐ๋ด์ ์์ฒด์ ์ผ๋ก ์ ํ์ด ์์ต๋๋ค. ๊ทธ๋ ๊ธฐ์ Swift๋ Literal์ ํ์ ์ ์ ์ถํ๋ ค๊ณ ์๋ํ๊ฒ ๋ฉ๋๋ค.
์ด๋ฏธ์ง ๋ฆฌํฐ๋ด๊ณผ ์์ ๋ฆฌํฐ๋ด๋ ๊ฐ์ ๋๋์ด์ง ์์๊น ์๊ฐํ๋ค.
Playground
์ค์ ๋ง๋ค๊ณ ์๋ ํ๋ก์ ํธ์์ ์ฝ๋ ํ ์คํธ๋ฅผ ํ๋ ๊ฒ์ด ์๊ฐ๋ณด๋ค ์ฝ์ง ์์ ๊ฒฝ์ฐ๊ฐ ์๊ธฐ ๋๋ฌธ์ ์ฝ๋์ ํ ์คํธ ์ฉ๋๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง๋ค.
ํจ์, ํจ์์ ๋ฐํ๊ฐ
๋ฐํ๊ฐ์ด ์๊ณ ์์์ ๋ฐ๋ผ ์ฝ๋๊ฐ ๋ฌ๋ผ์ง๋ค. ํจ์ ์ ์์ฑํ๋ ๊ฒ ์ง์ง ์ค์ํ๋ค.
The text was updated successfully, but these errors were encountered: