-
Notifications
You must be signed in to change notification settings - Fork 0
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
2주차 기본,도전,심화과제 PR #19
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.
KIYA 역시 경민님 👍🏻 코드 깔끔하네요 !! 😎
|
||
extension UIViewController { | ||
func changeRootViewController(_ viewControllerToPresent: UIViewController) { | ||
if let window = UIApplication.shared.windows.first { |
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.
UIApplication.shared.windows.
요거 iOS 15에서도 가능한가여 ?? (just 궁금)
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.
저도 궁금합니다!!
@@ -58,7 +58,7 @@ final class JoinNameViewController: UIViewController { | |||
} | |||
|
|||
@IBAction func nextButtonDidTap(_ sender: Any) { | |||
guard let passwordVC = self.storyboard?.instantiateViewController(withIdentifier: "JoinPasswordViewController") as? JoinPasswordViewController else { return } | |||
guard let passwordVC = self.storyboard?.instantiateViewController(withIdentifier: Const.ViewController.JoinPasswordVC) as? JoinPasswordViewController else { return } |
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.
뷰 컨트롤러의 identifier를 따로 상수처리하는 이유가 뭔가요?? 찾아볼 때 조금더 효율적이라 따로 정리해두는 건가요??🧐
저도 배워서 사용해보고 싶어요!!!
var borderView = UIView(frame: CGRect(x: 0, y: 0, | ||
width: UIScreen.main.bounds.width, height: 1.5)) | ||
borderView.backgroundColor = UIColor(red: 218.0/255.0, green: 218.0/255.0, blue: 218.0/255.0, alpha: 1.0) | ||
self.tabBar.addSubview(borderView) |
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.
요 borderView는 탭 바의 테두리(?)인가요 ??
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { | ||
tabBar.backgroundColor = item.tag == 3 ? .black : .white | ||
tabBar.tintColor = item.tag == 3 ? .white : .black | ||
tabBar.barTintColor = item.tag == 3 ? .white : .black | ||
} |
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.
와 이런코드 너무 신기하고 똑똑해요 ... 세상에 ... 🙉
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.
tag를 통한 방법이 이거였군요 배워갑니다!!
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.
경민...코드와 ... 폴더링 ... 다음주에 쑉쌱해서 와도 될까요... 정말 많이 배워갑니다...
과제 고생 너무 많았습니다!!!~ 😚😚
passwordTextField.isSecureTextEntry.toggle() | ||
} | ||
|
||
@IBAction func completeButtonDidTap(_ sender: Any) { | ||
guard let completeVC = UIStoryboard(name: "Complete", bundle: nil).instantiateViewController(withIdentifier: "CompleteViewController") as? CompleteViewController else { return } | ||
guard let completeVC = UIStoryboard(name: Const.Storyboard.Complete, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.CompleteVC) as? CompleteViewController else { return } |
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.
이렇게 Const.Storyboard를 사용하는 이유는 뭔가요...?!?!?(태클X...진짜단순궁금...)
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { | ||
tabBar.backgroundColor = item.tag == 3 ? .black : .white | ||
tabBar.tintColor = item.tag == 3 ? .white : .black | ||
tabBar.barTintColor = item.tag == 3 ? .white : .black | ||
} |
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.
저도 상수 처리..? 공부해서 다음에 적용해볼래요🔥
그리고 Label 일부 단어 속성 변경하는 법 배워갑니다!!
func setPartialLabelColor(targetStringList: [String], color: UIColor?) { | ||
let fullText = text ?? "" | ||
let attributedString = NSMutableAttributedString(string: fullText) | ||
targetStringList.forEach { |
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.
targetStringList.forEach문이
fullText 중 targetString 원소에 해당하는 단어들만 속성을 바꿔주는 내용 맞나요?
제대로 이해했는지 궁금해요!!!
|
||
extension UIViewController { | ||
func changeRootViewController(_ viewControllerToPresent: UIViewController) { | ||
if let window = UIApplication.shared.windows.first { |
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.
저도 궁금합니다!!
@@ -23,13 +23,23 @@ extension Const { | |||
|
|||
// MARK: - Home | |||
|
|||
static let HomeVC = "HomeViewController" |
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.
Const에 대해 설명해줄 수 있나요..😂
검색해보니깐 Constant, 상수를 정리할 때 사용하는 것 같은데,, 잘 모르겠어요,,
뷰 컨트롤러 구조체를 만드는데 주로 사용하는 걸까요??
@@ -58,7 +58,7 @@ final class JoinNameViewController: UIViewController { | |||
} | |||
|
|||
@IBAction func nextButtonDidTap(_ sender: Any) { | |||
guard let passwordVC = self.storyboard?.instantiateViewController(withIdentifier: "JoinPasswordViewController") as? JoinPasswordViewController else { return } | |||
guard let passwordVC = self.storyboard?.instantiateViewController(withIdentifier: Const.ViewController.JoinPasswordVC) as? JoinPasswordViewController else { return } |
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.
뷰 컨트롤러의 identifier를 따로 상수처리하는 이유가 뭔가요?? 찾아볼 때 조금더 효율적이라 따로 정리해두는 건가요??🧐
저도 배워서 사용해보고 싶어요!!!
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.
잘보고갑니다!
항상 많이 배워요
///Label의 일부만 색을 바꿀 수 있는 익스텐션 | ||
func setPartialLabelColor(targetStringList: [String], color: UIColor?) { |
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으로 빼놓은거 좋네요
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { | ||
tabBar.backgroundColor = item.tag == 3 ? .black : .white | ||
tabBar.tintColor = item.tag == 3 ? .white : .black | ||
tabBar.barTintColor = item.tag == 3 ? .white : .black | ||
} |
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.
코드 너무 잘보고 갑니다..! 쑉쌱할 부분이 보여서 얼른 가서 수정해야겠어요>< 너무 수고 많으셧습니당
welcomeLabel.text = "\(userName)님 Instagram에 오신 것을 환영합니다" | ||
welcomeLabel.text = """ | ||
\(userName)님 Instagram에 | ||
오신 것을 환영합니다 | ||
""" |
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.
수정 전 코드와 수정 후 코드의 차이가 궁금합니다..!
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { | ||
tabBar.backgroundColor = item.tag == 3 ? .black : .white | ||
tabBar.tintColor = item.tag == 3 ? .white : .black | ||
tabBar.barTintColor = item.tag == 3 ? .white : .black | ||
} |
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 setLabelUI() { | ||
joinLabel.setPartialLabelColor(targetStringList: ["가입하기"], color: UIColor.tintColor) | ||
} |
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.
와 이렇게 라벨색상을 바꾸는거 알아갑니다! 위에 코드보고 어디에 쓰이는지 궁금했었는데 여기서 쓰이는 거였군요!
🌱 작업한 내용
기본, 도전, 심화 과제를 했습니다..
🌱 PR Point
칭찬 부탁><
스크린샷 귀찮아서 죄송합니다
📸 스크린샷
📮 관련 이슈