Skip to content

Commit

Permalink
[Chore] 코드 정리 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
seuriseuljjeok committed May 31, 2024
1 parent 6adcb5a commit b3fe999
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import UIKit

import Then

class TabBarViewController: UITabBarController {
final class TabBarViewController: UITabBarController {

// MARK: - UI Components

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

class ObservablePattern<T> { // --- a
final class ObservablePattern<T> { // --- a

var value: T? { // --- b
didSet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ protocol LoginViewDelegate: AnyObject {
func pushToWelcomeVC(id: String)
}

class LoginView: UIView {
final class LoginView: UIView {

// MARK: - UI Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ protocol CreateNicknameVCDelegate: AnyObject {
func saveUserNickname(nickname: String)
}

class CreateNicknameViewController: UIViewController {
final class CreateNicknameViewController: UIViewController {

// MARK: - UI Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class LoginViewController: UIViewController {
final class LoginViewController: UIViewController {

// MARK: - UI Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,20 @@ final class MainViewModel: NSObject {

// MARK: - Properties

// private var isSuccess: Bool = false {
// didSet {
// self.didUpdateNetworkResult?(isSuccess)
// }
// }
//
// private var isLoading: Bool = true {
// didSet {
// self.didChangeLoadingIndicator?(isLoading)
// }
// }

var didUpdateNetworkResult: ObservablePattern<Bool> = ObservablePattern(false)

var didChangeLoadingIndicator: ObservablePattern<Bool> = ObservablePattern(true)

private var mainData: [Contents] = []

private var recommendedData: [Contents] = []

private var popularData: [Contents] = []

private var paramountsData: [Contents] = []

private var categoryData: [Contents] = []

let dataSource: [MainSection] = MainSection.dataSource

}
Expand Down Expand Up @@ -76,7 +64,7 @@ extension MainViewModel {
guard let networkResult = self.didUpdateNetworkResult.value else { return false}
return networkResult
}

}

extension MainViewModel: UICollectionViewDataSource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extension MovieViewModel {
return
}
}
guard let networkResult = self.didUpdateNetworkResult.value else { return false}
guard let networkResult = self.didUpdateNetworkResult.value else { return false }
return networkResult
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class BasicHeaderView: UICollectionReusableView {
final class BasicHeaderView: UICollectionReusableView {

// MARK: - UI Properties

Expand Down Expand Up @@ -52,13 +52,10 @@ class BasicHeaderView: UICollectionReusableView {
private extension BasicHeaderView {

func setHierarchy() {

self.addSubviews(titleLabel, viewAllButton)

}

func setLayout() {

titleLabel.snp.makeConstraints {
$0.bottom.equalToSuperview()
$0.leading.equalToSuperview()
Expand All @@ -73,7 +70,6 @@ private extension BasicHeaderView {
}

func setStyle() {

titleLabel.do {
$0.font = UIFont.pretendard(.subhead3)
$0.textColor = UIColor(resource: .white)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class HeaderCategoryView: UIView {
final class HeaderCategoryView: UIView {

// MARK: - UI Property

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class LiveView: UIView {
final class LiveView: UIView {

// MARK: - UI Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class MovieView: UIView {
final class MovieView: UIView {

// MARK: - UI Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@

import UIKit

class NavigationBarView: UIView {
final class NavigationBarView: UIView {

// MARK: - UI Properties

private let tvingLogoButton = UIButton()

private let profileImage = UIImageView()


// MARK: - Properties




// MARK: - Life Cycles

Expand All @@ -42,13 +38,10 @@ class NavigationBarView: UIView {
private extension NavigationBarView {

func setHierarchy() {

self.addSubviews(tvingLogoButton, profileImage)

}

func setLayout() {

tvingLogoButton.snp.makeConstraints {
$0.top.bottom.equalToSuperview()
$0.leading.equalToSuperview().inset(10)
Expand All @@ -63,7 +56,6 @@ private extension NavigationBarView {
}

func setStyle() {

self.backgroundColor = .clear

tvingLogoButton.do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ protocol PageControlButtonDelegate: AnyObject {
func didTapControlButton(index: Int)
}

class PageControlButtonView: UICollectionReusableView {
final class PageControlButtonView: UICollectionReusableView {

// MARK: - UI Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class ParamountView: UIView {
final class ParamountView: UIView {

// MARK: - UI Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class TVProgramView: UIView {
final class TVProgramView: UIView {

// MARK: - UI Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ final class UnderlineSegmentedControlView: UISegmentedControl {
}

func moveUnderlineView(to index: Int) {

underlineView.backgroundColor = UIColor(resource: .white)

guard let text = self.titleForSegment(at: index),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

class WelcomeViewController: UIViewController {
final class WelcomeViewController: UIViewController {

// MARK: - UI Properties

Expand Down Expand Up @@ -49,7 +49,6 @@ private extension WelcomeViewController {
}

func setLayout() {

logoImageView.snp.makeConstraints {
$0.top.equalToSuperview().inset(60)
$0.leading.trailing.equalToSuperview()
Expand All @@ -70,7 +69,6 @@ private extension WelcomeViewController {
}

func setStyle() {

self.view.backgroundColor = UIColor(resource: .black)
self.navigationController?.navigationBar.isHidden = true

Expand Down

0 comments on commit b3fe999

Please sign in to comment.