Skip to content

Commit

Permalink
feat: 내 근처의 명함 네비바 (TeamNADA#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwns33 committed Feb 28, 2023
1 parent 3e86c94 commit 9343671
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "iconRefreshLocation.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "iconRefreshLocation@2x.png",
"scale" : "2x"
},
{
"scale" : "3x",
"idiom" : "universal",
"filename" : "iconRefreshLocation@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,34 @@ final class AroundMeViewController: UIViewController {

// MARK: - UI Components

private let navigationBar = CustomNavigationBar()

// MARK: - View Life Cycles

override func viewDidLoad() {
super.viewDidLoad()
setUI()
setLayout()
}

}

extension AroundMeViewController {

// MARK: - UI & Layout

private func setUI() {
self.view.backgroundColor = .white
self.navigationController?.navigationBar.isHidden = true
navigationBar.setUI("내 근처의 명함", leftImage: UIImage(named: "iconClear"), rightImage: UIImage(named: "iconRefreshLocation"))
}

private func setLayout() {
view.addSubviews([navigationBar])

navigationBar.snp.makeConstraints { make in
make.top.leading.trailing.equalTo(self.view.safeAreaLayoutGuide)
make.height.equalTo(50)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import UIKit
2) 해당 ViewController로 가서 CustomNavigationBar를 상속받은 UIView 생성 (ex: navigationBar)
3) navigationBar.leftButtonAction = { 왼쪽버튼을 누르면 해야할 것 } 을 추가해요.
4) navigationBar.rightButtonAction = { 오른쪽버튼을 누르면 해야할 것 } 을 추가해요.
5) func iconImage(leftImage: UIImage, rightImage: UIImage) 함수를 이용하여 왼쪽 아이템과 오른쪽 아이템을 바꿔주세요.
5) func setUI(_ title: String?, leftImage: UIImage?, rightImage: UIImage?) 함수를 이용하여 왼쪽/오른쪽 아이템과 타이틀을 바꿔주세요.
*/

Expand Down Expand Up @@ -57,8 +57,8 @@ class CustomNavigationBar: UIView {

func setUI(_ title: String?, leftImage: UIImage?, rightImage: UIImage?) {
titleLabel.text = title
leftButton.setImage(leftImage?.withRenderingMode(.alwaysTemplate), for: .normal)
rightButton.setImage(rightImage?.withRenderingMode(.alwaysTemplate), for: .normal)
leftButton.setImage(leftImage?.withRenderingMode(.alwaysOriginal), for: .normal)
rightButton.setImage(rightImage?.withRenderingMode(.alwaysOriginal), for: .normal)
}

private func setLayout() {
Expand Down

0 comments on commit 9343671

Please sign in to comment.