-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ScrollableView & 앱 디자인 컬러 추가 (#12)
* feat: TabBarController 설정 및 탭별 ViewController 생성(#10) * feat: ScrollableView 구현 (#11) * feat: 앱 디자인 컬러 추가
- Loading branch information
1 parent
939a746
commit da6f09d
Showing
22 changed files
with
742 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// AppDelegate.swift | ||
// AirBnb | ||
// | ||
// Created by 송태환 on 2022/05/23. | ||
// | ||
|
||
import UIKit | ||
|
||
@main | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
func application( | ||
_: UIApplication, | ||
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? | ||
) -> Bool { | ||
true | ||
} | ||
|
||
// MARK: UISceneSession Lifecycle | ||
|
||
func application( | ||
_: UIApplication, | ||
configurationForConnecting connectingSceneSession: UISceneSession, | ||
options _: UIScene.ConnectionOptions | ||
) -> UISceneConfiguration { | ||
UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// SceneDelegate.swift | ||
// AirBnb | ||
// | ||
// Created by 송태환 on 2022/05/23. | ||
// | ||
|
||
import UIKit | ||
|
||
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | ||
var window: UIWindow? | ||
|
||
func scene(_ scene: UIScene, willConnectTo _: UISceneSession, options _: UIScene.ConnectionOptions) { | ||
guard let scene = (scene as? UIWindowScene) else { | ||
return | ||
} | ||
|
||
let tabBarController = UITabBarController() | ||
let navigationController = UINavigationController(rootViewController: tabBarController) | ||
let homeController = HomeController() | ||
let wishListController = WishListViewController() | ||
let reservationController = ReservationViewController() | ||
|
||
homeController.tabBarItem = .init( | ||
title: "검색", | ||
image: .magnifier, | ||
selectedImage: .magnifier | ||
) | ||
|
||
wishListController.tabBarItem = .init( | ||
title: "위시리스트", | ||
image: .heart, | ||
selectedImage: .heartFilled | ||
) | ||
|
||
reservationController.tabBarItem = .init( | ||
title: "예약", | ||
image: .profile, | ||
selectedImage: .profileFilled | ||
) | ||
|
||
tabBarController.viewControllers = [ | ||
homeController, | ||
wishListController, | ||
reservationController | ||
] | ||
|
||
self.window = UIWindow(windowScene: scene) | ||
self.window?.rootViewController = navigationController | ||
self.window?.makeKeyAndVisible() | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
ios/AirBnb/AirBnb/Presentation/Scenes/Home/HomeController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// | ||
// HomeController.swift | ||
// AirBnb | ||
// | ||
// Created by 송태환 on 2022/05/23. | ||
// | ||
|
||
import SnapKit | ||
import UIKit | ||
|
||
class HomeController: UIViewController { | ||
private let scrollView = ScrollableView() | ||
|
||
private let searchBar: UITextField = { | ||
let textField = UITextField() | ||
textField.backgroundColor = .gray | ||
return textField | ||
}() | ||
|
||
// MARK: - Life Cycles | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
self.configureUI() | ||
} | ||
|
||
// MARK: - UI Configuration | ||
|
||
private func configureUI() { | ||
self.navigationController?.navigationBar.isHidden = true | ||
self.view.backgroundColor = .systemBackground | ||
self.configureScrollView() | ||
self.configureSearchBar() | ||
} | ||
|
||
private func configureScrollView() { | ||
self.view.addSubview(self.scrollView) | ||
self.scrollView.contentView.snp.makeConstraints { make in | ||
make.height.greaterThanOrEqualTo(self.view.safeAreaLayoutGuide.snp.height) | ||
} | ||
|
||
self.scrollView.snp.makeConstraints { make in | ||
make.edges.equalTo(self.view.safeAreaLayoutGuide) | ||
} | ||
} | ||
|
||
private func configureSearchBar() { | ||
let searchBarWrapper = UIView() | ||
self.scrollView.addContent(searchBarWrapper) | ||
searchBarWrapper.addSubview(self.searchBar) | ||
|
||
let imageView = UIImageView(image: .magnifier) | ||
imageView.contentMode = .scaleAspectFit | ||
self.searchBar.leftView = imageView | ||
self.searchBar.leftViewMode = .always | ||
self.searchBar.layer.cornerRadius = 10 | ||
self.searchBar.backgroundColor = .gray | ||
|
||
searchBarWrapper.snp.makeConstraints { make in | ||
make.top.equalTo(self.scrollView.contentView.snp.top) | ||
make.leading.equalTo(self.scrollView.contentView.snp.leading) | ||
make.trailing.equalTo(self.scrollView.contentView.snp.trailing) | ||
} | ||
|
||
self.searchBar.snp.makeConstraints { make in | ||
let edgeInsets = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16) | ||
make.edges.equalTo(searchBarWrapper).inset(edgeInsets) | ||
make.height.equalTo(40) | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
ios/AirBnb/AirBnb/Presentation/Scenes/Reservation/ReservationViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// ReservationViewController.swift | ||
// AirBnb | ||
// | ||
// Created by 송태환 on 2022/05/25. | ||
// | ||
|
||
import SnapKit | ||
import UIKit | ||
|
||
class ReservationViewController: UIViewController { | ||
// MARK: - Life Cycles | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
self.configureUI() | ||
} | ||
|
||
// MARK: - UI Configuration | ||
|
||
private func configureUI() { | ||
self.view.backgroundColor = .systemBackground | ||
} | ||
} |
Oops, something went wrong.