-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
Gongbaek_iOS/Gongbaek_iOS/Global/Enum/TextFieldState.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// TextFieldState.swift | ||
// Gongbaek_iOS | ||
// | ||
// Created by 김민서 on 1/16/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
enum TextFieldState { | ||
case nickname | ||
case location | ||
case title | ||
} | ||
|
||
extension TextFieldState { | ||
var titleText: String { | ||
switch self { | ||
case .nickname: return "닉네임" | ||
case .location: return "장소" | ||
case .title: return "제목" | ||
} | ||
} | ||
|
||
var placeholderText: String { | ||
switch self { | ||
case .nickname: return "한글을 활용해 최대 8자 이내로 입력해주세요." | ||
case .location: return "모임 장소를 입력해주세요. ex) M동 1층 로비" | ||
case .title: return "모임 제목을 입력해주세요." | ||
} | ||
} | ||
|
||
var maxCharacterCount: Int { | ||
switch self { | ||
case .nickname: return 8 | ||
case .location, .title: return 20 | ||
} | ||
} | ||
} |