11# DynamicTextEditor
22
3- ` DynamicTextEditor ` 는 사용자의 입력에 따라 높이가 자동으로 조절되는 SwiftUI 기반의 TextEditor Component입니다.
4-
5- > 카카오톡 앱의 채팅화면에 TextField와 같이 동적으로 Height가 변하는 TextEditor
3+ ` DynamicTextEditor ` is a SwiftUI-based ` TextEditor ` component that automatically adjusts its height according to the user’s input.
4+
5+ > Similar to the chat input field in KakaoTalk, where the text field dynamically grows with the number of lines.
6+
7+ ---
8+
9+ ## Language
10+ 🇰🇷 [ 한국어 README] ( README_KR.md ) | 🇺🇸 [ English README] ( README.md ) | 🇯🇵 [ 日本語 README] ( README_JP.md )
611
712## ✨ Features
813
9- - ✅ 최대 줄 수 설정 가능
10- - ✅ placeholder 텍스트 지원
11- - ✅ 동적으로 height가 변하는 TextEditor
12- - ✅ Custom Font 적용 가능
14+ - ✅ Set maximum line count
15+ - ✅ Support for placeholder text
16+ - ✅ Automatically resizing ` TextEditor `
17+ - ✅ Custom font support
18+
1319---
1420
1521## 🛠 Requirements
1622
17- - iOS 15+
18- - SwiftUI
23+ - iOS 15+
24+ - SwiftUI
1925
2026---
2127
2531
2632``` swift
2733dependencies: [
28- .package (url : " https://github.com/your-id /DynamicTextEditor.git" , branch : " main" )
34+ .package (url : " https://github.com/winwx /DynamicTextEditor.git" , branch : " main" )
2935]
3036```
37+
3138---
3239
3340## 🚀 Usage
3441
35- ### 기본 예시
42+ ### Basic Example
3643``` swift
3744import SwiftUI
3845import DynamicTextEditor
3946
4047@State var text: String = " "
4148
4249var body: some View {
43- DynamicTextEditor (" 내용을 입력해주세요 ." , text : $text)
50+ DynamicTextEditor (" Enter your text.. ." , text : $text)
4451}
4552```
4653
47- <img src =" GIFs/Default_DynamicTextEditor.gif " width =" 300 " />
54+ <img src =" GIFs/Default_DynamicTextEditor.gif " width =" 300 " />
4855
49- ### 카카오톡 클론 코딩 예시
56+ ### KakaoTalk Clone Example
5057``` swift
5158import SwiftUI
5259import DynamicTextEditor
@@ -57,7 +64,7 @@ var body: some View {
5764 ...
5865 HStack (alignment : .bottom , spacing : 16 ) {
5966 DynamicTextEditor (
60- " 메시지 입력 " ,
67+ " Type a message " ,
6168 text : $text
6269 )
6370 .setFont (uiFont : .systemFont (ofSize : 16 ))
@@ -76,53 +83,58 @@ var body: some View {
7683}
7784```
7885
79- <img src =" GIFs/DynamicTextEditor_clone_kakaotalk.gif " width =" 300 " />
86+ <img src =" GIFs/DynamicTextEditor_clone_kakaotalk.gif " width =" 300 " />
87+
88+ ---
8089
8190## 🎛 Modifier API
8291
83- DynamicTextEditor는 SwiftUI의 Modifier 스타일 API로 다양한 속성을 설정할 수 있습니다.
92+ DynamicTextEditor provides a SwiftUI-style modifier API to customize its behavior and appearance.
93+
8494### 🔤 ` setFont(uiFont:) `
8595
86- 사용할 UIFont를 설정합니다 .
96+ Sets the font using ` UIFont ` .
8797
8898``` swift
89- DynamicTextEditor (" 입력 " , text : $text)
99+ DynamicTextEditor (" Input " , text : $text)
90100 .setFont (uiFont : .systemFont (ofSize : 16 , weight : .medium ))
91101```
92102
93103### 📏 ` setMaxLineCount(_:) `
94104
95- 최대 줄 수를 설정합니다. 기본값은 5입니다 .
105+ Sets the maximum number of lines. Default is ** 5 ** .
96106
97107``` swift
98- DynamicTextEditor (" 입력 " , text : $text)
108+ DynamicTextEditor (" Input " , text : $text)
99109 .setMaxLineCount (3 )
100- ````
110+ ```
101111
102112### 🎨 ` setTextColor(_:) `
103113
104- 텍스트 색상을 설정합니다. 기본값은 ' .black '입니다 .
114+ Sets the text color. Default is ` .black ` .
105115
106116``` swift
107- DynamicTextEditor (" 입력 " , text : $text)
117+ DynamicTextEditor (" Input " , text : $text)
108118 .setTextColor (.gray )
109119```
110120
111- ### 👤 ` setPlcaeholderColor (_:)`
121+ ### 👤 ` setPlaceholderColor (_:)`
112122
113- 텍스트 색상을 설정합니다. 기본값은 ' .gray'입니다 .
123+ Sets the placeholder color. Default is ` .gray ` .
114124
115125``` swift
116- DynamicTextEditor (" 입력 " , text : $text)
126+ DynamicTextEditor (" Input " , text : $text)
117127 .setPlaceholderColor (.black )
118128```
119129
120- 🧪 커스텀 예시
130+ ---
131+
132+ 🧪 Custom Example
121133
122134``` swift
123- DynamicTextEditor (" 댓글을 입력하세요 " , text : $text)
135+ DynamicTextEditor (" Write a comment... " , text : $text)
124136 .setFont (uiFont : .systemFont (ofSize : 14 ))
125137 .setMaxLineCount (4 )
126138 .setTextColor (.blue )
127- .setPlaceholder (.red )
139+ .setPlaceholderColor (.red )
128140```
0 commit comments