Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit 5ec07264c7876cca578d99d28201b26cbba1dc58 0 parents
Daniel Amitay authored
Showing with 897 additions and 0 deletions.
  1. +22 −0 DAReloadActivity/DAReloadActivityButton.h
  2. +100 −0 DAReloadActivity/DAReloadActivityButton.m
  3. BIN  DAReloadActivity/reload.png
  4. BIN  DAReloadActivity/reload@2x.png
  5. BIN  DAReloadActivityExample/.DS_Store
  6. +299 −0 DAReloadActivityExample/DAReloadActivityExample.xcodeproj/project.pbxproj
  7. +7 −0 DAReloadActivityExample/DAReloadActivityExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  8. BIN  ...ityExample.xcodeproj/project.xcworkspace/xcuserdata/danielamitay.xcuserdatad/UserInterfaceState.xcuserstate
  9. +84 −0 ...oadActivityExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/DAReloadActivityExample.xcscheme
  10. +22 −0 ...le/DAReloadActivityExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/xcschememanagement.plist
  11. +17 −0 DAReloadActivityExample/DAReloadActivityExample/AppDelegate.h
  12. +70 −0 DAReloadActivityExample/DAReloadActivityExample/AppDelegate.m
  13. +40 −0 DAReloadActivityExample/DAReloadActivityExample/DAReloadActivityExample-Info.plist
  14. +14 −0 DAReloadActivityExample/DAReloadActivityExample/DAReloadActivityExample-Prefix.pch
  15. +17 −0 DAReloadActivityExample/DAReloadActivityExample/ViewController.h
  16. +98 −0 DAReloadActivityExample/DAReloadActivityExample/ViewController.m
  17. +2 −0  DAReloadActivityExample/DAReloadActivityExample/en.lproj/InfoPlist.strings
  18. +18 −0 DAReloadActivityExample/DAReloadActivityExample/main.m
  19. +23 −0 LICENSE.md
  20. +64 −0 README.md
