Skip to content

Commit

Permalink
170829 네비게이션바 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
wooooooong committed Aug 29, 2017
2 parents e365675 + 06971dd commit 64814fd
Show file tree
Hide file tree
Showing 31 changed files with 1,291 additions and 2,182 deletions.
4 changes: 4 additions & 0 deletions iOSProject/pyunrihae/pyunrihae.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
989FA7A41F52E2BA001D1E42 /* ic_check.png in Resources */ = {isa = PBXBuildFile; fileRef = 989FA7A31F52E2BA001D1E42 /* ic_check.png */; };
989FA7A81F53EA9A001D1E42 /* empty_star.png in Resources */ = {isa = PBXBuildFile; fileRef = 989FA7A71F53EA9A001D1E42 /* empty_star.png */; };
98B288601F53EF43007673FF /* ic_default_product.png in Resources */ = {isa = PBXBuildFile; fileRef = 98B2885F1F53EF43007673FF /* ic_default_product.png */; };
98B288621F54FDDC007673FF /* Pyunrihae.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98B288611F54FDDC007673FF /* Pyunrihae.swift */; };
98B394861F4D59190071BB8B /* ProductAllergyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98B394851F4D59190071BB8B /* ProductAllergyViewController.swift */; };
98B394881F4E5EDA0071BB8B /* MainProduct.xib in Resources */ = {isa = PBXBuildFile; fileRef = 98B394871F4E5EDA0071BB8B /* MainProduct.xib */; };
98B3948A1F4E63230071BB8B /* MainProduct.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98B394891F4E63230071BB8B /* MainProduct.swift */; };
Expand Down Expand Up @@ -190,6 +191,7 @@
989FA7A31F52E2BA001D1E42 /* ic_check.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_check.png; sourceTree = "<group>"; };
989FA7A71F53EA9A001D1E42 /* empty_star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = empty_star.png; sourceTree = "<group>"; };
98B2885F1F53EF43007673FF /* ic_default_product.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_default_product.png; sourceTree = "<group>"; };
98B288611F54FDDC007673FF /* Pyunrihae.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pyunrihae.swift; sourceTree = "<group>"; };
98B394851F4D59190071BB8B /* ProductAllergyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductAllergyViewController.swift; sourceTree = "<group>"; };
98B394871F4E5EDA0071BB8B /* MainProduct.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainProduct.xib; sourceTree = "<group>"; };
98B394891F4E63230071BB8B /* MainProduct.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainProduct.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -417,6 +419,7 @@
98B82EDB1F45352A001C63A4 /* Validator.swift */,
98B82EDD1F45748D001C63A4 /* User.swift */,
98C5AAD71F342C3900610115 /* DataManager.swift */,
98B288611F54FDDC007673FF /* Pyunrihae.swift */,
);
name = Model;
sourceTree = "<group>";
Expand Down Expand Up @@ -952,6 +955,7 @@
98B394861F4D59190071BB8B /* ProductAllergyViewController.swift in Sources */,
9865E54A1F3C436000014795 /* ProductReviewTableViewCell.swift in Sources */,
98D9F2E01F418DF3009D0E10 /* README.md in Sources */,
98B288621F54FDDC007673FF /* Pyunrihae.swift in Sources */,
98CBA0D81F4AEDF4003D0370 /* LikeProductTableViewCell.swift in Sources */,
98D569241F4D119B002693E9 /* RankingTableViewCell.swift in Sources */,
98D9F2EC1F418DF3009D0E10 /* YNSearchTextField.swift in Sources */,
Expand Down
28 changes: 16 additions & 12 deletions iOSProject/pyunrihae/pyunrihae/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import GoogleSignIn
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,GIDSignInDelegate{
var window: UIWindow?
var user: User?
var productList : [Product] = []
let category = ["전체","도시락","김밥","베이커리","라면","식품","스낵","아이스크림","음료"]
let priceLevelList = ["비싸다","비싼편","적당","싼편","싸다"]
Expand All @@ -25,11 +24,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate,GIDSignInDelegate{
GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID
GIDSignIn.sharedInstance().delegate = self

let handle = Auth.auth().addStateDidChangeListener { (auth, user) in
_ = Auth.auth().addStateDidChangeListener { (auth, user) in
if user == nil {
do {
try Auth.auth().signOut()
self.user = User.init()
User.sharedInstance = User.init()
NotificationCenter.default.post(name: NSNotification.Name("userLogined"), object: nil)
} catch let signOutError as NSError {
print ("Error signing out: %@", signOutError)
Expand Down Expand Up @@ -77,17 +76,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate,GIDSignInDelegate{
// ...

Auth.auth().signIn(with: credential) { (user, error) in
if let error = error {
// ...
if error != nil {
// 에러 발생하면
return
}
// User is signed in
// ...

let user_instance = User.init(id: (user?.uid)!, email: (user?.email)!, nickname: (user?.displayName)!)
DataManager.saveUser(user: user_instance)
self.user = user_instance
NotificationCenter.default.post(name: NSNotification.Name("userLogined"), object: nil)
DataManager.getUserFromUID(uid: (user?.uid)!, completion: { (resultUser) in
if resultUser.email != "" { // 이전에 연결된 게 있으면
User.sharedInstance = resultUser
NotificationCenter.default.post(name: NSNotification.Name("userLogined"), object: nil)
}else{ // 새로 가입한 거라면
let user_instance = User.init(id: (user!.uid), email: (user?.email)!, nickname: (user?.displayName)!)
DataManager.saveUser(user: user_instance)
}
})


}

}
Expand All @@ -100,7 +104,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,GIDSignInDelegate{
let firebaseAuth = Auth.auth()
do {
try firebaseAuth.signOut()
self.user = User.init()
User.sharedInstance = User.init()
NotificationCenter.default.post(name: NSNotification.Name("userLogined"), object: nil)
} catch let signOutError as NSError {
print ("Error signing out: %@", signOutError)
Expand Down
35 changes: 18 additions & 17 deletions iOSProject/pyunrihae/pyunrihae/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@
<!--상품상세-->
<scene sceneID="1Yi-Qd-Imp">
<objects>
<viewController storyboardIdentifier="ProductDetailViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="t3O-Pz-lwz" customClass="ProductDetailViewController" customModule="pyunrihae" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="ProductDetailViewController" extendedLayoutIncludesOpaqueBars="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="t3O-Pz-lwz" customClass="ProductDetailViewController" customModule="pyunrihae" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="iGX-N6-Qxt"/>
<viewControllerLayoutGuide type="bottom" id="FHL-9w-PA7"/>
Expand Down Expand Up @@ -753,13 +753,6 @@
<segue destination="VCz-lc-hnn" kind="show" id="fGg-R2-bk1"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="KNy-kz-u4p">
<rect key="frame" x="142.5" y="8" width="90" height="90"/>
<constraints>
<constraint firstAttribute="height" constant="90" id="bNd-gl-6Ga"/>
<constraint firstAttribute="width" constant="90" id="rdN-OO-zBa"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" layoutMarginsFollowReadableWidth="YES" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Pw-03-jM2">
<rect key="frame" x="23" y="130.5" width="0.0" height="0.0"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
Expand Down Expand Up @@ -816,6 +809,13 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="KNy-kz-u4p">
<rect key="frame" x="142.5" y="10" width="90" height="90"/>
<constraints>
<constraint firstAttribute="height" constant="90" id="bNd-gl-6Ga"/>
<constraint firstAttribute="width" constant="90" id="rdN-OO-zBa"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstItem="0MK-5P-nnW" firstAttribute="top" secondItem="WOt-dN-weK" secondAttribute="bottom" constant="10" id="3bd-Fy-XQO"/>
Expand All @@ -833,7 +833,7 @@
<constraint firstItem="9Pw-03-jM2" firstAttribute="leading" secondItem="46E-GN-5Jm" secondAttribute="leadingMargin" constant="15" id="Vq2-OJ-uaZ"/>
<constraint firstItem="dqo-2X-vDe" firstAttribute="top" secondItem="mqw-Ps-KXU" secondAttribute="bottom" constant="15" id="bCG-km-p7q"/>
<constraint firstItem="WOt-dN-weK" firstAttribute="leading" secondItem="9Pw-03-jM2" secondAttribute="trailing" constant="10" id="cUb-AB-wnP"/>
<constraint firstItem="KNy-kz-u4p" firstAttribute="top" secondItem="46E-GN-5Jm" secondAttribute="top" constant="8" id="ctQ-Ji-gJC"/>
<constraint firstItem="KNy-kz-u4p" firstAttribute="top" secondItem="46E-GN-5Jm" secondAttribute="top" constant="10" id="ctQ-Ji-gJC"/>
<constraint firstItem="JfI-S8-kUQ" firstAttribute="top" secondItem="46E-GN-5Jm" secondAttribute="topMargin" id="e2A-Qh-u5n"/>
<constraint firstAttribute="trailingMargin" secondItem="mqw-Ps-KXU" secondAttribute="trailing" constant="15" id="hmX-pP-8xg"/>
<constraint firstAttribute="trailingMargin" secondItem="TTH-cm-D1b" secondAttribute="trailing" constant="15" id="mFV-WZ-8ux"/>
Expand Down Expand Up @@ -1283,6 +1283,7 @@
</button>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" translucent="NO" prompted="NO"/>
<connections>
<outlet property="alertMessageLabel" destination="Kpd-B6-MNv" id="Ufe-r7-xfs"/>
<outlet property="tableView" destination="M9H-67-xPN" id="YS1-lZ-1vo"/>
Expand Down Expand Up @@ -1373,14 +1374,14 @@
<viewControllerLayoutGuide type="bottom" id="r9v-QD-yI8"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="mFM-IA-tQd">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="N2X-GZ-z2X">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yHM-6Y-gO8">
<rect key="frame" x="0.0" y="0.0" width="375" height="917"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="853"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WuU-0d-sPY">
<rect key="frame" x="0.0" y="415" width="375" height="183"/>
Expand Down Expand Up @@ -1690,11 +1691,11 @@
<viewControllerLayoutGuide type="bottom" id="AQ8-pT-ejH"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Awu-nl-7jT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="iv5-gl-6HS">
<rect key="frame" x="41" y="84" width="293" height="499"/>
<rect key="frame" x="41" y="64" width="293" height="475"/>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
Expand Down Expand Up @@ -1722,11 +1723,11 @@
<viewControllerLayoutGuide type="bottom" id="8E4-r7-sJK"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="hoE-eE-7Vs">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="58" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="ArB-bi-2Lo">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" rowHeight="58" id="hEU-ol-izC" customClass="AllergyTableViewCell" customModule="pyunrihae" customModuleProvider="target">
Expand Down Expand Up @@ -1978,7 +1979,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="닉네임, 이메일,비밀번호를 입력해주세요." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TBO-lJ-IOE">
<rect key="frame" x="75" y="90" width="225.5" height="17"/>
<rect key="frame" x="75" y="90" width="225" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.64313725489999995" green="0.66666666669999997" blue="0.70196078429999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
Expand Down
Loading

0 comments on commit 64814fd

Please sign in to comment.