Skip to content

Commit

Permalink
Set initial selected transition mode (flip or fold) from code (simpli…
Browse files Browse the repository at this point in the history
…fies testing a particular mode)
  • Loading branch information
Mark Pospesel committed Jun 8, 2012
1 parent c8fef50 commit 575604a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 64 deletions.
1 change: 1 addition & 0 deletions MPFoldTransition/ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enum {
@property (readonly, nonatomic) BOOL isFold;

@property (weak, nonatomic) IBOutlet UIView *contentView;
@property (weak, nonatomic) IBOutlet UISegmentedControl *modeSegment;

- (IBAction)stepperValueChanged:(id)sender;
- (IBAction)stylePressed:(UIBarButtonItem *)sender;
Expand Down
6 changes: 4 additions & 2 deletions MPFoldTransition/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ @implementation ViewController
@synthesize foldStyle = _foldStyle;
@synthesize flipStyle = _flipStyle;
@synthesize contentView = _contentView;
@synthesize modeSegment = _modeSegment;
@synthesize popover = _popover;

- (id)init
Expand Down Expand Up @@ -73,7 +74,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

- (void)doInit
{
_mode = MPTransitionModeFold;
_mode = MPTransitionModeFlip;
_foldStyle = MPFoldStyleCubic;
_flipStyle = MPFlipStyleDefault;
}
Expand Down Expand Up @@ -115,13 +116,14 @@ - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

[self.modeSegment setSelectedSegmentIndex:(int)[self mode]];
[self.contentView addSubview:[self getLabelForIndex:0]];
}

- (void)viewDidUnload
{
[self setContentView:nil];
[self setModeSegment:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
Expand Down
32 changes: 1 addition & 31 deletions MPFoldTransition/en.lproj/MainStoryboard_iPad.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
<connections>
<outlet property="contentView" destination="dPQ-si-lBp" id="kmC-XW-Ckr"/>
<outlet property="modeSegment" destination="tH2-oi-S73" id="zmY-nV-pSH"/>
</connections>
</viewController>
</objects>
Expand Down Expand Up @@ -539,37 +540,6 @@
<point key="canvasLocation" x="751" y="747"/>
</scene>
</scenes>
<classes>
<class className="AboutViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/AboutViewController.h"/>
<relationships>
<relationship kind="action" name="donePressed:"/>
</relationships>
</class>
<class className="DetailsViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/DetailsViewController.h"/>
<relationships>
<relationship kind="action" name="popPressed:"/>
</relationships>
</class>
<class className="StyleTable" superclassName="UITableViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/StyleTable.h"/>
<relationships>
<relationship kind="action" name="donePressed:"/>
</relationships>
</class>
<class className="ViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/ViewController.h"/>
<relationships>
<relationship kind="action" name="detailPressed:"/>
<relationship kind="action" name="infoPressed:"/>
<relationship kind="action" name="modeValueChanged:"/>
<relationship kind="action" name="stepperValueChanged:"/>
<relationship kind="action" name="stylePressed:" candidateClass="UIBarButtonItem"/>
<relationship kind="outlet" name="contentView" candidateClass="UIView"/>
</relationships>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
<simulatedOrientationMetrics key="orientation"/>
Expand Down
32 changes: 1 addition & 31 deletions MPFoldTransition/en.lproj/MainStoryboard_iPhone.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
</navigationItem>
<connections>
<outlet property="contentView" destination="HSa-mD-uY9" id="Fnj-vu-ntt"/>
<outlet property="modeSegment" destination="qtm-Cg-4aA" id="ibx-Sd-nGh"/>
</connections>
</viewController>
</objects>
Expand Down Expand Up @@ -528,37 +529,6 @@
<point key="canvasLocation" x="859" y="62"/>
</scene>
</scenes>
<classes>
<class className="AboutViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/AboutViewController.h"/>
<relationships>
<relationship kind="action" name="donePressed:"/>
</relationships>
</class>
<class className="DetailsViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/DetailsViewController.h"/>
<relationships>
<relationship kind="action" name="popPressed:"/>
</relationships>
</class>
<class className="StyleTable" superclassName="UITableViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/StyleTable.h"/>
<relationships>
<relationship kind="action" name="donePressed:"/>
</relationships>
</class>
<class className="ViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/ViewController.h"/>
<relationships>
<relationship kind="action" name="detailPressed:"/>
<relationship kind="action" name="infoPressed:"/>
<relationship kind="action" name="modeValueChanged:"/>
<relationship kind="action" name="stepperValueChanged:"/>
<relationship kind="action" name="stylePressed:" candidateClass="UIBarButtonItem"/>
<relationship kind="outlet" name="contentView" candidateClass="UIView"/>
</relationships>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
Expand Down

0 comments on commit 575604a

Please sign in to comment.