Inigo Valentin 10 лет назад
Родитель
Сommit
9164dcbbb9

BIN
app.xcodeproj/project.xcworkspace/xcuserdata/seavenois.xcuserdatad/UserInterfaceState.xcuserstate


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

@@ -100,37 +100,82 @@
                                 </connections>
                             </collectionView>
                             <containerView opaque="NO" contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FfD-xR-Ufj" userLabel="Container View Home">
-                                <frame key="frameInset" height="381" maxY="-5"/>
+                                <frame key="frameInset" minX="-2" height="380" maxX="2" maxY="-2"/>
                                 <connections>
                                     <segue destination="aNc-O2-1Df" kind="embed" id="DGi-yn-SV1"/>
                                 </connections>
                             </containerView>
-                            <containerView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="T4H-Rn-I4y" userLabel="Container View Location">
+                            <containerView opaque="NO" contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="T4H-Rn-I4y" userLabel="Container View Location">
                                 <frame key="frameInset" minX="38" height="128" maxX="42" maxY="126"/>
                                 <connections>
                                     <segue destination="Xnt-cB-Rqv" kind="embed" id="tDq-Wx-d8o"/>
                                 </connections>
                             </containerView>
+                            <containerView opaque="NO" contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nhy-Gy-cgq" userLabel="Container View Lablanca">
+                                <frame key="frameInset" minX="38" height="128" maxX="42" maxY="178"/>
+                                <connections>
+                                    <segue destination="BMN-HQ-lp2" kind="embed" id="pVd-Ff-B2f"/>
+                                </connections>
+                            </containerView>
+                            <containerView opaque="NO" contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="T5i-d0-9I1" userLabel="Container View Activities">
+                                <frame key="frameInset" minX="38" height="128" maxX="42" maxY="178"/>
+                                <connections>
+                                    <segue destination="0Sj-kN-N7N" kind="embed" id="TI8-Fn-Xcz"/>
+                                </connections>
+                            </containerView>
+                            <containerView opaque="NO" contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="p8H-ai-kTU" userLabel="Container View Blog">
+                                <frame key="frameInset" minX="40" height="128" maxX="40" maxY="176"/>
+                                <connections>
+                                    <segue destination="CT0-x2-ZHC" kind="embed" id="53Z-m9-zSG"/>
+                                </connections>
+                            </containerView>
+                            <containerView opaque="NO" contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3r9-W6-dmf" userLabel="Container View Gallery">
+                                <frame key="frameInset" minX="40" height="128" maxX="40" maxY="176"/>
+                                <connections>
+                                    <segue destination="Bxe-vP-zrv" kind="embed" id="ufh-fQ-2yF"/>
+                                </connections>
+                            </containerView>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
+                            <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"/>
+                            <constraint firstItem="3r9-W6-dmf" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="41B-9B-3vB"/>
+                            <constraint firstItem="p8H-ai-kTU" firstAttribute="centerX" secondItem="Ikv-46-g2m" secondAttribute="centerX" id="4Iu-SL-dAB"/>
                             <constraint firstItem="Ikv-46-g2m" firstAttribute="top" secondItem="zFh-si-6JY" secondAttribute="bottom" id="779-4E-igL"/>
                             <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="FfD-xR-Ufj" secondAttribute="bottom" id="7jk-ze-1Vp"/>
+                            <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="p8H-ai-kTU" secondAttribute="bottom" id="Bkf-Wu-jW9"/>
                             <constraint firstItem="zFh-si-6JY" firstAttribute="leading" secondItem="Ikv-46-g2m" secondAttribute="leading" id="DtH-3x-QsB"/>
