diff --git a/Drink-EG/Drink-EG.xcodeproj/project.pbxproj b/Drink-EG/Drink-EG.xcodeproj/project.pbxproj index 7cb8401..ead9e39 100644 --- a/Drink-EG/Drink-EG.xcodeproj/project.pbxproj +++ b/Drink-EG/Drink-EG.xcodeproj/project.pbxproj @@ -78,7 +78,6 @@ 16C19ADE2C73AF6000E93FD0 /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C19ADD2C73AF6000E93FD0 /* UserDefaults.swift */; }; 16C19AE12C74423300E93FD0 /* SwiftyToaster in Frameworks */ = {isa = PBXBuildFile; productRef = 16C19AE02C74423300E93FD0 /* SwiftyToaster */; }; 16C19AE62C74987600E93FD0 /* YouTubeiOSPlayerHelper in Frameworks */ = {isa = PBXBuildFile; productRef = 16C19AE52C74987600E93FD0 /* YouTubeiOSPlayerHelper */; }; - 16C19B0B2C7DA80C00E93FD0 /* Realm in Frameworks */ = {isa = PBXBuildFile; productRef = 16C19B0A2C7DA80C00E93FD0 /* Realm */; }; 16C19B0D2C7DA80C00E93FD0 /* RealmSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 16C19B0C2C7DA80C00E93FD0 /* RealmSwift */; }; 16C19B102C7DB73200E93FD0 /* Then in Frameworks */ = {isa = PBXBuildFile; productRef = 16C19B0F2C7DB73200E93FD0 /* Then */; }; 16C19B162C7DB88100E93FD0 /* Note.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C19B152C7DB88100E93FD0 /* Note.swift */; }; @@ -125,6 +124,8 @@ 1FBD19532C6CFABB005C16A8 /* WineShopListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FBD19522C6CFABB005C16A8 /* WineShopListCollectionViewCell.swift */; }; 1FBD19552C6D2BF7005C16A8 /* ReviewListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FBD19542C6D2BF7005C16A8 /* ReviewListViewController.swift */; }; 1FBD19572C6DDBAB005C16A8 /* ReviewListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FBD19562C6DDBAB005C16A8 /* ReviewListCollectionViewCell.swift */; }; + 1FC522272CA91ED000EC0635 /* TabBarShadow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FC522262CA91ED000EC0635 /* TabBarShadow.swift */; }; + 1FC522292CA933FC00EC0635 /* MenuCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FC522282CA933FC00EC0635 /* MenuCollectionViewCell.swift */; }; 5E22192D2C69D592005849FB /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5E2219242C69D592005849FB /* Pretendard-Bold.otf */; }; 5E22192E2C69D592005849FB /* Pretendard-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5E2219252C69D592005849FB /* Pretendard-Black.otf */; }; 5E22192F2C69D592005849FB /* Pretendard-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5E2219262C69D592005849FB /* Pretendard-Regular.otf */; }; @@ -293,6 +294,8 @@ 1FBD19522C6CFABB005C16A8 /* WineShopListCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WineShopListCollectionViewCell.swift; sourceTree = ""; }; 1FBD19542C6D2BF7005C16A8 /* ReviewListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewListViewController.swift; sourceTree = ""; }; 1FBD19562C6DDBAB005C16A8 /* ReviewListCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewListCollectionViewCell.swift; sourceTree = ""; }; + 1FC522262CA91ED000EC0635 /* TabBarShadow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarShadow.swift; sourceTree = ""; }; + 1FC522282CA933FC00EC0635 /* MenuCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuCollectionViewCell.swift; sourceTree = ""; }; 5E2219242C69D592005849FB /* Pretendard-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Bold.otf"; sourceTree = ""; }; 5E2219252C69D592005849FB /* Pretendard-Black.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Black.otf"; sourceTree = ""; }; 5E2219262C69D592005849FB /* Pretendard-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Regular.otf"; sourceTree = ""; }; @@ -333,7 +336,6 @@ buildActionMask = 2147483647; files = ( 16C19B0D2C7DA80C00E93FD0 /* RealmSwift in Frameworks */, - 16C19B0B2C7DA80C00E93FD0 /* Realm in Frameworks */, 164A0A132CA3AED700504BF1 /* SDWebImageMapKit in Frameworks */, 5E2219712C6B5B5B005849FB /* Cosmos in Frameworks */, 5E22195E2C69DDB5005849FB /* SnapKit in Frameworks */, @@ -475,6 +477,7 @@ 16C19AD12C73AE0200E93FD0 /* UIView.swift */, 16C19ADD2C73AF6000E93FD0 /* UserDefaults.swift */, 5E42B0172C74A39300DAB751 /* MovingTextField.swift */, + 1FC522262CA91ED000EC0635 /* TabBarShadow.swift */, ); path = Extensions; sourceTree = ""; @@ -669,6 +672,7 @@ 1F598F022C581A7D000CE79F /* StartLoginCollectionViewCell.swift */, 1F598EEB2C524D2E000CE79F /* RecomCollectionViewCell.swift */, 1F205A302C68BB5200E80659 /* CartListCollectionViewCell.swift */, + 1FC522282CA933FC00EC0635 /* MenuCollectionViewCell.swift */, ); path = Main; sourceTree = ""; @@ -865,7 +869,6 @@ 5E2219702C6B5B5B005849FB /* Cosmos */, 16C19AE02C74423300E93FD0 /* SwiftyToaster */, 16C19AE52C74987600E93FD0 /* YouTubeiOSPlayerHelper */, - 16C19B0A2C7DA80C00E93FD0 /* Realm */, 16C19B0C2C7DA80C00E93FD0 /* RealmSwift */, 16C19B0F2C7DB73200E93FD0 /* Then */, 164A0A102CA3AED700504BF1 /* SDWebImage */, @@ -965,6 +968,7 @@ 16752F9D2C5A7FB90001907D /* HexCode.swift in Sources */, 1F598F0B2C5CBD9E000CE79F /* EnterTasteTestViewController.swift in Sources */, 1F8F99FA2C6F538300EAEF6C /* WineInfoResponse.swift in Sources */, + 1FC522272CA91ED000EC0635 /* TabBarShadow.swift in Sources */, 5E22196E2C6B2EA0005849FB /* RatingViewController.swift in Sources */, 1F205A432C6B66EB00E80659 /* TasteTestThirdCollectionViewCell.swift in Sources */, 1F8FECB32C74777B00704491 /* WineLikeRequest.swift in Sources */, @@ -974,6 +978,7 @@ 5E23147F2C5901BB004E2013 /* (null) in Sources */, 16B97D162C4C0F6400D8B453 /* SavingVideoViewController.swift in Sources */, 165400F82C69EFBD008A9DBF /* WineNewsResponse.swift in Sources */, + 1FC522292CA933FC00EC0635 /* MenuCollectionViewCell.swift in Sources */, 165400E92C69DDCB008A9DBF /* WineClassAPI.swift in Sources */, 1F598EEA2C5227C5000CE79F /* AdImageCollectionViewCell.swift in Sources */, 1F205A412C6B540600E80659 /* TasteTestSecondCollectionViewCell.swift in Sources */, @@ -1405,11 +1410,6 @@ package = 16C19AE42C74987600E93FD0 /* XCRemoteSwiftPackageReference "youtube-ios-player-helper" */; productName = YouTubeiOSPlayerHelper; }; - 16C19B0A2C7DA80C00E93FD0 /* Realm */ = { - isa = XCSwiftPackageProductDependency; - package = 16C19B092C7DA80C00E93FD0 /* XCRemoteSwiftPackageReference "realm-swift" */; - productName = Realm; - }; 16C19B0C2C7DA80C00E93FD0 /* RealmSwift */ = { isa = XCSwiftPackageProductDependency; package = 16C19B092C7DA80C00E93FD0 /* XCRemoteSwiftPackageReference "realm-swift" */; diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415.png index a30d891..3a64e60 100644 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415.png and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415@2x.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415@2x.png index 81f1452..12eebaf 100644 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415@2x.png and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415@2x.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415@3x.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415@3x.png index 5d4ac83..d324403 100644 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415@3x.png and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad1.imageset/Group 415@3x.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/Contents.json b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/Contents.json index a23deba..862be47 100644 --- a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/Contents.json +++ b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "자막 중.png", + "filename" : "자막 중.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "자막 중@2x.png", + "filename" : "자막 중@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "자막 중@3x.png", + "filename" : "자막 중@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git "a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221.png" "b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221.png" index 57f74aa..68dc525 100644 Binary files "a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221.png" and "b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221.png" differ diff --git "a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221@2x.png" "b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221@2x.png" index d680a82..6d1f823 100644 Binary files "a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221@2x.png" and "b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221@2x.png" differ diff --git "a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221@3x.png" "b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221@3x.png" index e087621..caf16d2 100644 Binary files "a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221@3x.png" and "b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad2.imageset/\354\236\220\353\247\211 \354\244\221@3x.png" differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416.png index db5a79a..68302b8 100644 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416.png and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416@2x.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416@2x.png index 44deb71..98c9db9 100644 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416@2x.png and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416@2x.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416@3x.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416@3x.png index 8c9eda4..cfd8f65 100644 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416@3x.png and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/AdSampleImage/ad3.imageset/Group 416@3x.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/Contents.json b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/Contents.json index 6ac9326..b59c79f 100644 --- a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/Contents.json +++ b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "ion_search.png", + "filename" : "search.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "ion_search (1).png", + "filename" : "search@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "ion_search (2).png", + "filename" : "search@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search (1).png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search (1).png deleted file mode 100644 index c95e8a3..0000000 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search (1).png and /dev/null differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search (2).png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search (2).png deleted file mode 100644 index ccef65a..0000000 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search (2).png and /dev/null differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search.png deleted file mode 100644 index d7bfd42..0000000 Binary files a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/ion_search.png and /dev/null differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search.png new file mode 100644 index 0000000..2a40ea2 Binary files /dev/null and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search@2x.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search@2x.png new file mode 100644 index 0000000..988370d Binary files /dev/null and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search@2x.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search@3x.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search@3x.png new file mode 100644 index 0000000..38b5c9d Binary files /dev/null and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/Icon/icon_search.imageset/search@3x.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Contents.json b/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Contents.json new file mode 100644 index 0000000..9d2cdce --- /dev/null +++ b/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Rectangle 261.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rectangle 261@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rectangle 261@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261.png new file mode 100644 index 0000000..ae3ffee Binary files /dev/null and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261@2x.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261@2x.png new file mode 100644 index 0000000..69f284a Binary files /dev/null and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261@2x.png differ diff --git a/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261@3x.png b/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261@3x.png new file mode 100644 index 0000000..81c4b0b Binary files /dev/null and b/Drink-EG/Drink-EG/Resources/Assets.xcassets/logoSample.imageset/Rectangle 261@3x.png differ diff --git a/Drink-EG/Drink-EG/Resources/Extensions/TabBarShadow.swift b/Drink-EG/Drink-EG/Resources/Extensions/TabBarShadow.swift new file mode 100644 index 0000000..40a3bb8 --- /dev/null +++ b/Drink-EG/Drink-EG/Resources/Extensions/TabBarShadow.swift @@ -0,0 +1,34 @@ +// +// TabBarShadow.swift +// Drink-EG +// +// Created by 이현주 on 9/29/24. +// + +import Foundation +import UIKit + +extension CALayer { + // Sketch 스타일의 그림자를 생성하는 유틸리티 함수 + func applyShadow( + color: UIColor = .black, + alpha: Float = 0.5, + x: CGFloat = 0, + y: CGFloat = 2, + blur: CGFloat = 4 + ) { + shadowColor = color.cgColor + shadowOpacity = alpha + shadowOffset = CGSize(width: x, height: y) + shadowRadius = blur / 2.0 + } +} + +extension UITabBar { + // 기본 그림자 스타일을 초기화해야 커스텀 스타일을 적용할 수 있다. + static func clearShadow() { + UITabBar.appearance().shadowImage = UIImage() + UITabBar.appearance().backgroundImage = UIImage() + UITabBar.appearance().backgroundColor = UIColor.white + } +} diff --git a/Drink-EG/Drink-EG/Resources/SceneDelegate.swift b/Drink-EG/Drink-EG/Resources/SceneDelegate.swift index dbe1d33..0c0ec5c 100644 --- a/Drink-EG/Drink-EG/Resources/SceneDelegate.swift +++ b/Drink-EG/Drink-EG/Resources/SceneDelegate.swift @@ -20,7 +20,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // 화면을 구성하는 UIWindow 인스턴스 생성 let window = UIWindow(windowScene: windowScene) // 실제 첫 화면이 되는 MainViewController 인스턴스 생성 - let vc = EnterLoginViewController() + let vc = LoginViewController() // NavigationController을 사용할 경우, MainViewController를 rootViewController로 갖는 NavigationController을 생성해야한다. let navigationController = UINavigationController(rootViewController: vc) navigationController.isNavigationBarHidden = true diff --git a/Drink-EG/Drink-EG/Sources/Cells/Main/AdImageCollectionViewCell.swift b/Drink-EG/Drink-EG/Sources/Cells/Main/AdImageCollectionViewCell.swift index 34b6fec..b1ef17d 100644 --- a/Drink-EG/Drink-EG/Sources/Cells/Main/AdImageCollectionViewCell.swift +++ b/Drink-EG/Drink-EG/Sources/Cells/Main/AdImageCollectionViewCell.swift @@ -25,8 +25,6 @@ class AdImageCollectionViewCell : UICollectionViewCell { private func setupUI() { self.contentView.addSubview(imageView) - self.contentView.layer.cornerRadius = 16 - self.contentView.layer.masksToBounds = true imageView.snp.makeConstraints { make in make.edges.equalToSuperview() diff --git a/Drink-EG/Drink-EG/Sources/Cells/Main/MenuCollectionViewCell.swift b/Drink-EG/Drink-EG/Sources/Cells/Main/MenuCollectionViewCell.swift new file mode 100644 index 0000000..831299e --- /dev/null +++ b/Drink-EG/Drink-EG/Sources/Cells/Main/MenuCollectionViewCell.swift @@ -0,0 +1,58 @@ +// +// MenuCollectionViewCell.swift +// Drink-EG +// +// Created by 이현주 on 9/29/24. +// + +import UIKit + +class MenuCollectionViewCell: UICollectionViewCell { + + private let menuImage: UIImageView = { + let iv = UIImageView() + iv.backgroundColor = UIColor(hex: "D9D9D9") + return iv + }() + + private let menuName: UILabel = { + let l1 = UILabel() + l1.font = .systemFont(ofSize: 12, weight: .regular) + l1.textColor = .black + l1.textAlignment = .center + //l1.numberOfLines = 2 + return l1 + }() + + override init(frame: CGRect) { + super.init(frame: frame) + + setupUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //레이아웃까지 + private func setupUI() { + self.contentView.addSubview(menuImage) + self.contentView.addSubview(menuName) + self.contentView.layer.cornerRadius = 5 + self.contentView.layer.masksToBounds = true + + + menuImage.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + menuName.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(5) + make.bottom.equalToSuperview().inset(2) + } + } + + func configure(name: String) { + menuName.text = name + } +} diff --git a/Drink-EG/Drink-EG/Sources/Cells/Main/RecomCollectionViewCell.swift b/Drink-EG/Drink-EG/Sources/Cells/Main/RecomCollectionViewCell.swift index e084fb8..e63c140 100644 --- a/Drink-EG/Drink-EG/Sources/Cells/Main/RecomCollectionViewCell.swift +++ b/Drink-EG/Drink-EG/Sources/Cells/Main/RecomCollectionViewCell.swift @@ -20,7 +20,7 @@ class RecomCollectionViewCell: UICollectionViewCell { private let label1: UILabel = { let l1 = UILabel() l1.font = .systemFont(ofSize: 13, weight: .bold) - l1.textColor = .black + l1.textColor = .white l1.numberOfLines = 2 //l1.adjustsFontSizeToFitWidth = true l1.lineBreakMode = .byTruncatingTail // 생략 부호(...)가 꼬리에 위치하도록 설정 @@ -29,7 +29,7 @@ class RecomCollectionViewCell: UICollectionViewCell { private let view: UIView = { let v = UIView() - v.backgroundColor = UIColor(hue: 0.0417, saturation: 0.19, brightness: 1, alpha: 0.7) + v.backgroundColor = UIColor(hue: 0.7389, saturation: 0.89, brightness: 0.69, alpha: 0.7) return v }() diff --git a/Drink-EG/Drink-EG/Sources/VCs/Main/HomeViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/Main/HomeViewController.swift index 36f6cad..eca363f 100644 --- a/Drink-EG/Drink-EG/Sources/VCs/Main/HomeViewController.swift +++ b/Drink-EG/Drink-EG/Sources/VCs/Main/HomeViewController.swift @@ -20,6 +20,7 @@ class HomeViewController: UIViewController { private var AdContents: [String] = ["ad1", "ad2", "ad3"] private var AdLinks: [String] = ["https://www.instagram.com/drinkeg.official?igsh=eGoyYzkxNmh5bXR5","https://www.7-eleven.co.kr/event/eventList.asp", "https://github.com/Drink-Easy/moblie-iOS-native"] private var RecomContents: [RecommendWineResponse] = [] + private var MenuContents: [String] = ["어플 가이드", "콜키지 프리", "위시 리스트", "인기 와인"] var name: String = "" var selectedWine: String? @@ -39,41 +40,22 @@ class HomeViewController: UIViewController { return contentView }() - let searchButton = UIButton(type: .system) - let cartButton = UIButton(type: .system) - let goToNoteButton = UIButton(type: .system) - let firstLine = UILabel() - let NoteLabel = UILabel() - - lazy var badgeLabel: UILabel = { - let label = UILabel(frame: CGRect(x: 0, y: 0, width: 16, height: 16)) - label.translatesAutoresizingMaskIntoConstraints = false - label.layer.cornerRadius = label.bounds.size.height / 2 - label.textAlignment = .center - label.layer.masksToBounds = true - label.textColor = .white - label.font = .boldSystemFont(ofSize: 10) - label.backgroundColor = UIColor(hex: "FF7A6D") - return label + private let logoView: UIImageView = { + let i = UIImageView() + i.image = UIImage(named: "logoSample") + return i + }() + let searchButton: UIButton = { + let b = UIButton() + b.setImage(UIImage(named: "icon_search"), for: .normal) + return b }() + let firstLine = UILabel() - private func showBadge() { - badgeLabel.text = "\(shoppingListManager.myCartWines.count)" - - // 장바구니가 비어 있는지 확인 - if shoppingListManager.myCartWines.isEmpty { - // 장바구니가 비어 있으면 badgeLabel을 cartButton에서 제거 - badgeLabel.removeFromSuperview() - } else { - // 장바구니에 아이템이 있으면 badgeLabel을 cartButton에 추가 - if badgeLabel.superview == nil { - cartButton.addSubview(badgeLabel) - } - badgeLabel.snp.makeConstraints { make in - make.centerX.equalTo(cartButton.snp.centerX).offset(10) - make.top.equalTo(cartButton).inset(2) - make.width.height.equalTo(16) - } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + if let navigationController = self.navigationController { + navigationController.setNavigationBarHidden(true, animated: false) } } @@ -92,100 +74,38 @@ class HomeViewController: UIViewController { Toaster.shared.makeToast("503 Service Unavailable", .short) } } - - // 버튼 하단에 붉은색으로 칠하는 layer 추가 - let Layer = CALayer() - Layer.name = "redLayer" // 레이어 식별용 이름 설정 - Layer.backgroundColor = UIColor(hue: 0.0417, saturation: 0.19, brightness: 1, alpha: 0.8).cgColor - goToNoteButton.layer.addSublayer(Layer) - - // layer 위에 label 추가 - let titleLabel = UILabel() - titleLabel.text = "테이스팅 노트 작성하기" - titleLabel.textColor = .black - titleLabel.font = UIFont.boldSystemFont(ofSize: 16) - titleLabel.textAlignment = .left - titleLabel.translatesAutoresizingMaskIntoConstraints = false - goToNoteButton.addSubview(titleLabel) - - let goToIcon = UIImageView() - goToIcon.image = UIImage(named: "icon_goTo") - goToNoteButton.addSubview(goToIcon) - - // 초기 레이아웃 설정 - titleLabel.snp.makeConstraints { make in - make.top.equalToSuperview().offset(86) // 초기 위치 (임시 값) - make.leading.equalToSuperview().offset(18) - } - - goToIcon.snp.makeConstraints { make in - make.centerY.equalTo(titleLabel) // 초기 위치 (임시 값) - make.trailing.equalToSuperview().inset(12) - } } - // 홈으로 갈 때마다 쇼핑카트 badge의 상태가 업데이트 - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - // badgeLabel 업데이트 - showBadge() - } - - override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - - // Layer의 크기 및 위치 조정 - if let Layer = goToNoteButton.layer.sublayers?.first(where: { $0.name == "redLayer" }) { - let width = goToNoteButton.frame.width - let height = width * (47.0 / 353.0) - Layer.frame = CGRect(x: 0, y: goToNoteButton.bounds.height - height, width: width, height: height) - } - - // titleLabel의 위치 조정 - if let titleLabel = goToNoteButton.subviews.compactMap({ $0 as? UILabel }).first { - titleLabel.snp.updateConstraints { make in - make.top.equalTo(goToNoteButton.bounds.height - (goToNoteButton.frame.width * (47.0 / 353.0)) + 14) - } + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + if let navigationController = self.navigationController { + navigationController.setNavigationBarHidden(false, animated: false) } } private func setupUI() { - // 검색 버튼 설정 - configureSearchButton() - // 장바구니 버튼 설정 - configureCartButton() // label 설정 configureLabel() - // 노트 바로가기 버튼 설정 - configureNoteButton() - - // StackView 설정 - let stackView = UIStackView(arrangedSubviews: [searchButton, cartButton]) - stackView.axis = .horizontal - stackView.distribution = .fillProportionally - stackView.spacing = 8 - - view.addSubview(stackView) - - // SnapKit을 사용하여 제약 조건 설정 - stackView.snp.makeConstraints { make in + + view.addSubview(logoView) + view.addSubview(searchButton) + + logoView.snp.makeConstraints { make in make.top.equalTo(view.safeAreaLayoutGuide.snp.top) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(20) - make.height.greaterThanOrEqualTo(34) + make.leading.equalTo(view.safeAreaLayoutGuide).offset(20) + make.height.greaterThanOrEqualTo(33) } searchButton.snp.makeConstraints { make in - make.width.equalToSuperview().multipliedBy(0.88) - } - - cartButton.snp.makeConstraints { make in - make.width.equalToSuperview().multipliedBy(0.12) + make.top.equalTo(view.safeAreaLayoutGuide.snp.top) + make.trailing.equalTo(view.safeAreaLayoutGuide).inset(25) + make.centerY.equalTo(logoView) } view.addSubview(scrollView) scrollView.snp.makeConstraints { make in - make.top.equalTo(stackView.snp.bottom).offset(10) + make.top.equalTo(logoView.snp.bottom).offset(15) make.leading.trailing.equalToSuperview() make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom) } @@ -202,45 +122,39 @@ class HomeViewController: UIViewController { contentView.addSubview(pageControl) AdImageCollectionView.snp.makeConstraints { make in - make.top.equalTo(contentView.snp.top).offset(10) + make.top.equalToSuperview().offset(1) make.centerX.equalToSuperview() - make.leading.trailing.equalTo(stackView) - make.height.equalTo(AdImageCollectionView.snp.width).multipliedBy(247.0/356.0) + make.leading.trailing.equalTo(view) + make.height.equalTo(AdImageCollectionView.snp.width).multipliedBy(326.0/390.0) } pageControl.snp.makeConstraints { make in - make.top.equalTo(AdImageCollectionView.snp.bottom).offset(8) + make.top.equalTo(AdImageCollectionView.snp.bottom).offset(-27) make.centerX.equalTo(view.safeAreaLayoutGuide) } + contentView.addSubview(MenuCollectionView) + + MenuCollectionView.snp.makeConstraints { make in + make.top.equalTo(AdImageCollectionView.snp.bottom).offset(34) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(32.5) + make.height.greaterThanOrEqualTo(70) + } + contentView.addSubview(firstLine) - firstLine.snp.makeConstraints {make in - make.top.equalTo(pageControl.snp.bottom).offset(12) - make.leading.equalTo(AdImageCollectionView) + firstLine.snp.makeConstraints {make in + make.top.equalTo(MenuCollectionView.snp.bottom).offset(33) + make.leading.equalTo(view.safeAreaLayoutGuide).offset(21) } contentView.addSubview(RecomCollectionView) RecomCollectionView.snp.makeConstraints { make in - make.top.equalTo(firstLine.snp.bottom).offset(13) + make.top.equalTo(firstLine.snp.bottom).offset(8) make.centerX.equalTo(view.safeAreaLayoutGuide) - make.leading.trailing.equalTo(AdImageCollectionView) + make.leading.trailing.equalTo(firstLine).offset(-5) make.height.greaterThanOrEqualTo(166) - - } - - contentView.addSubview(NoteLabel) - NoteLabel.snp.makeConstraints { make in - make.top.equalTo(RecomCollectionView.snp.bottom).offset(35) - make.leading.equalTo(view.safeAreaLayoutGuide).offset(23) - } - - contentView.addSubview(goToNoteButton) - goToNoteButton.snp.makeConstraints { make in - make.top.equalTo(NoteLabel.snp.bottom).offset(20) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(23) - make.height.equalTo(AdImageCollectionView.snp.width).multipliedBy(119.0/353.0) make.bottom.equalToSuperview().inset(20) } @@ -248,86 +162,15 @@ class HomeViewController: UIViewController { make.bottom.equalToSuperview().inset(20) } } - - private func configureSearchButton() { - searchButton.setTitle(" 관심있는 와인을 검색해 보세요!", for: .normal) - searchButton.setTitleColor(UIColor(hue: 0, saturation: 0, brightness: 0.45, alpha: 1.0), for: .normal) - searchButton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 12) - searchButton.contentHorizontalAlignment = .left - searchButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 17, bottom: 0, right: 0) - - // 검색 버튼의 레이아웃 설정 - searchButton.backgroundColor = UIColor(hue: 0/360, saturation: 0/100, brightness: 89/100, alpha: 1.0) - searchButton.layer.cornerRadius = 8 - searchButton.layer.masksToBounds = true - searchButton.layer.borderWidth = 0 - - // 돋보기 이미지 설정 - searchButton.setImage(UIImage(named: "icon_search"), for: .normal) - searchButton.tintColor = UIColor(hue: 0, saturation: 0, brightness: 0.4, alpha: 1.0) - searchButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 0) - - // 버튼 액션 추가 - searchButton.addTarget(self, action: #selector(searchButtonTapped), for: .touchUpInside) - } - - private func configureCartButton() { - cartButton.setTitle("", for: .normal) - - // 장바구니 이미지 설정 - let cartImage = UIImage(named: "icon_cart") - cartButton.setImage(cartImage, for: .normal) - cartButton.tintColor = UIColor(hue: 0, saturation: 0, brightness: 0.4, alpha: 1.0) - - // 장바구니 버튼의 레이아웃 설정 - cartButton.backgroundColor = .clear // 배경색 제거 - cartButton.layer.cornerRadius = 0 // 모서리 반경 제거 - cartButton.layer.borderWidth = 0 // 테두리 제거 - - // 버튼 액션 추가 - cartButton.addTarget(self, action: #selector(cartButtonTapped), for: .touchUpInside) - } - - @objc private func searchButtonTapped() { - let searchHomeViewController = SearchHomeViewController() - navigationController?.pushViewController(searchHomeViewController, animated: true) - } - - @objc private func cartButtonTapped() { - let shoppingCartListViewController = ShoppingCartListViewController() - navigationController?.pushViewController(shoppingCartListViewController, animated: true) - } - + private func configureLabel() { firstLine.text = "\(name) 님이 좋아할 만한 와인" - firstLine.font = UIFont.systemFont(ofSize: 18, weight: .bold) + firstLine.font = UIFont.systemFont(ofSize: 24, weight: .bold) guard let text = self.firstLine.text else { return } let attributedStr = NSMutableAttributedString(string: text) - attributedStr.addAttribute(.font, value: UIFont.systemFont(ofSize: 24, weight: .bold), range: (text as NSString).range(of: "\(name)")) + attributedStr.addAttribute(.foregroundColor, value: UIColor(hex: "7E13B1") ?? .black, range: (text as NSString).range(of: "\(name)")) self.firstLine.attributedText = attributedStr - - NoteLabel.text = "테이스팅 노트" - NoteLabel.font = UIFont.systemFont(ofSize: 22, weight: .bold) - } - - private func configureNoteButton() { - goToNoteButton.backgroundColor = UIColor(hue: 0/360, saturation: 0/100, brightness: 89/100, alpha: 1.0) - goToNoteButton.layer.cornerRadius = 10 - goToNoteButton.layer.masksToBounds = true - goToNoteButton.layer.borderWidth = 0 - - goToNoteButton.setImage(UIImage(named: "HomeGoToTastingNote")?.withRenderingMode(.alwaysOriginal), for: .normal) - goToNoteButton.contentVerticalAlignment = .fill - goToNoteButton.contentHorizontalAlignment = .fill - - goToNoteButton.addTarget(self, action: #selector(noteButtonTapped), for: .touchUpInside) - - } - - @objc private func noteButtonTapped() { - let addNewNoteViewController = AddNewNoteViewController() - navigationController?.pushViewController(addNewNoteViewController, animated: true) } lazy var AdImageCollectionView: UICollectionView = { @@ -351,7 +194,6 @@ class HomeViewController: UIViewController { // UI setting cv.backgroundColor = .clear - cv.layer.cornerRadius = 16 cv.layer.shadowOpacity = 0.3 cv.layer.shadowColor = UIColor.black.cgColor cv.layer.shadowOffset = CGSize(width: 0, height: 2) @@ -364,7 +206,7 @@ class HomeViewController: UIViewController { lazy var pageControl: UIPageControl = { let p = UIPageControl() p.pageIndicatorTintColor = UIColor(hex: "#D9D9D9") - p.currentPageIndicatorTintColor = UIColor(hex: "#FF7A6D") + p.currentPageIndicatorTintColor = UIColor(hex: "#5813B1") return p }() @@ -384,7 +226,26 @@ class HomeViewController: UIViewController { cv.decelerationRate = .fast cv.backgroundColor = .clear - cv.layer.cornerRadius = 10 + + return cv + }() + + lazy var MenuCollectionView: UICollectionView = { + let layout = UICollectionViewFlowLayout() + layout.scrollDirection = .horizontal + layout.minimumLineSpacing = 16 // 셀 사이의 간격 + + let cv = UICollectionView(frame: .zero, collectionViewLayout: layout) + cv.register(MenuCollectionViewCell.self, forCellWithReuseIdentifier: "MenuCollectionViewCell") + cv.translatesAutoresizingMaskIntoConstraints = false + cv.showsHorizontalScrollIndicator = false + cv.delegate = self + cv.dataSource = self + cv.tag = 3 + + cv.decelerationRate = .fast + cv.backgroundColor = .clear + cv.layer.cornerRadius = 5 return cv }() @@ -409,6 +270,9 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega else if collectionView.tag == 2 { return self.RecomContents.count } + else if collectionView.tag == 3 { + return 4 + } return 0 } @@ -427,6 +291,12 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega return cell } + else if collectionView.tag == 3 { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MenuCollectionViewCell", for: indexPath) as! MenuCollectionViewCell + + cell.configure(name: MenuContents[indexPath.item]) + return cell + } return UICollectionViewCell() } @@ -436,7 +306,7 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega let adSafariView: SFSafariViewController = SFSafariViewController(url: adURL! as URL) self.present(adSafariView, animated: true, completion: nil) } - if collectionView.tag == 2 { + else if collectionView.tag == 2 { let selectedWine = RecomContents[indexPath.row] let wineInfoViewController = WineInfoViewController() wineInfoViewController.name.text = selectedWine.wineName @@ -444,6 +314,9 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega wineInfoViewController.wineId = selectedWine.wineId navigationController?.pushViewController(wineInfoViewController, animated: true) } + else if collectionView.tag == 3 { + //메뉴 셀마다 클릭 시 해당 페이지로 이동 + } } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { @@ -453,9 +326,29 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega else if collectionView.tag == 2 { return CGSize(width: ((collectionView.frame.height)*0.9), height: ((collectionView.frame.height)*0.9)) } + else if collectionView.tag == 3 { + return CGSize(width: collectionView.frame.height, height: collectionView.frame.height) + } return CGSize.zero } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + if collectionView.tag == 3 { + // 컬렉션 뷰에서 셀을 가운데에 정렬하기 위해 좌우 여백을 계산 + let totalCellWidth = 100 * CGFloat(collectionView.numberOfItems(inSection: section)) // 셀 크기 * 셀 개수 + let totalSpacingWidth = 10 * CGFloat(collectionView.numberOfItems(inSection: section) - 1) // 셀 사이 간격 * 간격 개수 + + let totalContentWidth = totalCellWidth + totalSpacingWidth + let collectionViewWidth = collectionView.bounds.width + + // 가운데 정렬을 위해 남는 공간을 양쪽 여백으로 나누어 설정 + let inset = max((collectionViewWidth - totalContentWidth) / 2.0, 0) + + return UIEdgeInsets(top: 0, left: inset, bottom: 0, right: inset) + } + return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) + } + func getHomeInfo(completion: @escaping (Bool) -> Void) { provider.request(.getHomeInfo) { result in switch result { diff --git a/Drink-EG/Drink-EG/Sources/VCs/Main/MainTabBarViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/Main/MainTabBarViewController.swift index e991063..c0d107d 100644 --- a/Drink-EG/Drink-EG/Sources/VCs/Main/MainTabBarViewController.swift +++ b/Drink-EG/Drink-EG/Sources/VCs/Main/MainTabBarViewController.swift @@ -17,8 +17,8 @@ class MainTabBarViewController : UITabBarController { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() var tabFrame = tabBar.frame - tabFrame.size.height = 93 - tabFrame.origin.y = view.frame.size.height - 93 + tabFrame.size.height = 96 + tabFrame.origin.y = view.frame.size.height - 90 tabBar.frame = tabFrame } @@ -30,20 +30,20 @@ class MainTabBarViewController : UITabBarController { let nav4 = UINavigationController(rootViewController: CommunityMainViewController()) let nav5 = UINavigationController(rootViewController: MypageViewController()) - nav1.tabBarItem = UITabBarItem(title: "", image: UIImage(named: "TabHome"), tag: 0) - nav2.tabBarItem = UITabBarItem(title: "", image: UIImage(named: "TabClass"), tag: 1) - nav3.tabBarItem = UITabBarItem(title: "", image: UIImage(named: "TabNote"), tag: 2) - nav4.tabBarItem = UITabBarItem(title: "", image: UIImage(named: "TabGroup"), tag: 3) - nav5.tabBarItem = UITabBarItem(title: "", image: UIImage(named: "TabSetting"), tag: 4) + nav1.tabBarItem = UITabBarItem(title: "홈", image: UIImage(named: "TabHome"), tag: 0) + nav2.tabBarItem = UITabBarItem(title: "클래스", image: UIImage(named: "TabClass"), tag: 1) + nav3.tabBarItem = UITabBarItem(title: "테이스팅 노트", image: UIImage(named: "TabNote"), tag: 2) + nav4.tabBarItem = UITabBarItem(title: "모임", image: UIImage(named: "TabGroup"), tag: 3) + nav5.tabBarItem = UITabBarItem(title: "설정", image: UIImage(named: "TabSetting"), tag: 4) + + UITabBar.clearShadow() + tabBar.layer.applyShadow(color: .gray, alpha: 0.3, x: 0, y: 0, blur: 15) tabBar.tintColor = .label - tabBar.backgroundColor = UIColor(hue: 0, saturation: 0, brightness: 0, alpha: 0.6) - tabBar.layer.cornerRadius = 20 - tabBar.layer.maskedCorners = CACornerMask(arrayLiteral: .layerMinXMinYCorner, .layerMaxXMinYCorner) - tabBar.layer.masksToBounds = true + tabBar.backgroundColor = .white - tabBar.tintColor = .white - tabBar.unselectedItemTintColor = UIColor(hue: 0, saturation: 0, brightness: 0.85, alpha: 1.0) + tabBar.tintColor = UIColor(hex: "5813B1") + tabBar.unselectedItemTintColor = UIColor(hue: 0, saturation: 0, brightness: 0, alpha: 0.5) setViewControllers([nav1, nav2, nav3, nav4, nav5], animated: true) }