Ver código fonte

Schedule controller in progress.

Iñigo Valentin 9 anos atrás
pai
commit
61cda13651

+ 4 - 0
app.xcodeproj/project.pbxproj

@@ -53,6 +53,7 @@
 		93D9EA6C1DE3498500089002 /* HomeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93D9EA6B1DE3498500089002 /* HomeView.xib */; };
 		93D9EA711DE37C7900089002 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D9EA701DE37C7900089002 /* libsqlite3.tbd */; };
 		93D9EA761DE3ACBB00089002 /* Sync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D9EA751DE3ACBB00089002 /* Sync.swift */; };
+		93E0C5F41EBE306900905811 /* ScheduleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E0C5F31EBE306900905811 /* ScheduleViewController.swift */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -104,6 +105,7 @@
 		93D9EA6B1DE3498500089002 /* HomeView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeView.xib; sourceTree = "<group>"; };
 		93D9EA701DE37C7900089002 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
 		93D9EA751DE3ACBB00089002 /* Sync.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sync.swift; sourceTree = "<group>"; };
+		93E0C5F31EBE306900905811 /* ScheduleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScheduleViewController.swift; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -184,6 +186,7 @@
 				938D211E1EA2306300C47EC3 /* LablancaView.swift */,
 				9326C4F31EA51C39007DF2A4 /* RowLablancaDay.xib */,
 				9326C4F51EA5279D007DF2A4 /* RowLablancaDay.swift */,
+				93E0C5F31EBE306900905811 /* ScheduleViewController.swift */,
 			);
 			path = app;
 			sourceTree = "<group>";
