瀏覽代碼

Schedule controller partially implemented.

Iñigo Valentin 9 年之前
父節點
當前提交
e873aec31d
共有 25 個文件被更改,包括 572 次插入101 次删除
  1. 8 0
      app.xcodeproj/project.pbxproj
  2. 6 0
      app/Assets.xcassets/Misc/Contents.json
  3. 23 0
      app/Assets.xcassets/Misc/Pinpoint.imageset/Contents.json
  4. 二進制
      app/Assets.xcassets/Misc/Pinpoint.imageset/pinpoint-1.png
  5. 二進制
      app/Assets.xcassets/Misc/Pinpoint.imageset/pinpoint-2.png
  6. 二進制
      app/Assets.xcassets/Misc/Pinpoint.imageset/pinpoint.png
  7. 23 0
      app/Assets.xcassets/Misc/PinpointGM.imageset/Contents.json
  8. 二進制
      app/Assets.xcassets/Misc/PinpointGM.imageset/pinpoint_gm-1.png
  9. 二進制
      app/Assets.xcassets/Misc/PinpointGM.imageset/pinpoint_gm-2.png
  10. 二進制
      app/Assets.xcassets/Misc/PinpointGM.imageset/pinpoint_gm.png
  11. 23 0
      app/Assets.xcassets/Misc/ScheduleBullet.imageset/Contents.json
  12. 二進制
      app/Assets.xcassets/Misc/ScheduleBullet.imageset/schedule_point-1.png
  13. 二進制
      app/Assets.xcassets/Misc/ScheduleBullet.imageset/schedule_point-2.png
  14. 二進制
      app/Assets.xcassets/Misc/ScheduleBullet.imageset/schedule_point.png
  15. 23 0
      app/Assets.xcassets/Misc/ScheduleLine.imageset/Contents.json
  16. 二進制
      app/Assets.xcassets/Misc/ScheduleLine.imageset/schedule_timeline-1.png
  17. 二進制
      app/Assets.xcassets/Misc/ScheduleLine.imageset/schedule_timeline-2.png
  18. 二進制
      app/Assets.xcassets/Misc/ScheduleLine.imageset/schedule_timeline.png
  19. 84 49
      app/Base.lproj/Main.storyboard
  20. 13 0
      app/LablancaView.swift
  21. 141 0
      app/RowSchedule.swift
  22. 143 0
      app/RowSchedule.xib
  23. 63 50
      app/ScheduleViewController.swift
  24. 20 0
      app/ViewController.swift
  25. 2 2
      app/app.xcdatamodeld/app.xcdatamodel/contents

+ 8 - 0
app.xcodeproj/project.pbxproj

@@ -54,6 +54,8 @@
 		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 */; };
+		93EB2F0C1EBF5AEB00F64186 /* RowSchedule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93EB2F0B1EBF5AEB00F64186 /* RowSchedule.swift */; };
+		93EB2F0E1EBF5BF500F64186 /* RowSchedule.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93EB2F0D1EBF5BF500F64186 /* RowSchedule.xib */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -106,6 +108,8 @@
 		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>"; };
+		93EB2F0B1EBF5AEB00F64186 /* RowSchedule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowSchedule.swift; sourceTree = "<group>"; };
+		93EB2F0D1EBF5BF500F64186 /* RowSchedule.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RowSchedule.xib; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -187,6 +191,8 @@
 				9326C4F31EA51C39007DF2A4 /* RowLablancaDay.xib */,
 				9326C4F51EA5279D007DF2A4 /* RowLablancaDay.swift */,
 				93E0C5F31EBE306900905811 /* ScheduleViewController.swift */,
+				93EB2F0B1EBF5AEB00F64186 /* RowSchedule.swift */,
+				93EB2F0D1EBF5BF500F64186 /* RowSchedule.xib */,
 			);
 			path = app;
 			sourceTree = "<group>";
@@ -272,6 +278,7 @@
 				93075C6A1E59CAB000396389 /* BlogView.xib in Resources */,
 				93B84BA41D9C31AB006C0F67 /* Assets.xcassets in Resources */,
 				935D6E2D1E8678B700CED3A1 /* GalleryView.xib in Resources */,
+				93EB2F0E1EBF5BF500F64186 /* RowSchedule.xib in Resources */,
 				93BAD2EE1E585578009DF853 /* RowHomeBlog.xib in Resources */,
 				9326C4F41EA51C39007DF2A4 /* RowLablancaDay.xib in Resources */,
 				935D6E311E867C5E00CED3A1 /* RowGallery.xib in Resources */,
@@ -309,6 +316,7 @@
 				93B84B9A1D9C31AB006C0F67 /* AppDelegate.swift in Sources */,
 				93B84BA21D9C31AB006C0F67 /* app.xcdatamodeld in Sources */,
 				935D6E331E867C7E00CED3A1 /* RowGallery.swift in Sources */,