22 DAReloadActivity/DAReloadActivityButton.h
@@ -0,0 +1,22 @@
+//
+// DAReloadActivityButton.h
+// DAReloadActivity
+//
+// Created by Daniel Amitay on 2/6/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface DAReloadActivityButton : UIButton
+{
+ BOOL animating;
+}
+@property (nonatomic) CGFloat animationDuration;
+
+- (BOOL)isAnimating;
+- (void)startAnimating;
+- (void)stopAnimating;
+- (void)spin;
+
+@end
100 DAReloadActivity/DAReloadActivityButton.m
@@ -0,0 +1,100 @@
+//
+// DAReloadActivityButton.m
+// DAReloadActivity
+//
+// Created by Daniel Amitay on 2/6/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import "DAReloadActivityButton.h"
+#import <QuartzCore/QuartzCore.h>
+
+@implementation DAReloadActivityButton
+
+@synthesize animationDuration =_animationDuration;
+
+#pragma mark - Init Methods
+
+- (id)init
+{
+ self = [super initWithFrame:CGRectMake(0, 0, 28, 28)];
+ if (self)
+ {
+ self.showsTouchWhenHighlighted = YES;
+ [self setBackgroundImage:[UIImage imageNamed:@"reload"] forState:UIControlStateNormal];
+ }
+ return self;
+}
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self)
+ {
+ self.showsTouchWhenHighlighted = YES;
+ [self setBackgroundImage:[UIImage imageNamed:@"reload"] forState:UIControlStateNormal];
+ }
+ return self;
+}
+
+- (id)initWithCoder:(NSCoder *)aDecoder
+{
+ self = [super initWithCoder:aDecoder];
+ if (self)
+ {
+ self.showsTouchWhenHighlighted = YES;
+ [self setBackgroundImage:[UIImage imageNamed:@"reload"] forState:UIControlStateNormal];
+ }
+ return self;
+}
+
+#pragma mark - Public Methods
+
+- (BOOL)isAnimating
+{
+ CAAnimation *spinAnimation = [self.layer animationForKey:@"spinAnimation"];
+ return (animating || spinAnimation);
+}
+
+- (void)startAnimating
+{
+ animating = YES;
+ [self spin];
+}
+
+- (void)stopAnimating
+{
+ animating = NO;
+}
+
+- (void)spin
+{
+ CABasicAnimation *spinAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
+ spinAnimation.byValue = [NSNumber numberWithFloat:2*M_PI];
+ spinAnimation.duration = self.animationDuration;
+ spinAnimation.delegate = self;
+ [self.layer addAnimation:spinAnimation forKey:@"spinAnimation"];
+}
+
+#pragma mark - Animation Delegates
+
+- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
+{
+ if (animating)
+ {
+ [self spin];
+ }
+}
+
+#pragma mark - Property Methods
+
+- (CGFloat)animationDuration
+{
+ if (!_animationDuration)
+ {
+ _animationDuration = 1.0f;
+ }
+ return _animationDuration;
+}
+
+@end
BIN  DAReloadActivity/reload.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  DAReloadActivity/reload@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  DAReloadActivityExample/.DS_Store
Binary file not shown
299 DAReloadActivityExample/DAReloadActivityExample.xcodeproj/project.pbxproj
@@ -0,0 +1,299 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 63B780EC14E080280009EE1F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B780EB14E080280009EE1F /* UIKit.framework */; };
+ 63B780EE14E080280009EE1F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B780ED14E080280009EE1F /* Foundation.framework */; };
+ 63B780F014E080280009EE1F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B780EF14E080280009EE1F /* CoreGraphics.framework */; };
+ 63B780F614E080280009EE1F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 63B780F414E080280009EE1F /* InfoPlist.strings */; };
+ 63B780F814E080280009EE1F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B780F714E080280009EE1F /* main.m */; };
+ 63B780FC14E080280009EE1F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B780FB14E080280009EE1F /* AppDelegate.m */; };
+ 63B780FF14E080280009EE1F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B780FE14E080280009EE1F /* ViewController.m */; };
+ 63B7810F14E0850F0009EE1F /* DAReloadActivityButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B7810E14E0850F0009EE1F /* DAReloadActivityButton.m */; };
+ 63B7811114E085290009EE1F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B7811014E085290009EE1F /* QuartzCore.framework */; };
+ 63B7811414E086990009EE1F /* reload.png in Resources */ = {isa = PBXBuildFile; fileRef = 63B7811214E086990009EE1F /* reload.png */; };
+ 63B7811514E086990009EE1F /* reload@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 63B7811314E086990009EE1F /* reload@2x.png */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 63B780E714E080280009EE1F /* DAReloadActivityExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DAReloadActivityExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 63B780EB14E080280009EE1F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 63B780ED14E080280009EE1F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 63B780EF14E080280009EE1F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 63B780F314E080280009EE1F /* DAReloadActivityExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DAReloadActivityExample-Info.plist"; sourceTree = "<group>"; };
+ 63B780F514E080280009EE1F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 63B780F714E080280009EE1F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 63B780F914E080280009EE1F /* DAReloadActivityExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DAReloadActivityExample-Prefix.pch"; sourceTree = "<group>"; };
+ 63B780FA14E080280009EE1F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 63B780FB14E080280009EE1F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 63B780FD14E080280009EE1F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
+ 63B780FE14E080280009EE1F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+ 63B7810D14E0850F0009EE1F /* DAReloadActivityButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DAReloadActivityButton.h; sourceTree = "<group>"; };
+ 63B7810E14E0850F0009EE1F /* DAReloadActivityButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DAReloadActivityButton.m; sourceTree = "<group>"; };
+ 63B7811014E085290009EE1F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ 63B7811214E086990009EE1F /* reload.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = reload.png; sourceTree = "<group>"; };
+ 63B7811314E086990009EE1F /* reload@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "reload@2x.png"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 63B780E414E080280009EE1F /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63B7811114E085290009EE1F /* QuartzCore.framework in Frameworks */,
+ 63B780EC14E080280009EE1F /* UIKit.framework in Frameworks */,
+ 63B780EE14E080280009EE1F /* Foundation.framework in Frameworks */,
+ 63B780F014E080280009EE1F /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 63B780DC14E080280009EE1F = {
+ isa = PBXGroup;
+ children = (
+ 63B7810C14E0850F0009EE1F /* DAReloadActivity */,
+ 63B780F114E080280009EE1F /* DAReloadActivityExample */,
+ 63B780EA14E080280009EE1F /* Frameworks */,
+ 63B780E814E080280009EE1F /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 63B780E814E080280009EE1F /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 63B780E714E080280009EE1F /* DAReloadActivityExample.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 63B780EA14E080280009EE1F /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 63B7811014E085290009EE1F /* QuartzCore.framework */,
+ 63B780EB14E080280009EE1F /* UIKit.framework */,
+ 63B780ED14E080280009EE1F /* Foundation.framework */,
+ 63B780EF14E080280009EE1F /* CoreGraphics.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 63B780F114E080280009EE1F /* DAReloadActivityExample */ = {
+ isa = PBXGroup;
+ children = (
+ 63B780FA14E080280009EE1F /* AppDelegate.h */,
+ 63B780FB14E080280009EE1F /* AppDelegate.m */,
+ 63B780FD14E080280009EE1F /* ViewController.h */,
+ 63B780FE14E080280009EE1F /* ViewController.m */,
+ 63B780F214E080280009EE1F /* Supporting Files */,
+ );
+ path = DAReloadActivityExample;
+ sourceTree = "<group>";
+ };
+ 63B780F214E080280009EE1F /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 63B780F314E080280009EE1F /* DAReloadActivityExample-Info.plist */,
+ 63B780F414E080280009EE1F /* InfoPlist.strings */,
+ 63B780F714E080280009EE1F /* main.m */,
+ 63B780F914E080280009EE1F /* DAReloadActivityExample-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 63B7810C14E0850F0009EE1F /* DAReloadActivity */ = {
+ isa = PBXGroup;
+ children = (
+ 63B7810D14E0850F0009EE1F /* DAReloadActivityButton.h */,
+ 63B7810E14E0850F0009EE1F /* DAReloadActivityButton.m */,
+ 63B7811214E086990009EE1F /* reload.png */,
+ 63B7811314E086990009EE1F /* reload@2x.png */,
+ );
+ name = DAReloadActivity;
+ path = ../DAReloadActivity;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 63B780E614E080280009EE1F /* DAReloadActivityExample */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 63B7810514E080280009EE1F /* Build configuration list for PBXNativeTarget "DAReloadActivityExample" */;
+ buildPhases = (
+ 63B780E314E080280009EE1F /* Sources */,
+ 63B780E414E080280009EE1F /* Frameworks */,
+ 63B780E514E080280009EE1F /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = DAReloadActivityExample;
+ productName = DAReloadActivityExample;
+ productReference = 63B780E714E080280009EE1F /* DAReloadActivityExample.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 63B780DE14E080280009EE1F /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ ORGANIZATIONNAME = "Shout Messenger";
+ };
+ buildConfigurationList = 63B780E114E080280009EE1F /* Build configuration list for PBXProject "DAReloadActivityExample" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 63B780DC14E080280009EE1F;
+ productRefGroup = 63B780E814E080280009EE1F /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 63B780E614E080280009EE1F /* DAReloadActivityExample */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 63B780E514E080280009EE1F /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63B780F614E080280009EE1F /* InfoPlist.strings in Resources */,
+ 63B7811414E086990009EE1F /* reload.png in Resources */,
+ 63B7811514E086990009EE1F /* reload@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 63B780E314E080280009EE1F /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63B780F814E080280009EE1F /* main.m in Sources */,
+ 63B780FC14E080280009EE1F /* AppDelegate.m in Sources */,
+ 63B780FF14E080280009EE1F /* ViewController.m in Sources */,
+ 63B7810F14E0850F0009EE1F /* DAReloadActivityButton.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 63B780F414E080280009EE1F /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 63B780F514E080280009EE1F /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 63B7810314E080280009EE1F /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 63B7810414E080280009EE1F /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 63B7810614E080280009EE1F /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "DAReloadActivityExample/DAReloadActivityExample-Prefix.pch";
+ INFOPLIST_FILE = "DAReloadActivityExample/DAReloadActivityExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 63B7810714E080280009EE1F /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "DAReloadActivityExample/DAReloadActivityExample-Prefix.pch";
+ INFOPLIST_FILE = "DAReloadActivityExample/DAReloadActivityExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 63B780E114E080280009EE1F /* Build configuration list for PBXProject "DAReloadActivityExample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 63B7810314E080280009EE1F /* Debug */,
+ 63B7810414E080280009EE1F /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 63B7810514E080280009EE1F /* Build configuration list for PBXNativeTarget "DAReloadActivityExample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 63B7810614E080280009EE1F /* Debug */,
+ 63B7810714E080280009EE1F /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 63B780DE14E080280009EE1F /* Project object */;
+}
7 DAReloadActivityExample/DAReloadActivityExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:DAReloadActivityExample.xcodeproj">
+ </FileRef>
+</Workspace>
BIN  ...Example.xcodeproj/project.xcworkspace/xcuserdata/danielamitay.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
84 ...ActivityExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/DAReloadActivityExample.xcscheme
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "63B780E614E080280009EE1F"
+ BuildableName = "DAReloadActivityExample.app"
+ BlueprintName = "DAReloadActivityExample"
+ ReferencedContainer = "container:DAReloadActivityExample.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "63B780E614E080280009EE1F"
+ BuildableName = "DAReloadActivityExample.app"
+ BlueprintName = "DAReloadActivityExample"
+ ReferencedContainer = "container:DAReloadActivityExample.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "63B780E614E080280009EE1F"
+ BuildableName = "DAReloadActivityExample.app"
+ BlueprintName = "DAReloadActivityExample"
+ ReferencedContainer = "container:DAReloadActivityExample.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "63B780E614E080280009EE1F"
+ BuildableName = "DAReloadActivityExample.app"
+ BlueprintName = "DAReloadActivityExample"
+ ReferencedContainer = "container:DAReloadActivityExample.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
22 ...DAReloadActivityExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,22 @@
+<?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>SchemeUserState</key>
+ <dict>
+ <key>DAReloadActivityExample.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>63B780E614E080280009EE1F</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
17 DAReloadActivityExample/DAReloadActivityExample/AppDelegate.h
@@ -0,0 +1,17 @@
+//
+// AppDelegate.h
+// DAReloadActivityExample
+//
+// Created by Daniel Amitay on 2/6/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class ViewController;
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
70 DAReloadActivityExample/DAReloadActivityExample/AppDelegate.m
@@ -0,0 +1,70 @@
+//
+// AppDelegate.m
+// DAReloadActivityExample
+//
+// Created by Daniel Amitay on 2/6/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+#import "ViewController.h"
+
+@implementation AppDelegate
+
+@synthesize window = _window;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ // Override point for customization after application launch.
+
+ ViewController *viewController = [[ViewController alloc] init];
+
+ UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
+
+ self.window.rootViewController = navController;
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ /*
+ Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ /*
+ Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+ */
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ /*
+ Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ */
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ /*
+ Called when the application is about to terminate.
+ Save data if appropriate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+@end
40 DAReloadActivityExample/DAReloadActivityExample/DAReloadActivityExample-Info.plist
@@ -0,0 +1,40 @@
+<?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>CFBundleIconFiles</key>
+ <array/>
+ <key>CFBundleIdentifier</key>
+ <string>us.amitay.${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>
+</dict>
+</plist>
14 DAReloadActivityExample/DAReloadActivityExample/DAReloadActivityExample-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'DAReloadActivityExample' target in the 'DAReloadActivityExample' 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
17 DAReloadActivityExample/DAReloadActivityExample/ViewController.h
@@ -0,0 +1,17 @@
+//
+// ViewController.h
+// DAReloadActivityExample
+//
+// Created by Daniel Amitay on 2/6/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "DAReloadActivityButton.h"
+
+@interface ViewController : UIViewController
+
+@property (nonatomic, strong) DAReloadActivityButton *navigationBarItem;
+@property (nonatomic, strong) DAReloadActivityButton *viewButton;
+
+@end
98 DAReloadActivityExample/DAReloadActivityExample/ViewController.m
@@ -0,0 +1,98 @@
+//
+// ViewController.m
+// DAReloadActivityExample
+//
+// Created by Daniel Amitay on 2/6/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import "ViewController.h"
+
+@implementation ViewController
+
+@synthesize navigationBarItem;
+@synthesize viewButton;
+
+- (void)didReceiveMemoryWarning
+{
+ [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, typically from a nib.
+ self.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
+
+ navigationBarItem = [[DAReloadActivityButton alloc] init];
+ navigationBarItem.showsTouchWhenHighlighted = NO;
+ [navigationBarItem addTarget:self action:@selector(animate:) forControlEvents:UIControlEventTouchUpInside];
+ UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:navigationBarItem];
+ self.navigationItem.rightBarButtonItem = barButtonItem;
+
+ viewButton = [[DAReloadActivityButton alloc] init];
+ [viewButton addTarget:self action:@selector(animate:) forControlEvents:UIControlEventTouchUpInside];
+ viewButton.center = CGPointMake(160, 176);
+ viewButton.autoresizingMask = (UIViewAutoresizingFlexibleTopMargin |
+ UIViewAutoresizingFlexibleBottomMargin |
+ UIViewAutoresizingFlexibleLeftMargin |
+ UIViewAutoresizingFlexibleRightMargin);
+ [self.view addSubview:viewButton];
+}
+
+- (void)animate:(DAReloadActivityButton *)button
+{
+ if(button == navigationBarItem)
+ {
+ [button spin];
+ }
+ else
+ {
+ if ([button isAnimating])
+ {
+ [button stopAnimating];
+ }
+ else
+ {
+ [button startAnimating];
+ }
+ }
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ [super viewWillAppear:animated];
+}
+
+- (void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+}
+
+- (void)viewWillDisappear:(BOOL)animated
+{
+ [super viewWillDisappear:animated];
+}
+
+- (void)viewDidDisappear:(BOOL)animated
+{
+ [super viewDidDisappear:animated];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
+}
+
+@end
2  DAReloadActivityExample/DAReloadActivityExample/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
18 DAReloadActivityExample/DAReloadActivityExample/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// DAReloadActivityExample
+//
+// Created by Daniel Amitay on 2/6/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
23 LICENSE.md
@@ -0,0 +1,23 @@
+# License
+
+## MIT License
+
+Copyright (c) 2012 Daniel Amitay (http://www.amitay.us)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
64 README.md
@@ -0,0 +1,64 @@
+## DAReloadActivity
+
+DAReloadActivity is a UIButton subclass (with a refresh arrow by default) with UIActivityIndicatorView properties.
+
+It was built to be an imitation of Path's cover refresh button.
+
+View the included example project for a demonstration.
+
+## Installation
+
+To use DAReloadActivity:
+
+1 - Copy over the `DAReloadActivity` folder to your project folder.
+2 - Allocate, Initialize.
+Optional - Customize.
+
+## Usage
+Wherever you want to use DAReloadActivity, import the appropriate header file and initialize as follows:
+
+```
+' #import "DAReloadActivityButton.h" '
+```
+
+Initialize either via code or Interface Builder.
+
+## Notes
+
+### Automatic Reference Counting (ARC) support
+DAReloadActivity was made with ARC enabled by default.
+
+## Contact
+
+- [Personal website](http://www.amitay.us)
+- [GitHub](http://github.com/danielamitay)
+- [Twitter](http://twitter.com/danielamitay)
+- [LinkedIn](http://www.linkedin.com/in/danielamitay)
+- [Hacker News](http://news.ycombinator.com/user?id=danielamitay)
+- [Email](daniel@amitay.us)
+
+If you use/enjoy DAReloadActivity, let me know!
+
+## License
+
+### MIT License
+
+Copyright (c) 2012 Daniel Amitay (http://www.amitay.us)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Please sign in to comment.
Something went wrong with that request. Please try again.