Skip to content

Commit

Permalink
Refactor [#242] BaseView / BaseVC 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
chaentopia committed Sep 21, 2023
1 parent dd1c44b commit 015dd66
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SnapKit
import Then
import KakaoSDKTalk

final class KakaoFriendView: UIView {
final class KakaoFriendView: BaseView {

// MARK: - Variables
// MARK: Property
Expand All @@ -37,27 +37,16 @@ final class KakaoFriendView: UIView {
// MARK: LifeCycle
override init(frame: CGRect) {
super.init(frame: frame)
setUI()
setDelegate()
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

// MARK: - extension
extension KakaoFriendView {

// MARK: Layout Helpers
private func setUI() {
setStyle()
setLayout()
override func setUI() {
super.setUI()
updateView()
}

private func setStyle() {
override func setStyle() {
self.backgroundColor = .black

inviteBannerView.do {
Expand All @@ -82,7 +71,7 @@ extension KakaoFriendView {
}
}

private func setLayout() {
override func setLayout() {

self.addSubviews(
inviteBannerView,
Expand All @@ -106,6 +95,10 @@ extension KakaoFriendView {
$0.center.equalToSuperview()
}
}
}

// MARK: - extension
extension KakaoFriendView {

private func setDelegate() {
kakaoFriendTableView.dataSource = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SnapKit
import Then

final class SchoolFriendView: UIView {
final class SchoolFriendView: BaseView {

// MARK: - Variables
// MARK: Property
Expand All @@ -36,27 +36,16 @@ final class SchoolFriendView: UIView {
// MARK: LifeCycle
override init(frame: CGRect) {
super.init(frame: frame)
setUI()
setDelegate()
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

// MARK: - extension
extension SchoolFriendView {

// MARK: Layout Helpers
private func setUI() {
setStyle()
setLayout()
override func setUI() {
super.setUI()
updateView()
}

private func setStyle() {
override func setStyle() {
self.backgroundColor = .clear
inviteBannerView.rootViewName = "school"
emptyView.viewControllerName = "schoolFriend"
Expand All @@ -83,7 +72,7 @@ extension SchoolFriendView {
}
}

private func setLayout() {
override func setLayout() {

self.addSubviews(inviteBannerView,
schoolFriendTableView)
Expand All @@ -106,6 +95,10 @@ extension SchoolFriendView {
$0.center.equalToSuperview()
}
}
}

// MARK: - extension
extension SchoolFriendView {

private func setDelegate() {
schoolFriendTableView.dataSource = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Amplitude
import SnapKit
import Then

final class RecommendingViewController: UIViewController {
final class RecommendingViewController: BaseViewController {

// MARK: - Variables
// MARK: Component
Expand Down Expand Up @@ -43,7 +43,6 @@ final class RecommendingViewController: UIViewController {
// MARK: LifeCycle
override func viewDidLoad() {
super.viewDidLoad()
setUI()
setDelegate()
setAddTarget()
setSegmentedControl()
Expand All @@ -55,25 +54,16 @@ final class RecommendingViewController: UIViewController {
self.tabBarController?.tabBar.isHidden = false
self.navigationController?.navigationBar.isHidden = true
}
}

// MARK: - extension
extension RecommendingViewController {

// MARK: Layout Helpers
private func setUI() {
setStyle()
setLayout()
}

private func setStyle() {
override func setStyle() {
view.backgroundColor = .black
pageViewController.do {
$0.setViewControllers([self.dataViewControllers[0]], direction: .forward, animated: true)
}
}

private func setLayout() {
override func setLayout() {
self.navigationController?.navigationBar.isHidden = true

view.addSubviews(
Expand Down Expand Up @@ -105,6 +95,10 @@ extension RecommendingViewController {
$0.bottom.equalToSuperview()
}
}
}

// MARK: - extension
extension RecommendingViewController {

// MARK: Custom Function
private func setDelegate() {
Expand Down

0 comments on commit 015dd66

Please sign in to comment.