+				93EB2F0C1EBF5AEB00F64186 /* RowSchedule.swift in Sources */,
 				936966ED1E98445200A11055 /* AlbumViewController.swift in Sources */,
 				93D9EA681DE342AC00089002 /* UIView.swift in Sources */,
 				938D211F1EA2306300C47EC3 /* LablancaView.swift in Sources */,

+ 6 - 0
app/Assets.xcassets/Misc/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 23 - 0
app/Assets.xcassets/Misc/Pinpoint.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "pinpoint.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "pinpoint-1.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "pinpoint-2.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二進制
app/Assets.xcassets/Misc/Pinpoint.imageset/pinpoint-1.png


二進制
app/Assets.xcassets/Misc/Pinpoint.imageset/pinpoint-2.png


二進制
app/Assets.xcassets/Misc/Pinpoint.imageset/pinpoint.png


+ 23 - 0
app/Assets.xcassets/Misc/PinpointGM.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "pinpoint_gm.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "pinpoint_gm-1.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "pinpoint_gm-2.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二進制
app/Assets.xcassets/Misc/PinpointGM.imageset/pinpoint_gm-1.png


二進制
app/Assets.xcassets/Misc/PinpointGM.imageset/pinpoint_gm-2.png


二進制
app/Assets.xcassets/Misc/PinpointGM.imageset/pinpoint_gm.png


+ 23 - 0
app/Assets.xcassets/Misc/ScheduleBullet.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "schedule_point.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "schedule_point-1.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "schedule_point-2.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二進制
app/Assets.xcassets/Misc/ScheduleBullet.imageset/schedule_point-1.png


二進制
app/Assets.xcassets/Misc/ScheduleBullet.imageset/schedule_point-2.png


二進制
app/Assets.xcassets/Misc/ScheduleBullet.imageset/schedule_point.png


+ 23 - 0
app/Assets.xcassets/Misc/ScheduleLine.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "schedule_timeline.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "schedule_timeline-1.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "schedule_timeline-2.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二進制
app/Assets.xcassets/Misc/ScheduleLine.imageset/schedule_timeline-1.png


二進制
app/Assets.xcassets/Misc/ScheduleLine.imageset/schedule_timeline-2.png


二進制
app/Assets.xcassets/Misc/ScheduleLine.imageset/schedule_timeline.png


+ 84 - 49
app/Base.lproj/Main.storyboard

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<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">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" 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>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
         <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -64,7 +64,7 @@
                                 </collectionViewFlowLayout>
                                 <cells>
                                     <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="a4j-DF-epb" customClass="MenuCollectionViewCell" customModule="app" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="-3" width="100" height="50"/>
+                                        <rect key="frame" x="0.0" y="-2.5" width="100" height="50"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                             <rect key="frame" x="0.0" y="0.0" width="100" height="50"/>
@@ -187,6 +187,7 @@
                         <outlet property="containerViewLocation" destination="T4H-Rn-I4y" id="EFa-Km-WuR"/>
                         <segue destination="UkS-wI-Yhx" kind="show" identifier="SeguePost" id="gs2-jd-cPW"/>
                         <segue destination="k0M-Sk-DZM" kind="show" identifier="SegueAlbum" id="Puc-tv-vaD"/>
+                        <segue destination="zJF-Mh-CNb" kind="show" identifier="SegueSchedule" id="A70-jo-yAP"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
@@ -559,7 +560,7 @@
                                     <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" bounces="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kmd-tW-XIB">
                                         <rect key="frame" x="0.0" y="0.0" width="320" height="518"/>
                                         <subviews>
-                                            <view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sej-1q-hlq" userLabel="Section">
+                                            <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sej-1q-hlq" userLabel="Section">
                                                 <rect key="frame" x="10" y="10" width="300" height="1046"/>
                                                 <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="YsV-il-CeR" userLabel="Title">
@@ -572,13 +573,13 @@
                                                         <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                         <nil key="highlightedColor"/>
                                                     </label>
-                                                    <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="NlX-b5-vyb" userLabel="Content">
+                                                    <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="NlX-b5-vyb" userLabel="Content">
                                                         <rect key="frame" x="0.0" y="30" width="300" height="1016"/>
                                                         <subviews>
                                                             <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YEF-04-q7Y" userLabel="Album">
                                                                 <rect key="frame" x="8" y="8" width="284" height="1000"/>
                                                                 <subviews>
-                                                                    <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="WRD-IZ-JpU">
+                                                                    <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="WRD-IZ-JpU">
                                                                         <rect key="frame" x="0.0" y="0.0" width="284" height="1000"/>
                                                                     </stackView>
                                                                 </subviews>
@@ -702,17 +703,17 @@
                         <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"/>
+                                <rect key="frame" x="0.0" y="20" width="320" height="30"/>
                                 <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"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="48" height="30"/>
                                         <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"/>
