Skip to content

Commit

Permalink
Ported to ARC + Modern obj-c
Browse files Browse the repository at this point in the history
Thanks to Orta for his improvements.
  • Loading branch information
jberlana committed Jul 30, 2013
1 parent 04feef2 commit ee04585
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 181 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions Demo/ExampleViewController.h 100644 → 100755
Expand Up @@ -25,10 +25,10 @@
#import <UIKit/UIKit.h>
#import "JBKenBurnsView.h"

@interface ExampleViewController : UIViewController <KenBurnsViewDelegate> {
KenBurnsView *kenView;
@interface ExampleViewController : UIViewController <JBKenBurnsViewDelegate> {
JBKenBurnsView *kenView;
}

@property (nonatomic, retain) IBOutlet KenBurnsView *kenView;
@property (nonatomic, retain) IBOutlet JBKenBurnsView *kenView;

@end
16 changes: 7 additions & 9 deletions Demo/ExampleViewController.m 100644 → 100755
Expand Up @@ -46,19 +46,21 @@ - (void)viewDidLoad
self.kenView.layer.borderWidth = 1;
self.kenView.layer.borderColor = [UIColor blackColor].CGColor;
self.kenView.delegate = self;

}

- (void)viewdidAppear:(BOOL)animated
{
NSArray *myImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"image1.jpeg"],
[UIImage imageNamed:@"image2.jpeg"],
[UIImage imageNamed:@"image3.jpeg"],
[UIImage imageNamed:@"image4.png"],
[UIImage imageNamed:@"image5.png"], nil];

[self.kenView animateWithImages:myImages
transitionDuration:15
loop:YES
[self.kenView animateWithImages:myImages
transitionDuration:12
loop:YES
isLandscape:YES];

}

- (void)viewDidUnload
Expand All @@ -85,10 +87,6 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
return YES;
}

- (void)dealloc {
[kenView release];
[super dealloc];
}

#pragma KenBurnsViewDelegate
- (void)didShowImageAtIndex:(NSUInteger)index
Expand Down
24 changes: 10 additions & 14 deletions Demo/ExampleViewController.xib 100644 → 100755
@@ -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">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>
<int key="IBDocument.SystemTarget">1536</int>
<string key="IBDocument.SystemVersion">12B19</string>
<string key="IBDocument.InterfaceBuilderVersion">2829</string>
<string key="IBDocument.AppKitVersion">1187</string>
<string key="IBDocument.HIToolboxVersion">624.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
<string key="NS.object.0">1914</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -34,7 +34,7 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIView" id="766721923">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">301</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -43,8 +43,6 @@
<int key="NSvFlags">319</int>
<string key="NSFrameSize">{1024, 748}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:195</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
Expand All @@ -57,8 +55,6 @@
</object>
</object>
<string key="NSFrame">{{0, 20}, {1024, 748}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="363181407"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
Expand Down Expand Up @@ -147,14 +143,14 @@
<string>4.CustomClassName</string>
<string>4.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>ExampleViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>KenBurnsView</string>
<string>JBKenBurnsView</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
Expand Down Expand Up @@ -212,6 +208,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">933</string>
<string key="IBCocoaTouchPluginVersion">1914</string>
</data>
</archive>
Empty file modified Demo/KenBurnsAppDelegate.h 100644 → 100755
Empty file.
7 changes: 0 additions & 7 deletions Demo/KenBurnsAppDelegate.m 100644 → 100755
Expand Up @@ -76,11 +76,4 @@ - (void)applicationWillTerminate:(UIApplication *)application
*/
}

- (void)dealloc
{
[_window release];
[_exampleViewController release];
[super dealloc];
}

@end
Empty file modified Demo/KenBurnsDemo-Info.plist 100644 → 100755
Empty file.
Empty file modified Demo/KenBurnsDemo-Prefix.pch 100644 → 100755
Empty file.
Empty file modified Demo/en.lproj/InfoPlist.strings 100644 → 100755
Empty file.
Empty file modified Demo/images/image1.jpeg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Demo/images/image2.jpeg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Demo/images/image3.jpeg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Demo/images/image4.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Demo/images/image5.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions Demo/main.m 100644 → 100755
Expand Up @@ -7,11 +7,11 @@
//

#import <UIKit/UIKit.h>
#import "KenBurnsAppDelegate.h"

int main(int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([KenBurnsAppDelegate class]));
}
}
22 changes: 5 additions & 17 deletions KenBurns/JBKenBurnsView.h 100644 → 100755
Expand Up @@ -26,33 +26,21 @@
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

@class KenBurnsView;
@class JBKenBurnsView;

#pragma - KenBurnsViewDelegate
@protocol KenBurnsViewDelegate <NSObject>
@protocol JBKenBurnsViewDelegate <NSObject>
@optional
- (void)didShowImageAtIndex:(NSUInteger)index;
- (void)didFinishAllAnimations;

@end

@interface KenBurnsView : UIView {
NSMutableArray *imagesArray;
float timeTransition;
BOOL isLoop;
BOOL isLandscape;
__weak id <KenBurnsViewDelegate> delegate;
}
@interface JBKenBurnsView : UIView

@property (nonatomic, assign) float timeTransition;
@property (nonatomic, retain) NSMutableArray *imagesArray;
@property (nonatomic) BOOL isLoop;
@property (nonatomic) BOOL isLandscape;
@property (weak) id<KenBurnsViewDelegate> delegate;
@property (unsafe_unretained) id<JBKenBurnsViewDelegate> delegate;

- (void) animateWithImagePaths:(NSArray *)imagePaths transitionDuration:(float)time loop:(BOOL)isLoop isLandscape:(BOOL)isLandscape;
- (void) animateWithImages:(NSArray *)images transitionDuration:(float)time loop:(BOOL)isLoop isLandscape:(BOOL)isLandscape;
- (void) animateWithURLs:(NSArray *)urls transitionDuration:(float)duration loop:(BOOL)shouldLoop isLandscape:(BOOL)inLandscape;

@end


0 comments on commit ee04585

Please sign in to comment.