-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSocialViewController.swift
51 lines (42 loc) · 1.67 KB
/
SocialViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// SocialViewController.swift
// Better-me-iOS
//
// Created by 황인성 on 2023/02/01.
//
import UIKit
import SwiftUI
class SocialViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
configureNaviBar()
// Do any additional setup after loading the view.
}
@IBSegueAction func addSwiftUIView(_ coder: NSCoder) -> UIViewController? {
return UIHostingController(coder: coder, rootView: ContentView())
}
// @IBSegueAction func addSwiftUIView(_ coder: NSCoder) -> UIViewController? {
// return UIHostingController(coder: coder, rootView: ContentView())
// }
private func dateToString(date: Date) -> String{
let formmater = DateFormatter()
formmater.dateFormat = "M월 d일 E요일"
formmater.locale = Locale(identifier: "ko-KR")
return formmater.string(from: date)
}
private func configureNaviBar() {
let image = UIImage(named: "BetterMeLogo")
let date = dateToString(date: Date())
navigationItem.leftBarButtonItem = UIBarButtonItem(image: image, style: .plain, target: nil, action: nil)
navigationItem.rightBarButtonItem = UIBarButtonItem(title: date, style: .plain, target: nil, action: nil)
navigationItem.rightBarButtonItem?.tintColor = .black
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}