venue in schedule now shows correctly

This commit is contained in:
Senad Uka
2014-09-04 08:28:15 +02:00
parent 10eb4e0f14
commit 0e1b3048ce
7 changed files with 164 additions and 26 deletions

View File

@@ -73,22 +73,65 @@
</objects>
<point key="canvasLocation" x="1333" y="-242"/>
</scene>
<!--Table View Controller-->
<!--Schedule Films View Controller-->
<scene sceneID="2yk-lz-VwC">
<objects>
<tableViewController id="0t7-N6-wZY" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="as4-4p-NwJ">
<tableViewController id="0t7-N6-wZY" customClass="FESScheduleFilmsViewController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="109" sectionHeaderHeight="22" sectionFooterHeight="22" id="as4-4p-NwJ">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="NlW-xg-4gy">
<rect key="frame" x="0.0" y="86" width="320" height="44"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="scheduleFilmCell" rowHeight="109" id="NlW-xg-4gy" customClass="FESScheduleFilmCell">
<rect key="frame" x="0.0" y="86" width="320" height="109"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="NlW-xg-4gy" id="qGp-By-vBv">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="108"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VMV-Mw-Ifg">
<rect key="frame" x="20" y="20" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qhF-PW-R8w">
<rect key="frame" x="70" y="20" width="236" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yQC-zo-ba8">
<rect key="frame" x="70" y="48" width="236" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5wK-D2-9Nf">
<rect key="frame" x="70" y="77" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="qhF-PW-R8w" firstAttribute="leading" secondItem="VMV-Mw-Ifg" secondAttribute="trailing" constant="8" id="6jd-wM-3re"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="qhF-PW-R8w" secondAttribute="trailing" constant="14" id="6pV-wl-tKi"/>
<constraint firstItem="qhF-PW-R8w" firstAttribute="leading" secondItem="VMV-Mw-Ifg" secondAttribute="trailing" constant="20" id="BDY-y4-iVQ"/>
<constraint firstItem="5wK-D2-9Nf" firstAttribute="leading" secondItem="qGp-By-vBv" secondAttribute="leading" constant="70" id="aOH-hG-W6Q"/>
<constraint firstAttribute="trailing" secondItem="yQC-zo-ba8" secondAttribute="trailing" constant="14" id="p6G-uz-cU3"/>
<constraint firstAttribute="trailing" secondItem="qhF-PW-R8w" secondAttribute="trailing" constant="20" id="u0C-ff-LaB"/>
<constraint firstItem="VMV-Mw-Ifg" firstAttribute="leading" secondItem="qGp-By-vBv" secondAttribute="leading" constant="20" id="wiZ-uQ-wz0"/>
<constraint firstItem="yQC-zo-ba8" firstAttribute="leading" secondItem="qGp-By-vBv" secondAttribute="leading" constant="70" id="yjj-Xh-y6n"/>
<constraint firstAttribute="trailing" secondItem="5wK-D2-9Nf" secondAttribute="trailing" constant="208" id="yuJ-Nt-rQB"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="scheduleFilmDuration" destination="5wK-D2-9Nf" id="ESW-5j-in1"/>
<outlet property="scheduleFilmTime" destination="VMV-Mw-Ifg" id="2Vl-pn-ljV"/>
<outlet property="scheduleFilmTitle" destination="qhF-PW-R8w" id="UF0-jb-ZWv"/>
<outlet property="scheduleFilmVenue" destination="yQC-zo-ba8" id="W2e-In-hzD"/>
</connections>
</tableViewCell>
</prototypes>
<connections>

View File

@@ -0,0 +1,18 @@
//
// FESScheduleFilmCell.h
// FestivalHelper
//
// Created by Hamo Hapic on 03/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FESScheduleFilmCell : UITableViewCell
@property (weak, nonatomic)IBOutlet UILabel *scheduleFilmTime;
@property (weak, nonatomic)IBOutlet UILabel *scheduleFilmTitle;
@property (weak, nonatomic)IBOutlet UILabel *scheduleFilmVenue;
@property (weak, nonatomic)IBOutlet UILabel *scheduleFilmDuration;
@end

View File

@@ -0,0 +1,39 @@
//
// FESScheduleFilmCell.m
// FestivalHelper
//
// Created by Hamo Hapic on 03/09/14.
// Copyright (c) 2014 Senad Uka. All rights reserved.
//
#import "FESScheduleFilmCell.h"
@implementation FESScheduleFilmCell
@synthesize scheduleFilmTitle;
@synthesize scheduleFilmDuration;
@synthesize scheduleFilmTime;
@synthesize scheduleFilmVenue;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)awakeFromNib
{
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end

View File

@@ -8,6 +8,7 @@
#import "FESScheduleFilmsViewController.h"
#import "FESScheduleFilm.h"
#import "FESScheduleFilmCell.h"
@interface FESScheduleFilmsViewController ()
@@ -55,16 +56,26 @@
return [scheduleFilmsArray count];
}
/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
// Configure the cell...
UITableViewCell *retrievedCell = [tableView dequeueReusableCellWithIdentifier:@"scheduleFilmCell" forIndexPath:indexPath];
FESScheduleFilmCell *cell = (FESScheduleFilmCell *)retrievedCell;
if(cell)
{
//The beauty of this is that you have all your data in one object and grab WHATEVER you like
//This way in the future you can add another field without doing much.
FESScheduleFilm *scheduleFilm = [scheduleFilmsArray objectAtIndex:indexPath.row];
cell.scheduleFilmTime.text = scheduleFilm.scheduleFilmTime;
cell.scheduleFilmDuration.text = scheduleFilm.scheduleFilmDuration;
cell.scheduleFilmTitle.text = scheduleFilm.scheduleFilmTitle;
cell.scheduleFilmVenue.text = scheduleFilm.scheduleFilmVenue;
}
return cell;
}
*/
/*
// Override to support conditional editing of the table view.

View File

@@ -9,6 +9,7 @@
#import "FESScheduleTableViewController.h"
#import "FESSCheduleEntry.h"
#import "FESScheduleEntryCell.h"
#import "FESScheduleFilmsViewController.h"
@interface FESScheduleTableViewController ()
@@ -166,7 +167,11 @@
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
FESScheduleFilmsViewController *destination = (FESScheduleFilmsViewController *) [segue destinationViewController];
FESSCheduleEntry *entry = (FESSCheduleEntry *)[self.scheduleArray objectAtIndex:self.tableView.indexPathForSelectedRow.row];
// Pass the selected object to the new view controller.
destination.scheduleFilmsArray = entry.scheduleFilms;
}