Iñigo Valentin 9 лет назад
Родитель
Сommit
f288c53a95
2 измененных файлов с 5 добавлено и 53 удалено
  1. 4 14
      app/Base.lproj/Main.storyboard
  2. 1 39
      app/ViewController.swift

+ 4 - 14
app/Base.lproj/Main.storyboard

@@ -142,16 +142,9 @@
                                     <segue destination="Bxe-vP-zrv" kind="embed" id="ufh-fQ-2yF"/>
                                 </connections>
                             </containerView>
-                            <containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mlD-LQ-7rk" userLabel="Container View Post">
-                                <rect key="frame" x="0.0" y="110" width="320" height="458"/>
-                                <connections>
-                                    <segue destination="UkS-wI-Yhx" kind="embed" id="Ye2-qm-gxO"/>
-                                </connections>
-                            </containerView>
                         </subviews>
                         <color key="backgroundColor" red="0.0" green="0.47058823529411764" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
-                            <constraint firstItem="mlD-LQ-7rk" firstAttribute="top" secondItem="Ikv-46-g2m" secondAttribute="bottom" id="0pt-jc-DqH"/>
                             <constraint firstItem="p8H-ai-kTU" firstAttribute="top" secondItem="Ikv-46-g2m" secondAttribute="bottom" id="1fj-8m-lWP"/>
                             <constraint firstItem="T4H-Rn-I4y" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="3Eh-im-76c"/>
                             <constraint firstItem="p8H-ai-kTU" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="3z5-Bs-qVY"/>
@@ -174,16 +167,13 @@
                             <constraint firstItem="T5i-d0-9I1" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="ZQY-pp-rDk"/>
                             <constraint firstItem="nhy-Gy-cgq" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="ZjH-ke-Gtv"/>
                             <constraint firstItem="T4H-Rn-I4y" firstAttribute="centerX" secondItem="Ikv-46-g2m" secondAttribute="centerX" id="a3W-7J-vjF"/>
-                            <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="mlD-LQ-7rk" secondAttribute="bottom" id="aRg-2c-Jny"/>
                             <constraint firstItem="nhy-Gy-cgq" firstAttribute="top" secondItem="Ikv-46-g2m" secondAttribute="bottom" id="dey-LW-WUE"/>
                             <constraint firstItem="3r9-W6-dmf" firstAttribute="centerX" secondItem="Ikv-46-g2m" secondAttribute="centerX" id="efu-E3-cv8"/>
                             <constraint firstItem="Ikv-46-g2m" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="eln-ck-QcI"/>
                             <constraint firstItem="FfD-xR-Ufj" firstAttribute="top" secondItem="Ikv-46-g2m" secondAttribute="bottom" id="fwz-Vq-Hzc"/>
-                            <constraint firstItem="mlD-LQ-7rk" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="hjx-EG-jOT"/>
                             <constraint firstItem="Ikv-46-g2m" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="j8o-dm-xpa"/>
                             <constraint firstItem="FfD-xR-Ufj" firstAttribute="centerX" secondItem="Ikv-46-g2m" secondAttribute="centerX" id="kSp-hr-GIX"/>
                             <constraint firstItem="T5i-d0-9I1" firstAttribute="centerX" secondItem="Ikv-46-g2m" secondAttribute="centerX" id="psj-oK-zVR"/>
-                            <constraint firstItem="mlD-LQ-7rk" firstAttribute="centerX" secondItem="Ikv-46-g2m" secondAttribute="centerX" id="u90-c1-7kN"/>
                             <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="T4H-Rn-I4y" secondAttribute="bottom" id="vQE-x2-yf6"/>
                         </constraints>
                     </view>
@@ -194,7 +184,7 @@
                         <outlet property="containerViewHome" destination="FfD-xR-Ufj" id="EtF-qz-vWE"/>
                         <outlet property="containerViewLablanca" destination="nhy-Gy-cgq" id="bBa-2W-hjf"/>
                         <outlet property="containerViewLocation" destination="T4H-Rn-I4y" id="EFa-Km-WuR"/>
-                        <outlet property="containerViewPost" destination="mlD-LQ-7rk" id="vBh-WX-EhR"/>
+                        <segue destination="UkS-wI-Yhx" kind="show" identifier="SeguePost" id="gs2-jd-cPW"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
@@ -309,16 +299,16 @@
             </objects>
             <point key="canvasLocation" x="1509" y="576"/>
         </scene>
