Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/#15-on-view
Browse files Browse the repository at this point in the history
  • Loading branch information
yeahzxnn committed Jan 30, 2024
2 parents 51175db + 29bd6a2 commit 193d14b
Show file tree
Hide file tree
Showing 19 changed files with 296 additions and 9 deletions.
38 changes: 37 additions & 1 deletion On_off_iOS/On_off_iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
objects = {

/* Begin PBXBuildFile section */
3584F3AC2B5A5CC7007ACB57 /* (null) in Sources */ = {isa = PBXBuildFile; };
3584F3AE2B5A5FEB007ACB57 /* (null) in Sources */ = {isa = PBXBuildFile; };
35AC0F502B64025300AB0A6B /* TabItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35AC0F4F2B64025300AB0A6B /* TabItem.swift */; };
35AC0F522B64030400AB0A6B /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35AC0F512B64030400AB0A6B /* TabBarController.swift */; };
374FD4932B4268EC00F2E645 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = 374FD4922B4268EC00F2E645 /* RxCocoa */; };
374FD4952B4268EC00F2E645 /* RxRelay in Frameworks */ = {isa = PBXBuildFile; productRef = 374FD4942B4268EC00F2E645 /* RxRelay */; };
374FD4972B4268EC00F2E645 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 374FD4962B4268EC00F2E645 /* RxSwift */; };
Expand Down Expand Up @@ -54,6 +58,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
35AC0F4F2B64025300AB0A6B /* TabItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabItem.swift; sourceTree = "<group>"; };
35AC0F512B64030400AB0A6B /* TabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarController.swift; sourceTree = "<group>"; };
374FD49C2B4281E100F2E645 /* OnboardingCustomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCustomView.swift; sourceTree = "<group>"; };
374FD49E2B42825B00F2E645 /* CustomPageControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomPageControl.swift; sourceTree = "<group>"; };
374FD4A12B4294F100F2E645 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -113,11 +119,36 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
35984F222B63EE8000A5F6F2 /* TabBar */ = {
isa = PBXGroup;
children = (
35AC0F552B64117E00AB0A6B /* Model */,
35AC0F592B6412A600AB0A6B /* View */,
);
path = TabBar;
sourceTree = "<group>";
};
35AC0F552B64117E00AB0A6B /* Model */ = {
isa = PBXGroup;
children = (
35AC0F4F2B64025300AB0A6B /* TabItem.swift */,
);
path = Model;
sourceTree = "<group>";
};
35AC0F592B6412A600AB0A6B /* View */ = {
isa = PBXGroup;
children = (
35AC0F512B64030400AB0A6B /* TabBarController.swift */,
);
path = View;
sourceTree = "<group>";
};
374FD49B2B4281CA00F2E645 /* OnBoarding */ = {
isa = PBXGroup;
children = (
3787D00D2B42A85900F054DD /* Model */,
3787D00B2B42A84100F054DD /* View */,
3787D00D2B42A85900F054DD /* Model */,
3787D00C2B42A84900F054DD /* ViewModel */,
);
path = OnBoarding;
Expand Down Expand Up @@ -348,6 +379,7 @@
3B42300C2B41572200D0B038 /* On_off_iOS */ = {
isa = PBXGroup;
children = (
35984F222B63EE8000A5F6F2 /* TabBar */,
3B0129C12B623BA900B191AD /* Home */,
3B9C89CF2B4AED640083CF44 /* Statistics */,
3769A6842B58561D00D79C33 /* SelectTime */,
Expand Down Expand Up @@ -528,15 +560,19 @@
3B0129CC2B624D6000B191AD /* Home.swift in Sources */,
374FD49D2B4281E100F2E645 /* OnboardingCustomView.swift in Sources */,
3BB806D82B5024BC00555E58 /* MonthStatistics.swift in Sources */,
3584F3AE2B5A5FEB007ACB57 /* (null) in Sources */,
3BB806D32B5021BC00555E58 /* StatisticsViewModel.swift in Sources */,
3B0129C82B6246E900B191AD /* Ext + UIImage.swift in Sources */,
3B4230102B41572200D0B038 /* SceneDelegate.swift in Sources */,
3584F3AC2B5A5CC7007ACB57 /* (null) in Sources */,
378140632B42F07A00F2AA5A /* ProfileSettingViewController.swift in Sources */,
3B0129C32B623BB900B191AD /* HomeViewController.swift in Sources */,
3787D0112B42E0B100F054DD /* LoginViewModel.swift in Sources */,
3787D00A2B429F1700F054DD /* LaunchViewController.swift in Sources */,
3BD552682B58FCF70043920E /* CalendarCell.swift in Sources */,
35AC0F522B64030400AB0A6B /* TabBarController.swift in Sources */,
3BD552662B58FA8C0043920E /* RateFillView.swift in Sources */,
35AC0F502B64025300AB0A6B /* TabItem.swift in Sources */,
3BD5526A2B5914B10043920E /* CalendarStatistics.swift in Sources */,
3B9C89D12B4AED7C0083CF44 /* StatisticsViewController.swift in Sources */,
3B0129C62B6242F800B191AD /* Ext + ViewController.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"pins" : [
{
"identity" : "lottie-ios",
"identity" : "fscalendar",
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-ios.git",
"location" : "https://github.com/WenchaoD/FSCalendar.git",
"state" : {
"revision" : "3f1202f254ad5d71f6c5b518ed2d6b9e2abe6969",
"version" : "4.3.4"
"revision" : "0fbdec5172fccb90f707472eeaea4ffe095278f6",
"version" : "2.8.4"
}
},
{
"identity" : "fscalendar",
"identity" : "lottie-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/WenchaoD/FSCalendar.git",
"location" : "https://github.com/airbnb/lottie-ios.git",
"state" : {
"revision" : "0fbdec5172fccb90f707472eeaea4ffe095278f6",
"version" : "2.8.4"
"revision" : "3f1202f254ad5d71f6c5b518ed2d6b9e2abe6969",
"version" : "4.3.4"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "logo-2.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "hometapped.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "homeuntapped.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "mypagetapped.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "mypageuntapped.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "statisticstapped.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "statisticsuntapped.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions On_off_iOS/On_off_iOS/TabBar/Model/TabItem.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// TabItem.swift
// On_off_iOS
//
// Created by 신예진 on 1/27/24.
//

import Foundation
import UIKit
import SnapKit

enum TabItem: Int, CaseIterable {
case statistics
case home
case my
//탭 안 눌렀을 때의 이미지
var normalImage: UIImage? {
switch self {
case .statistics:
return UIImage(named: "statisticsuntapped")
case .home:
return UIImage(named: "homeuntapped")
case .my:
return UIImage(named: "mypageuntapped")
}
}
//탭 눌렀을 때의 이미지
var selectedImage: UIImage? {
switch self {
case .statistics:
return UIImage(named: "statisticstapped")
case .home:
return UIImage(named: "hometapped")
case .my:
return UIImage(named: "mypagetapped")
}
}
}
60 changes: 60 additions & 0 deletions On_off_iOS/On_off_iOS/TabBar/View/TabBarController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// TabBarController.swift
// On_off_iOS
//
// Created by 신예진 on 1/27/24.
//

import Foundation
import UIKit
import SnapKit

final class TabBarController: UITabBarController {

override func viewDidLoad() {
super.viewDidLoad()
// 탭 바 커스텀 설정 및 뷰 컨트롤러 설정 초기화
configureTabBar()
setupViewControllers()
}

private func setupViewControllers() {
// 탭 바에 표시할 뷰 컨트롤러들 생성
let statisticsVC = createViewController(for: .statistics)
let homeVC = createViewController(for: .home)
let myVC = createViewController(for: .my)

// 뷰 컨트롤러 배열 설정
viewControllers = [statisticsVC, homeVC, myVC]

}

private func createViewController(for tabItem: TabItem) -> UIViewController {
var viewController: UIViewController

switch tabItem {
case .statistics:
viewController = StatisticsViewController()
case .home:
viewController = HomeViewController()
case .my:
viewController = StatisticsViewController()
}

// 탭 바 아이템 설정
viewController.tabBarItem = UITabBarItem(
title: nil,
image: tabItem.normalImage?.withRenderingMode(.alwaysOriginal),
selectedImage: tabItem.selectedImage?.withRenderingMode(.alwaysOriginal)
)

return viewController
}

private func configureTabBar() {
// 탭 바의 색 및 기타 속성 설정
tabBar.tintColor = .label
tabBar.layer.masksToBounds = true
tabBar.backgroundColor = .white
}
}

0 comments on commit 193d14b

Please sign in to comment.