Skip to content

Commit

Permalink
Add some tests for how hidden/non-hidden views work with Frank
Browse files Browse the repository at this point in the history
  • Loading branch information
moredip committed Oct 20, 2012
1 parent 1dee5f4 commit 179da44
Show file tree
Hide file tree
Showing 8 changed files with 448 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example/Controls/Controls.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
9C60AD54157C97FB008EE16A /* UIProgressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C60AD52157C97FB008EE16A /* UIProgressViewController.m */; };
9C60AD56157C97FB008EE16A /* UIProgressViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C60AD53157C97FB008EE16A /* UIProgressViewController.xib */; };
C164121F1543BFDC00FECF23 /* EditableTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C164121E1543BFDC00FECF23 /* EditableTableViewController.m */; };
C177A4D216323CD60081DF77 /* ViewPropertiesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C177A4D016323CD50081DF77 /* ViewPropertiesViewController.m */; };
C177A4D316323CD60081DF77 /* ViewPropertiesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C177A4D116323CD50081DF77 /* ViewPropertiesViewController.xib */; };
C1C3CCC6156BE29D00AEE136 /* image0.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C3CCC5156BE29D00AEE136 /* image0.png */; };
C1C3CCC9156BE30200AEE136 /* image1.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C3CCC8156BE30200AEE136 /* image1.png */; };
C1C3CCCC156BE33800AEE136 /* image2.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C3CCCB156BE33800AEE136 /* image2.png */; };
Expand Down Expand Up @@ -46,6 +48,9 @@
9C60AD53157C97FB008EE16A /* UIProgressViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIProgressViewController.xib; sourceTree = "<group>"; };
C164121D1543BFDC00FECF23 /* EditableTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditableTableViewController.h; sourceTree = "<group>"; };
C164121E1543BFDC00FECF23 /* EditableTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditableTableViewController.m; sourceTree = "<group>"; };
C177A4CF16323CD50081DF77 /* ViewPropertiesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewPropertiesViewController.h; sourceTree = "<group>"; };
C177A4D016323CD50081DF77 /* ViewPropertiesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewPropertiesViewController.m; sourceTree = "<group>"; };
C177A4D116323CD50081DF77 /* ViewPropertiesViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewPropertiesViewController.xib; sourceTree = "<group>"; };
C1AC878D15605FAB002B1165 /* ControlsAppDelegate+FrankExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ControlsAppDelegate+FrankExtensions.m"; sourceTree = "<group>"; };
C1C3CCC5156BE29D00AEE136 /* image0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = image0.png; path = images/image0.png; sourceTree = "<group>"; };
C1C3CCC8156BE30200AEE136 /* image1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = image1.png; path = images/image1.png; sourceTree = "<group>"; };
Expand Down Expand Up @@ -165,6 +170,9 @@
9C60AD51157C97FB008EE16A /* UIProgressViewController.h */,
9C60AD52157C97FB008EE16A /* UIProgressViewController.m */,
9C60AD53157C97FB008EE16A /* UIProgressViewController.xib */,
C177A4CF16323CD50081DF77 /* ViewPropertiesViewController.h */,
C177A4D016323CD50081DF77 /* ViewPropertiesViewController.m */,
C177A4D116323CD50081DF77 /* ViewPropertiesViewController.xib */,
);
path = Controls;
sourceTree = "<group>";
Expand Down Expand Up @@ -252,6 +260,7 @@
C1C3CCD2156BE39900AEE136 /* image4.png in Resources */,
9C60AD56157C97FB008EE16A /* UIProgressViewController.xib in Resources */,
C1E8A77715F3B418001083B5 /* MainWindow-iPad.xib in Resources */,
C177A4D316323CD60081DF77 /* ViewPropertiesViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -272,6 +281,7 @@
C1E7C1CB1569DA9200CCBCD8 /* DataEntryViewController.m in Sources */,
9C60AD54157C97FB008EE16A /* UIProgressViewController.m in Sources */,
D66968BD1594DDDE000163A8 /* ControlsAppDelegate+FrankExtensions.m in Sources */,
C177A4D216323CD60081DF77 /* ViewPropertiesViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
9 changes: 9 additions & 0 deletions example/Controls/Controls/RootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
#import "EditableTableViewController.h"
#import "DataEntryViewController.h"
#import "UIProgressViewController.h"
#import "ViewPropertiesViewController.h"

typedef enum {
RowsUISwitch,
RowsCarousel,
RowsEditableTable,
RowsDataEntry,
RowsUIProgressView,
RowsViewProperties,
RowsCount,
} Rows;

Expand Down Expand Up @@ -94,6 +96,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
case RowsUIProgressView:
cell.textLabel.text = @"UIProgressView";
break;
case RowsViewProperties:
cell.textLabel.text = @"View Properties";
break;

}

Expand Down Expand Up @@ -161,6 +166,10 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
break;
case RowsUIProgressView:
detailVC = [[UIProgressViewController alloc] initWithNibName:@"UIProgressViewController" bundle:nil];
break;
case RowsViewProperties:
detailVC = [[ViewPropertiesViewController alloc] initWithNibName:@"ViewPropertiesViewController" bundle:nil];

break;
}

Expand Down
13 changes: 13 additions & 0 deletions example/Controls/Controls/ViewPropertiesViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ViewPropertiesViewController.h
// Controls
//
// Created by Pete Hodgson on 10/19/12.
// Copyright (c) 2012 ThoughtWorks. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ViewPropertiesViewController : UIViewController

@end
64 changes: 64 additions & 0 deletions example/Controls/Controls/ViewPropertiesViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// ViewPropertiesViewController.m
// Controls
//
// Created by Pete Hodgson on 10/19/12.
// Copyright (c) 2012 ThoughtWorks. All rights reserved.
//

#import "ViewPropertiesViewController.h"

@interface ViewPropertiesViewController ()
@property (retain, nonatomic) IBOutlet UIButton *hideButton;
@property (retain, nonatomic) IBOutlet UIView *blueSquare;
@property (retain, nonatomic) IBOutlet UIView *orangeSquare;

@end

@implementation ViewPropertiesViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (void)dealloc {
[_hideButton release];
[_blueSquare release];
[_orangeSquare release];
[super dealloc];
}
- (void)viewDidUnload {
[self setHideButton:nil];
[self setBlueSquare:nil];
[self setOrangeSquare:nil];
[super viewDidUnload];
}

- (IBAction)didTouchHideButton:(id)sender {

if( self.blueSquare.hidden ){
self.blueSquare.hidden = false;
[self.hideButton setTitle:@"Hide view" forState:UIControlStateNormal];
}else{
self.blueSquare.hidden = true;
[self.hideButton setTitle:@"Show view" forState:UIControlStateNormal];
}
}
@end
Loading

0 comments on commit 179da44

Please sign in to comment.