Skip to content

Commit

Permalink
#6 feat: NavigationBarController 생성 및 RootViewController로 지정
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeeehee committed May 25, 2022
1 parent 22cc135 commit d032ecf
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 72 deletions.
62 changes: 38 additions & 24 deletions airbnb/airbnb.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

/* Begin PBXBuildFile section */
1DEF879FF49710DE9E378A0B /* Pods_airbnbTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17879D07A8010A4E6A2147BE /* Pods_airbnbTests.framework */; };
73571FC0283DF6E8002F411F /* HeaderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73571FBF283DF6E8002F411F /* HeaderViewController.swift */; };
73571FC2283DFB18002F411F /* UIColor+Extention.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73571FC1283DFB18002F411F /* UIColor+Extention.swift */; };
73B9A767283C7EE8003A8C25 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73B9A766283C7EE8003A8C25 /* AppDelegate.swift */; };
73B9A769283C7EE8003A8C25 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73B9A768283C7EE8003A8C25 /* SceneDelegate.swift */; };
73B9A76B283C7EE8003A8C25 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73B9A76A283C7EE8003A8C25 /* ViewController.swift */; };
73B9A76E283C7EE8003A8C25 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73B9A76C283C7EE8003A8C25 /* Main.storyboard */; };
73B9A770283C7EE9003A8C25 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 73B9A76F283C7EE9003A8C25 /* Assets.xcassets */; };
73B9A773283C7EE9003A8C25 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73B9A771283C7EE9003A8C25 /* LaunchScreen.storyboard */; };
73B9A77E283C7EE9003A8C25 /* airbnbTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73B9A77D283C7EE9003A8C25 /* airbnbTests.swift */; };
Expand Down Expand Up @@ -44,11 +44,11 @@
4C8FBDEFF1B39C5BD4366F89 /* Pods-airbnb-airbnbUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-airbnb-airbnbUITests.debug.xcconfig"; path = "Target Support Files/Pods-airbnb-airbnbUITests/Pods-airbnb-airbnbUITests.debug.xcconfig"; sourceTree = "<group>"; };
4D0E80456C281DE34190974F /* Pods-airbnb.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-airbnb.debug.xcconfig"; path = "Target Support Files/Pods-airbnb/Pods-airbnb.debug.xcconfig"; sourceTree = "<group>"; };
4E46533D09A96A3749B72362 /* Pods-airbnb-airbnbUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-airbnb-airbnbUITests.release.xcconfig"; path = "Target Support Files/Pods-airbnb-airbnbUITests/Pods-airbnb-airbnbUITests.release.xcconfig"; sourceTree = "<group>"; };
73571FBF283DF6E8002F411F /* HeaderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderViewController.swift; sourceTree = "<group>"; };
73571FC1283DFB18002F411F /* UIColor+Extention.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extention.swift"; sourceTree = "<group>"; };
73B9A763283C7EE8003A8C25 /* airbnb.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = airbnb.app; sourceTree = BUILT_PRODUCTS_DIR; };
73B9A766283C7EE8003A8C25 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
73B9A768283C7EE8003A8C25 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
73B9A76A283C7EE8003A8C25 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
73B9A76D283C7EE8003A8C25 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
73B9A76F283C7EE9003A8C25 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
73B9A772283C7EE9003A8C25 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
73B9A774283C7EE9003A8C25 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -92,6 +92,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
73571FBE283DE6B6002F411F /* Extension */ = {
isa = PBXGroup;
children = (
73571FC1283DFB18002F411F /* UIColor+Extention.swift */,
);
path = Extension;
sourceTree = "<group>";
};
73B9A75A283C7EE8003A8C25 = {
isa = PBXGroup;
children = (
Expand All @@ -118,12 +126,8 @@
73B9A765283C7EE8003A8C25 /* airbnb */ = {
isa = PBXGroup;
children = (
73B9A766283C7EE8003A8C25 /* AppDelegate.swift */,
73B9A768283C7EE8003A8C25 /* SceneDelegate.swift */,
73B9A76A283C7EE8003A8C25 /* ViewController.swift */,
73B9A76C283C7EE8003A8C25 /* Main.storyboard */,
73B9A76F283C7EE9003A8C25 /* Assets.xcassets */,
73B9A771283C7EE9003A8C25 /* LaunchScreen.storyboard */,
73B9A79C283CC53E003A8C25 /* Sources */,
73B9A79B283CC522003A8C25 /* Resources */,
73B9A774283C7EE9003A8C25 /* Info.plist */,
);
path = airbnb;
Expand All @@ -146,6 +150,26 @@
path = airbnbUITests;
sourceTree = "<group>";
};
73B9A79B283CC522003A8C25 /* Resources */ = {
isa = PBXGroup;
children = (
73B9A771283C7EE9003A8C25 /* LaunchScreen.storyboard */,
73B9A76F283C7EE9003A8C25 /* Assets.xcassets */,
);
path = Resources;
sourceTree = "<group>";
};
73B9A79C283CC53E003A8C25 /* Sources */ = {
isa = PBXGroup;
children = (
73571FBF283DF6E8002F411F /* HeaderViewController.swift */,
73B9A768283C7EE8003A8C25 /* SceneDelegate.swift */,
73B9A766283C7EE8003A8C25 /* AppDelegate.swift */,
73571FBE283DE6B6002F411F /* Extension */,
);
path = Sources;
sourceTree = "<group>";
};
93000A4293A0D8B457566CAC /* Pods */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -281,7 +305,6 @@
files = (
73B9A773283C7EE9003A8C25 /* LaunchScreen.storyboard in Resources */,
73B9A770283C7EE9003A8C25 /* Assets.xcassets in Resources */,
73B9A76E283C7EE8003A8C25 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -427,9 +450,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
73B9A76B283C7EE8003A8C25 /* ViewController.swift in Sources */,
73571FC2283DFB18002F411F /* UIColor+Extention.swift in Sources */,
73B9A767283C7EE8003A8C25 /* AppDelegate.swift in Sources */,
73B9A769283C7EE8003A8C25 /* SceneDelegate.swift in Sources */,
73571FC0283DF6E8002F411F /* HeaderViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -466,14 +490,6 @@
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
73B9A76C283C7EE8003A8C25 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
73B9A76D283C7EE8003A8C25 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
73B9A771283C7EE9003A8C25 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -535,7 +551,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.5;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -589,7 +605,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.5;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -612,7 +628,6 @@
INFOPLIST_FILE = airbnb/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -641,7 +656,6 @@
INFOPLIST_FILE = airbnb/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
24 changes: 0 additions & 24 deletions airbnb/airbnb/Base.lproj/Main.storyboard

This file was deleted.

2 changes: 0 additions & 2 deletions airbnb/airbnb/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -11,15 +13,20 @@
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
File renamed without changes.
19 changes: 19 additions & 0 deletions airbnb/airbnb/Sources/Extension/UIColor+Extention.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// UIColor+Extention.swift
// airbnb
//
// Created by Jihee hwang on 2022/05/25.
//

import UIKit

extension UIColor {
static let grey1 = UIColor(red: 51 / 255, green: 51 / 255, blue: 51 / 255, alpha: 1)
static let grey2 = UIColor(red: 79 / 255, green: 79 / 255, blue: 79 / 255, alpha: 1)
static let grey3 = UIColor(red: 130 / 255, green: 130 / 255, blue: 130 / 255, alpha: 1)
static let grey4 = UIColor(red: 189 / 255, green: 189 / 255, blue: 189 / 255, alpha: 1)
static let grey5 = UIColor(red: 244 / 255, green: 244 / 255, blue: 244 / 255, alpha: 1)
static let grey6 = UIColor(red: 245 / 255, green: 245 / 255, blue: 247 / 255, alpha: 1)
static let primary = UIColor(red: 232 / 255, green: 76 / 255, blue: 96 / 255, alpha: 1)
static let secondary = UIColor(red: 17 / 255, green: 137 / 255, blue: 23 / 255, alpha: 1)
}
38 changes: 38 additions & 0 deletions airbnb/airbnb/Sources/HeaderViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// HeaderViewController.swift
// airbnb
//
// Created by Jihee hwang on 2022/05/25.
//

import UIKit
import SnapKit

class HeaderViewController: UIViewController {

private let underLineView: UIView = {
let view = UIView()
view.backgroundColor = .grey4
return view
}()

override func viewDidLoad() {
super.viewDidLoad()

configureView()
layout()
}

private func configureView() {
view.backgroundColor = .white
}

private func layout() {
view.addSubview(underLineView)

underLineView.snp.makeConstraints {
$0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide)
$0.height.equalTo(1)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let _ = (scene as? UIWindowScene) else { return }
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene) // 이름을 만들어준 그 UIWindowScene을 SceneDelegate의 window 프로퍼티에 대입
let mainViewController = HeaderViewController() // 맨 처음 보여줄 VC
let navigationController = UINavigationController(rootViewController: mainViewController)

window?.rootViewController = navigationController
window?.makeKeyAndVisible()
}

func sceneDidDisconnect(_ scene: UIScene) {
Expand Down
16 changes: 0 additions & 16 deletions airbnb/airbnb/ViewController.swift

This file was deleted.

0 comments on commit d032ecf

Please sign in to comment.