Skip to content

Commit

Permalink
Design: VC title 및 image 추가
Browse files Browse the repository at this point in the history
tab bar에 VC title 및 image 추가
tab bar에 VC 연결
#11
  • Loading branch information
hhyukjin committed Jan 31, 2024
1 parent 2fc910e commit ff31539
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 4 deletions.
Binary file not shown.
1 change: 1 addition & 0 deletions iOS/Ringo/Ringo/AccountViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class AccountViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = .blue
// Do any additional setup after loading the view.
}

Expand Down
1 change: 1 addition & 0 deletions iOS/Ringo/Ringo/ContactsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class ContactsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = .red
// Do any additional setup after loading the view.
}

Expand Down
1 change: 1 addition & 0 deletions iOS/Ringo/Ringo/RecentsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class RecentsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = .green
// Do any additional setup after loading the view.
}

Expand Down
2 changes: 1 addition & 1 deletion iOS/Ringo/Ringo/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
let mainViewController = ViewController()
let mainViewController = TabBarViewController()

window?.rootViewController = mainViewController
window?.makeKeyAndVisible()
Expand Down
14 changes: 12 additions & 2 deletions iOS/Ringo/Ringo/TabBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,26 @@
//

import UIKit
import SnapKit

class TabBarViewController: UITabBarController{

override func viewDidLoad() {
super.viewDidLoad()

let contactsVC = ContactsViewController()
let contactsVC = UINavigationController(rootViewController: ContactsViewController())
let recentsVC = RecentsViewController()
let AccountVC = AccountViewController()
let accountVC = AccountViewController()

contactsVC.title = "Contacts"
recentsVC.title = "Recents"
accountVC.title = "Account"

contactsVC.tabBarItem.image = UIImage(systemName: "person.3")
recentsVC.tabBarItem.image = UIImage(systemName: "clock")
accountVC.tabBarItem.image = UIImage(systemName: "person.text.rectangle")

setViewControllers([contactsVC,recentsVC,accountVC], animated: true)
}

}
2 changes: 1 addition & 1 deletion iOS/Ringo/Ringo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ struct ViewPreview: PreviewProvider {
ViewControllerRepresentable().edgesIgnoringSafeArea(.all)
}
}

// hexcode로 색 지정하기
extension UIColor {

convenience init(hexCode: String, alpha: CGFloat = 1.0) {
Expand Down

0 comments on commit ff31539

Please sign in to comment.