Skip to content
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

Merged
merged 27 commits into from
Nov 15, 2021
Merged

Feature/3rd assignment #14

merged 27 commits into from
Nov 15, 2021

Conversation

YoonAh-dev
Copy link
Member

@YoonAh-dev YoonAh-dev commented Oct 27, 2021

📌 관련 이슈

close #12
close #13

📌 변경 사항 및 이유

home 부분의 레이아웃 구성 및 애니메이션을 넣어줬습니다.

  • TableView Header로 collectionView를 넣어줬습니다.
  • 상단바는 따로 뷰를 만들어서 구현했습니다.
  • 데이터를 가져오는 Manager를 만들었습니다.
  • Icon들을 YoutubeIcon에서 관리해줍니다.

📌 PR Point

레이아웃 코드가 복잡하진 않은지 봐주셨으면 좋겠습니다.

2주차가 아직 머지 전이기 때문에 3주차에 Files changed가 축적됐습니다..🥲
웬만하면 2주차 머지 완료하고 코드 봐주세요!

📌 참고 사항

@YoonAh-dev YoonAh-dev added 💐 듀나 Duna's work 🌈 과제 Assignment 3️⃣ 차 Third Assignment labels Oct 27, 2021
@YoonAh-dev YoonAh-dev added this to the 3차 과제 구현 milestone Oct 27, 2021
@YoonAh-dev YoonAh-dev self-assigned this Oct 27, 2021
@Taehyeon-Kim
Copy link
Member

지나가다 들렸습니다.. 살짝 봤는데 역시 대박이네 이 선배 조만간 코드 뜯어보러 오겠습니다💥

@noah0316
Copy link

쓴배님 코드, 구조, 조명, 온도, 습도 넘 간지납니다...역시 햄짜기 혹은 도라에몽 선생님..

if Login.shared.isLogin() {
window.rootViewController = TabbarController()
} else {
let navi = UINavigationController.init(rootViewController: LoginVC())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.init() 으로 객체를 생성하는 것과 그냥 괄호로 생성하는 것에 차이가 있나요?

Copy link
Member Author

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()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

싱글턴?!?! 그러면private init() {} 으로 생성자 안막아도 되나요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 감사합니다. 막으러갑니다 ㅋㅋ

Comment on lines +34 to +44
@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)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기에 @nonobjc 애너테이션을 붙이는 이유가 뭔가요?

Copy link
Member Author

@YoonAh-dev YoonAh-dev Nov 15, 2021

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로 변환하지 말라는 뜻입니다!

Comment on lines +16 to +38
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)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수마다 def 변수가 중복되는데 그냥 클래스 멤버변수로 선언하면 안되는 건가요? 유저디폴츠를 제가 몰라서...😂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 함 빼서 사용하겠습니다. 감사합니다👍

Copy link

@loinsir loinsir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 아닌 리뷰... 남겨드렸습니다ㅋㅋ

@YoonAh-dev YoonAh-dev merged commit 376ebbe into main Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3️⃣ 차 Third Assignment 🌈 과제 Assignment 💐 듀나 Duna's work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 헤더 애니메이션 구현 [UI] iOS 3차 과제 전체 레이아웃 구성
4 participants