-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from boostcampwm-2024/fix/handleObject
[Fix] 오브젝트 수정 기능 QA 반영
- Loading branch information
Showing
17 changed files
with
379 additions
and
169 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
59 changes: 59 additions & 0 deletions
59
Presentation/Presentation/Sources/Common/View/AirplainTextField.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,59 @@ | ||
// | ||
// AirplainTextField.swift | ||
// Presentation | ||
// | ||
// Created by 이동현 on 12/2/24. | ||
// | ||
|
||
import UIKit | ||
|
||
public protocol AirplaINTextFieldDelegate: AnyObject, UITextFieldDelegate { | ||
func airplainTextFieldDidChange(_ textField: AirplainTextField) | ||
} | ||
|
||
public final class AirplainTextField: UITextField { | ||
weak var airplainTextFieldDelegate: AirplaINTextFieldDelegate? { | ||
didSet { | ||
delegate = airplainTextFieldDelegate | ||
} | ||
} | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
configureAttribute() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
configureAttribute() | ||
} | ||
|
||
private func configureAttribute() { | ||
configurePlaceHolder() | ||
|
||
self.addAction( | ||
UIAction { [weak self] _ in | ||
guard let self else { return } | ||
self.airplainTextFieldDelegate?.airplainTextFieldDidChange(self) | ||
}, | ||
for: .editingChanged) | ||
|
||
self.addAction( | ||
UIAction { [weak self] _ in | ||
self?.attributedPlaceholder = nil | ||
}, | ||
for: .editingDidBegin) | ||
|
||
self.addAction( | ||
UIAction { [weak self] _ in | ||
self?.configurePlaceHolder() | ||
}, | ||
for: .editingDidEnd) | ||
} | ||
|
||
private func configurePlaceHolder() { | ||
let placeholderText = "Hello, AirplaIN" | ||
let placeholderAttributes: [NSAttributedString.Key: Any] = [.foregroundColor: UIColor.airplainBlack] | ||
self.attributedPlaceholder = NSAttributedString(string: placeholderText, attributes: placeholderAttributes) | ||
} | ||
} |
Oops, something went wrong.