+                                        <rect key="frame" x="48" y="0.0" width="224" height="30"/>
                                         <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
                                         <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                         <nil key="highlightedColor"/>
@@ -731,10 +732,10 @@
                                 </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"/>
+                                <rect key="frame" x="0.0" y="50" width="320" height="518"/>
                                 <subviews>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nIg-ez-N2J" userLabel="Section">
-                                        <rect key="frame" x="10" y="10" width="300" height="507.5"/>
+                                        <rect key="frame" x="10" y="10" width="300" height="498"/>
                                         <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"/>
@@ -747,10 +748,10 @@
                                                 <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"/>
+                                                <rect key="frame" x="2" y="30" width="296" height="468.5"/>
                                                 <subviews>
                                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="odg-U1-6cp" userLabel="Calendar">
-                                                        <rect key="frame" x="8" y="8" width="284" height="60"/>
+                                                        <rect key="frame" x="8" y="8" width="280" 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"/>
@@ -775,8 +776,30 @@
                                                                     </userDefinedRuntimeAttribute>
                                                                 </userDefinedRuntimeAttributes>
                                                             </button>
+                                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="25" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EUB-BM-L7c" userLabel="Number">
+                                                                <rect key="frame" x="65" y="7.5" width="45" height="45"/>
+                                                                <constraints>
+                                                                    <constraint firstAttribute="width" constant="45" id="0J5-54-fFO"/>
+                                                                    <constraint firstAttribute="height" constant="45" id="bRL-x7-mQS"/>
+                                                                </constraints>
+                                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="35"/>
+                                                                <nil key="textColor"/>
+                                                                <nil key="highlightedColor"/>
+                                                            </label>
+                                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Agosto" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g7M-sJ-teh" userLabel="Month">
+                                                                <rect key="frame" x="110" y="32" width="105" height="20.5"/>
+                                                                <fontDescription key="fontDescription" type="italicSystem" pointSize="17"/>
+                                                                <nil key="textColor"/>
+                                                                <nil key="highlightedColor"/>
+                                                            </label>
+                                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Margoeguna" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TH3-vv-4wy">
+                                                                <rect key="frame" x="110" y="7.5" width="115" height="20.5"/>
+                                                                <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
+                                                                <nil key="textColor"/>
+                                                                <nil key="highlightedColor"/>
+                                                            </label>
                                                             <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"/>
+                                                                <rect key="frame" x="225" 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"/>
@@ -802,53 +825,63 @@
                                                         <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="EUB-BM-L7c" firstAttribute="leading" secondItem="ean-uL-e8X" secondAttribute="trailing" constant="10" id="7wi-ei-pIo"/>
                                                             <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 firstItem="TH3-vv-4wy" firstAttribute="trailing" secondItem="gEL-Ik-UfU" secondAttribute="leading" id="Fwr-5c-qZk"/>
+                                                            <constraint firstItem="g7M-sJ-teh" firstAttribute="leading" secondItem="EUB-BM-L7c" secondAttribute="trailing" id="SDa-kN-y0V"/>
+                                                            <constraint firstItem="g7M-sJ-teh" firstAttribute="bottom" secondItem="EUB-BM-L7c" secondAttribute="bottom" id="ewO-z9-CnW"/>
+                                                            <constraint firstItem="TH3-vv-4wy" firstAttribute="leading" secondItem="EUB-BM-L7c" secondAttribute="trailing" id="exx-HG-g1H"/>
+                                                            <constraint firstItem="TH3-vv-4wy" firstAttribute="top" secondItem="EUB-BM-L7c" secondAttribute="top" id="fjd-hL-ilJ"/>
                                                             <constraint firstAttribute="trailing" secondItem="gEL-Ik-UfU" secondAttribute="trailing" constant="10" id="lUb-Gk-coy"/>
+                                                            <constraint firstItem="g7M-sJ-teh" firstAttribute="trailing" secondItem="gEL-Ik-UfU" secondAttribute="leading" constant="-10" id="nvO-MM-b9b"/>
+                                                            <constraint firstItem="EUB-BM-L7c" firstAttribute="centerY" secondItem="odg-U1-6cp" secondAttribute="centerY" id="yZR-5M-Qdr"/>
                                                             <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"/>
+                                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sqf-Nt-Prc" userLabel="Schedule">
+                                                        <rect key="frame" x="8" y="78" width="280" height="382.5"/>
                                                         <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"/>
+                                                            <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="48Q-LP-YCz">
+                                                                <rect key="frame" x="0.0" y="0.0" width="280" height="382.5"/>
                                                                 <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 opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="bHp-Km-KNL">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="280" height="382.5"/>
                                                                     </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"/>
