-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
325 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// ExplodingTextViewController.h | ||
// SongGong | ||
// | ||
// Created by Arshad Tayyeb on 7/17/11. | ||
// Copyright 2011 doubleTwist Corporation. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface ExplodingTextViewController : UIViewController { | ||
UILabel *textLabel; | ||
CGRect origRect; | ||
} | ||
+ (id)explodeText:(NSString *)text; | ||
- (void)explodeText:(NSString *)text; | ||
|
||
@property (nonatomic, retain) IBOutlet UILabel *textLabel; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// | ||
// ExplodingTextViewController.m | ||
// SongGong | ||
// | ||
// Created by Arshad Tayyeb on 7/17/11. | ||
// Copyright 2011 doubleTwist Corporation. All rights reserved. | ||
// | ||
|
||
#import "ExplodingTextViewController.h" | ||
#import "SongGongAppDelegate.h" | ||
|
||
@implementation ExplodingTextViewController | ||
@synthesize textLabel; | ||
|
||
+ (id)explodeText:(NSString *)text | ||
{ | ||
ExplodingTextViewController *vc = [[[ExplodingTextViewController alloc] init] autorelease]; | ||
[vc explodeText:text]; | ||
return vc; | ||
} | ||
|
||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | ||
{ | ||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | ||
if (self) { | ||
// Custom initialization | ||
} | ||
return self; | ||
} | ||
|
||
- (void)didReceiveMemoryWarning | ||
{ | ||
// Releases the view if it doesn't have a superview. | ||
[super didReceiveMemoryWarning]; | ||
|
||
// Release any cached data, images, etc that aren't in use. | ||
} | ||
|
||
#pragma mark - View lifecycle | ||
|
||
- (void)viewDidLoad | ||
{ | ||
[super viewDidLoad]; | ||
// Do any additional setup after loading the view from its nib. | ||
origRect = self.view.frame; | ||
self.view.hidden = YES; | ||
} | ||
|
||
- (void)viewDidUnload | ||
{ | ||
[self setTextLabel:nil]; | ||
[super viewDidUnload]; | ||
// Release any retained subviews of the main view. | ||
// e.g. self.myOutlet = nil; | ||
} | ||
|
||
#pragma mark - | ||
- (void)explodeText:(NSString *)text | ||
{ | ||
if (!self.view.superview) | ||
{ | ||
[[SongGongAppDelegate mainView] addSubview:self.view]; | ||
} | ||
|
||
[self retain]; | ||
[self.view setHidden:YES]; | ||
self.view.frame = origRect; | ||
self.textLabel.text = text; | ||
[self.view setHidden:NO]; | ||
|
||
[UIView beginAnimations:NSStringFromSelector(_cmd) context:nil]; | ||
|
||
[UIView setAnimationDidStopSelector:@selector(animatePlaylistViewPart2:finished:context:)]; | ||
[UIView setAnimationCurve:UIViewAnimationCurveLinear]; | ||
[UIView setAnimationDuration:.25]; | ||
[UIView setAnimationDelegate:self]; | ||
CGAffineTransform transform = CGAffineTransformMakeScale(5.0,5.0); | ||
self.view.transform = transform; | ||
[UIView commitAnimations]; | ||
} | ||
|
||
- (void)explodingDone:(NSString *)animationId finished:(BOOL)finished context:(id)context | ||
{ | ||
[self.view removeFromSuperview]; | ||
[self release]; | ||
} | ||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | ||
{ | ||
// Return YES for supported orientations | ||
return (interfaceOrientation == UIInterfaceOrientationPortrait); | ||
} | ||
|
||
- (void)dealloc { | ||
[textLabel release]; | ||
[super dealloc]; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10"> | ||
<data> | ||
<int key="IBDocument.SystemTarget">1280</int> | ||
<string key="IBDocument.SystemVersion">10J869</string> | ||
<string key="IBDocument.InterfaceBuilderVersion">1891</string> | ||
<string key="IBDocument.AppKitVersion">1038.35</string> | ||
<string key="IBDocument.HIToolboxVersion">461.00</string> | ||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions"> | ||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> | ||
<string key="NS.object.0">884</string> | ||
</object> | ||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<string>IBProxyObject</string> | ||
<string>IBUILabel</string> | ||
</object> | ||
<object class="NSArray" key="IBDocument.PluginDependencies"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> | ||
</object> | ||
<object class="NSMutableDictionary" key="IBDocument.Metadata"> | ||
<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> | ||
<object class="IBProxyObject" id="372490531"> | ||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string> | ||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> | ||
</object> | ||
<object class="IBProxyObject" id="975951072"> | ||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string> | ||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> | ||
</object> | ||
<object class="IBUILabel" id="565154465"> | ||
<reference key="NSNextResponder"/> | ||
<int key="NSvFlags">274</int> | ||
<string key="NSFrameSize">{240, 120}</string> | ||
<reference key="NSSuperview"/> | ||
<reference key="NSWindow"/> | ||
<reference key="NSNextKeyView"/> | ||
<bool key="IBUIOpaque">NO</bool> | ||
<bool key="IBUIClipsSubviews">YES</bool> | ||
<int key="IBUIContentMode">7</int> | ||
<bool key="IBUIUserInteractionEnabled">NO</bool> | ||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> | ||
<string key="IBUIText">Label</string> | ||
<object class="NSColor" key="IBUITextColor"> | ||
<int key="NSColorSpace">3</int> | ||
<bytes key="NSWhite">MQA</bytes> | ||
<object class="NSColorSpace" key="NSCustomColorSpace"> | ||
<int key="NSID">2</int> | ||
</object> | ||
</object> | ||
<nil key="IBUIHighlightedColor"/> | ||
<int key="IBUIBaselineAdjustment">1</int> | ||
<float key="IBUIMinimumFontSize">10</float> | ||
<int key="IBUITextAlignment">1</int> | ||
<object class="IBUIFontDescription" key="IBUIFontDescription"> | ||
<int key="type">2</int> | ||
<double key="pointSize">52</double> | ||
</object> | ||
<object class="NSFont" key="IBUIFont"> | ||
<string key="NSName">Helvetica-Bold</string> | ||
<double key="NSSize">52</double> | ||
<int key="NSfFlags">16</int> | ||
</object> | ||
</object> | ||
</object> | ||
<object class="IBObjectContainer" key="IBDocument.Objects"> | ||
<object class="NSMutableArray" key="connectionRecords"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<object class="IBConnectionRecord"> | ||
<object class="IBCocoaTouchOutletConnection" key="connection"> | ||
<string key="label">view</string> | ||
<reference key="source" ref="372490531"/> | ||
<reference key="destination" ref="565154465"/> | ||
</object> | ||
<int key="connectionID">7</int> | ||
</object> | ||
<object class="IBConnectionRecord"> | ||
<object class="IBCocoaTouchOutletConnection" key="connection"> | ||
<string key="label">textLabel</string> | ||
<reference key="source" ref="372490531"/> | ||
<reference key="destination" ref="565154465"/> | ||
</object> | ||
<int key="connectionID">8</int> | ||
</object> | ||
</object> | ||
<object class="IBMutableOrderedSet" key="objectRecords"> | ||
<object class="NSArray" key="orderedObjects"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<object class="IBObjectRecord"> | ||
<int key="objectID">0</int> | ||
<object class="NSArray" key="object" id="0"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
</object> | ||
<reference key="children" ref="1000"/> | ||
<nil key="parent"/> | ||
</object> | ||
<object class="IBObjectRecord"> | ||
<int key="objectID">-1</int> | ||
<reference key="object" ref="372490531"/> | ||
<reference key="parent" ref="0"/> | ||
<string key="objectName">File's Owner</string> | ||
</object> | ||
<object class="IBObjectRecord"> | ||
<int key="objectID">-2</int> | ||
<reference key="object" ref="975951072"/> | ||
<reference key="parent" ref="0"/> | ||
</object> | ||
<object class="IBObjectRecord"> | ||
<int key="objectID">6</int> | ||
<reference key="object" ref="565154465"/> | ||
<reference key="parent" ref="0"/> | ||
</object> | ||
</object> | ||
</object> | ||
<object class="NSMutableDictionary" key="flattenedProperties"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<object class="NSArray" key="dict.sortedKeys"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<string>-1.CustomClassName</string> | ||
<string>-1.IBPluginDependency</string> | ||
<string>-2.CustomClassName</string> | ||
<string>-2.IBPluginDependency</string> | ||
<string>6.IBPluginDependency</string> | ||
</object> | ||
<object class="NSMutableArray" key="dict.values"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<string>ExplodingTextViewController</string> | ||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> | ||
<string>UIResponder</string> | ||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> | ||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> | ||
</object> | ||
</object> | ||
<object class="NSMutableDictionary" key="unlocalizedProperties"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<reference key="dict.sortedKeys" ref="0"/> | ||
<reference key="dict.values" ref="0"/> | ||
</object> | ||
<nil key="activeLocalization"/> | ||
<object class="NSMutableDictionary" key="localizations"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<reference key="dict.sortedKeys" ref="0"/> | ||
<reference key="dict.values" ref="0"/> | ||
</object> | ||
<nil key="sourceID"/> | ||
<int key="maxID">8</int> | ||
</object> | ||
<object class="IBClassDescriber" key="IBDocument.Classes"> | ||
<object class="NSMutableArray" key="referencedPartialClassDescriptions"> | ||
<bool key="EncodedWithXMLCoder">YES</bool> | ||
<object class="IBPartialClassDescription"> | ||
<string key="className">ExplodingTextViewController</string> | ||
<string key="superclassName">UIViewController</string> | ||
<object class="NSMutableDictionary" key="outlets"> | ||
<string key="NS.key.0">textLabel</string> | ||
<string key="NS.object.0">UILabel</string> | ||
</object> | ||
<object class="NSMutableDictionary" key="toOneOutletInfosByName"> | ||
<string key="NS.key.0">textLabel</string> | ||
<object class="IBToOneOutletInfo" key="NS.object.0"> | ||
<string key="name">textLabel</string> | ||
<string key="candidateClassName">UILabel</string> | ||
</object> | ||
</object> | ||
<object class="IBClassDescriptionSource" key="sourceIdentifier"> | ||
<string key="majorKey">IBProjectSource</string> | ||
<string key="minorKey">./Classes/ExplodingTextViewController.h</string> | ||
</object> | ||
</object> | ||
</object> | ||
</object> | ||
<int key="IBDocument.localizationMode">0</int> | ||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> | ||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> | ||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string> | ||
<integer value="3000" key="NS.object.0"/> | ||
</object> | ||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> | ||
<int key="IBDocument.defaultPropertyAccessControl">3</int> | ||
<string key="IBCocoaTouchPluginVersion">884</string> | ||
</data> | ||
</archive> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters