Browse Source

Merge branch 'Home' into Sync

Iñigo Valentin 9 years ago
parent
commit
fbc4661776
10 changed files with 271 additions and 137 deletions
  1. 43 0
      README.es-ES.md
  2. 43 0
      README.es-EU.md
  3. 33 14
      README.md
  4. 19 17
      app/Base.lproj/Main.storyboard
  5. 6 7
      app/BlogView.swift
  6. 82 67
      app/HomeView.swift
  7. 2 2
      app/Info.plist
  8. 16 3
      app/RowSchedule.swift
  9. 21 25
      app/RowSchedule.xib
  10. 6 2
      app/ScheduleViewController.swift

+ 43 - 0
README.es-ES.md

@@ -0,0 +1,43 @@
+---
+[Informazioa euskaraz](README.es-EU.md) 
+[Information in english](README.md)
+---
+
+
+# Androizko Gasteizko Margolariak aplikazioia #
+
+Una aplicacion para iOS para miembros de [Gasteizko Margolariak](https://margolariak.com/) [Vitoria-Gasteiz](http://www.vitoria-gasteiz.org/).
+
+### Durante las Fiestas ###
+
+Hay funciones diseñadas especificamente para las Fiestas de La Blanca, y solo estarán disponibles en esas fechas.
+
+* [NO IMPLEMENTADO] Consulta en tu teléfono el Programa de Fiestas, encuentra actos alrededor tuyo ydescubre como llegar hasta ellos.
+* [NO IMPLEMENTADO] Consulta el Programa de Fiestas de Gasteizko Margolariak, detallado y con la ubicación de cada actividad...
+* [NO IMPLEMENTADO] ... pero, como no somos famosos por nuestra puntualidad, comprueba nuestra ubicación en tiempo real.
+
+
+### Durante el resto del año ###
+
+* [PARCIALMENTE IMPLEMENTADO] Mantente informado de las actividades que organizamos durante el resto del año.
+* [PARCIALMENTE IMPLEMENTADO] Recibe las ultimas noticias sobre la Cuadrilla en nuestro Blog
+* [PARCIALMENTE IMPLEMENTADO] Galería de fotos de todas nuestras actividades.
+
+
+### Compatibilidad ###
+
+iOS 9.1 o superior.
+
+
+### Idiomas ###
+
+* [IMPLEMENTADO] Castellano
+* [NO IMPLEMENTADO] Inglés
+* [NO IMPLEMENTADO] Euskera 
+
+
+### Otros dispositivos ###
+
+* ¿Android? [Lo tenemos!](https://github.com/GasteizkoMargolariak/GasteizkoMargolariakApp) 
+* ¿Prefieres el sitio web? [No problem!](https://github.com/GasteizkoMargolariak/GasteizkoMargolariakWeb)
+

+ 43 - 0
README.es-EU.md

@@ -0,0 +1,43 @@
+---
+[Informacion en castellano](README.es-ES.md) 
+[Information in english](README.md)
+---
+
+
+# Androizko Gasteizko Margolariak aplikazioia #
+
+Una aplicacion para iOS para miembros de [Gasteizko Margolariak](https://margolariak.com/) [Vitoria-Gasteiz](http://www.vitoria-gasteiz.org/).
+
+### Durante las Fiestas ###
+
+Hay funciones diseñadas especificamente para las Fiestas de La Blanca, y solo estarán disponibles en esas fechas.
+
+* [NO IMPLEMENTADO] Consulta en tu teléfono el Programa de Fiestas, encuentra actos alrededor tuyo ydescubre como llegar hasta ellos.
+* [NO IMPLEMENTADO] Consulta el Programa de Fiestas de Gasteizko Margolariak, detallado y con la ubicación de cada actividad...
+* [NO IMPLEMENTADO] ... pero, como no somos famosos por nuestra puntualidad, comprueba nuestra ubicación en tiempo real.
+
+
+### Durante el resto del año ###
+
+* [PARCIALMENTE IMPLEMENTADO] Mantente informado de las actividades que organizamos durante el resto del año.
+* [PARCIALMENTE IMPLEMENTADO] Recibe las ultimas noticias sobre la Cuadrilla en nuestro Blog
+* [PARCIALMENTE IMPLEMENTADO] Galería de fotos de todas nuestras actividades.
+
+
+### Compatibilidad ###
+
+iOS 9.1 o superior.
+
+
+### Idiomas ###
+
+* [IMPLEMENTADO] Castellano
+* [NO IMPLEMENTADO] Inglés
+* [NO IMPLEMENTADO] Euskera 
+
+
+### Otros dispositivos ###
+
+* ¿Android? [Lo tenemos!](https://github.com/GasteizkoMargolariak/GasteizkoMargolariakApp) 
+* ¿Prefieres el sitio web? [No problem!](https://github.com/GasteizkoMargolariak/GasteizkoMargolariakWeb)
+

+ 33 - 14
README.md

@@ -1,26 +1,45 @@
+---
+[Información en castellano](README.es-ES.md) 
+[Informazioa euskaraz](README.es-EU.md)
+---
 
-Gasteizko Margolariak iOS App
-===
 
-An iOS app intended for members of <a href="http://margolariak.com/">Gasteizko Margolariak</a> in <a href="http://www.vitoria-gasteiz.org/">Vitoria-Gasteiz</a>, Spain.
+# Gasteizko Margolariak Android App #
 
-### Status ###
+An iOS app intended for members of [Gasteizko Margolariak](https://margolariak.com/) in [Vitoria-Gasteiz](http://www.vitoria-gasteiz.org/), Spain.
 
-In a few words: nothing works. Yet.
+### Features during the city festivals ###
 
+This features will be only available during the city festivals.
 
-### Upcaming features during the city festivals ###
+* [TODO] Check out the festival schedule, discover events all around the city, and get their location.
+* [TODO] Check out the schedule for the members of Gasteizko Margolariak, indicating the location of every event and activity...
+* [TODO] ... but, since we are not known for our puntuality, check out the location of Gasteizko Margolariak in real time.
+* [TODO] Approximate distance to important event around the city.
 
-This features wil be only available during the city festivals.
 
-* Check out the festival schedule, showing events all around the city, and indicating their location.
-* Check out the schedule for the members of Gasteizko Margolariak, indicating the location of every event and activity...
-* ... but, since we are not known for our puntuality, check out the location of Gasteizko Margolariak in real time.
+### Features for the rest of the year ###
 
+* [PARTIALLY IMPLEMENTED] Check out and be notified of all activities organized by Gasteizko Margolariak.
+* [MOSTLY IMPLEMENTED] Stay updated witho our blog.
+* [MOSTLY IMPLEMENTED] Check out our photo gallery.
 
-### Upcaming features for the rest of the year ###
 
-* Check out and be notified of all activities organized by Gasteizko Margolariak.
-* View nd comment our blog.
-* View and comment our gallery.
+### Compatibility ###
+
+iOS 9.1 or higher.
+
+
+### Languages ###
+
+* [AVAILABLE] Spanish
+* [TODO] English
+* [TODO] Basque
+
+
+### On other devices ###
+
+* Got Android? [Got you covered!](https://github.com/GasteizkoMargolariak/GasteizkoMargolariakApp) 
+* Do you prefer web pages? [No problem!](https://github.com/GasteizkoMargolariak/GasteizkoMargolariakWeb)
+
 

+ 19 - 17
app/Base.lproj/Main.storyboard

@@ -704,17 +704,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="30"/>
+                                <rect key="frame" x="0.0" y="20" width="320" height="29"/>
                                 <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="30"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="48" height="29"/>
                                         <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="30"/>
+                                        <rect key="frame" x="48" y="0.0" width="224" height="29"/>
                                         <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
                                         <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                         <nil key="highlightedColor"/>
@@ -733,10 +733,10 @@
                                 </constraints>
                             </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rRo-dr-1GN">
-                                <rect key="frame" x="0.0" y="50" width="320" height="518"/>
+                                <rect key="frame" x="0.0" y="49" width="320" height="519"/>
                                 <subviews>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nIg-ez-N2J" userLabel="Section">
-                                        <rect key="frame" x="10" y="10" width="300" height="498"/>
+                                        <rect key="frame" x="10" y="10" width="300" height="499"/>
                                         <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"/>
@@ -749,7 +749,7 @@
                                                 <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="2" y="30" width="296" height="468.5"/>
+                                                <rect key="frame" x="2" y="30" width="296" height="469"/>
                                                 <subviews>
                                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="odg-U1-6cp" userLabel="Calendar">
                                                         <rect key="frame" x="8" y="8" width="280" height="60"/>
@@ -778,7 +778,7 @@
                                                                 </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"/>
+                                                                <rect key="frame" x="65" y="8" width="45" height="45"/>
                                                                 <constraints>
                                                                     <constraint firstAttribute="width" constant="45" id="0J5-54-fFO"/>
                                                                     <constraint firstAttribute="height" constant="45" id="bRL-x7-mQS"/>
@@ -788,13 +788,13 @@
                                                                 <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"/>
+                                                                <rect key="frame" x="110" y="32.5" 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"/>
+                                                                <rect key="frame" x="110" y="8" width="115" height="20.5"/>
                                                                 <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
                                                                 <nil key="textColor"/>
                                                                 <nil key="highlightedColor"/>
@@ -841,27 +841,29 @@
                                                         </constraints>
                                                     </view>
                                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sqf-Nt-Prc" userLabel="Schedule">
-                                                        <rect key="frame" x="8" y="78" width="280" height="382.5"/>
+                                                        <rect key="frame" x="8" y="78" width="280" height="383"/>
                                                         <subviews>
-                                                            <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"/>
+                                                            <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" bounces="NO" translatesAutoresizingMaskIntoConstraints="NO" id="48Q-LP-YCz">
+                                                                <rect key="frame" x="0.0" y="0.0" width="280" height="383"/>
                                                                 <subviews>
-                                                                    <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 opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="bHp-Km-KNL">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="280" height="383"/>
                                                                     </stackView>
                                                                 </subviews>
                                                                 <constraints>
-                                                                    <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"/>
+                                                                    <constraint firstItem="bHp-Km-KNL" firstAttribute="top" secondItem="48Q-LP-YCz" secondAttribute="top" id="eg6-cn-DEy"/>
+                                                                    <constraint firstAttribute="trailing" secondItem="bHp-Km-KNL" secondAttribute="trailing" id="gRo-5O-urs"/>
+                                                                    <constraint firstAttribute="bottom" secondItem="bHp-Km-KNL" secondAttribute="bottom" id="gfj-Ap-09t"/>
                                                                 </constraints>
                                                             </scrollView>
                                                         </subviews>
                                                         <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 firstAttribute="bottom" secondItem="48Q-LP-YCz" secondAttribute="bottom" id="Hh1-co-5CG"/>
+                                                            <constraint firstItem="48Q-LP-YCz" firstAttribute="top" secondItem="Sqf-Nt-Prc" secondAttribute="top" id="Hkf-Vo-M1V"/>
                                                             <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>

+ 6 - 7
app/BlogView.swift

@@ -60,9 +60,9 @@ class BlogView: UIView {
 		
 		// Get viewController from StoryBoard
 		self.storyboard = UIStoryboard(name: "Main", bundle: nil)
-		self.controller = storyboard?.instantiateViewController(withIdentifier: "GMViewController") as! ViewController
+		self.controller = storyboard?.instantiateViewController(withIdentifier: "GMViewController") as? ViewController
 		self.context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
-		self.delegate = UIApplication.shared.delegate as! AppDelegate
+		self.delegate = UIApplication.shared.delegate as? AppDelegate
 		self.lang = getLanguage()
 		self.context?.persistentStoreCoordinator = delegate?.persistentStoreCoordinator
 		
@@ -86,7 +86,7 @@ class BlogView: UIView {
 			
 			// Get the results
 			let searchResults = try self.context?.fetch(fetchRequest)			
-			NSLog(":BLOG:DEBUG: Total posts: \(searchResults?.count)")
+			NSLog(":BLOG:DEBUG: Total posts: \(String(describing: searchResults?.count))")
 			
 			var row : RowBlog
 			var count = 0
@@ -95,9 +95,9 @@ class BlogView: UIView {
 			var text: String
 			var image: String
 			
-			for r in searchResults as! [NSManagedObject] {
+			for r in searchResults! {
 				count = count + 1
-				NSLog(":BLOG:DEBUG: Post perm: \(r.value(forKey: "permalink"))")
+				NSLog(":BLOG:DEBUG: Post perm: \(String(describing: r.value(forKey: "permalink")))")
 								
 				//Create a new row
 				row = RowBlog.init(s: "rowBlog\(count)", i: count)
@@ -117,7 +117,7 @@ class BlogView: UIView {
 				imgFetchRequest.fetchLimit = 1
 				do{
 					let imgSearchResults = try context?.fetch(imgFetchRequest)
-					for imgR in imgSearchResults as! [NSManagedObject]{
+					for imgR in imgSearchResults!{
 						image = imgR.value(forKey: "image")! as! String
 						NSLog(":BLOG:DEBUG: Image: \(image)")
 						row.setImage(filename: image)
@@ -149,7 +149,6 @@ class BlogView: UIView {
 			NSLog(":BLOG:ERROR: Error with request: \(error)")
 		}
 		NSLog(":BLOG:DEBUG: Finished populating BlogView")
-
 	}
 	
 	/*func openPost(){//(_ sender:UITapGestureRecognizer? = nil){

+ 82 - 67
app/HomeView.swift

@@ -21,18 +21,16 @@
 import Foundation
 import CoreData
 import UIKit
+
+
 /**
- Class to handle the home view.
- */
+Class to handle the home view.
+*/
 class HomeView: UIView {
 	
-	//The main scroll view.
+	// Outlets
 	@IBOutlet weak var scrollView: UIScrollView!
-	
-	//The container of the view.
 	@IBOutlet weak var container: UIView!
-	
-	//Each of the sections of the view.
 	@IBOutlet weak var locationSection: Section!
 	@IBOutlet weak var lablancaSection: Section!
 	@IBOutlet weak var futureActivitiesSection: Section!
@@ -45,24 +43,31 @@ class HomeView: UIView {
 	var moc: NSManagedObjectContext? = nil
 	var appDelegate: AppDelegate? = nil
 	
+	
+	/**
+	Run when the view is started.
+	:param: frame Frame for the view.
+	*/
 	override init(frame: CGRect){
 		super.init(frame: frame)
 	}
 	
+	
 	/**
-	 Run when the view is started.
+	Run when the view is started.
+	:param: coder Application decoder.
 	*/
 	required init?(coder aDecoder: NSCoder) {
 		
 		super.init(coder: aDecoder)
 		
-		//Load the contents of the HomeView.xib file.
+		// Load the contents of the HomeView.xib file.
 		Bundle.main.loadNibNamed("HomeView", owner: self, options: nil)
 		self.addSubview(container)
 		container.frame = self.bounds
 		
 
-		//Set titles for each section
+		// Set titles for each section
 		locationSection.setTitle(text: "Encuentranos")
 		lablancaSection.setTitle(text: "La Blanca")
 		futureActivitiesSection.setTitle(text: "Proximas actividades")
@@ -71,13 +76,13 @@ class HomeView: UIView {
 		pastActivitiesSection.setTitle(text: "Ultimas actividades")
 		socialSection.setTitle(text: "Siguenos")
 		
-		//Get info to populate sections
+		// Get info to populate sections
 		self.moc = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
 		self.appDelegate = UIApplication.shared.delegate as! AppDelegate
 		self.moc?.persistentStoreCoordinator = appDelegate?.persistentStoreCoordinator
 		self.lang = getLanguage()
 		
-		//Populate sections
+		// Populate sections
 		self.populate()
 		
 		
@@ -92,11 +97,14 @@ class HomeView: UIView {
 		//self.scrollView.contentSize.height = 1300// CGFloat(h);
 	}
 
+	
 	/**
-	 Triggers a reloading (or initial loading) of all sections.
+	Triggers a reloading (or initial loading) of all sections.
 	*/
 	func populate(){
 		
+		NSLog(":HOME:DEBUG: Populating home view.")
+		
 		//Populate sections
 		self.setUpPastActivities(context: self.moc!, delegate: appDelegate!, lang: self.lang!, parent: self.pastActivitiesSection.getContentStack())
 		self.setUpBlog(context: self.moc!, delegate: self.appDelegate!, lang: self.lang!, parent: self.blogSection.getContentStack())
@@ -106,6 +114,11 @@ class HomeView: UIView {
 		self.pastActivitiesSection.expandSection()
 	}
 	
+	
+	/**
+	Retrieves the device language. The only available ones are Spanish, English and Basque.
+	:return: Two letter language code (en, eu, es). If other, spanish will be selected.
+	*/
 	func getLanguage() -> String{
 		let pre = NSLocale.preferredLanguages[0].subStr(start: 0, end: 1)
 		if(pre == "es" || pre == "en" || pre == "eu"){
@@ -116,9 +129,17 @@ class HomeView: UIView {
 		}
 	}
 	
+	
+	/**
+	Sets the future activities section.
+	Loads up to two future activities.
+	:param: context Aplication context.
+	:param: delegate Application delegate.
+	:param: lang Device language. Two letter code. Accepts 'es', 'en' and 'eu'.
+	:param: parent View where the rows will be loaded.
+	*/
 	func setUpFutureActivities(context : NSManagedObjectContext, delegate: AppDelegate, lang: String, parent : UIStackView){
 		
-		//context.persistentStoreCoordinator = delegate.persistentStoreCoordinator
 		let fetchRequest: NSFetchRequest<Activity> = Activity.fetchRequest()
 		let sortDescriptor = NSSortDescriptor(key: "date", ascending: true)
 		let sortDescriptors = [sortDescriptor]
@@ -127,11 +148,8 @@ class HomeView: UIView {
 		fetchRequest.fetchLimit = 2
 		
 		do {
-			//go get the results
 			let searchResults = try context.fetch(fetchRequest)
-			
-			//I like to check the size of the returned results!
-			print ("Activities: \(searchResults.count)")
+			NSLog(":HOME:DEBUG: Future activity count: \(searchResults.count)")
 			
 			var row : RowHomePastActivities
 			var count = 0
@@ -140,19 +158,14 @@ class HomeView: UIView {
 			var text: String
 			var image: String
 			
-			//You need to convert to NSManagedObject to use 'for' loops
 			for r in searchResults as [NSManagedObject] {
 				count = count + 1
-				//get the Key Value pairs (although there may be a better way to do that...
-				print("Perm: \(r.value(forKey: "permalink"))")
-				
 				
 				//Create a new row
 				row = RowHomePastActivities.init(s: "rowHomeFutureActivities\(count)", i: count)
 				id = r.value(forKey: "id")! as! Int
 				title = r.value(forKey: "title_\(lang)")! as! String
 				text = r.value(forKey: "text_\(lang)")! as! String
-				print(title)
 				row.setTitle(text: title)
 				row.setText(text: text)
 				
@@ -168,26 +181,30 @@ class HomeView: UIView {
 					let imgSearchResults = try context.fetch(imgFetchRequest)
 					for imgR in imgSearchResults as [NSManagedObject]{
 						image = imgR.value(forKey: "image")! as! String
-						print ("IMAGE: \(image)")
 						row.setImage(filename: image)
 					}
 				} catch {
-					print("Error getting image for activity \(id): \(error)")
+					NSLog(":HOME:ERROR: Error getting image for futureactivity \(id): \(error)")
 				}
-				
-				print("Row height: \(row.frame.height)")
-				
 				parent.addArrangedSubview(row)
 				
 			}
 		} catch {
-			print("Error with request: \(error)")
+			NSLog(":HOME:ERROR: Error setting the future activities section up: \(error)")
 		}
 	}
 	
+	
+	/**
+	Sets the blog section.
+	Loads up to two posts.
+	:param: context Aplication context.
+	:param: delegate Application delegate.
+	:param: lang Device language. Two letter code. Accepts 'es', 'en' and 'eu'.
+	:param: parent View where the rows will be loaded.
+	*/
 	func setUpBlog(context : NSManagedObjectContext, delegate: AppDelegate, lang: String, parent : UIStackView){
 		
-		//context.persistentStoreCoordinator = delegate.persistentStoreCoordinator
 		let fetchRequest: NSFetchRequest<Post> = Post.fetchRequest()
 		let sortDescriptor = NSSortDescriptor(key: "dtime", ascending: false)
 		let sortDescriptors = [sortDescriptor]
@@ -195,11 +212,8 @@ class HomeView: UIView {
 		fetchRequest.fetchLimit = 2
 		
 		do {
-			//go get the results
 			let searchResults = try context.fetch(fetchRequest)
-			
-			//I like to check the size of the returned results!
-			print ("Post: \(searchResults.count)")
+			NSLog(":HOME:DEBUG: Post count: \(searchResults.count)")
 			
 			var row : RowHomeBlog
 			var count = 0
@@ -208,12 +222,8 @@ class HomeView: UIView {
 			var text: String
 			var image: String
 			
-			//You need to convert to NSManagedObject to use 'for' loops
 			for r in searchResults as [NSManagedObject] {
 				count = count + 1
-				//get the Key Value pairs (although there may be a better way to do that...
-				print("Perm: \(r.value(forKey: "permalink"))")
-				
 				
 				//Create a new row
 				row = RowHomeBlog.init(s: "rowHomeBlog\(count)", i: count)
@@ -237,15 +247,12 @@ class HomeView: UIView {
 					let imgSearchResults = try context.fetch(imgFetchRequest)
 					for imgR in imgSearchResults as [NSManagedObject]{
 						image = imgR.value(forKey: "image")! as! String
-						print ("IMAGE: \(image)")
 						row.setImage(filename: image)
 					}
 				} catch {
-					print("Error getting image for post \(id): \(error)")
+					NSLog(":HOME:ERROR: Error getting image for post \(id): \(error)")
 				}
 				
-				print("Row height: \(row.frame.height)")
-				
 				parent.addArrangedSubview(row)
 				
 				let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(openPost(_:)))
@@ -254,13 +261,21 @@ class HomeView: UIView {
 				
 			}
 		} catch {
-			print("Error with request: \(error)")
+			NSLog(":HOME:ERROR: Error setting the blog section up: \(error)")
 		}
 	}
 	
+	
+	/**
+	Sets the past activities section.
+	Loads up to two past activities.
+	:param: context Aplication context.
+	:param: delegate Application delegate.
+	:param: lang Device language. Two letter code. Accepts 'es', 'en' and 'eu'.
+	:param: parent View where the rows will be loaded.
+	*/
 	func setUpPastActivities(context : NSManagedObjectContext, delegate: AppDelegate, lang: String, parent : UIStackView){
 		
-		//context.persistentStoreCoordinator = delegate.persistentStoreCoordinator
 		let fetchRequest: NSFetchRequest<Activity> = Activity.fetchRequest()
 		let sortDescriptor = NSSortDescriptor(key: "date", ascending: false)
 		let sortDescriptors = [sortDescriptor]
@@ -269,11 +284,8 @@ class HomeView: UIView {
 		fetchRequest.fetchLimit = 2
 		
 		do {
-			//go get the results
 			let searchResults = try context.fetch(fetchRequest)
-			
-			//I like to check the size of the returned results!
-			print ("Activities: \(searchResults.count)")
+			NSLog(":HOME:LOG: Setting past activities up. Count: \(searchResults.count)")
 			
 			var row : RowHomePastActivities
 			var count = 0
@@ -282,12 +294,8 @@ class HomeView: UIView {
 			var text: String
 			var image: String
 			
-			//You need to convert to NSManagedObject to use 'for' loops
 			for r in searchResults as [NSManagedObject] {
 				count = count + 1
-				//get the Key Value pairs (although there may be a better way to do that...
-				print("Perm: \(r.value(forKey: "permalink"))")
-				
 				
 				//Create a new row
 				row = RowHomePastActivities.init(s: "rowHomePastActivities\(count)", i: count)
@@ -311,32 +319,35 @@ class HomeView: UIView {
 					let imgSearchResults = try context.fetch(imgFetchRequest)
 					for imgR in imgSearchResults as [NSManagedObject]{
 						image = imgR.value(forKey: "image")! as! String
-						print ("IMAGE: \(image)")
 						row.setImage(filename: image)
 					}
 				} catch {
-					print("Error getting image for activity \(id): \(error)")
+					NSLog(":HOME:ERROR: Error getting image for past activity \(id): \(error)")
 				}
 				
-				print("Row height: \(row.frame.height)")
-				
 				parent.addArrangedSubview(row)
 				
 			}
 		} catch {
-			print("Error with request: \(error)")
+			NSLog(":HOME:ERROR: Error setting the past activities section up: \(error)")
 		}
 	}
 	
+	/**
+	Sets the fgallery section.
+	Loads up to four photos.
+	:param: context Aplication context.
+	:param: delegate Application delegate.
+	:param: parent View where the rows will be loaded.
+	*/
 	func setUpGallery(context : NSManagedObjectContext, delegate: AppDelegate,parent: UIStackView){
-		print("HOME:LOG: Setting up gallery.")
+		NSLog(":HOME:LOG: Setting gallery section up.")
 		
 		// Create the row
 		var row: RowHomeGallery
 		row = RowHomeGallery.init(s: "rowHomeGallery", i: 0)
 		parent.addArrangedSubview(row)
 		
-		
 		// Set images
 		let fetchRequest: NSFetchRequest<Photo> = Photo.fetchRequest()
 		let sortDescriptor = NSSortDescriptor(key: "uploaded", ascending: false)
@@ -345,10 +356,7 @@ class HomeView: UIView {
 		fetchRequest.fetchLimit = 4
 		
 		do {
-			//go get the results
 			let searchResults = try context.fetch(fetchRequest)
-	
-			var id: Int
 			var image: String
 			
 			// Loop images
@@ -365,24 +373,31 @@ class HomeView: UIView {
 			
 		}
 		catch{
-			print("HOME:ERROR: Error setting gallery up: \(error)")
+			NSLog(":HOME:ERROR: Error setting gallery up: \(error)")
 		}
 		
 	}
 	
+	/**
+	Sets the social section.
+	:param: parent View where the rows will be loaded.
+	*/
 	func setUpSocial(parent : UIStackView){
-		print("SETING UP SOCIAL")
+		NSLog(":HOME:LOG: Setting soceial section up.")
 		//Create a new row
 		var row : RowHomeSocial
 		row = RowHomeSocial.init(s: "rowHomeSocial", i: 0)
-		print("ROW CREATED")
 		parent.addArrangedSubview(row)
 	}
 	
+	/**
+	opens the blog section, showing a post.
+	:param: sender: View calling the function.
+	*/
 	func openPost(_ sender:UITapGestureRecognizer? = nil){
-		print("HOME:DEBUG: getting delegate and showing post.")
+		NSLog(":HOME:DEBUG: Getting delegate and showing post.")
 		let delegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
 		delegate.controller?.showPost(id: (sender?.view as! RowHomeBlog).id)
-		print("HOME:DEBUG: Post should be shown.")
+		NSLog(":HOME:DEBUG: Post should be shown.")
 	}
 }

+ 2 - 2
app/Info.plist

@@ -17,9 +17,9 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>0.0.2</string>
+	<string>0.0.3</string>
 	<key>CFBundleVersion</key>
-	<string>3</string>
+	<string>4</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>UILaunchStoryboardName</key>

+ 16 - 3
app/RowSchedule.swift

@@ -93,7 +93,14 @@ Extension of UIView to be formatted as sections.
 	:param: minutes Minutes of the event start.
 	*/
 	func setTime(hours: Int, minutes: Int){
-		self.lbTime.text = "\(hours):\(minutes)"
+		var strMinutes: String = ""
+		if "\(minutes)".length == 1{
+			strMinutes = "0\(minutes)"
+		}
+		else{
+			strMinutes = "\(minutes)"
+		}
+		self.lbTime.text = "\(hours):\(strMinutes)"
 	}
 	
 	/**
@@ -101,11 +108,17 @@ Extension of UIView to be formatted as sections.
 	: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)"
+		var strMinutes: String = ""
+		if "\(minutes)".length == 1{
+			strMinutes = "0\(minutes)"
+		}
+		else{
+			strMinutes = "\(minutes)"
+		}
+		self.lbTime.text = "\(hours):\(strMinutes)"
 	}
 	
 	/**

+ 21 - 25
app/RowSchedule.xib

@@ -27,9 +27,9 @@
                     <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"/>
+                            <rect key="frame" x="0.0" y="0.0" width="375" 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">
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="00:00" textAlignment="right" 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"/>
@@ -38,41 +38,42 @@
                                     <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"/>
+                                <imageView userInteractionEnabled="NO" alpha="0.75" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="q6x-38-7dL" userLabel="Line">
+                                    <rect key="frame" x="76" y="-0.5" width="2" height="120"/>
+                                    <color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
                                     <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"/>
+                                    <rect key="frame" x="67" 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"/>
+                                    <rect key="frame" x="92" y="10" width="283" 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"/>
+                                    <rect key="frame" x="102" y="37" width="263" 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"/>
+                                    <rect key="frame" x="107" y="68" width="10" height="13"/>
                                     <constraints>
-                                        <constraint firstAttribute="width" constant="19" id="Biy-y3-MT7"/>
-                                        <constraint firstAttribute="height" constant="26" id="OQG-JA-m2Q"/>
+                                        <constraint firstAttribute="width" constant="10" id="Biy-y3-MT7"/>
+                                        <constraint firstAttribute="height" constant="13" 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"/>
+                                    <rect key="frame" x="122" y="66.5" width="243" height="17"/>
+                                    <fontDescription key="fontDescription" type="italicSystem" pointSize="14"/>
                                     <color key="textColor" red="0.32931472081218272" green="0.32931472081218272" blue="0.32931472081218272" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     <nil key="highlightedColor"/>
                                 </label>
@@ -82,7 +83,7 @@
                                 <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="vSV-nw-MRt" firstAttribute="leading" secondItem="pxM-Zk-Eo7" secondAttribute="trailing" constant="5" 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"/>
@@ -90,34 +91,30 @@
                                 <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="pxM-Zk-Eo7" firstAttribute="leading" secondItem="VVW-yL-wmh" secondAttribute="trailing" constant="2" 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"/>
+                                    <real key="value" value="0.0"/>
                                 </userDefinedRuntimeAttribute>
                                 <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                    <real key="value" value="3"/>
+                                    <real key="value" value="0.0"/>
                                 </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 firstAttribute="trailing" secondItem="ko7-ge-5ca" secondAttribute="trailing" id="H98-ZX-xoZ"/>
+                        <constraint firstItem="ko7-ge-5ca" firstAttribute="bottom" secondItem="HZR-5W-2l9" secondAttribute="bottom" id="O6V-Wc-nvy"/>
+                        <constraint firstItem="ko7-ge-5ca" firstAttribute="leading" secondItem="HZR-5W-2l9" secondAttribute="leading" 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"/>
+                        <constraint firstAttribute="top" secondItem="ko7-ge-5ca" secondAttribute="top" id="odh-eT-v0E"/>
                     </constraints>
                     <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
                     <userDefinedRuntimeAttributes>
@@ -138,6 +135,5 @@
     <resources>
         <image name="Pinpoint" width="10" height="13"/>
         <image name="ScheduleBullet" width="12" height="12"/>
-        <image name="ScheduleLine" width="1" height="2"/>
     </resources>
 </document>

+ 6 - 2
app/ScheduleViewController.swift

@@ -156,11 +156,15 @@ class ScheduleViewController: UIViewController, UIGestureRecognizerDelegate {
 				
 				NSLog(":SCHEDULECONTROLLER:DEBUG: Adding row: height: \(row.frame.height)")
 				svScheduleList.addArrangedSubview(row)
-				row.setNeedsLayout()
-				row.layoutIfNeeded()
+				//row.setNeedsLayout()
+				//row.layoutIfNeeded()
 				
 				rowcount = rowcount + 1
 			}
+
+			svScheduleList.setNeedsLayout()
+			svScheduleList.layoutIfNeeded()
+
 		} catch {
 			NSLog(":SCHEDULECONTROLLER:ERROR: Error with request: \(error)")
 		}