+                            <constraint firstItem="nhy-Gy-cgq" firstAttribute="centerX" secondItem="Ikv-46-g2m" secondAttribute="centerX" id="EZy-Ld-6HE"/>
+                            <constraint firstItem="3r9-W6-dmf" firstAttribute="top" secondItem="Ikv-46-g2m" secondAttribute="bottom" id="F1F-Vz-PQg"/>
+                            <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="T5i-d0-9I1" secondAttribute="bottom" id="FIc-3H-vLO"/>
                             <constraint firstItem="zFh-si-6JY" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="HNI-Oh-agx"/>
                             <constraint firstItem="FfD-xR-Ufj" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="MPS-z3-zNb"/>
                             <constraint firstItem="zFh-si-6JY" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" id="MZQ-hn-ezh"/>
+                            <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="nhy-Gy-cgq" secondAttribute="bottom" id="NZm-e4-hZE"/>
+                            <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="3r9-W6-dmf" secondAttribute="bottom" id="QiZ-RE-Mc6"/>
                             <constraint firstItem="T4H-Rn-I4y" firstAttribute="top" secondItem="Ikv-46-g2m" secondAttribute="bottom" id="UAm-na-Ilc"/>
+                            <constraint firstItem="T5i-d0-9I1" firstAttribute="top" secondItem="Ikv-46-g2m" secondAttribute="bottom" id="VOD-tJ-ecM"/>
+                            <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="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="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="wfy-db-euE" firstAttribute="top" secondItem="T4H-Rn-I4y" secondAttribute="bottom" id="vQE-x2-yf6"/>
                         </constraints>
                     </view>
                     <connections>
+                        <outlet property="containerViewActivities" destination="T5i-d0-9I1" id="Zre-fI-1Lg"/>
+                        <outlet property="containerViewBlog" destination="p8H-ai-kTU" id="yCB-k7-XUk"/>
+                        <outlet property="containerViewGallery" destination="3r9-W6-dmf" id="rlK-vI-dz2"/>
                         <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"/>
                     </connections>
                 </viewController>
@@ -143,7 +188,7 @@
             <objects>
                 <viewController storyboardIdentifier="homeViewControllerScene" title="Home" id="aNc-O2-1Df" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="12o-6g-8cT">
-                        <rect key="frame" x="0.0" y="0.0" width="320" height="381"/>
+                        <rect key="frame" x="0.0" y="0.0" width="320" height="380"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="0.9425276964" green="1" blue="0.35931510379999998" alpha="1" colorSpace="calibratedRGB"/>
                     </view>
@@ -164,7 +209,63 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="r7U-0f-tjM" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1234" y="1473"/>
+            <point key="canvasLocation" x="1091" y="1708"/>
+        </scene>
+        <!--La Blanca-->
+        <scene sceneID="FPb-4H-Oac">
+            <objects>
+                <viewController title="La Blanca" id="BMN-HQ-lp2" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="XIc-19-qoq">
+                        <rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="L8G-JV-V2l" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1583" y="870"/>
+        </scene>
+        <!--Activities-->
+        <scene sceneID="Dyc-GB-FPW">
+            <objects>
+                <viewController title="Activities" id="0Sj-kN-N7N" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="e8E-bp-zJI">
+                        <rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="0.4079896717" green="1" blue="0.34807942549999998" alpha="1" colorSpace="calibratedRGB"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="iuX-Se-nlc" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1734" y="1234"/>
+        </scene>
+        <!--Blog-->
+        <scene sceneID="A6s-4k-Qpj">
+            <objects>
+                <viewController title="Blog" id="CT0-x2-ZHC" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="c4t-ul-w0Z">
+                        <rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="1" green="0.33842284866451022" blue="0.42972784824945376" alpha="1" colorSpace="calibratedRGB"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="iDB-bY-1MG" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1643" y="1803"/>
+        </scene>
+        <!--Gallery-->
+        <scene sceneID="Uqp-if-ZuD">
+            <objects>
+                <viewController title="Gallery" id="Bxe-vP-zrv" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="pPe-Xd-teA">
+                        <rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="2vc-bF-Qwf" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1509" y="576"/>
         </scene>
     </scenes>
 </document>

+ 67 - 5
app/ViewController.swift

@@ -12,10 +12,21 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
     
     var sectionCollection: UICollectionView!
 
