Markey Kulry Style App With Swift

Overview

마켓컬리 스타일 앱

(SnapKit & CollectionViewPractice)

기능

  • No Storyboard
  • SnapKit
  • UITabBarController
  • UICollectionView

구현

  • 상단 바

상세

  • No Storyboard에서 UITabBarController -> UINavigationController -> UIViewController 추가
    • MainTabBarController.swift

self.viewControllers = [recommendNC, homeNC] 이거 안써서 한시간 날렸다. 순서도 중요!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let homeVC = HomeViewController()
        let recommendVC = RecommendViewController()
        
        let homeNC = UINavigationController(rootViewController: homeVC)
        let recommendNC = UINavigationController(rootViewController: recommendVC)
        
        self.viewControllers = [recommendNC, homeNC]
        self.tabBar.backgroundColor = .white
        self.tabBar.tintColor = .purple
        self.tabBar.unselectedItemTintColor = .lightGray
    
        let homeTabBarItem = UITabBarItem(title: "", image: UIImage(systemName: "house"), tag: 1)
        let recommendTabBarItem = UITabBarItem(title: "추천", image: UIImage(systemName: "star"), tag: 0)
        
        homeTabBarItem.selectedImage = UIImage(systemName: "house.fill")
        recommendTabBarItem.selectedImage = UIImage(systemName: "star.fill")
        
        homeNC.tabBarItem = homeTabBarItem
        recommendNC.tabBarItem = recommendTabBarItem
    }
  • 추천 탭의 네비게이션 바 설정
    • 뷰 전체 색을 보라색, mainView를 흰색으로 하고 네비게이션 바 밑 부분 전체를 덮는다.
    • 바 버튼 추가할 때, 순서 중요
    • RecommendViewController.swift

직접 만들어 봤는데, 네비게이션 바를 이용하는게 더 간단하고 기기별로 동일한 UI를 보여줄 수 있어서 더 좋았다.

    let mainView = UIView()

    override func viewDidLoad() {
        super.viewDidLoad()
                
        // MARK: 네비게이션 바 설정
        self.view.backgroundColor = .purple
        self.title = "추천"
        // title 글자 색상 변경
        self.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.white]
        
        let locationBarButtonItem = UIBarButtonItem(
                                                    image: UIImage(systemName: "cart"),
                                                    style: .plain,
                                                    target: nil,
                                                    action: nil
                                                    )
        let basketBarButtonItem = UIBarButtonItem(
                                                    image: UIImage(systemName: "location"),
                                                    style: .plain,
                                                    target: nil,
                                                    action: nil
                                                    )
        // BarButtonItem 색생 변경
        self.navigationController?.navigationBar.tintColor = .white
        
        // 우측 바 버튼 아이템에 추가
        self.navigationItem.rightBarButtonItems = [locationBarButtonItem, basketBarButtonItem]
        
        self.view.addSubview(mainView)
        
        mainView.backgroundColor = .white
        mainView.snp.makeConstraints { make in
            make.leading.bottom.trailing.equalToSuperview()
            // top은 safeArea까지
            make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top)
        }

    }
You might also like...
Porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI.

SwiftUI example app: Koober We're porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI and we are sharing the cod

Quotes App is quotes browsing app which is built with Quotable Free API completely in SwiftUI.
Quotes App is quotes browsing app which is built with Quotable Free API completely in SwiftUI.

Quotes App is quotes browsing app which is built with Quotable Free API completely in SwiftUI. You can watch the whole journey of building this

SwiftUI App to view the App Activity Record from iOS 15
SwiftUI App to view the App Activity Record from iOS 15

App Activity Viewer A viewer for the iOS 15 "Record App Activity" export. FAQ How do I create an App Activity Report? Go to the "Settings" app of your

iOS app for Ribbit, Broker API Reference App
iOS app for Ribbit, Broker API Reference App

Ribbit Reference Implementation (iOS) The reference implementation for designing the iOS user interface of a broker-dealer trading application with th

