diff --git a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/FriendProfileView.swift b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/FriendProfileView.swift index dd436df3..4cb6e5b8 100644 --- a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/FriendProfileView.swift +++ b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/FriendProfileView.swift @@ -26,8 +26,6 @@ final class FriendProfileView: BaseView { // MARK: - Variables // MARK: Component weak var handleBottomSheetButtonDelegate: HandleBottomSheetButtonDelegate? - - // var indexNumber: Int = -1 weak var handleDeleteFriendButtonDelegate: HandleDeleteFriendButtonDelegate? private let profileImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 72.adjusted, height: 72.adjusted)) diff --git a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/MyProfileHeaderView.swift b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/MyProfileHeaderView.swift index 1ced828e..97d67bf9 100644 --- a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/MyProfileHeaderView.swift +++ b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/MyProfileHeaderView.swift @@ -83,7 +83,6 @@ extension MyProfileHeaderView { self.friendCountView.friendCountLabel.text = String(data.friendCount) + "명" self.friendCountView.friendCountLabel.asColor(targetString: "명", color: .grayscales500) - Amplitude.instance().setUserProperties(["user_friends": data.friendCount, "user_message_received": data.yelloCount, "user_name": data.name]) diff --git a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/MyProfileView.swift b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/MyProfileView.swift index 600e47a7..01316073 100644 --- a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/MyProfileView.swift +++ b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/MyProfileView.swift @@ -11,12 +11,11 @@ import Amplitude import SnapKit import Then -final class MyProfileView: UIView { +final class MyProfileView: BaseView { // MARK: - Variables // MARK: Component let mainProfileView = UIView() - let profileImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 48 .adjusted, height: 48.adjusted)) let profileStarGradientView = UIView(frame: CGRect(x: 0, y: 0, width: 344.adjusted, height: 6.adjustedHeight)) @@ -33,7 +32,6 @@ final class MyProfileView: UIView { private let addGroupButton = UIButton(frame: CGRect(x: 0, y: 0, width: 129.adjustedWidth, height: 48.adjustedHeight)) lazy var shopButton = UIButton(frame: CGRect(x: 0, y: 0, width: 202.adjustedWidth, height: 44.adjustedHeight)) let shopBackgroundView = UIView(frame: CGRect(x: 0, y: 0, width: 206.adjustedWidth, height: 48.adjustedHeight)) - let nameSkeletonLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 66.adjustedWidth, height: 16.adjustedHeight)) let schoolSkeletonLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 66.adjustedWidth, height: 16.adjustedHeight)) @@ -44,29 +42,8 @@ final class MyProfileView: UIView { } } - // MARK: - Function - // MARK: LifeCycle - override init(frame: CGRect) { - super.init(frame: frame) - setUI() - } - - @available(*, unavailable) - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} - -// MARK: - extension -extension MyProfileView { - // MARK: Layout Helpers - private func setUI() { - setStyle() - setLayout() - } - - private func setStyle() { + override func setStyle() { mainProfileView.do { $0.backgroundColor = .grayscales900 @@ -171,11 +148,10 @@ extension MyProfileView { $0.makeCornerRound(radius: 2.adjustedHeight) $0.isHidden = true } - updateProfileView() } - private func setLayout() { + override func setLayout() { self.addSubviews( mainProfileView, profileStarGradientView, diff --git a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/NavigationBarView.swift b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/NavigationBarView.swift index e0b01b88..d07053c0 100644 --- a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/NavigationBarView.swift +++ b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/NavigationBarView.swift @@ -15,7 +15,7 @@ protocol NavigationBarViewDelegate: AnyObject { func settingButtonTapped() } -final class NavigationBarView: UIView { +final class NavigationBarView: BaseView { // MARK: - Variables // MARK: Property @@ -25,34 +25,8 @@ final class NavigationBarView: UIView { private let profileLabel = UILabel() lazy var settingButton = UIButton() - // MARK: - Function - // MARK: LifeCycle - override init(frame: CGRect) { - super.init(frame: frame) - setUI() - } - - @available(*, unavailable) - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} - -// MARK: - extension -extension NavigationBarView { - - // MARK: Objc Function - @objc private func settingButtonTapped() { - delegate?.settingButtonTapped() - } - // MARK: Layout Helpers - private func setUI() { - setStyle() - setLayout() - } - - private func setStyle() { + override func setStyle() { self.backgroundColor = .black profileLabel.do { @@ -69,16 +43,10 @@ extension NavigationBarView { } } - private func setLayout() { + override func setLayout() { self.addSubviews(profileLabel, settingButton) - let statusBarHeight = UIApplication.shared.connectedScenes - .compactMap { $0 as? UIWindowScene } - .first? - .statusBarManager? - .statusBarFrame.height ?? 20 - profileLabel.snp.makeConstraints { $0.centerY.equalToSuperview() $0.leading.equalToSuperview().offset(16.adjustedWidth) @@ -91,4 +59,9 @@ extension NavigationBarView { $0.height.equalTo(28.adjustedHeight) } } + + // MARK: Objc Function + @objc private func settingButtonTapped() { + delegate?.settingButtonTapped() + } } diff --git a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/ProfileView.swift b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/ProfileView.swift index 8592bd1e..6ff28fb7 100644 --- a/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/ProfileView.swift +++ b/YELLO-iOS/YELLO-iOS/Presentation/Profile/Main/View/ProfileView.swift @@ -16,7 +16,7 @@ protocol HandleFriendCellDelegate: AnyObject { func presentModal(index: Int) } -final class ProfileView: UIView { +final class ProfileView: BaseView { // MARK: - Variables // MARK: Property @@ -52,26 +52,10 @@ final class ProfileView: 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 ProfileView { - - // MARK: Layout Helpers - private func setUI() { - setStyle() - setLayout() - } - - private func setStyle() { + override func setStyle() { self.backgroundColor = .black refreshControl.do { @@ -105,7 +89,7 @@ extension ProfileView { } } - private func setLayout() { + override func setLayout() { self.addSubviews(navigationBarView, myFriendTableView, topButton)