+                                                                    <constraint firstItem="bHp-Km-KNL" firstAttribute="centerY" secondItem="48Q-LP-YCz" secondAttribute="centerY" id="HB5-Fp-quo"/>
+                                                                    <constraint firstItem="bHp-Km-KNL" firstAttribute="centerX" secondItem="48Q-LP-YCz" secondAttribute="centerX" id="VAI-Nn-IAt"/>
+                                                                    <constraint firstItem="bHp-Km-KNL" firstAttribute="width" secondItem="48Q-LP-YCz" secondAttribute="width" id="aBI-FI-uS0"/>
+                                                                    <constraint firstItem="bHp-Km-KNL" firstAttribute="height" secondItem="48Q-LP-YCz" secondAttribute="height" id="pD4-YH-rJ5"/>
                                                                 </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>
+                                                            </scrollView>
                                                         </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"/>
+                                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                        <constraints>
+                                                            <constraint firstItem="48Q-LP-YCz" firstAttribute="centerX" secondItem="Sqf-Nt-Prc" secondAttribute="centerX" id="D5K-ml-TlX"/>
+                                                            <constraint firstItem="48Q-LP-YCz" firstAttribute="height" secondItem="Sqf-Nt-Prc" secondAttribute="height" id="hRA-1N-OZH"/>
+                                                            <constraint firstItem="48Q-LP-YCz" firstAttribute="centerY" secondItem="Sqf-Nt-Prc" secondAttribute="centerY" id="tz4-U7-hYk"/>
+                                                            <constraint firstItem="48Q-LP-YCz" firstAttribute="width" secondItem="Sqf-Nt-Prc" secondAttribute="width" id="zUk-4F-sbH"/>
+                                                        </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="0.0"/>
+                                                                <real key="value" value="1"/>
+                                                            </userDefinedRuntimeAttribute>
+                                                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                                                <real key="value" value="3"/>
                                                             </userDefinedRuntimeAttribute>
                                                         </userDefinedRuntimeAttributes>
-                                                    </scrollView>
+                                                    </view>
                                                 </subviews>
                                                 <color key="backgroundColor" red="0.59607843140000005" green="0.7843137255" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                                                <constraints>
+                                                    <constraint firstItem="Sqf-Nt-Prc" firstAttribute="top" secondItem="odg-U1-6cp" secondAttribute="bottom" constant="10" id="aOG-X0-VZl"/>
+                                                </constraints>
                                                 <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
                                             </stackView>
                                         </subviews>
@@ -857,8 +890,9 @@
                                             <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="Sqf-Nt-Prc" firstAttribute="width" secondItem="nIg-ez-N2J" secondAttribute="width" constant="-20" id="Z9f-tb-ejn"/>
                                             <constraint firstItem="663-n7-Jwn" firstAttribute="top" secondItem="nIg-ez-N2J" secondAttribute="top" id="add-lE-oaz"/>
+                                            <constraint firstItem="Sqf-Nt-Prc" firstAttribute="centerX" secondItem="nIg-ez-N2J" secondAttribute="centerX" id="ccQ-Bg-VP2"/>
                                             <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>
@@ -876,7 +910,7 @@
                                         </userDefinedRuntimeAttributes>
                                     </view>
                                 </subviews>
-                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <color key="backgroundColor" red="0.70980392160000005" green="0.82745098039999998" blue="0.8980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <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"/>
@@ -907,11 +941,12 @@
                         </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"/>
+                        <outlet property="btNext" destination="gEL-Ik-UfU" id="yfe-ny-2eZ"/>
+                        <outlet property="btPrev" destination="ean-uL-e8X" id="8ah-gF-AV8"/>
+                        <outlet property="lbDayMonth" destination="g7M-sJ-teh" id="Wwr-mS-Y3D"/>
+                        <outlet property="lbDayName" destination="TH3-vv-4wy" id="hbO-Yb-NUo"/>
+                        <outlet property="lbDayNumber" destination="EUB-BM-L7c" id="UjL-xN-CcE"/>
+                        <outlet property="svScheduleList" destination="bHp-Km-KNL" id="aSi-lC-w6H"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="rq0-MV-vyl" userLabel="First Responder" sceneMemberID="firstResponder"/>

+ 13 - 0
app/LablancaView.swift

@@ -113,6 +113,12 @@ class LablancaView: UIView {
 			NSLog(":LABLANCA:ERROR: Error getting festivals info: \(error)")
 		}
 		
+		// Set up schedule buttons
+		let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(openSchedule(_:)))
+		fBtSchedule.isUserInteractionEnabled = true
+		fBtSchedule.addGestureRecognizer(tapRecognizer)
+		
+		
 		// Get info about the day prices.
 		let dateFormatter = DateFormatter()
 		dateFormatter.dateFormat = "yyyy-MM-dd"
@@ -185,6 +191,13 @@ class LablancaView: UIView {
 		// Nothing else to be done.
 	}
 	
