-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feat/#15-on-view
- Loading branch information
Showing
19 changed files
with
296 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
On_off_iOS/On_off_iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
On_off_iOS/On_off_iOS/Assets/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
Binary file added
BIN
+48.5 KB
On_off_iOS/On_off_iOS/Assets/Assets.xcassets/AppIcon.appiconset/logo-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions
6
On_off_iOS/On_off_iOS/Assets/Assets.xcassets/TabBar/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
On_off_iOS/On_off_iOS/Assets/Assets.xcassets/TabBar/hometapped.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...iOS/On_off_iOS/Assets/Assets.xcassets/TabBar/hometapped.imageset/hometapped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
On_off_iOS/On_off_iOS/Assets/Assets.xcassets/TabBar/homeuntapped.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...On_off_iOS/Assets/Assets.xcassets/TabBar/homeuntapped.imageset/homeuntapped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
On_off_iOS/On_off_iOS/Assets/Assets.xcassets/TabBar/mypagetapped.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...On_off_iOS/Assets/Assets.xcassets/TabBar/mypagetapped.imageset/mypagetapped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
On_off_iOS/On_off_iOS/Assets/Assets.xcassets/TabBar/mypageuntapped.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...ff_iOS/Assets/Assets.xcassets/TabBar/mypageuntapped.imageset/mypageuntapped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
On_off_iOS/On_off_iOS/Assets/Assets.xcassets/TabBar/statisticstapped.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...OS/Assets/Assets.xcassets/TabBar/statisticstapped.imageset/statisticstapped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...ff_iOS/On_off_iOS/Assets/Assets.xcassets/TabBar/statisticsuntapped.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...ssets/Assets.xcassets/TabBar/statisticsuntapped.imageset/statisticsuntapped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |