let backImage = UIImage(systemName: "arrow.backward") navigationBar.backIndicatorImage = backImage navigationBar.backIndicatorTransitionMaskImage = backImage navigationBar.tintColor = .white UINavigationController๋ฅผ ์์๋ฐ๋ ViewController class ์ viewDidLoad() ์์์ ์ฌ์ฉํ์๋ค.
๐ Apple/UIKit
let section = NSCollectionLayoutSection(group: group) section.orthogonalScrollingBehavior = .continuous ํ์ฌ ์น์
์ ๋๋น์ ๊ตฌ์ ๋ฐ์ง ์๊ณ horizontal scrollํ๋ ค๋ฉด orthogonalScrollingBehavior์ .continous๋ก ํด์ฃผ๋ฉด ๋๋ค. ๊ทธ๋ฌ๋ฉด ์ข์ฐ๋ก ์คํฌ๋กค์ด ๊ฐ๋ฅํด์ง๋ค. ์์ฑ์ .groupPaging์ผ๋ก ๋ฐ๊ฟ์ฃผ๋ฉด ์์ผ๋ก ์คํฌ๋กค ํ ๋ ํ์ด์ง๋ฅผ ๋๊ธฐ๋ ์ ๋๋ฉ์ด์
์ผ๋ก ๋์ด์ง๋ฉด์ ๋ณด์ฌ์ง๋ค.
textView์์๋ multi-line์ ์
๋ ฅํ๊ธฐ ๋๋ฌธ์, ๋ค์์ ๋ฉ์๋๋ฅผ ์ถ๊ฐํ์ฌ ์ํฐ ์
๋ ฅ์ ๊ฐ์งํ ์ ์๋ค. func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { guard text == "\n" else { return true } dismiss(animated: true) return true } ๋ฐํ ๊ฐ(Return Value) true >> if the old text should be replaced by the new text ์ด์ ํ
์คํธ๋ฅผ ์ ํ
์คํธ๋ก ๋์ฒดํด์ผ ํ ๊ฒฝ์ฐ false >> if the replacement operation s..

import UIKit final class SourceTextViewController: UIViewController { private let placeholderText = "ํ
์คํธ๋ฅผ ์
๋ ฅํด์ฃผ์ธ์" private lazy var textView: UITextView = { let textView = UITextView() textView.text = placeholderText textView.textColor = .secondaryLabel textView.font = .systemFont(ofSize: 16, weight: .semibold) textView.returnKeyType = .done textView.delegate = self return textView }() override f..