+	func openSchedule(_ sender:UITapGestureRecognizer? = nil){
+		NSLog(":LABLANCA:DEBUG: Getting delegate and showing schedule.")
+		let delegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
+		delegate.controller?.showSchedule(margolari: false)
+		NSLog(":LABLANCA:DEBUG: Schedule should be shown.")
+	}
+	
 	func getLanguage() -> String{
 		let pre = NSLocale.preferredLanguages[0].subStr(start: 0, end: 1)
 		if(pre == "es" || pre == "en" || pre == "eu"){

+ 141 - 0
app/RowSchedule.swift

@@ -0,0 +1,141 @@
+// 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 Foundation
+import UIKit
+
+/**
+Extension of UIView to be formatted as sections.
+*/
+@IBDesignable class RowSchedule: UIView {
+
+	
+	// Outlets
+	@IBOutlet weak var container: UIView!
+	@IBOutlet weak var lbTime: UILabel!
+	@IBOutlet weak var lbTitle: UILabel!
+	@IBOutlet weak var lbText: UILabel!
+	@IBOutlet weak var lbLocation: UILabel!
+	
+	/**
+	Default constructor
+	*/
+	required init?(coder aDecoder: NSCoder) {
+		super.init(coder: aDecoder)
+	}
+	
+	private func loadViewFromNib() {
+		let bundle = Bundle(for: type(of: self))
+		let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle)
+		nib.instantiate(withOwner: self, options: nil).first as! UIView
+	}
+	
+	/**
+	Default constructor.
+	:param: s Custom identifier
+	:param: i Custom identifier
+	*/
+	init(s: String, i: Int) {
+		super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
+		loadViewFromNib()
+		self.frame = self.bounds
+		self.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		self.translatesAutoresizingMaskIntoConstraints = true
+		
+		container.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		container.translatesAutoresizingMaskIntoConstraints = true
+		
+		container.frame = self.bounds
+		self.addSubview(container)
+		
+		// Set tap recognizer
+		/*print("ROW_BLOG:DEBUG: set tap recognizer")
+		let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector (self.openPost (_:)))
+		tapRecognizer.delegate = (UIApplication.shared.delegate as! AppDelegate).controller
+		addGestureRecognizer(tapRecognizer)*/
+	}
+	
+	/**
+	Default constructor for the interface builder
+	*/
+	override init(frame: CGRect){
+		super.init(frame: frame)
+	}
+	
+	/**
+	Sets the time of the event.
+	:param: str String with the time to set.
+	*/
+	func setTime(str: String){
+		self.lbTime.text = str
+	}
+	
+	/**
+	Sets the time of the event.
+	:param: hours Hour of the event start.
+	:param: minutes Minutes of the event start.
+	*/
+	func setTime(hours: Int, minutes: Int){
+		self.lbTime.text = "\(hours):\(minutes)"
+	}
+	
+	/**
+	Sets the time of the event.
+	:param: dtime Datetime of the event start.
+	*/
+	func setTime(dtime: NSDate){
+		let dateformatter = DateFormatter()
+		let calendar = Calendar.current
+		let hours = calendar.component(.hour, from: dtime as Date)
+		let minutes = calendar.component(.minute, from: dtime as Date)
+		self.lbTime.text = "\(hours):\(minutes)"
+	}
+	
+	/**
+	Sets the title of the event.
+	:param: text The title of the event.
+	*/
+	func setTitle(text: String){
+		self.lbTitle.text = text
+	}
+	
+	/**
+	Sets the location of the event.
+	:param: text The location of the event.
+	*/
+	func setLocation(text: String){
+		self.lbLocation.text = text
+	}
+	
+	/**
+	Sets the description of the event. Decodes HTML.
+	:param: text The new text.
+	*/
+	func setText(text: String){
+		self.lbText.text = text.stripHtml()
+	}
+	
+	/**
+	Opens an event dialog.
+	*/
+	func openEvent(_ sender:UITapGestureRecognizer? = nil){
+		print("ROW_BLOG:DEBUG: openpost")
+	}
+}

+ 143 - 0
app/RowSchedule.xib

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RowSchedule" customModule="app">
+            <connections>
+                <outlet property="container" destination="HZR-5W-2l9" id="Pbz-zj-AcP"/>
+                <outlet property="lbLocation" destination="Edl-Ib-zzS" id="P41-6d-DGV"/>
+                <outlet property="lbText" destination="pCF-JC-n5h" id="yAA-gU-Dt5"/>
+                <outlet property="lbTime" destination="VVW-yL-wmh" id="PLK-PD-yaj"/>
+                <outlet property="lbTitle" destination="vSV-nw-MRt" id="LoG-Yq-S3M"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HZR-5W-2l9" userLabel="Container">
+                    <rect key="frame" x="0.0" y="273.5" width="375" height="120"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ko7-ge-5ca" userLabel="Entry">
+                            <rect key="frame" x="10" y="10" width="355" height="120"/>
+                            <subviews>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="00:00" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VVW-yL-wmh" userLabel="Time">
+                                    <rect key="frame" x="10" y="10" width="55" height="22"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="55" id="qJV-iR-yg8"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
+                                    <color key="textColor" red="0.1529411765" green="0.33333333329999998" blue="0.45098039220000002" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <imageView userInteractionEnabled="NO" alpha="0.75" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ScheduleLine" translatesAutoresizingMaskIntoConstraints="NO" id="q6x-38-7dL" userLabel="Line">
+                                    <rect key="frame" x="79" y="-0.5" width="2" height="120"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="2" id="Qy1-BX-GQH"/>
+                                    </constraints>
+                                </imageView>
+                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ScheduleBullet" translatesAutoresizingMaskIntoConstraints="NO" id="pxM-Zk-Eo7" userLabel="Bullet">
+                                    <rect key="frame" x="70" y="11" width="20" height="20"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="20" id="WHH-b4-kKt"/>
+                                        <constraint firstAttribute="height" constant="20" id="Ye0-5j-v5U"/>
+                                    </constraints>
+                                </imageView>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vSV-nw-MRt" userLabel="Title">
+                                    <rect key="frame" x="100" y="10" width="255" height="22"/>
+                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
+                                    <color key="textColor" red="0.1529411765" green="0.33333333329999998" blue="0.45098039220000002" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Text" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pCF-JC-n5h" userLabel="Text">
+                                    <rect key="frame" x="110" y="37" width="235" height="21"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Pinpoint" translatesAutoresizingMaskIntoConstraints="NO" id="BmB-4o-ng5" userLabel="Pinpoint">
+                                    <rect key="frame" x="115" y="68" width="19" height="26"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="19" id="Biy-y3-MT7"/>
+                                        <constraint firstAttribute="height" constant="26" id="OQG-JA-m2Q"/>
+                                    </constraints>
+                                </imageView>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Location" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Edl-Ib-zzS">
+                                    <rect key="frame" x="139" y="72.5" width="206" height="18"/>
+                                    <fontDescription key="fontDescription" type="italicSystem" pointSize="15"/>
+                                    <color key="textColor" red="0.32931472081218272" green="0.32931472081218272" blue="0.32931472081218272" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                            <constraints>
+                                <constraint firstItem="Edl-Ib-zzS" firstAttribute="trailing" secondItem="pCF-JC-n5h" secondAttribute="trailing" id="1VK-ft-zMD"/>
+                                <constraint firstItem="VVW-yL-wmh" firstAttribute="leading" secondItem="ko7-ge-5ca" secondAttribute="leading" constant="10" id="2bv-NZ-02c"/>
+                                <constraint firstItem="vSV-nw-MRt" firstAttribute="centerY" secondItem="VVW-yL-wmh" secondAttribute="centerY" id="4zW-mq-1iT"/>
+                                <constraint firstItem="vSV-nw-MRt" firstAttribute="leading" secondItem="pxM-Zk-Eo7" secondAttribute="trailing" constant="10" id="7KL-GL-vCQ"/>
+                                <constraint firstItem="Edl-Ib-zzS" firstAttribute="leading" secondItem="BmB-4o-ng5" secondAttribute="trailing" constant="5" id="7k0-y1-elz"/>
+                                <constraint firstItem="BmB-4o-ng5" firstAttribute="leading" secondItem="pCF-JC-n5h" secondAttribute="leading" constant="5" id="EbO-2o-ewf"/>
+                                <constraint firstItem="q6x-38-7dL" firstAttribute="centerX" secondItem="pxM-Zk-Eo7" secondAttribute="centerX" id="FOh-uA-HYL"/>
+                                <constraint firstItem="VVW-yL-wmh" firstAttribute="top" secondItem="ko7-ge-5ca" secondAttribute="top" constant="10" id="MGt-lg-S7C"/>
+                                <constraint firstItem="BmB-4o-ng5" firstAttribute="top" secondItem="pCF-JC-n5h" secondAttribute="bottom" constant="10" id="MOh-Ga-NOQ"/>
+                                <constraint firstItem="pxM-Zk-Eo7" firstAttribute="centerY" secondItem="VVW-yL-wmh" secondAttribute="centerY" id="ORZ-Cx-D0o"/>
+                                <constraint firstItem="pCF-JC-n5h" firstAttribute="width" secondItem="vSV-nw-MRt" secondAttribute="width" constant="-20" id="ZWn-od-vpP"/>
+                                <constraint firstItem="pxM-Zk-Eo7" firstAttribute="leading" secondItem="VVW-yL-wmh" secondAttribute="trailing" constant="5" id="g87-LH-Iby"/>
+                                <constraint firstItem="pCF-JC-n5h" firstAttribute="top" secondItem="vSV-nw-MRt" secondAttribute="bottom" constant="5" id="h98-Dl-4cw"/>
+                                <constraint firstAttribute="trailing" secondItem="vSV-nw-MRt" secondAttribute="trailing" id="jLW-at-0mc"/>
+                                <constraint firstItem="q6x-38-7dL" firstAttribute="top" secondItem="ko7-ge-5ca" secondAttribute="top" id="mdq-SM-9G4"/>
+                                <constraint firstItem="pCF-JC-n5h" firstAttribute="centerX" secondItem="vSV-nw-MRt" secondAttribute="centerX" id="nM3-9e-iDR"/>
+                                <constraint firstItem="Edl-Ib-zzS" firstAttribute="centerY" secondItem="BmB-4o-ng5" secondAttribute="centerY" id="olt-3s-reR"/>
+                            </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>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="120" id="5eZ-Gg-zIC"/>
+                        <constraint firstAttribute="trailing" secondItem="ko7-ge-5ca" secondAttribute="trailing" constant="10" id="H98-ZX-xoZ"/>
+                        <constraint firstItem="ko7-ge-5ca" firstAttribute="bottom" secondItem="HZR-5W-2l9" secondAttribute="bottom" constant="10" id="O6V-Wc-nvy"/>
+                        <constraint firstItem="ko7-ge-5ca" firstAttribute="leading" secondItem="HZR-5W-2l9" secondAttribute="leading" constant="10" id="giZ-PP-oZq"/>
+                        <constraint firstItem="q6x-38-7dL" firstAttribute="height" secondItem="HZR-5W-2l9" secondAttribute="height" id="nyx-DR-DHI"/>
+                        <constraint firstAttribute="top" secondItem="ko7-ge-5ca" secondAttribute="top" constant="-10" id="odh-eT-v0E"/>
+                    </constraints>
+                    <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                            <real key="value" value="0.0"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="HZR-5W-2l9" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="Lp5-k0-ysc"/>
+                <constraint firstItem="HZR-5W-2l9" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="QJ3-of-4nA"/>
+                <constraint firstItem="HZR-5W-2l9" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="lFR-Ff-arx"/>
+            </constraints>
+        </view>
+    </objects>
+    <resources>
+        <image name="Pinpoint" width="10" height="13"/>
+        <image name="ScheduleBullet" width="12" height="12"/>
+        <image name="ScheduleLine" width="1" height="2"/>
+    </resources>
+</document>

+ 63 - 50
app/ScheduleViewController.swift

@@ -27,6 +27,12 @@ The view controller of the app.
 class ScheduleViewController: UIViewController, UIGestureRecognizerDelegate {
 
 	// Outlets
+	@IBOutlet weak var btPrev: UIButton!
+	@IBOutlet weak var btNext: UIButton!
+	@IBOutlet weak var lbDayNumber: UILabel!
+	@IBOutlet weak var lbDayMonth: UILabel!
+	@IBOutlet weak var lbDayName: UILabel!
+	@IBOutlet weak var svScheduleList: UIStackView!
 	
 	// Margolari schedule indicator
 	var margolari: Bool = false
@@ -43,12 +49,14 @@ class ScheduleViewController: UIViewController, UIGestureRecognizerDelegate {
 	*/
 	override func viewDidLoad() {
 		
-		NSLog(":SCHEDULECONTROLLER:LOG: Init album.")
+		NSLog(":SCHEDULECONTROLLER:LOG: Init schedule.")
 		
 		super.viewDidLoad()
 		self.loadSchedule(margolari: margolari)
 		
-		// Set button action TODO
+		//TODO Title
+		
+		// TODO Set button action
 		//barButton.addTarget(self, action: #selector(self.back), for: .touchUpInside)
 	}
 	
@@ -69,84 +77,89 @@ class ScheduleViewController: UIViewController, UIGestureRecognizerDelegate {
 	}
 	
 	/**
-	Loads the photos of the album
+	Loads the schedule.
 	*/
 	public func loadSchedule(margolari: Bool){
 		
 		NSLog(":SCHEDULECONTROLLER:DEBUG: Loading schedule: Margolariak \(margolari)")
 		
-		/*
-		var row : RowAlbum
+		var rowcount = 0
+		var row: RowSchedule
+		var start: NSDate
+		var title: String
+		var text: String
+		var locationId: Int
+		var location: String
 		
+		NSLog(":SCHEDULECONTROLLER:DEBUG: 1")
 		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
 		let appDelegate = UIApplication.shared.delegate as! AppDelegate
 		let lang : String = getLanguage()
+		NSLog(":SCHEDULECONTROLLER:DEBUG: 2")
 		context.persistentStoreCoordinator = appDelegate.persistentStoreCoordinator
-		let fetchRequest: NSFetchRequest<Photo_album> = Photo_album.fetchRequest()
-		fetchRequest.predicate = NSPredicate(format: "album = %i", id)
+		let fetchRequest: NSFetchRequest<Festival_event> = Festival_event.fetchRequest()
+		let sortDescriptor = NSSortDescriptor(key: "start", ascending: false)
+		let sortDescriptors = [sortDescriptor]
+		NSLog(":SCHEDULECONTROLLER:DEBUG: 3")
+		fetchRequest.sortDescriptors = sortDescriptors
 		
-		var rowcount = 0
+		if margolari == true{
+			fetchRequest.predicate = NSPredicate(format: "gm = %i", 1)
+		}
+		else{
+			fetchRequest.predicate = NSPredicate(format: "gm = %i", 0)
+		}
+		
+		// TODO: filter by date, not by number
+		fetchRequest.fetchLimit = 20
+		
+		NSLog(":SCHEDULECONTROLLER:DEBUG: 4")
 		
 		do {
 			
-			// Get the photo list
+			// Get the result
 			let searchResults = try context.fetch(fetchRequest)
-			var image: String
+			NSLog(":SCHEDULECONTROLLER:DEBUG: 5")
 			
-			NSLog(":GALLERYCONTROLLER:DEBUG: Total photos: \(searchResults.count)")
+			NSLog(":SCHEDULECONTROLLER:DEBUG: Total events: \(searchResults.count)")
 			
-			for i in (0..<searchResults.count) where i % 2 == 0 {
+			for r in searchResults as [NSManagedObject] {
 				
-				var r = searchResults[i]
-				var photoId = r.value(forKey: "photo")! as! Int
+				title = r.value(forKey: "title_\(lang)") as! String
+				text = r.value(forKey: "description_\(lang)") as! String
+				start = r.value(forKey: "start")! as! NSDate
+				locationId = r.value(forKey: "place")! as! Int
+				row = RowSchedule.init(s: "rowSchedule\(rowcount)", i: rowcount)
 				
-				row = RowAlbum.init(s: "rowAlbum\(i)", i: i)
+				row.setTitle(text: title)
+				row.setText(text: text)
+				row.setTime(dtime: start)
 				
-				// 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
+				// Get location info from Place entity
+				let locationFetchRequest: NSFetchRequest<Place> = Place.fetchRequest()
+				locationFetchRequest.predicate = NSPredicate(format: "id == %i", locationId)
+				locationFetchRequest.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)
+					var locationSearchResults = try context.fetch(locationFetchRequest)
+					var locationR = locationSearchResults[0]
+					location = locationR.value(forKey: "name_\(lang)")! as! String
+					
+					row.setLocation(text: location)
 				} catch {
-					print(":GALLERYCONTROLLER:ERROR: Error getting image for post \(id): \(error)")
+					NSLog(":SCHEDULECONTROLLER:ERROR: Error getting location: \(error)")
 				}
 				
-				NSLog(":GALLERYCONTROLLER:DEBUG: Adding row: height: \(row.frame.height)")
-				albumContainer.addArrangedSubview(row)
+				NSLog(":SCHEDULECONTROLLER:DEBUG: Adding row: height: \(row.frame.height)")
+				svScheduleList.addArrangedSubview(row)
+				row.setNeedsLayout()
+				row.layoutIfNeeded()
 				
 				rowcount = rowcount + 1
 			}
 		} catch {
-			print("POST:ERROR: Error with request: \(error)")
+			NSLog(":SCHEDULECONTROLLER:ERROR: Error with request: \(error)")
 		}
 
-		*/
-
 	}
 	
 	/**

+ 20 - 0
app/ViewController.swift

@@ -60,6 +60,18 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 		performSegue(withIdentifier: "SegueAlbum", sender: nil)
 	}
 	
+	func showSchedule(margolari: Bool){
+		NSLog(":CONTROLLER:DEBUG: Showing schedule. Margolari: \(margolari)")
+		if margolari == true{
+			self.passId = 1
+		}
+		else{
+			self.passId = 0
+		}
+		// TODO: Uncomment when ready
+		performSegue(withIdentifier: "SegueSchedule", sender: nil)
+	}
+	
 	override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 		NSLog(":CONTROLLER:DEBUG: preparing for segue '\(segue.identifier)' with id \(self.passId)")
 		if segue.identifier == "SeguePost"{
@@ -68,6 +80,14 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 		if segue.identifier == "SegueAlbum"{
 			(segue.destination as! AlbumViewController).id = passId
 		}
+		if segue.identifier == "SegueSchedule"{
+			if passId == 1{
+				(segue.destination as! ScheduleViewController).margolari = true
+			}
+			else{
+				(segue.destination as! ScheduleViewController).margolari = false
+			}
+		}
 	}
 	
 	/**

+ 2 - 2
app/app.xcdatamodeld/app.xcdatamodel/contents

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="11759" systemVersion="16D32" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
+<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="12141" systemVersion="16E195" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
     <entity name="Activity" representedClassName=".Activity" syncable="YES" codeGenerationType="class">
         <attribute name="after_en" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="after_es" optional="YES" attributeType="String" syncable="YES"/>
@@ -88,7 +88,7 @@
         <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="end" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
-        <attribute name="gm" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
+        <attribute name="gm" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="host" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
         <attribute name="place" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>