+    @IBOutlet weak var containerViewGallery: UIView!
+    @IBOutlet weak var containerViewBlog: UIView!
+    @IBOutlet weak var containerViewActivities: UIView!
+    @IBOutlet weak var containerViewLablanca: UIView!
     @IBOutlet weak var containerViewLocation: UIView!
     @IBOutlet weak var containerViewHome: UIView!
     override func viewDidLoad() {
-        print("LOAD")
+        
+        //Hide all sections, except for the first one
+        self.containerViewLocation.alpha = 0
+        self.containerViewLablanca.alpha = 0
+        self.containerViewActivities.alpha = 0
+        self.containerViewBlog.alpha = 0
+        self.containerViewGallery.alpha = 0
+        
         super.viewDidLoad()
         // Do any additional setup after loading the view, typically from a nib.
     }
@@ -47,12 +58,13 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
         //Set text
         cell.label.text = self.items[indexPath.item]
         
-        
-        //Mark the first cell as selected
+        //Mark the first cell as selected...
         if indexPath.item == selected{
             cell.bar.backgroundColor = UIColor(red: 90/255, green: 180/255, blue: 255/255, alpha: 1)
             cell.label.font = UIFont.boldSystemFont(ofSize: cell.label.font.pointSize)
         }
+            
+        //... and the others as unselected
         else{
             cell.bar.backgroundColor = UIColor(red: 148/255, green: 209/255, blue: 255/255, alpha: 1)
             cell.label.font = UIFont.systemFont(ofSize: cell.label.font.pointSize)
@@ -73,7 +85,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
         print("SELECTED: \(selected)")
         //Activate label
         var i = 0
-        for cell in sectionCollection.visibleCells as! [MenuCollectionViewCell]{
+        for cell in sectionCollection.visibleCells as! [MenuCollectionViewCell]{ //TODO: Not only visibles!
             if i == selected + 1{
                 cell.bar.backgroundColor = UIColor(red: 90/255, green: 180/255, blue: 255/255, alpha: 1)
                 cell.label.font = UIFont.boldSystemFont(ofSize: cell.label.font.pointSize)
@@ -91,13 +103,63 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
             UIView.animate(withDuration: 0.5, animations: {
                 self.containerViewHome.alpha = 1
                 self.containerViewLocation.alpha = 0
+                self.containerViewLablanca.alpha = 0
+                self.containerViewActivities.alpha = 0
+                self.containerViewBlog.alpha = 0
+                self.containerViewGallery.alpha = 0
             })
-        } else if selected == 1 {
+        }
+        else if selected == 1 {
             UIView.animate(withDuration: 0.5, animations: {
                 self.containerViewHome.alpha = 0
                 self.containerViewLocation.alpha = 1
+                self.containerViewLablanca.alpha = 0
+                self.containerViewActivities.alpha = 0
+                self.containerViewBlog.alpha = 0
+                self.containerViewGallery.alpha = 0
             })
         }
+        else if selected == 2 {
+            UIView.animate(withDuration: 0.5, animations: {
+                self.containerViewHome.alpha = 0
+                self.containerViewLocation.alpha = 0
+                self.containerViewLablanca.alpha = 1
+                self.containerViewActivities.alpha = 0
+                self.containerViewBlog.alpha = 0
+                self.containerViewGallery.alpha = 0
+            })
+        }
+        else if selected == 3 {
+            UIView.animate(withDuration: 0.5, animations: {
+                self.containerViewHome.alpha = 0
+                self.containerViewLocation.alpha = 0
+                self.containerViewLablanca.alpha = 0
+                self.containerViewActivities.alpha = 1
+                self.containerViewBlog.alpha = 0
+                self.containerViewGallery.alpha = 0
+            })
+        }
+        else if selected == 4 {
+            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 = 1
+                self.containerViewGallery.alpha = 0
+            })
+        }
+        else if selected == 5 {
+            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 = 1
+            })
+        }
+        
     }