-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] #40 - 방생성 설정 뷰 구현 #45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
텍필 딜리게이트 신기한것... 잘 보고 갑니다
if text.count >= maxLength { | ||
let maxIndex = text.index(text.startIndex, offsetBy: maxLength) | ||
let newString = String(text[text.startIndex..<maxIndex]) | ||
textField.text = newString | ||
countLabel.text = "15/15" | ||
countLabel.textColor = .sparkPinkred | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
글자수가 초과할때마다 추가된 글자를 잘라주는거네요! 잘배워갑니당
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그렇습니다 땡큐포현규선배
} | ||
} | ||
|
||
extension CreateRoomVC: UITextFieldDelegate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
텍스트필드 딜리게이트는 처음봐요...! 잘 보고 가요!
extension CreateRoomVC: UITextFieldDelegate { | ||
/// 여백 클릭 시 | ||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?){ | ||
self.view.endEditing(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endEditing이 true이고 false인 경우에 어떤 일을 하나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
키보드가 내려가지 않습니당
참고하면 좋을거 같아서 남겨용
true if the view resigned the first responder status or false if it did not.
출처: https://developer.apple.com/documentation/uikit/uiview/1619630-endediting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네비바 야무지게 만들어뒀으니.. 낼 일어나시면 제꺼 머지하시고... 써주세여
private func ableButton() { | ||
lineView.backgroundColor = .sparkPinkred | ||
nextButton.backgroundColor = .sparkPinkred | ||
nextButton.isEnabled = true | ||
} | ||
|
||
private func disableButton() { | ||
lineView.backgroundColor = .sparkGray | ||
nextButton.backgroundColor = .sparkGray | ||
nextButton.isEnabled = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
작성 시작에 대한 lineView 로! 고생하셨습니다!
attributedString.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.sparkPinkred, range: ((countLabel.text ?? "") as NSString).range(of:"\(text.count)")) | ||
countLabel.textColor = .sparkDarkGray | ||
countLabel.attributedText = attributedString | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오호..! 좋은 아이디어네요! 만약에 저라면
range 에 NSRange(location: 0, length: "\(text)".count)
요렇게 했을 거 같아요! 같은 역할이니 참고만 해주세욥 수고하셨어용
extension CreateRoomVC: UITextFieldDelegate { | ||
/// 여백 클릭 시 | ||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?){ | ||
self.view.endEditing(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
키보드가 내려가지 않습니당
참고하면 좋을거 같아서 남겨용
true if the view resigned the first responder status or false if it did not.
출처: https://developer.apple.com/documentation/uikit/uiview/1619630-endediting
Merge branch 'develop' of https://github.com/TeamSparker/Spark-iOS into feature/TeamSparker#40
🌴 PR 요약
🌱 작업한 브랜치
🌱 작업한 내용
📌 참고 사항
Keyboard+ 익스텐션으로 빼려고 했는데, 저런식으로 하는게 더 깔끔한 것 같기도 해서 저렇게 했습니다..
위에는 네비게이션바가 들어갈 것을 대비해서 일단 만들었는데,
저 부분은 네비바 적용된 다음에 다시 손보겠습니다.
📸 스크린샷
📮 관련 이슈