Skip to content

Commit

Permalink
Modication of the sample to match the new integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ipodishima committed Nov 2, 2011
1 parent 3daaca5 commit a990e8f
Show file tree
Hide file tree
Showing 9 changed files with 237 additions and 60 deletions.
6 changes: 6 additions & 0 deletions Examples/Cascade/Cascade.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
20AB8423141FA51400C11F72 /* detached_image.png in Resources */ = {isa = PBXBuildFile; fileRef = 20AB8422141FA51400C11F72 /* detached_image.png */; };
20AB8427141FA55B00C11F72 /* ExampleNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 20AB8426141FA55B00C11F72 /* ExampleNavigationController.m */; };
B68075131458204B008035DC /* libCascade.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B680751214582041008035DC /* libCascade.a */; };
E06EEEE6146160A30095F933 /* ExampleUITableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E06EEEE5146160A20095F933 /* ExampleUITableViewController.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -103,6 +104,8 @@
20AB8425141FA55B00C11F72 /* ExampleNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleNavigationController.h; sourceTree = "<group>"; };
20AB8426141FA55B00C11F72 /* ExampleNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleNavigationController.m; sourceTree = "<group>"; };
B680750A14582041008035DC /* Cascade.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Cascade.xcodeproj; path = ../../src/Cascade/Cascade.xcodeproj; sourceTree = SOURCE_ROOT; };
E06EEEE4146160A20095F933 /* ExampleUITableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleUITableViewController.h; sourceTree = "<group>"; };
E06EEEE5146160A20095F933 /* ExampleUITableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleUITableViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -188,6 +191,8 @@
209BC87214587B77005160AE /* ExampleXIBViewController.h */,
209BC87314587B77005160AE /* ExampleXIBViewController.m */,
209BC87414587B77005160AE /* ExampleXIBViewController.xib */,
E06EEEE4146160A20095F933 /* ExampleUITableViewController.h */,
E06EEEE5146160A20095F933 /* ExampleUITableViewController.m */,
207EA49A13992C0400A8200F /* Supporting Files */,
);
path = Cascade;
Expand Down Expand Up @@ -323,6 +328,7 @@
209E099013C8F95400BCFFD0 /* ExampleWebViewController.m in Sources */,
20AB8427141FA55B00C11F72 /* ExampleNavigationController.m in Sources */,
209BC87514587B77005160AE /* ExampleXIBViewController.m in Sources */,
E06EEEE6146160A30095F933 /* ExampleUITableViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cascade/Cascade/ExampleCategoriesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// if you select row, then create and push custom UIViewController
ExampleTableViewController* rootTableViewController = [[ExampleTableViewController alloc] initWithTableViewStyle: UITableViewStylePlain];
ExampleTableViewController* rootTableViewController = [[ExampleTableViewController alloc] initWithTableViewStyle:UITableViewStylePlain size:CLViewSizeNormal];
[self.cascadeNavigationController setRootViewController:rootTableViewController animated:YES];

}
Expand Down
86 changes: 49 additions & 37 deletions Examples/Cascade/Cascade/ExampleCategoriesViewController.xib
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1056</int>
<string key="IBDocument.SystemVersion">11A511</string>
<string key="IBDocument.InterfaceBuilderVersion">1617</string>
<string key="IBDocument.AppKitVersion">1138</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">534</string>
<string key="NS.object.0">933</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -23,11 +23,8 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -96,9 +93,9 @@
<reference key="NSSuperview" ref="942394161"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="622239563"/>
<object class="NSColor" key="IBUIBackgroundColor" id="64150975">
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<bytes key="NSWhite">MSAwAA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
Expand Down Expand Up @@ -137,12 +134,10 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSFont" key="IBUIFont" id="613598267">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="64150975">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<reference key="IBUIHighlightedTitleColor" ref="64150975"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
Expand All @@ -160,18 +155,29 @@
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">refresh.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="808033599">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="613598267">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="683854917">
<reference key="NSNextResponder" ref="622239563"/>
<int key="NSvFlags">289</int>
<string key="NSFrame">{{721, 9}, {40, 25}}</string>
<reference key="NSSuperview" ref="622239563"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="613598267"/>
<reference key="IBUIHighlightedTitleColor" ref="64150975"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
Expand All @@ -187,6 +193,8 @@
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">preferences.png</string>
</object>
<reference key="IBUIFontDescription" ref="808033599"/>
<reference key="IBUIFont" ref="613598267"/>
</object>
</object>
<string key="NSFrame">{{0, 964}, {768, 40}}</string>
Expand Down Expand Up @@ -260,7 +268,9 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
Expand Down Expand Up @@ -393,7 +403,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">42</int>
<int key="maxID">43</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand All @@ -416,7 +426,18 @@
</object>
<object class="IBPartialClassDescription">
<string key="className">CLCategoriesViewController</string>
<string key="superclassName">CLTableViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">tableView</string>
<string key="NS.object.0">UITableView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">tableView</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">tableView</string>
<string key="candidateClassName">UITableView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/CLCategoriesViewController.h</string>
Expand Down Expand Up @@ -470,16 +491,15 @@
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">CLTableViewController</string>
<string key="superclassName">CLViewController</string>
<string key="className">ExampleCategoriesViewController</string>
<string key="superclassName">CLCategoriesViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/CLTableViewController.h</string>
<string key="minorKey">./Classes/ExampleCategoriesViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">CLViewController</string>
<string key="superclassName">UIViewController</string>
<string key="className">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">cascadeNavigationController</string>
<string key="NS.object.0">CLCascadeNavigationController</string>
Expand All @@ -493,15 +513,7 @@
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/CLViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">ExampleCategoriesViewController</string>
<string key="superclassName">CLCategoriesViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/ExampleCategoriesViewController.h</string>
<string key="minorKey">./Classes/UIViewController.h</string>
</object>
</object>
</object>
Expand Down Expand Up @@ -535,6 +547,6 @@
<string>{20, 24}</string>
</object>
</object>
<string key="IBCocoaTouchPluginVersion">534</string>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
4 changes: 2 additions & 2 deletions Examples/Cascade/Cascade/ExampleNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ - (void) cascadeViewDidCancelPullToDetachPages:(CLCascadeView*)cascadeView {
- (void) cascadeViewDidPullToDetachPages:(CLCascadeView*)cascadeView {
[super cascadeViewDidPullToDetachPages:cascadeView];

id view = [[(CLViewController*)self.rootViewController segmentedView] contentView];
id view = [[self.rootViewController segmentedView] contentView];
if ([view isKindOfClass:[UITableView class]]) {
UITableView* tableView = (UITableView*)view;
NSIndexPath* indexPath = [tableView indexPathForSelectedRow];
Expand Down Expand Up @@ -137,7 +137,7 @@ - (void) cascadeViewDidPullToDetachPages:(CLCascadeView*)cascadeView {
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void) cascadeView:(CLCascadeView*)cascadeView didAddPage:(UIView*)page animated:(BOOL)animated {
- (void) cascadeView:(CLCascadeView*)cascadeView didAddPage:(UIViewController*)page animated:(BOOL)animated {
_dynamicDetachImage.hidden = ([self.viewControllers count] < 2) ? YES : NO;
_staticDetachImage.hidden = ([self.viewControllers count] < 2) ? YES : NO;
}
Expand Down
11 changes: 9 additions & 2 deletions Examples/Cascade/Cascade/ExampleTableViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@
#import <Foundation/Foundation.h>
#import <Cascade/Cascade.h>

@interface ExampleTableViewController : CLTableViewController {

// We could also inherits from CLTableViewController
// This is just to show how to use a standard UIViewController and place a content view !

@interface ExampleTableViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> {
UITableViewStyle _tableViewStyle;
}

@property (nonatomic, strong) UITableView *tableView;

- (id) initWithTableViewStyle:(UITableViewStyle)style size:(CLViewSize)size;

@end
61 changes: 44 additions & 17 deletions Examples/Cascade/Cascade/ExampleTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,32 @@
#import "ExampleTableViewController.h"
#import "ExampleWebViewController.h"
#import "ExampleXIBViewController.h"
#import "ExampleUITableViewController.h"

@implementation ExampleTableViewController
@synthesize tableView = _tableView;

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void) loadView {
CLSegmentedView *view_ = [[CLSegmentedView alloc] initWithSize:CLViewSizeWider];
self.view = view_;

self.tableView = [[UITableView alloc] initWithFrame:CGRectZero
style:_tableViewStyle];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[view_ setContentView:_tableView];
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (id) initWithTableViewStyle:(UITableViewStyle)style size:(CLViewSize)size;
{
self = [super initWithSize: size];
if (self) {
_tableViewStyle = style;
}
return self;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)didReceiveMemoryWarning
Expand Down Expand Up @@ -75,7 +96,7 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 6;
return 8;
}


Expand All @@ -90,16 +111,20 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}

// Configure the cell...

if (indexPath.row%3 == 0) {
cell.textLabel.text = @"New Table View";
} else
if (indexPath.row%3 == 1) {
cell.textLabel.text = @"New Web View";

if (indexPath.row%4 == 0) {
cell.textLabel.text = @"New Table View with CLSegmentedView";
} else
{
cell.textLabel.text = @"New View from XIB";
}
if (indexPath.row%4 == 1) {
cell.textLabel.text = @"New Web View";
} else
if (indexPath.row%4 == 2) {
cell.textLabel.text = @"New UITableViewController";
}
else
{
cell.textLabel.text = @"New View from XIB";
}
return cell;
}

Expand All @@ -109,17 +134,19 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
CLViewController* viewController = nil;
UIViewController* viewController = nil;

if (indexPath.row%3 == 0) {
viewController = [[ExampleTableViewController alloc] initWithTableViewStyle: UITableViewStylePlain];
if (indexPath.row%4 == 0) {
viewController = [[ExampleTableViewController alloc] initWithTableViewStyle:UITableViewStylePlain size:CLViewSizeNormal];
} else
if (indexPath.row%3 == 1) {
if (indexPath.row%4 == 1) {
viewController = [[ExampleWebViewController alloc] init];
} else
{
viewController = [[ExampleXIBViewController alloc] initWithNibName:@"ExampleXIBViewController" bundle:nil size:CLViewSizeNormal];
}
if (indexPath.row%4 == 2) {
viewController = [[ExampleUITableViewController alloc] initWithStyle:UITableViewStylePlain];
} else
viewController = [[ExampleXIBViewController alloc] initWithNibName:@"ExampleXIBViewController" bundle:nil size:CLViewSizeNormal];


[self pushDetailViewController:viewController animated:YES];
}
Expand Down
13 changes: 13 additions & 0 deletions Examples/Cascade/Cascade/ExampleUITableViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ExampleUITableViewController.h
// Cascade
//
// Created by Marian PAUL on 02/11/11.
// Copyright (c) 2011 iPuP SARL. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ExampleUITableViewController : UITableViewController

@end
Loading

0 comments on commit a990e8f

Please sign in to comment.