Permalink
Browse files

Initial project import

  • Loading branch information...
1 parent daa8679 commit bbd37a02cbb1605ab3b3ba42ff9b353ae7c23e05 @ezwart committed Sep 25, 2012
Showing with 1,215 additions and 0 deletions.
  1. BIN .DS_Store
  2. BIN Example/EZSpinnerViewDemo/.DS_Store
  3. +344 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo.xcodeproj/project.pbxproj
  4. BIN Example/EZSpinnerViewDemo/EZSpinnerViewDemo/.DS_Store
  5. BIN Example/EZSpinnerViewDemo/EZSpinnerViewDemo/Default-568h@2x.png
  6. BIN Example/EZSpinnerViewDemo/EZSpinnerViewDemo/Default.png
  7. BIN Example/EZSpinnerViewDemo/EZSpinnerViewDemo/Default@2x.png
  8. +19 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/EZSAppDelegate.h
  9. +35 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/EZSAppDelegate.m
  10. +16 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/EZSViewController.h
  11. +70 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/EZSViewController.m
  12. +45 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/EZSpinnerViewDemo-Info.plist
  13. +14 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/EZSpinnerViewDemo-Prefix.pch
  14. BIN Example/EZSpinnerViewDemo/EZSpinnerViewDemo/Graphics/spinner.png
  15. BIN Example/EZSpinnerViewDemo/EZSpinnerViewDemo/Graphics/spinner@2x.png
  16. +230 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/en.lproj/EZSViewController_iPad.xib
  17. +244 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/en.lproj/EZSViewController_iPhone.xib
  18. +2 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/en.lproj/InfoPlist.strings
  19. +18 −0 Example/EZSpinnerViewDemo/EZSpinnerViewDemo/main.m
  20. BIN Source/.DS_Store
  21. BIN Source/EZSpinnerView/.DS_Store
  22. +31 −0 Source/EZSpinnerView/EZSpinnerView.h
  23. +147 −0 Source/EZSpinnerView/EZSpinnerView.m
View
BIN .DS_Store
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,19 @@
+//
+// EZSAppDelegate.h
+// EZSpinnerViewDemo
+//
+// Created by Erwin Zwart on 9/25/12.
+// Copyright (c) 2012 Erwin Zwart. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class EZSViewController;
+
+@interface EZSAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@property (strong, nonatomic) EZSViewController *viewController;
+
+@end
@@ -0,0 +1,35 @@
+//
+// EZSAppDelegate.m
+// EZSpinnerViewDemo
+//
+// Created by Erwin Zwart on 9/25/12.
+// Copyright (c) 2012 Erwin Zwart. All rights reserved.
+//
+
+#import "EZSAppDelegate.h"
+
+#import "EZSViewController.h"
+
+@implementation EZSAppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+
+ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
+ {
+ self.viewController = [[EZSViewController alloc] initWithNibName:@"EZSViewController_iPhone" bundle:nil];
+ }
+ else
+ {
+ self.viewController = [[EZSViewController alloc] initWithNibName:@"EZSViewController_iPad" bundle:nil];
+ }
+
+ self.window.rootViewController = self.viewController;
+ [self.window makeKeyAndVisible];
+
+ return YES;
+}
+
+
+@end
@@ -0,0 +1,16 @@
+//
+// EZSViewController.h
+// EZSpinnerViewDemo
+//
+// Created by Erwin Zwart on 9/25/12.
+// Copyright (c) 2012 Erwin Zwart. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "EZSpinnerView.h"
+
+@interface EZSViewController : UIViewController
+
+@property (nonatomic, strong) EZSpinnerView *spinner;
+
+@end
@@ -0,0 +1,70 @@
+//
+// EZSViewController.m
+// EZSpinnerViewDemo
+//
+// Created by Erwin Zwart on 9/25/12.
+// Copyright (c) 2012 Erwin Zwart. All rights reserved.
+//
+
+#import "EZSViewController.h"
+
+@interface EZSViewController ()
+
+- (void) dismissSpinnerAfterdelay;
+
+- (IBAction)stringButtonPressed:(id)sender;
+- (IBAction)imageButtonPressed:(id)sender;
+
+@end
+
+
+@implementation EZSViewController
+
+@synthesize spinner = _spinner;
+
+- (void) dismissSpinnerAfterdelay
+{
+ if (self.spinner)
+ {
+ int64_t delayInSeconds = 3.0;
+ dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
+ dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
+ [self.spinner removeFromSuperview];
+ self.spinner = nil;
+ });
+ }
+}
+
+#pragma mark - IBActions
+
+- (IBAction)stringButtonPressed:(id)sender
+{
+ if (self.spinner) return;
+
+ EZSpinnerView *newSpinner = [EZSpinnerView spinnerViewWithText:@"loading.."
+ fontOrNil:nil
+ andColorOrNil:nil];
+
+ self.spinner = newSpinner;
+
+ [self.view addSubview:newSpinner];
+
+ [self dismissSpinnerAfterdelay];
+}
+
+- (IBAction)imageButtonPressed:(id)sender
+{
+ if (self.spinner) return;
+
+ UIImage *image = [UIImage imageNamed:@"spinner"];
+
+ EZSpinnerView *newSpinner = [EZSpinnerView spinnerViewWithImage:image];
+
+ self.spinner = newSpinner;
+
+ [self.view addSubview:newSpinner];
+
+ [self dismissSpinnerAfterdelay];
+}
+
+@end
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.erwinzwart.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'EZSpinnerViewDemo' target in the 'EZSpinnerViewDemo' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_4_0
+#warning "This project uses features only available in iOS SDK 4.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit bbd37a0

Please sign in to comment.