-
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
Feature/3rd assignment #14
Conversation
…OPT-iOS-Part/ShinYunA into feature/2nd-Assignment
지나가다 들렸습니다.. 살짝 봤는데 역시 대박이네 이 선배 조만간 코드 뜯어보러 오겠습니다💥 |
쓴배님 코드, 구조, 조명, 온도, 습도 넘 간지납니다...역시 햄짜기 혹은 도라에몽 선생님.. |
if Login.shared.isLogin() { | ||
window.rootViewController = TabbarController() | ||
} else { | ||
let navi = UINavigationController.init(rootViewController: LoginVC()) |
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.
.init() 으로 객체를 생성하는 것과 그냥 괄호로 생성하는 것에 차이가 있나요?
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.
동일합니다!
.init()이나 UINavigationContoller(rootViewController: LoginVC())
둘 다 동일한 의미입니다.
init()를 쓰지 않아도 동일한 initializer 거든요!
import UIKit | ||
|
||
struct HomeManager { | ||
static let shared = HomeManager() |
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 init() {}
으로 생성자 안막아도 되나요?
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.
오 감사합니다. 막으러갑니다 ㅋㅋ
@nonobjc class var subGray: UIColor { | ||
return UIColor(rgb: 0x606060) | ||
} | ||
|
||
@nonobjc class var subGray100: UIColor { | ||
return UIColor(rgb: 0xF2F2F2) | ||
} | ||
|
||
@nonobjc class var subGray200: UIColor { | ||
return UIColor(rgb: 0xDADADA) | ||
} |
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.
여기에 @nonobjc
애너테이션을 붙이는 이유가 뭔가요?
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.
@nonobjc
은 objective-c로 컴파일을 돌리는 걸 막는 애너테이션입니다.
Color의 경우에는 objc와 swift 모두에서 사용이 되어지기 때문에 컴파일을 할 때 objc로 변환이 될 때가 있는데, 우리는 Swift만 사용할 것이기 때문에 Color를 objc로 변환하지 말라는 뜻입니다!
func isLogin() -> Bool { | ||
let def = UserDefaults.standard | ||
let flag = def.bool(forKey: login) | ||
|
||
return flag | ||
} | ||
|
||
func setLogin() { | ||
let def = UserDefaults.standard | ||
|
||
def.set(true, forKey: login) | ||
def.synchronize() | ||
} | ||
|
||
func setLoginOut() { | ||
let def = UserDefaults.standard | ||
|
||
def.set(false, forKey: login) | ||
def.synchronize() | ||
|
||
let navi = UINavigationController.init(rootViewController: LoginVC()) | ||
UIApplication.shared.keyWindow?.replaceRootViewController(navi, animated: true, completion: nil) | ||
} |
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.
함수마다 def 변수가 중복되는데 그냥 클래스 멤버변수로 선언하면 안되는 건가요? 유저디폴츠를 제가 몰라서...😂
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.
리뷰 아닌 리뷰... 남겨드렸습니다ㅋㅋ
📌 관련 이슈
close #12
close #13
📌 변경 사항 및 이유
home 부분의 레이아웃 구성 및 애니메이션을 넣어줬습니다.
📌 PR Point
레이아웃 코드가 복잡하진 않은지 봐주셨으면 좋겠습니다.
2주차가 아직 머지 전이기 때문에 3주차에 Files changed가 축적됐습니다..🥲
웬만하면 2주차 머지 완료하고 코드 봐주세요!
📌 참고 사항