The app provides additional actions for the Shortcuts app on macOS and iOS.
The app provides additional actions for the Shortcuts app on macOS and iOS.

Actions Supercharge your shortcuts The app provides additional actions for the Shortcuts app on macOS and iOS. Submit action idea (Submit an issue bef

A todo list iOS app developed with swift5 and coredata to persist data, this app help people organise their tasks on categories.
A todo list iOS app developed with swift5 and coredata to persist data, this app help people organise their tasks on categories.

A todo list iOS app developed with swift5 and coredata to persist data, this app help people organise their tasks on categories. The app is simple, intuitive, and easy to use and update tasks informations.

The app demonstrates how to use Firebase in a SwiftUI iOS app

Firebase SwiftUIDemo app This app demonstrates how to use Firebase in a SwiftUI iOS app. Firebase Setup Go to firebase.com Click new project. Copy app

Stocks-App - App that allows the user to track stocks of their choice
Stocks-App - App that allows the user to track stocks of their choice

Stocks-App App that allows the user to track stocks of their choice (Coming soon

NetFun-ios-app - iOS app using BFF service to display processed data.
NetFun-ios-app - iOS app using BFF service to display processed data.

NetFun-ios-app iOS app using BFF service to display processed data. The iOS demo developed in SwiftUI and it uses BFF service to show expected UI comp

Owner
Cobugi
Cobugi
Trello-style Task Management App

Krello Trello-style Task Management App 기한: 2022.05.04 ~ 05.20 (13일) 프로젝트에 대한 자세한 내용은 ?? Notion 에서 확인할 수 있습니다 앱 소개 Trello 의 기능을 따라 할일을 관리하는 iOS Applic

bumgeun 3 May 26, 2022
Apple Watch-style activity ring for SwiftUI.

WolfActivityRing Apple Watch-style activity ring for SwiftUI. Originally inspired by Eric Callanan's Create Activity Rings in SwiftUI with a number of

Wolf McNally 6 Sep 16, 2022
Todo is an iOS App written in Swift. This app is used for an online video training course. This app demonstrates how to use UITableViewController.

Todo Todo is an iOS App written in Swift. This app is used for an online video training course. This app demonstrates how to use UITableViewController

Jake Lin 273 Dec 29, 2022
In this mini app covered the concepts like basics of SwiftUI and Navigations and Animations and List with CRUD functions and MVVM and App Launch and App icons adding and also applied persistence using UserDefaults Concept.

TodoList In this application used the concepts from the beginner level project of SwiftUI_Evolve_1 The following concepts covered in this mini app Swi

Sivaram Yadav 2 Dec 4, 2021
Todo-app-swift- - A Todo Lists app built using swift

TODO-Lists App Available on the App Store What is this? This is a todo app I mad

Kushal Shingote 3 Feb 20, 2022
IOS-Quiz-App- - A trivia quiz app built with Swift using MVC structure

Quiz App A trivia quiz app built with Swift using MVC structure. Default Quiz

null 0 Feb 25, 2022
Ios-weather-app - A simple weather app with swift

AHOY Assignment Weather app Main Screen Settings Architecture The Architecture u

null 0 Jan 29, 2022
Marvel-App - Marvel App For iOS Using Swift

App Previews Home Screen Detail View Features Async await UICollectionViewCompos

null 0 Feb 14, 2022
This To-Do app was developed using Swift and SwiftUI and works on iOS, MacOS (Apple Silicon) and WatchOS. The tasks are kept on storage even when the app is restarted.

ToDo-SwiftUI This app has a lot of sentimental value for me, given that it helped me a lot to understand the process of doing an iOS app and became th

Augusto Galindo Ali 6 Jul 12, 2022
In app "App Update" button library in swift

What is Upstream? It gives you a magic button, because this button will only appear when there is an app update available on appstore for given app. P

Mohammad Yasir 6 Jun 22, 2022