-        <!--View Controller-->
+        <!--Post-->
         <scene sceneID="zgg-Cx-j75">
             <objects>
-                <viewController id="UkS-wI-Yhx" sceneMemberID="viewController">
+                <viewController title="Post" id="UkS-wI-Yhx" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="yy6-d2-MRo"/>
                         <viewControllerLayoutGuide type="bottom" id="IxZ-up-5UO"/>
                     </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="zcp-qV-FPt" customClass="PostView" customModule="app" customModuleProvider="target">
-                        <rect key="frame" x="0.0" y="0.0" width="320" height="458"/>
+                        <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="0.70980392156862748" green="0.82745098039215681" blue="0.89803921568627454" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>

+ 1 - 39
app/ViewController.swift

@@ -38,10 +38,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	@IBOutlet weak var containerViewLablanca: UIView!
 	@IBOutlet weak var containerViewLocation: UIView!
 	@IBOutlet weak var containerViewHome: HomeView!
-	@IBOutlet var containerViewPost: PostView!
-	
-	var refViewPost: PostView!
-	
 	
 	func getContext () -> NSManagedObjectContext {
 		//let appDelegate = UIApplication.shared.delegate as! AppDelegate
@@ -51,27 +47,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	
 	func showPost(id: Int){
 		print("CONTROLLER:DEBUG: showPost \(id)")
-		
-		if self.containerViewPost == nil{
-			print("CONTROLLER:DEBUG: containerViewPost has been released")
-		}
-		
-		UIView.animate(withDuration: 0.5, animations: {
-			self.containerViewHome.alpha = 0
-			self.containerViewLocation.alpha = 0
-			self.containerViewLablanca.alpha = 0
-			self.containerViewActivities.alpha = 0
-			self.containerViewBlog.alpha = 0
-			self.containerViewGallery.alpha = 0
-			self.containerViewPost.alpha = 1
-		})
-		
-		
-		//TODO get the uiview from the storyboard again
-		//self.storyboard?..instantiateViewController(withIdentifier: "PostView")
-		self.containerViewPost = PostView()
-		containerViewPost.title.text = "AAAAA"
-		//hself.refViewPost.loadPost(id: id)
+		performSegue(withIdentifier: "SeguePost", sender: nil)
 	}
 	
 	/**
@@ -85,9 +61,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 		self.containerViewActivities.alpha = 0
 		self.containerViewBlog.alpha = 0
 		self.containerViewGallery.alpha = 0
-		self.containerViewPost.alpha = 0.2
-		
-		self.refViewPost = self.containerViewPost
 		
 		
 		
@@ -105,11 +78,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 		delegate = UIApplication.shared.delegate as! AppDelegate
 		delegate?.controller = self
 		
-		
-		//self.containerViewPost.loadPost(id: 16)
-		print(type(of:containerViewPost))
-		5//self.containerViewPost.lp()
-		print(self.containerViewBlog.borderColor)
 	}
 
 	/**
@@ -188,7 +156,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 				self.containerViewActivities.alpha = 0
 				self.containerViewBlog.alpha = 0
 				self.containerViewGallery.alpha = 0
-				self.containerViewPost.alpha = 0
 			})
 		}
 		else if selected == 1 {
@@ -199,7 +166,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 				self.containerViewActivities.alpha = 0
 				self.containerViewBlog.alpha = 0
 				self.containerViewGallery.alpha = 0
-				self.containerViewPost.alpha = 0
 			})
 		}
 		else if selected == 2 {
@@ -210,7 +176,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 				self.containerViewActivities.alpha = 0
 				self.containerViewBlog.alpha = 0
 				self.containerViewGallery.alpha = 0
-				self.containerViewPost.alpha = 0
 			})
 		}
 		else if selected == 3 {
@@ -221,7 +186,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 				self.containerViewActivities.alpha = 1
 				self.containerViewBlog.alpha = 0
 				self.containerViewGallery.alpha = 0
-				self.containerViewPost.alpha = 0
 			})
 		}
 		else if selected == 4 {
@@ -232,7 +196,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 				self.containerViewActivities.alpha = 0
 				self.containerViewBlog.alpha = 1
 				self.containerViewGallery.alpha = 0
-				self.containerViewPost.alpha = 0
 			})
 		}
 		else if selected == 5 {
@@ -243,7 +206,6 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 				self.containerViewActivities.alpha = 0
 				self.containerViewBlog.alpha = 0
 				self.containerViewGallery.alpha = 1
-				self.containerViewPost.alpha = 0
 			})
 		}