Skip to content

Commit

Permalink
-initial cells of Contact UP have been made
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCrabbe committed Jun 6, 2014
1 parent d4fec34 commit 335546c
Show file tree
Hide file tree
Showing 11 changed files with 330 additions and 35 deletions.
14 changes: 12 additions & 2 deletions UniversityPrograms/UniversityPrograms.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
1B0A691C1938D58C005C821D /* AboutUPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B0A691A1938D58C005C821D /* AboutUPViewController.m */; };
1B0A69211938DA8B005C821D /* UpcomingEventsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B0A691F1938DA8B005C821D /* UpcomingEventsTableViewCell.m */; };
1B0A69221938DA8B005C821D /* UpcomingEventsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B0A69201938DA8B005C821D /* UpcomingEventsTableViewCell.xib */; };
1B48B56819421640008F5186 /* DirectoryTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B48B56619421640008F5186 /* DirectoryTableViewCell.m */; };
1B48B56919421640008F5186 /* DirectoryTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B48B56719421640008F5186 /* DirectoryTableViewCell.xib */; };
1B7880DA1940EBED00333ED5 /* MyUPInitTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B7880D81940EBED00333ED5 /* MyUPInitTableViewCell.m */; };
1B7880DB1940EBED00333ED5 /* MyUPInitTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B7880D91940EBED00333ED5 /* MyUPInitTableViewCell.xib */; };
1B7880E01940EC8B00333ED5 /* ContactUPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B7880DE1940EC8B00333ED5 /* ContactUPViewController.m */; };
Expand Down Expand Up @@ -95,6 +97,9 @@
1B0A691F1938DA8B005C821D /* UpcomingEventsTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UpcomingEventsTableViewCell.m; sourceTree = "<group>"; };
1B0A69201938DA8B005C821D /* UpcomingEventsTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UpcomingEventsTableViewCell.xib; sourceTree = "<group>"; };
1B38F299193F6FD2005158D1 /* UPWebserviceConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UPWebserviceConstants.h; sourceTree = "<group>"; };
1B48B56519421640008F5186 /* DirectoryTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryTableViewCell.h; sourceTree = "<group>"; };
1B48B56619421640008F5186 /* DirectoryTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DirectoryTableViewCell.m; sourceTree = "<group>"; };
1B48B56719421640008F5186 /* DirectoryTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DirectoryTableViewCell.xib; sourceTree = "<group>"; };
1B7880D71940EBED00333ED5 /* MyUPInitTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyUPInitTableViewCell.h; sourceTree = "<group>"; };
1B7880D81940EBED00333ED5 /* MyUPInitTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyUPInitTableViewCell.m; sourceTree = "<group>"; };
1B7880D91940EBED00333ED5 /* MyUPInitTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyUPInitTableViewCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -201,11 +206,11 @@
1B0A69031938D434005C821D /* Controllers */ = {
isa = PBXGroup;
children = (
1B7880DC1940EC5E00333ED5 /* Contact UP */,
1BB198C4193F9AB60017A1D6 /* UPNavigationViewController.h */,
1BB198C5193F9AB60017A1D6 /* UPNavigationViewController.m */,
1BB198CA193FA54A0017A1D6 /* UPViewController.h */,
1BB198CB193FA54A0017A1D6 /* UPViewController.m */,
1B7880DC1940EC5E00333ED5 /* Contact UP */,
1B0A690B1938D4A5005C821D /* upcoming events */,
1B0A69181938D575005C821D /* about */,
1BAD1A3C193CCB9E006D24AD /* MyUP */,
Expand Down Expand Up @@ -251,17 +256,20 @@
1B7880D71940EBED00333ED5 /* MyUPInitTableViewCell.h */,
1B7880D81940EBED00333ED5 /* MyUPInitTableViewCell.m */,
1B7880D91940EBED00333ED5 /* MyUPInitTableViewCell.xib */,
1B48B56519421640008F5186 /* DirectoryTableViewCell.h */,
1B48B56619421640008F5186 /* DirectoryTableViewCell.m */,
1B48B56719421640008F5186 /* DirectoryTableViewCell.xib */,
);
name = "Table Cells";
sourceTree = "<group>";
};
1B0A690B1938D4A5005C821D /* upcoming events */ = {
isa = PBXGroup;
children = (
1BAD1A4B193CD2AA006D24AD /* event */,
1B0A690E1938D520005C821D /* UpcomingEventViewController.h */,
1B0A690F1938D520005C821D /* UpcomingEventViewController.m */,
1B0A69101938D520005C821D /* UpcomingEventViewController.xib */,
1BAD1A4B193CD2AA006D24AD /* event */,
);
name = "upcoming events";
sourceTree = "<group>";
Expand Down Expand Up @@ -582,6 +590,7 @@
1BB198C0193F99F70017A1D6 /* Cog_filled.png in Resources */,
1B7880E91940EE9000333ED5 /* [email protected] in Resources */,
1BAD1A50193CD385006D24AD /* SpecificEventViewController.xib in Resources */,
1B48B56919421640008F5186 /* DirectoryTableViewCell.xib in Resources */,
1B7880E11940EC8B00333ED5 /* ContactUPViewController.xib in Resources */,
1BB198DB193FAA580017A1D6 /* Info.png in Resources */,
1B7880F1194105CE00333ED5 /* Pencil_filled.png in Resources */,
Expand Down Expand Up @@ -640,6 +649,7 @@
1BAD1A4F193CD385006D24AD /* SpecificEventViewController.m in Sources */,
1BB198C9193FA4530017A1D6 /* UIColor+UPColors.m in Sources */,
1B7880E01940EC8B00333ED5 /* ContactUPViewController.m in Sources */,
1B48B56819421640008F5186 /* DirectoryTableViewCell.m in Sources */,
1B0A691C1938D58C005C821D /* AboutUPViewController.m in Sources */,
1BA9FE68193E244B008F8981 /* PriorFeedbackTableViewCell.m in Sources */,
1BB198E3193FC4900017A1D6 /* LocationDTO.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ - (void)viewDidLoad
self.firstNameBox.text = [[NSUserDefaults standardUserDefaults] valueForKey:@"userFirstName"];
self.lastNameBox.text = [[NSUserDefaults standardUserDefaults] valueForKey:@"userLastName"];


// Do any additional setup after loading the view from its nib.
}
- (IBAction)didTapSubmit:(id)sender {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

#import <UIKit/UIKit.h>
#import "UPViewController.h"
@interface ContactUPViewController : UPViewController
@interface ContactUPViewController : UPViewController <UITableViewDelegate, UITableViewDataSource>

@end
86 changes: 86 additions & 0 deletions UniversityPrograms/UniversityPrograms/ContactUPViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@
//

#import "ContactUPViewController.h"
#import "DirectoryTableViewCell.h"
#import "CommentViewController.h"

@interface ContactUPViewController ()

@property NSArray *directoryArray;
@property (weak, nonatomic) IBOutlet UITableView *contactUPTableView;

@property (strong, nonatomic) IBOutlet UITableViewCell *addressCell;
@property (strong, nonatomic) IBOutlet UITableViewCell *directoryHeaderCell;
@property (strong, nonatomic) IBOutlet UITableViewCell *sendFeedbackCell;


@end

@implementation ContactUPViewController
Expand All @@ -21,6 +31,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self.title=@"Contact UP";
self.tabBarItem.image=[UIImage imageNamed:@"Contact.png"];
self.tabBarItem.selectedImage=[UIImage imageNamed:@"Contact_filled.png"];
self.directoryArray = [[NSArray alloc] init];
// Custom initialization
}
return self;
Expand All @@ -37,5 +48,80 @@ - (void)didReceiveMemoryWarning
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

// Return the number of rows in the section.
return self.directoryArray.count+3;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

if(indexPath.row==0){
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"sendFeedbackCell"];

if(!cell){
cell = self.sendFeedbackCell;
}
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
return cell;


}
else if(indexPath.row==1){
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"addressCell"];

if(!cell){
cell = self.addressCell;
}
return cell;

}
else if(indexPath.row==2){
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"directoryHeaderCell"];

if(!cell){
cell = self.directoryHeaderCell;
}
return cell;
}
else{
DirectoryTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"directoryCell"];

if(!cell){
cell = [[DirectoryTableViewCell alloc] init];
}
return cell;
}

}
- (CGFloat)tableView:(UITableView *)tableview heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
CGFloat retVal =0.0f;
if(indexPath.row==1){
retVal=120.0f;

}
else{
retVal=44.0f;

}

return retVal;

}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
CommentViewController *tappedEvent = [[CommentViewController alloc] init];
[self.navigationController pushViewController:tappedEvent animated:YES];
[self.contactUPTableView reloadData];
}

@end
Loading

0 comments on commit 335546c

Please sign in to comment.