Skip to content

Commit

Permalink
170828 #207 상품상세 오른쪽 들어오게 방식 변환
Browse files Browse the repository at this point in the history
  • Loading branch information
wooooooong committed Aug 28, 2017
1 parent ffa1c97 commit 5a5526d
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 10 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 @@ -42,6 +42,7 @@
989FA79C1F511E59001D1E42 /* ReviewPopupView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 989FA79B1F511E59001D1E42 /* ReviewPopupView.xib */; };
989FA7A01F52BEC8001D1E42 /* Popup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 989FA79F1F52BEC8001D1E42 /* Popup.swift */; };
989FA7A41F52E2BA001D1E42 /* ic_check.png in Resources */ = {isa = PBXBuildFile; fileRef = 989FA7A31F52E2BA001D1E42 /* ic_check.png */; };
989FA7A61F53DAA0001D1E42 /* Segue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 989FA7A51F53DAA0001D1E42 /* Segue.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 @@ -188,6 +189,7 @@
989FA79B1F511E59001D1E42 /* ReviewPopupView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ReviewPopupView.xib; sourceTree = "<group>"; };
989FA79F1F52BEC8001D1E42 /* Popup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Popup.swift; sourceTree = "<group>"; };
989FA7A31F52E2BA001D1E42 /* ic_check.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_check.png; sourceTree = "<group>"; };
989FA7A51F53DAA0001D1E42 /* Segue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Segue.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 @@ -404,6 +406,7 @@
isa = PBXGroup;
children = (
9865E54D1F3C576D00014795 /* Image.swift */,
989FA7A51F53DAA0001D1E42 /* Segue.swift */,
9865E5071F3943BD00014795 /* Button.swift */,
9865E5231F3AE04C00014795 /* Label.swift */,
989FA79F1F52BEC8001D1E42 /* Popup.swift */,
Expand Down Expand Up @@ -942,6 +945,7 @@
98F865A51F442B3800C2F333 /* LoginSignUpViewController.swift in Sources */,
98D9F2E31F418DF3009D0E10 /* YNSearch.swift in Sources */,
98DED89B1F41729100CC4D63 /* SearchViewController.swift in Sources */,
989FA7A61F53DAA0001D1E42 /* Segue.swift in Sources */,
9865E4F61F387C7A00014795 /* TabBarViewController.swift in Sources */,
9865E52C1F3AF3EE00014795 /* MypageTableViewCell.swift in Sources */,
98B394861F4D59190071BB8B /* ProductAllergyViewController.swift in Sources */,
Expand Down
6 changes: 3 additions & 3 deletions iOSProject/pyunrihae/pyunrihae/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@
<outlet property="orderNumLabel" destination="5Qe-nm-Vek" id="Hph-Mn-gPI"/>
<outlet property="productNameLabel" destination="b7P-Vs-4Ot" id="OnN-rQ-SJe"/>
<outlet property="starView" destination="cly-4C-f2a" id="9VA-5u-bgp"/>
<segue destination="9cE-6F-aqE" kind="show" id="bTl-dq-KGg"/>
<segue destination="9cE-6F-aqE" kind="show" customClass="Segue" customModule="pyunrihae" customModuleProvider="target" id="bTl-dq-KGg"/>
</connections>
</tableViewCell>
</prototypes>
Expand Down Expand Up @@ -2231,7 +2231,7 @@
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WfG-74-UDi">
<rect key="frame" x="27" y="537" width="160" height="50"/>
<rect key="frame" x="27.5" y="537" width="160" height="50"/>
<constraints>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="50" id="39b-fW-NRi"/>
<constraint firstAttribute="width" secondItem="WfG-74-UDi" secondAttribute="height" multiplier="16:5" id="Kxa-T3-la5"/>
Expand All @@ -2242,7 +2242,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YtJ-Az-ONQ">
<rect key="frame" x="187" y="537" width="160" height="50"/>
<rect key="frame" x="187.5" y="537" width="160" height="50"/>
<constraints>
<constraint firstAttribute="width" secondItem="YtJ-Az-ONQ" secondAttribute="height" multiplier="16:5" id="9Mx-gH-W1f"/>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="50" id="vLj-0W-BPw"/>
Expand Down
17 changes: 14 additions & 3 deletions iOSProject/pyunrihae/pyunrihae/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ class MainViewController: UIViewController {
if notification.userInfo?["validator"] as! Int == 0{
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "mainNavigationController") as! UINavigationController
self.present(vc, animated: true, completion: nil)
print(review.p_id)
let transition = CATransition()
transition.duration = 0.4
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
self.view.window!.layer.add(transition, forKey: kCATransition)
self.present(vc, animated: false, completion: nil)
NotificationCenter.default.post(name: NSNotification.Name("showReviewProduct"), object: self, userInfo: ["product" : review])
}
}
Expand Down Expand Up @@ -347,7 +352,13 @@ class MainViewController: UIViewController {
NotificationCenter.default.post(name: NSNotification.Name("showProduct"), object: self, userInfo: ["product" : product])
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "mainNavigationController") as! UINavigationController
self.present(vc, animated: true, completion: nil)
let transition = CATransition()
transition.duration = 0.4
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
self.view.window!.layer.add(transition, forKey: kCATransition)
self.present(vc, animated: false, completion: nil)
}
}
}
24 changes: 22 additions & 2 deletions iOSProject/pyunrihae/pyunrihae/ProductDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,22 @@ class ProductDetailViewController: UIViewController {
NotificationCenter.default.addObserver(self, selector: #selector(startUploading), name: NSNotification.Name("startUploading"), object: nil)
let tap = UITapGestureRecognizer(target: self, action: #selector(self.handleTap(_:)))
self.view.addGestureRecognizer(tap)
let swipeRight = UISwipeGestureRecognizer(target: self, action: #selector(self.respondToSwipeGesture))
swipeRight.direction = UISwipeGestureRecognizerDirection.right
self.view.addGestureRecognizer(swipeRight)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func respondToSwipeGesture(gesture: UIGestureRecognizer) {
if let swipeGesture = gesture as? UISwipeGestureRecognizer {
switch swipeGesture.direction {
case UISwipeGestureRecognizerDirection.right: close()
default: break
}
}
}
func handleTap(_ sender: UITapGestureRecognizer) { // 탭해주면 리뷰 작성 버튼 뜸
if hidden == true {
writingReviewBtn.isHidden = false
Expand All @@ -65,10 +76,19 @@ class ProductDetailViewController: UIViewController {
})
}
}
@IBAction func closeNavViewBtn(_ sender: UIButton) {
self.dismiss(animated: true, completion: nil)
func close() {
let transition = CATransition()
transition.duration = 0.4
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromLeft
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
self.view.window!.layer.add(transition, forKey: kCATransition)
self.dismiss(animated: false, completion: nil)
NotificationCenter.default.post(name: NSNotification.Name("reloadReview"), object: self)
}
@IBAction func closeNavViewBtn(_ sender: UIButton) {
close()
}
@IBAction func tabWishBtn(_ sender: UIButton) {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let user = appDelegate.user
Expand Down
8 changes: 7 additions & 1 deletion iOSProject/pyunrihae/pyunrihae/ReviewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ class ReviewViewController: UIViewController {
if notification.userInfo?["validator"] as! Int == 1{
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "mainNavigationController") as! UINavigationController
self.present(vc, animated: true, completion: nil)
let transition = CATransition()
transition.duration = 0.4
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
self.view.window!.layer.add(transition, forKey: kCATransition)
self.present(vc, animated: false, completion: nil)
NotificationCenter.default.post(name: NSNotification.Name("showReviewProduct"), object: self, userInfo: ["product" : review])
}
}
Expand Down
8 changes: 7 additions & 1 deletion iOSProject/pyunrihae/pyunrihae/SearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ class SearchViewController: YNSearchViewController,YNSearchDelegate {
}
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "mainNavigationController") as! UINavigationController
self.present(vc, animated: true, completion: nil)
let transition = CATransition()
transition.duration = 0.4
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
self.view.window!.layer.add(transition, forKey: kCATransition)
self.present(vc, animated: false, completion: nil)
}
func pushRankingController(text : String) {
NotificationCenter.default.post(name: NSNotification.Name("showRanking"), object: self)
Expand Down
30 changes: 30 additions & 0 deletions iOSProject/pyunrihae/pyunrihae/Segue.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// Segue.swift
// pyunrihae
//
// Created by woowabrothers on 2017. 8. 28..
// Copyright © 2017년 busride. All rights reserved.
//

import Foundation
import UIKit
class Segue: UIStoryboardSegue
{
override func perform()
{
let src = self.source.parent
let dst = self.destination
src?.view.superview?.insertSubview(dst.view, aboveSubview: (src?.view)!)
dst.view.transform = CGAffineTransform(translationX: (src?.view.frame.size.width)!, y: 0)
UIView.animate(withDuration: 0.25,
delay: 0.0,
options: UIViewAnimationOptions.curveEaseInOut,
animations: {
dst.view.transform = CGAffineTransform(translationX: 0, y: 0)
},
completion: { finished in
src?.present(dst, animated: false, completion: nil)
}
)
}
}

0 comments on commit 5a5526d

Please sign in to comment.