func convertToCurrencyFormat(price: Int) -> String { let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal numberFormatter.maximumFractionDigits = 0 let result = numberFormatter.string(from: NSNumber(value: price)) ?? "" return result }
๐ Apple
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..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbmUtPX%2FbtrNwnObNBL%2FfL6YxN3o6sKn67TozQ4L1k%2Fimg.png)
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..