@@ -287,6 +290,7 @@
 			files = (
 				93294FF81E336FA000FDAF50 /* Entry.swift in Sources */,
 				937EA02D1E5B8B5300D0893A /* UIApplcation.swift in Sources */,
+				93E0C5F41EBE306900905811 /* ScheduleViewController.swift in Sources */,
 				936966F11E984B5000A11055 /* RowAlbum.swift in Sources */,
 				93D9EA641DE273FD00089002 /* Section.swift in Sources */,
 				93D9EA6A1DE3491100089002 /* HomeView.swift in Sources */,

+ 232 - 3
app/Base.lproj/Main.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
     <device id="retina4_0" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -484,7 +484,7 @@
                                 </userDefinedRuntimeAttributes>
                             </view>
                         </subviews>
-                        <color key="backgroundColor" red="0.70980392160000005" green="0.82745098039999998" blue="0.8980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstItem="jx5-wy-ab4" firstAttribute="centerX" secondItem="mCJ-K1-jG1" secondAttribute="centerX" id="5lE-sn-JIj"/>
                             <constraint firstItem="arX-Be-0iS" firstAttribute="top" secondItem="yy6-d2-MRo" secondAttribute="bottom" id="SYd-o2-Nm3"/>
@@ -661,7 +661,7 @@
                                 </userDefinedRuntimeAttributes>
                             </view>
                         </subviews>
-                        <color key="backgroundColor" red="0.70980392160000005" green="0.82745098039999998" blue="0.8980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstItem="kLX-yW-lMr" firstAttribute="top" secondItem="ONc-DJ-6Kh" secondAttribute="bottom" id="1cs-f7-eXV"/>
                             <constraint firstItem="WEW-3s-kOI" firstAttribute="centerX" secondItem="iBY-d9-Ye4" secondAttribute="centerX" id="7rG-90-CBm"/>
@@ -689,6 +689,235 @@
             </objects>
             <point key="canvasLocation" x="-1978" y="1477"/>
         </scene>
+        <!--Schedule-->
+        <scene sceneID="0Lj-Be-Hu6">
+            <objects>
+                <viewController title="Album" id="zJF-Mh-CNb" userLabel="Schedule" customClass="ScheduleViewController" customModule="app" customModuleProvider="target" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="dOJ-i5-gIk"/>
+                        <viewControllerLayoutGuide type="bottom" id="Kp9-sV-JUZ"/>
+                    </layoutGuides>
+                    <view key="view" autoresizesSubviews="NO" contentMode="scaleToFill" id="8YN-gM-ymv" userLabel="Container">
+                        <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P0f-Qc-GSS" userLabel="Toolbar">
+                                <rect key="frame" x="0.0" y="20" width="320" height="20.5"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cV9-gT-2OC">
+                                        <rect key="frame" x="0.0" y="0.0" width="48" height="20.5"/>
+                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+                                        <state key="normal" title="&lt;">
+                                            <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        </state>
+                                    </button>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Gasteizko Margolariak" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RJE-Hu-oDM">
+                                        <rect key="frame" x="48" y="0.0" width="224" height="20.5"/>
+                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
+                                        <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstItem="RJE-Hu-oDM" firstAttribute="centerX" secondItem="P0f-Qc-GSS" secondAttribute="centerX" id="T6g-du-prz"/>
+                                    <constraint firstItem="cV9-gT-2OC" firstAttribute="leading" secondItem="P0f-Qc-GSS" secondAttribute="leading" id="VGf-cr-zKT"/>
+                                    <constraint firstItem="cV9-gT-2OC" firstAttribute="width" secondItem="P0f-Qc-GSS" secondAttribute="width" multiplier="0.15" id="WCJ-A0-CgT"/>
+                                    <constraint firstItem="RJE-Hu-oDM" firstAttribute="height" secondItem="P0f-Qc-GSS" secondAttribute="height" id="YlB-So-f8f"/>
+                                    <constraint firstItem="RJE-Hu-oDM" firstAttribute="centerY" secondItem="P0f-Qc-GSS" secondAttribute="centerY" id="aES-4b-n3l"/>
+                                    <constraint firstItem="RJE-Hu-oDM" firstAttribute="width" secondItem="P0f-Qc-GSS" secondAttribute="width" multiplier="0.7" id="fKA-UR-a5d"/>
+                                    <constraint firstItem="cV9-gT-2OC" firstAttribute="centerY" secondItem="P0f-Qc-GSS" secondAttribute="centerY" id="j0s-Q2-z7i"/>
+                                    <constraint firstItem="cV9-gT-2OC" firstAttribute="height" secondItem="P0f-Qc-GSS" secondAttribute="height" id="rCF-Un-LBK"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rRo-dr-1GN">
+                                <rect key="frame" x="0.0" y="40.5" width="320" height="527.5"/>
+                                <subviews>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nIg-ez-N2J" userLabel="Section">
+                                        <rect key="frame" x="10" y="10" width="300" height="507.5"/>
+                                        <subviews>
+                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" restorationIdentifier="Title" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="663-n7-Jwn" userLabel="Title">
+                                                <rect key="frame" x="0.0" y="0.0" width="300" height="30"/>
+                                                <color key="backgroundColor" red="0.0" green="0.47058823529999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="30" id="zTh-A8-uDI"/>
+                                                </constraints>
+                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
+                                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
+                                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="rYw-pJ-uyq" userLabel="Content">
+                                                <rect key="frame" x="0.0" y="30" width="300" height="478"/>
+                                                <subviews>
+                                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="odg-U1-6cp" userLabel="Calendar">
+                                                        <rect key="frame" x="8" y="8" width="284" height="60"/>
+                                                        <subviews>
+                                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ean-uL-e8X">
+                                                                <rect key="frame" x="10" y="7" width="45" height="45"/>
+                                                                <color key="backgroundColor" red="0.070588235289999995" green="0.27058823529999998" blue="0.4039215686" alpha="1" colorSpace="calibratedRGB"/>
+                                                                <constraints>
+                                                                    <constraint firstAttribute="height" constant="45" id="FCK-N3-WdV"/>
+                                                                    <constraint firstAttribute="width" constant="45" id="czB-hK-gr2"/>
+                                                                </constraints>
+                                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+                                                                <state key="normal" title="&lt;">
+                                                                    <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                                </state>
+                                                                <userDefinedRuntimeAttributes>
+                                                                    <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                                                        <color key="value" red="0.0" green="0.47058823529999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                    <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                                        <real key="value" value="2"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                                        <real key="value" value="4"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                </userDefinedRuntimeAttributes>
+                                                            </button>
+                                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gEL-Ik-UfU">
+                                                                <rect key="frame" x="229" y="7" width="45" height="45"/>
+                                                                <color key="backgroundColor" red="0.070588235289999995" green="0.27058823529999998" blue="0.4039215686" alpha="1" colorSpace="calibratedRGB"/>
+                                                                <constraints>
+                                                                    <constraint firstAttribute="width" constant="45" id="0Dv-S2-hPr"/>
+                                                                    <constraint firstAttribute="height" constant="45" id="GXZ-mi-hcs"/>
+                                                                </constraints>
+                                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+                                                                <state key="normal" title="&gt;">
+                                                                    <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                                </state>
+                                                                <userDefinedRuntimeAttributes>
+                                                                    <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                                                        <color key="value" red="0.0" green="0.47058823529999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                    <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                                        <real key="value" value="2"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                                        <real key="value" value="4"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                </userDefinedRuntimeAttributes>
+                                                            </button>
+                                                        </subviews>
+                                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                        <constraints>
+                                                            <constraint firstItem="ean-uL-e8X" firstAttribute="leading" secondItem="odg-U1-6cp" secondAttribute="leading" constant="10" id="2tn-Yg-glj"/>
+                                                            <constraint firstItem="gEL-Ik-UfU" firstAttribute="centerY" secondItem="odg-U1-6cp" secondAttribute="centerY" id="Drw-jI-c92"/>
+                                                            <constraint firstItem="ean-uL-e8X" firstAttribute="centerY" secondItem="odg-U1-6cp" secondAttribute="centerY" id="FbR-7B-mF9"/>
+                                                            <constraint firstAttribute="trailing" secondItem="gEL-Ik-UfU" secondAttribute="trailing" constant="10" id="lUb-Gk-coy"/>
+                                                            <constraint firstAttribute="height" constant="60" id="yfY-8b-HUb"/>
+                                                        </constraints>
+                                                    </view>
+                                                    <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" bounces="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="G9i-BS-kj8">
+                                                        <rect key="frame" x="8" y="78" width="284" height="392"/>
+                                                        <subviews>
+                                                            <view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Sqf-Nt-Prc" userLabel="Album">
+                                                                <rect key="frame" x="0.0" y="-226.5" width="284" height="452"/>
+                                                                <subviews>
+                                                                    <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="QJI-kW-POA">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="284" height="462"/>
+                                                                    </stackView>
+                                                                </subviews>
+                                                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                                <constraints>
+                                                                    <constraint firstItem="QJI-kW-POA" firstAttribute="centerY" secondItem="Sqf-Nt-Prc" secondAttribute="centerY" id="Gg2-ck-ana"/>
+                                                                    <constraint firstItem="QJI-kW-POA" firstAttribute="height" secondItem="Sqf-Nt-Prc" secondAttribute="height" id="LQl-fa-axL"/>
+                                                                    <constraint firstItem="QJI-kW-POA" firstAttribute="centerX" secondItem="Sqf-Nt-Prc" secondAttribute="centerX" id="Z1e-63-gZx"/>
+                                                                    <constraint firstItem="QJI-kW-POA" firstAttribute="width" secondItem="Sqf-Nt-Prc" secondAttribute="width" id="y4O-M2-qyA"/>
+                                                                </constraints>
+                                                                <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                                                                <userDefinedRuntimeAttributes>
+                                                                    <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                                                        <color key="value" red="0.42745098040000001" green="0.41176470590000003" blue="0.56470588239999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                    <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                                        <real key="value" value="1"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                                        <real key="value" value="3"/>
+                                                                    </userDefinedRuntimeAttribute>
+                                                                </userDefinedRuntimeAttributes>
+                                                            </view>
+                                                        </subviews>
+                                                        <color key="backgroundColor" red="0.70980392160000005" green="0.82745098039999998" blue="0.8980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                        <edgeInsets key="layoutMargins" top="10" left="10" bottom="10" right="10"/>
+                                                        <userDefinedRuntimeAttributes>
+                                                            <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                                <real key="value" value="0.0"/>
+                                                            </userDefinedRuntimeAttribute>
+                                                        </userDefinedRuntimeAttributes>
+                                                    </scrollView>
+                                                </subviews>
+                                                <color key="backgroundColor" red="0.59607843140000005" green="0.7843137255" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                                                <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                                            </stackView>
+                                        </subviews>
+                                        <color key="backgroundColor" red="0.59607843140000005" green="0.7843137255" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                                        <constraints>
+                                            <constraint firstItem="rYw-pJ-uyq" firstAttribute="top" secondItem="663-n7-Jwn" secondAttribute="bottom" id="9Gs-ds-1Kn"/>
+                                            <constraint firstItem="663-n7-Jwn" firstAttribute="width" secondItem="nIg-ez-N2J" secondAttribute="width" id="P66-wF-f9s"/>
+                                            <constraint firstItem="663-n7-Jwn" firstAttribute="centerX" secondItem="nIg-ez-N2J" secondAttribute="centerX" id="WQ9-5d-Emo"/>
+                                            <constraint firstItem="rYw-pJ-uyq" firstAttribute="width" secondItem="nIg-ez-N2J" secondAttribute="width" id="XfW-fP-xie"/>
+                                            <constraint firstItem="663-n7-Jwn" firstAttribute="top" secondItem="nIg-ez-N2J" secondAttribute="top" id="add-lE-oaz"/>
+                                            <constraint firstItem="rYw-pJ-uyq" firstAttribute="centerX" secondItem="nIg-ez-N2J" secondAttribute="centerX" id="fep-5d-H6q"/>
+                                            <constraint firstAttribute="bottom" secondItem="rYw-pJ-uyq" secondAttribute="bottom" id="uMf-AM-09X"/>
+                                        </constraints>
+                                        <edgeInsets key="layoutMargins" top="10" left="10" bottom="10" right="10"/>
+                                        <userDefinedRuntimeAttributes>
+                                            <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                                <color key="value" red="0.0" green="0.0" blue="0.066666666669999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            </userDefinedRuntimeAttribute>
+                                            <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                                <real key="value" value="1"/>
+                                            </userDefinedRuntimeAttribute>
+                                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                <real key="value" value="8"/>
+                                            </userDefinedRuntimeAttribute>
+                                        </userDefinedRuntimeAttributes>
+                                    </view>
+                                </subviews>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <constraints>
+                                    <constraint firstItem="nIg-ez-N2J" firstAttribute="height" secondItem="rRo-dr-1GN" secondAttribute="height" constant="-20" id="2cx-Wp-1D3"/>
+                                    <constraint firstItem="nIg-ez-N2J" firstAttribute="centerY" secondItem="rRo-dr-1GN" secondAttribute="centerY" id="Aow-J2-EtX"/>
+                                    <constraint firstItem="nIg-ez-N2J" firstAttribute="centerX" secondItem="rRo-dr-1GN" secondAttribute="centerX" id="DSh-bL-FaZ"/>
+                                    <constraint firstItem="nIg-ez-N2J" firstAttribute="width" secondItem="rRo-dr-1GN" secondAttribute="width" constant="-20" id="civ-Ll-a7e"/>
+                                </constraints>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                        <color key="value" red="0.70980392160000005" green="0.82745098039999998" blue="0.8980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
+                            </view>
+                        </subviews>
+                        <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="P0f-Qc-GSS" firstAttribute="width" secondItem="8YN-gM-ymv" secondAttribute="width" id="15Q-4t-71E"/>
+                            <constraint firstItem="rRo-dr-1GN" firstAttribute="top" secondItem="P0f-Qc-GSS" secondAttribute="bottom" id="40K-Ts-eE7"/>
+                            <constraint firstItem="rRo-dr-1GN" firstAttribute="width" secondItem="8YN-gM-ymv" secondAttribute="width" id="Jhr-rW-slc"/>
+                            <constraint firstItem="P0f-Qc-GSS" firstAttribute="top" secondItem="dOJ-i5-gIk" secondAttribute="bottom" id="WaW-Zq-Uf9"/>
+                            <constraint firstItem="P0f-Qc-GSS" firstAttribute="centerX" secondItem="8YN-gM-ymv" secondAttribute="centerX" id="gQv-36-Fxt"/>
+                            <constraint firstAttribute="bottom" secondItem="rRo-dr-1GN" secondAttribute="bottom" id="gzY-Cd-jBQ"/>
+                            <constraint firstItem="rRo-dr-1GN" firstAttribute="centerX" secondItem="8YN-gM-ymv" secondAttribute="centerX" id="yze-m6-yFy"/>
+                        </constraints>
+                        <userDefinedRuntimeAttributes>
+                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                <real key="value" value="0.0"/>
+                            </userDefinedRuntimeAttribute>
+                        </userDefinedRuntimeAttributes>
+                    </view>
+                    <connections>
+                        <outlet property="albumContainer" destination="QJI-kW-POA" id="lx0-EY-ryn"/>
+                        <outlet property="albumTitle" destination="663-n7-Jwn" id="PyG-dN-laj"/>
+                        <outlet property="albumView" destination="Sqf-Nt-Prc" id="JFw-h9-rTR"/>
+                        <outlet property="barButton" destination="cV9-gT-2OC" id="OEl-n0-Jqo"/>
+                        <outlet property="barTitle" destination="RJE-Hu-oDM" id="lLa-Lr-JZe"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="rq0-MV-vyl" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-2839" y="1801"/>
+        </scene>
     </scenes>
     <resources>
         <image name="PhotoPlaceholder" width="170" height="108"/>

+ 1 - 1
app/LablancaView.xib

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>

+ 167 - 0
app/ScheduleViewController.swift

@@ -0,0 +1,167 @@
+// Copyright (C) 2016 Inigo Valentin
+//
+// This file is part of the Gasteizko Margolariak IOS app.
+//
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
+//
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
+
+import UIKit
+import CoreData
+
+/**
+The view controller of the app.
+*/
+class ScheduleViewController: UIViewController, UIGestureRecognizerDelegate {
+
+	// Outlets
+	
+	// Margolari schedule indicator
+	var margolari: Bool = false
+	
+	// App delegate
+	var delegate: AppDelegate?
+	
+	func getContext () -> NSManagedObjectContext {
+		return NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType)
+	}
+	
+	/**
+	Run when the app loads.
+	*/
+	override func viewDidLoad() {
+		
+		NSLog(":SCHEDULECONTROLLER:LOG: Init album.")
+		
+		super.viewDidLoad()
+		self.loadSchedule(margolari: margolari)
+		
+		// Set button action TODO
+		//barButton.addTarget(self, action: #selector(self.back), for: .touchUpInside)
+	}
+	
+	/**
+	Returns to the main view controller.
+	*/
+	func back() {
+		NSLog(":SCHEDULECONTROLLER:DEBUG: Back")
+		self.dismiss(animated: true, completion: nil)
+	}
+	
+	
+	/**
+	Dispose of any resources that can be recreated.
+	*/
+	override func didReceiveMemoryWarning() {
+		super.didReceiveMemoryWarning()
+	}
+	
+	/**
+	Loads the photos of the album
+	*/
+	public func loadSchedule(margolari: Bool){
+		
+		NSLog(":SCHEDULECONTROLLER:DEBUG: Loading schedule: Margolariak \(margolari)")
+		
+		/*
+		var row : RowAlbum
+		
+		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
+		let appDelegate = UIApplication.shared.delegate as! AppDelegate
+		let lang : String = getLanguage()
+		context.persistentStoreCoordinator = appDelegate.persistentStoreCoordinator
+		let fetchRequest: NSFetchRequest<Photo_album> = Photo_album.fetchRequest()
+		fetchRequest.predicate = NSPredicate(format: "album = %i", id)
+		
+		var rowcount = 0
+		
+		do {
+			
+			// Get the photo list
+			let searchResults = try context.fetch(fetchRequest)
+			var image: String
+			
+			NSLog(":GALLERYCONTROLLER:DEBUG: Total photos: \(searchResults.count)")
+			
+			for i in (0..<searchResults.count) where i % 2 == 0 {
+				
+				var r = searchResults[i]
+				var photoId = r.value(forKey: "photo")! as! Int
+				
+				row = RowAlbum.init(s: "rowAlbum\(i)", i: i)
+				
+				// Get photo info from Photo entity
+				let imgFetchRequest: NSFetchRequest<Photo> = Photo.fetchRequest()
+				let imgSortDescriptor = NSSortDescriptor(key: "uploaded", ascending: true)
+				let imgSortDescriptors = [imgSortDescriptor]
+				imgFetchRequest.sortDescriptors = imgSortDescriptors
+				imgFetchRequest.predicate = NSPredicate(format: "id == %i", photoId)
+				imgFetchRequest.fetchLimit = 1
+				do{
+					var imgSearchResults = try context.fetch(imgFetchRequest)
+					var imgR = imgSearchResults[0]
+					image = imgR.value(forKey: "file")! as! String
+					NSLog(":GALLERYCONTROLLER:LOG: Image Row \(i) left: \(image)")
+					row.setImage(idx: 0, filename: image)
+					if i + 1 < searchResults.count {
+						r = searchResults[i + 1]
+						photoId = r.value(forKey: "photo")! as! Int
+						imgFetchRequest.predicate = NSPredicate(format: "id == %i", photoId)
+						imgSearchResults = try context.fetch(imgFetchRequest)
+						
+						
+						imgR = imgSearchResults[0]
+						image = imgR.value(forKey: "file")! as! String
+						NSLog(":GALLERYCONTROLLER:LOG: Image Row \(i) right: \(image)")
+						row.setImage(idx: 1, filename: image)
+					}
+					else{
+						NSLog(":GALLERYCONTROLLER:LOG: Image Row \(i) right: none")
+					}
+					//TODO create row, add images (L+R), add row to container.
+					//row.setImage(filename: image)
+				} catch {
+					print(":GALLERYCONTROLLER:ERROR: Error getting image for post \(id): \(error)")
+				}
+				
+				NSLog(":GALLERYCONTROLLER:DEBUG: Adding row: height: \(row.frame.height)")
+				albumContainer.addArrangedSubview(row)
+				
+				rowcount = rowcount + 1
+			}
+		} catch {
+			print("POST:ERROR: Error with request: \(error)")
+		}
+
+		*/
+
+	}
+	
+	/**
+	Gets the device language.
+	:return: Two letter language code of the device.
+	*/
+	func getLanguage() -> String{
+		let pre = NSLocale.preferredLanguages[0].subStr(start: 0, end: 1)
+		if(pre == "es" || pre == "en" || pre == "eu"){
+			return pre
+		}
+		else{
+			return "es"
+		}
+	}
+	
+}
+