Inigo Valentin пре 10 година
родитељ
комит
f9cb57bf8b

+ 57 - 10
Gasteizko Margolariak/Base.lproj/Main.storyboard

@@ -3,6 +3,7 @@
     <dependencies>
         <deployment identifier="iOS"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
+        <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
     </dependencies>
     <scenes>
         <!--Right View Controller-->
@@ -207,21 +208,64 @@
                         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SwiftViewController" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bao-vm-zME">
-                                <rect key="frame" x="180" y="100" width="240" height="93"/>
+                            <view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fQq-h9-XAb">
+                                <rect key="frame" x="0.0" y="28" width="600" height="224"/>
+                                <subviews>
+                                    <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" placeholderIntrinsicWidth="272" placeholderIntrinsicHeight="202" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="SQW-fW-w4x">
+                                        <rect key="frame" x="0.0" y="10" width="542" height="202"/>
+                                        <subviews>
+                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="La Blanca" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gMY-PS-HF9">
+                                                <rect key="frame" x="8" y="8" width="526" height="20"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="20" id="vhp-8S-vYm"/>
+                                                </constraints>
+                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
+                                            <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="54p-pF-Lwz">
+                                                <rect key="frame" x="8" y="28" width="526" height="166"/>
+                                                <subviews>
+                                                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" image="ic_launcher_24dp" translatesAutoresizingMaskIntoConstraints="NO" id="vDF-YI-Ctm">
+                                                        <rect key="frame" x="8" y="8" width="510" height="129"/>
+                                                    </imageView>
+                                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gc8-7f-NXp">
+                                                        <rect key="frame" x="8" y="137" width="510" height="21"/>
+                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+                                                        <nil key="highlightedColor"/>
+                                                    </label>
+                                                </subviews>
+                                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                                                <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                                                <userDefinedRuntimeAttributes>
+                                                    <userDefinedRuntimeAttribute type="number" keyPath="keyPath">
+                                                        <integer key="value" value="1"/>
+                                                    </userDefinedRuntimeAttribute>
+                                                </userDefinedRuntimeAttributes>
+                                            </stackView>
+                                        </subviews>
+                                        <color key="backgroundColor" red="0.60784313725490191" green="0.75686274509803919" blue="0.85490196078431369" alpha="1" colorSpace="calibratedRGB"/>
+                                        <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                                    </stackView>
+                                </subviews>
+                                <color key="backgroundColor" red="0.60784313725490191" green="0.75686274509803919" blue="0.85490196078431369" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
-                                    <constraint firstAttribute="height" constant="93" id="dAY-to-35w"/>
-                                    <constraint firstAttribute="width" constant="240" id="suh-ng-jJw"/>
+                                    <constraint firstItem="SQW-fW-w4x" firstAttribute="width" secondItem="fQq-h9-XAb" secondAttribute="width" multiplier="0.95" id="LA4-rH-wSd"/>
                                 </constraints>
-                                <fontDescription key="fontDescription" type="system" pointSize="22"/>
-                                <color key="textColor" red="0.61960784313725492" green="0.61960784313725492" blue="0.61960784313725492" alpha="1" colorSpace="calibratedRGB"/>
-                                <nil key="highlightedColor"/>
-                            </label>
+                                <edgeInsets key="layoutMargins" top="10" left="10" bottom="10" right="10"/>
+                            </view>
                         </subviews>
                         <color key="backgroundColor" red="0.89411764705882357" green="0.9137254901960784" blue="0.9137254901960784" alpha="1" colorSpace="calibratedRGB"/>
                         <constraints>
-                            <constraint firstItem="Bao-vm-zME" firstAttribute="top" secondItem="jtW-TN-dF4" secondAttribute="bottom" constant="80" id="Byq-zF-AOE"/>
-                            <constraint firstAttribute="centerX" secondItem="Bao-vm-zME" secondAttribute="centerX" id="jGK-wg-NME"/>
+                            <constraint firstItem="fQq-h9-XAb" firstAttribute="top" secondItem="jtW-TN-dF4" secondAttribute="bottom" constant="8" id="NIA-SG-F8G">
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
+                                        <integer key="value" value="1"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
+                            </constraint>
+                            <constraint firstItem="fQq-h9-XAb" firstAttribute="width" secondItem="FDk-dB-c3B" secondAttribute="width" multiplier="0.95" id="VMS-gU-Q7n"/>
+                            <constraint firstItem="fQq-h9-XAb" firstAttribute="centerX" secondItem="FDk-dB-c3B" secondAttribute="centerX" id="Zae-bP-EgN"/>
                         </constraints>
                     </view>
                     <navigationItem key="navigationItem" id="Wgh-E1-vlx"/>
@@ -607,5 +651,8 @@
             <point key="canvasLocation" x="138" y="2864"/>
         </scene>
     </scenes>
+    <resources>
+        <image name="ic_launcher_24dp" width="22" height="24"/>
+    </resources>
     <color key="tintColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
 </document>

+ 4 - 7
Gasteizko Margolariak/LeftViewController.swift

@@ -11,8 +11,7 @@
 import UIKit
 
 enum LeftMenu: Int {
-    case Main = 0
-    case Home
+    case Home = 0
     case Location
     case Lablanca
     case Schedule
@@ -31,7 +30,6 @@ class LeftViewController : UIViewController, LeftMenuProtocol {
     
     @IBOutlet weak var tableView: UITableView!
     var menus = ["Home", "Localizacion", "La Blanca", "Programa de Fiestas", "Programa Margolari", "Actividades", "Blog", "Galeria", "Ajustes"]
-    var mainViewController: UIViewController!
     var homeViewController: UIViewController!
     var locationViewController: UIViewController!
     var lablancaViewController: UIViewController!
@@ -98,9 +96,8 @@ class LeftViewController : UIViewController, LeftMenuProtocol {
     }
     
     func changeViewController(menu: LeftMenu) {
+		print("Selected item: \(menu)")
         switch menu {
-			case .Main:
-				self.slideMenuController()?.changeMainViewController(self.mainViewController, close: true)
 			case .Home:
 				self.slideMenuController()?.changeMainViewController(self.homeViewController, close: true)
 			case .Location:
@@ -127,7 +124,7 @@ extension LeftViewController : UITableViewDelegate {
     func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
         if let menu = LeftMenu(rawValue: indexPath.item) {
             switch menu {
-            case .Main, .Home, .Location, .Lablanca, .Schedule, .Gmschedule, .Activities, .Blog, .Gallery, .Settings:
+            case .Home, .Location, .Lablanca, .Schedule, .Gmschedule, .Activities, .Blog, .Gallery, .Settings:
                 return BaseTableViewCell.height()
             }
         }
@@ -145,7 +142,7 @@ extension LeftViewController : UITableViewDataSource {
         
         if let menu = LeftMenu(rawValue: indexPath.item) {
             switch menu {
-            case .Main, .Home, .Location, .Lablanca, .Schedule, .Gmschedule, .Activities, .Blog, .Gallery, .Settings:
+            case .Home, .Location, .Lablanca, .Schedule, .Gmschedule, .Activities, .Blog, .Gallery, .Settings:
                 let cell = BaseTableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: BaseTableViewCell.identifier)
                 cell.setData(menus[indexPath.row])
                 return cell