diff options
| author | Ronny Fenrich <Fenrich@Gmail.com> | 2013-06-13 13:40:44 -0600 |
|---|---|---|
| committer | Ronny Fenrich <Fenrich@Gmail.com> | 2013-06-13 13:40:44 -0600 |
| commit | bf6c97cdee2264656211126ee01066c3c5d4bd8d (patch) | |
| tree | df4a6a9ed1b76109a57d1bf71c85b5632a6e3a0b /Pods/SVPullToRefresh | |
| parent | d6d01c9dd86561ad2121f0f85f0a4529142d5093 (diff) | |
added Xcode project and converted to CocoaPods (added a bunch of libraries)
Diffstat (limited to 'Pods/SVPullToRefresh')
21 files changed, 2135 insertions, 0 deletions
diff --git a/Pods/SVPullToRefresh/Demo/Default-568h@2x.png b/Pods/SVPullToRefresh/Demo/Default-568h@2x.png Binary files differnew file mode 100644 index 0000000..0891b7a --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/Default-568h@2x.png diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo.xcodeproj/project.pbxproj b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c8dcd4e --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo.xcodeproj/project.pbxproj @@ -0,0 +1,336 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2214365616B48FD70057C96E /* SVPullToRefresh.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 2214365516B48FD70057C96E /* SVPullToRefresh.podspec */; }; + 22E0D9191545EE5B00BB6BB5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E0D9181545EE5B00BB6BB5 /* UIKit.framework */; }; + 22E0D91B1545EE5B00BB6BB5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E0D91A1545EE5B00BB6BB5 /* Foundation.framework */; }; + 22E0D91D1545EE5B00BB6BB5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E0D91C1545EE5B00BB6BB5 /* CoreGraphics.framework */; }; + 22E0D9231545EE5B00BB6BB5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 22E0D9211545EE5B00BB6BB5 /* InfoPlist.strings */; }; + 22E0D9251545EE5B00BB6BB5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E0D9241545EE5B00BB6BB5 /* main.m */; }; + 22E0D9291545EE5B00BB6BB5 /* SVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E0D9281545EE5B00BB6BB5 /* SVAppDelegate.m */; }; + 22E0D92C1545EE5B00BB6BB5 /* SVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E0D92B1545EE5B00BB6BB5 /* SVViewController.m */; }; + 22E0D92F1545EE5B00BB6BB5 /* SVViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22E0D92D1545EE5B00BB6BB5 /* SVViewController.xib */; }; + 22E0D93D1545EE7600BB6BB5 /* UIScrollView+SVPullToRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E0D93B1545EE7600BB6BB5 /* UIScrollView+SVPullToRefresh.m */; }; + 22E0D9411545EE9000BB6BB5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E0D9401545EE9000BB6BB5 /* QuartzCore.framework */; }; + 22E0D94B1545F63300BB6BB5 /* README.textile in Resources */ = {isa = PBXBuildFile; fileRef = 22E0D94A1545F63300BB6BB5 /* README.textile */; }; + 22FDEC971639082E00DB53A8 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 22FDEC961639082E00DB53A8 /* Default-568h@2x.png */; }; + 22FDEC9D16390CC800DB53A8 /* UIScrollView+SVInfiniteScrolling.m in Sources */ = {isa = PBXBuildFile; fileRef = 2288146016047C06005C6461 /* UIScrollView+SVInfiniteScrolling.m */; }; + 8E7FDB661640EBA200EE63E5 /* SVRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E7FDB641640EBA200EE63E5 /* SVRootViewController.m */; }; + 8E7FDB671640EBA200EE63E5 /* SVRootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8E7FDB651640EBA200EE63E5 /* SVRootViewController.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2214365516B48FD70057C96E /* SVPullToRefresh.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SVPullToRefresh.podspec; path = ../SVPullToRefresh.podspec; sourceTree = "<group>"; }; + 226989041639F55E00FCBB3B /* SVPullToRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVPullToRefresh.h; sourceTree = "<group>"; }; + 2288145F16047C06005C6461 /* UIScrollView+SVInfiniteScrolling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+SVInfiniteScrolling.h"; sourceTree = "<group>"; }; + 2288146016047C06005C6461 /* UIScrollView+SVInfiniteScrolling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+SVInfiniteScrolling.m"; sourceTree = "<group>"; }; + 22E0D9141545EE5B00BB6BB5 /* SVPullToRefreshDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SVPullToRefreshDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 22E0D9181545EE5B00BB6BB5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 22E0D91A1545EE5B00BB6BB5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 22E0D91C1545EE5B00BB6BB5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 22E0D9201545EE5B00BB6BB5 /* SVPullToRefreshDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SVPullToRefreshDemo-Info.plist"; sourceTree = "<group>"; }; + 22E0D9221545EE5B00BB6BB5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; + 22E0D9241545EE5B00BB6BB5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 22E0D9261545EE5B00BB6BB5 /* SVPullToRefreshDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SVPullToRefreshDemo-Prefix.pch"; sourceTree = "<group>"; }; + 22E0D9271545EE5B00BB6BB5 /* SVAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVAppDelegate.h; sourceTree = "<group>"; }; + 22E0D9281545EE5B00BB6BB5 /* SVAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SVAppDelegate.m; sourceTree = "<group>"; }; + 22E0D92A1545EE5B00BB6BB5 /* SVViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVViewController.h; sourceTree = "<group>"; }; + 22E0D92B1545EE5B00BB6BB5 /* SVViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SVViewController.m; sourceTree = "<group>"; }; + 22E0D92E1545EE5B00BB6BB5 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SVViewController.xib; sourceTree = "<group>"; }; + 22E0D93A1545EE7600BB6BB5 /* UIScrollView+SVPullToRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+SVPullToRefresh.h"; sourceTree = "<group>"; }; + 22E0D93B1545EE7600BB6BB5 /* UIScrollView+SVPullToRefresh.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+SVPullToRefresh.m"; sourceTree = "<group>"; }; + 22E0D9401545EE9000BB6BB5 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 22E0D94A1545F63300BB6BB5 /* README.textile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.textile; path = ../README.textile; sourceTree = "<group>"; }; + 22FDEC961639082E00DB53A8 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = "<group>"; }; + 8E7FDB631640EBA200EE63E5 /* SVRootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVRootViewController.h; sourceTree = "<group>"; }; + 8E7FDB641640EBA200EE63E5 /* SVRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVRootViewController.m; sourceTree = "<group>"; }; + 8E7FDB651640EBA200EE63E5 /* SVRootViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SVRootViewController.xib; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 22E0D9111545EE5B00BB6BB5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 22E0D9411545EE9000BB6BB5 /* QuartzCore.framework in Frameworks */, + 22E0D9191545EE5B00BB6BB5 /* UIKit.framework in Frameworks */, + 22E0D91B1545EE5B00BB6BB5 /* Foundation.framework in Frameworks */, + 22E0D91D1545EE5B00BB6BB5 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 22E0D9091545EE5B00BB6BB5 = { + isa = PBXGroup; + children = ( + 22E0D94A1545F63300BB6BB5 /* README.textile */, + 2214365516B48FD70057C96E /* SVPullToRefresh.podspec */, + 22E0D91E1545EE5B00BB6BB5 /* Demo */, + 22E0D9391545EE7600BB6BB5 /* SVPullToRefresh */, + 22E0D9171545EE5B00BB6BB5 /* Frameworks */, + 22E0D9151545EE5B00BB6BB5 /* Products */, + ); + sourceTree = "<group>"; + }; + 22E0D9151545EE5B00BB6BB5 /* Products */ = { + isa = PBXGroup; + children = ( + 22E0D9141545EE5B00BB6BB5 /* SVPullToRefreshDemo.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 22E0D9171545EE5B00BB6BB5 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 22E0D9401545EE9000BB6BB5 /* QuartzCore.framework */, + 22E0D9181545EE5B00BB6BB5 /* UIKit.framework */, + 22E0D91A1545EE5B00BB6BB5 /* Foundation.framework */, + 22E0D91C1545EE5B00BB6BB5 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 22E0D91E1545EE5B00BB6BB5 /* Demo */ = { + isa = PBXGroup; + children = ( + 22E0D9271545EE5B00BB6BB5 /* SVAppDelegate.h */, + 22E0D9281545EE5B00BB6BB5 /* SVAppDelegate.m */, + 8E7FDB631640EBA200EE63E5 /* SVRootViewController.h */, + 8E7FDB641640EBA200EE63E5 /* SVRootViewController.m */, + 8E7FDB651640EBA200EE63E5 /* SVRootViewController.xib */, + 22E0D92A1545EE5B00BB6BB5 /* SVViewController.h */, + 22E0D92B1545EE5B00BB6BB5 /* SVViewController.m */, + 22E0D92D1545EE5B00BB6BB5 /* SVViewController.xib */, + 22E0D91F1545EE5B00BB6BB5 /* Supporting Files */, + ); + name = Demo; + path = SVPullToRefreshDemo; + sourceTree = "<group>"; + }; + 22E0D91F1545EE5B00BB6BB5 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 22FDEC961639082E00DB53A8 /* Default-568h@2x.png */, + 22E0D9201545EE5B00BB6BB5 /* SVPullToRefreshDemo-Info.plist */, + 22E0D9211545EE5B00BB6BB5 /* InfoPlist.strings */, + 22E0D9241545EE5B00BB6BB5 /* main.m */, + 22E0D9261545EE5B00BB6BB5 /* SVPullToRefreshDemo-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = "<group>"; + }; + 22E0D9391545EE7600BB6BB5 /* SVPullToRefresh */ = { + isa = PBXGroup; + children = ( + 226989041639F55E00FCBB3B /* SVPullToRefresh.h */, + 22E0D93A1545EE7600BB6BB5 /* UIScrollView+SVPullToRefresh.h */, + 22E0D93B1545EE7600BB6BB5 /* UIScrollView+SVPullToRefresh.m */, + 2288145F16047C06005C6461 /* UIScrollView+SVInfiniteScrolling.h */, + 2288146016047C06005C6461 /* UIScrollView+SVInfiniteScrolling.m */, + ); + name = SVPullToRefresh; + path = ../SVPullToRefresh; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 22E0D9131545EE5B00BB6BB5 /* SVPullToRefreshDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 22E0D9321545EE5B00BB6BB5 /* Build configuration list for PBXNativeTarget "SVPullToRefreshDemo" */; + buildPhases = ( + 22E0D9101545EE5B00BB6BB5 /* Sources */, + 22E0D9111545EE5B00BB6BB5 /* Frameworks */, + 22E0D9121545EE5B00BB6BB5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SVPullToRefreshDemo; + productName = SVPullToRefreshDemo; + productReference = 22E0D9141545EE5B00BB6BB5 /* SVPullToRefreshDemo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 22E0D90B1545EE5B00BB6BB5 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = SV; + LastUpgradeCheck = 0430; + ORGANIZATIONNAME = Home; + }; + buildConfigurationList = 22E0D90E1545EE5B00BB6BB5 /* Build configuration list for PBXProject "SVPullToRefreshDemo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 22E0D9091545EE5B00BB6BB5; + productRefGroup = 22E0D9151545EE5B00BB6BB5 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 22E0D9131545EE5B00BB6BB5 /* SVPullToRefreshDemo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 22E0D9121545EE5B00BB6BB5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22E0D9231545EE5B00BB6BB5 /* InfoPlist.strings in Resources */, + 22E0D92F1545EE5B00BB6BB5 /* SVViewController.xib in Resources */, + 22E0D94B1545F63300BB6BB5 /* README.textile in Resources */, + 22FDEC971639082E00DB53A8 /* Default-568h@2x.png in Resources */, + 8E7FDB671640EBA200EE63E5 /* SVRootViewController.xib in Resources */, + 2214365616B48FD70057C96E /* SVPullToRefresh.podspec in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 22E0D9101545EE5B00BB6BB5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22E0D9251545EE5B00BB6BB5 /* main.m in Sources */, + 22E0D9291545EE5B00BB6BB5 /* SVAppDelegate.m in Sources */, + 22E0D92C1545EE5B00BB6BB5 /* SVViewController.m in Sources */, + 22E0D93D1545EE7600BB6BB5 /* UIScrollView+SVPullToRefresh.m in Sources */, + 22FDEC9D16390CC800DB53A8 /* UIScrollView+SVInfiniteScrolling.m in Sources */, + 8E7FDB661640EBA200EE63E5 /* SVRootViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 22E0D9211545EE5B00BB6BB5 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 22E0D9221545EE5B00BB6BB5 /* en */, + ); + name = InfoPlist.strings; + sourceTree = "<group>"; + }; + 22E0D92D1545EE5B00BB6BB5 /* SVViewController.xib */ = { + isa = PBXVariantGroup; + children = ( + 22E0D92E1545EE5B00BB6BB5 /* en */, + ); + name = SVViewController.xib; + sourceTree = "<group>"; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 22E0D9301545EE5B00BB6BB5 /* 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_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 22E0D9311545EE5B00BB6BB5 /* 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_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 22E0D9331545EE5B00BB6BB5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SVPullToRefreshDemo/SVPullToRefreshDemo-Prefix.pch"; + INFOPLIST_FILE = "SVPullToRefreshDemo/SVPullToRefreshDemo-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 22E0D9341545EE5B00BB6BB5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SVPullToRefreshDemo/SVPullToRefreshDemo-Prefix.pch"; + INFOPLIST_FILE = "SVPullToRefreshDemo/SVPullToRefreshDemo-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 22E0D90E1545EE5B00BB6BB5 /* Build configuration list for PBXProject "SVPullToRefreshDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 22E0D9301545EE5B00BB6BB5 /* Debug */, + 22E0D9311545EE5B00BB6BB5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 22E0D9321545EE5B00BB6BB5 /* Build configuration list for PBXNativeTarget "SVPullToRefreshDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 22E0D9331545EE5B00BB6BB5 /* Debug */, + 22E0D9341545EE5B00BB6BB5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 22E0D90B1545EE5B00BB6BB5 /* Project object */; +} diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVAppDelegate.h b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVAppDelegate.h new file mode 100644 index 0000000..7994a36 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVAppDelegate.h @@ -0,0 +1,17 @@ +// +// SVAppDelegate.h +// SVPullToRefreshDemo +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@class SVViewController; + +@interface SVAppDelegate : UIResponder <UIApplicationDelegate> + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVAppDelegate.m b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVAppDelegate.m new file mode 100644 index 0000000..374b777 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVAppDelegate.m @@ -0,0 +1,53 @@ +// +// SVAppDelegate.m +// SVPullToRefreshDemo +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// + +#import "SVAppDelegate.h" + +#import "SVRootViewController.h" + +@implementation SVAppDelegate + +@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. + self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[SVRootViewController alloc] initWithNibName:@"SVRootViewController" bundle:nil]]; + [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 diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVPullToRefreshDemo-Info.plist b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVPullToRefreshDemo-Info.plist new file mode 100644 index 0000000..7c2dbdb --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVPullToRefreshDemo-Info.plist @@ -0,0 +1,38 @@ +<?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.samvermette.${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> diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVPullToRefreshDemo-Prefix.pch b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVPullToRefreshDemo-Prefix.pch new file mode 100644 index 0000000..60936ac --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVPullToRefreshDemo-Prefix.pch @@ -0,0 +1,18 @@ +// +// Prefix header for all source files of the 'SVPullToRefreshDemo' target in the 'SVPullToRefreshDemo' 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 + +#ifdef DEBUG +#define SV_DEBUG_MEMORY_LEAK +#endif diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.h b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.h new file mode 100644 index 0000000..f9c5ad0 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.h @@ -0,0 +1,15 @@ +// +// SVRootViewController.h +// SVPullToRefreshDemo +// +// Created by fengjian on 12-10-31. +// Copyright (c) 2012年 Home. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@interface SVRootViewController : UIViewController + +- (IBAction)showTableView:(id)sender; + +@end diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.m b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.m new file mode 100644 index 0000000..7ad60c3 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.m @@ -0,0 +1,43 @@ +// +// SVRootViewController.m +// SVPullToRefreshDemo +// +// Created by fengjian on 12-10-31. +// Copyright (c) 2012年 Home. All rights reserved. +// + +#import "SVRootViewController.h" +#import "SVViewController.h" + +@interface SVRootViewController () + +@end + +@implementation SVRootViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)showTableView:(id)sender +{ + [self.navigationController pushViewController:[[SVViewController alloc] initWithNibName:@"SVViewController" bundle:nil] animated:YES]; +} +@end diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.xib b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.xib new file mode 100644 index 0000000..19f51e7 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVRootViewController.xib @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="UTF-8"?> +<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00"> + <data> + <int key="IBDocument.SystemTarget">1536</int> + <string key="IBDocument.SystemVersion">12C60</string> + <string key="IBDocument.InterfaceBuilderVersion">2843</string> + <string key="IBDocument.AppKitVersion">1187.34</string> + <string key="IBDocument.HIToolboxVersion">625.00</string> + <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> + <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="NS.object.0">1929</string> + </object> + <array key="IBDocument.IntegratedClassDependencies"> + <string>IBProxyObject</string> + <string>IBUIButton</string> + <string>IBUIView</string> + </array> + <array key="IBDocument.PluginDependencies"> + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + </array> + <object class="NSMutableDictionary" key="IBDocument.Metadata"> + <string key="NS.key.0">PluginDependencyRecalculationVersion</string> + <integer value="1" key="NS.object.0"/> + </object> + <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> + <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="IBUIView" id="191373211"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">274</int> + <array class="NSMutableArray" key="NSSubviews"> + <object class="IBUIButton" id="428280033"> + <reference key="NSNextResponder" ref="191373211"/> + <int key="NSvFlags">301</int> + <string key="NSFrame">{{87, 252}, {146, 44}}</string> + <reference key="NSSuperview" ref="191373211"/> + <string key="NSReuseIdentifierKey">_NS:9</string> + <bool key="IBUIOpaque">NO</bool> + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> + <int key="IBUIContentHorizontalAlignment">0</int> + <int key="IBUIContentVerticalAlignment">0</int> + <int key="IBUIButtonType">1</int> + <string key="IBUINormalTitle">Show Table View</string> + <object class="NSColor" key="IBUIHighlightedTitleColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MQA</bytes> + </object> + <object class="NSColor" key="IBUINormalTitleColor"> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes> + </object> + <object class="NSColor" key="IBUINormalTitleShadowColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC41AA</bytes> + </object> + <object class="IBUIFontDescription" key="IBUIFontDescription"> + <int key="type">2</int> + <double key="pointSize">15</double> + </object> + <object class="NSFont" key="IBUIFont"> + <string key="NSName">Helvetica-Bold</string> + <double key="NSSize">15</double> + <int key="NSfFlags">16</int> + </object> + </object> + </array> + <string key="NSFrame">{{0, 20}, {320, 548}}</string> + <reference key="NSSuperview"/> + <reference key="NSNextKeyView" ref="428280033"/> + <object class="NSColor" key="IBUIBackgroundColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MQA</bytes> + <object class="NSColorSpace" key="NSCustomColorSpace"> + <int key="NSID">2</int> + </object> + </object> + <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/> + <object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics"> + <string key="IBUISimulatedSizeMetricsClass">IBUIScreenMetrics</string> + <object class="NSMutableDictionary" key="IBUINormalizedOrientationToSizeMap"> + <bool key="EncodedWithXMLCoder">YES</bool> + <array key="dict.sortedKeys"> + <integer value="1"/> + <integer value="3"/> + </array> + <array key="dict.values"> + <string>{320, 568}</string> + <string>{568, 320}</string> + </array> + </object> + <string key="IBUITargetRuntime">IBCocoaTouchFramework</string> + <string key="IBUIDisplayName">Retina 4 Full Screen</string> + <int key="IBUIType">2</int> + </object> + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> + </object> + </array> + <object class="IBObjectContainer" key="IBDocument.Objects"> + <array class="NSMutableArray" key="connectionRecords"> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchOutletConnection" key="connection"> + <string key="label">view</string> + <reference key="source" ref="372490531"/> + <reference key="destination" ref="191373211"/> + </object> + <int key="connectionID">3</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchEventConnection" key="connection"> + <string key="label">showTableView:</string> + <reference key="source" ref="428280033"/> + <reference key="destination" ref="372490531"/> + <int key="IBEventType">7</int> + </object> + <int key="connectionID">8</int> + </object> + </array> + <object class="IBMutableOrderedSet" key="objectRecords"> + <array key="orderedObjects"> + <object class="IBObjectRecord"> + <int key="objectID">0</int> + <array key="object" id="0"/> + <reference key="children" ref="1000"/> + <nil key="parent"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1</int> + <reference key="object" ref="191373211"/> + <array class="NSMutableArray" key="children"> + <reference ref="428280033"/> + </array> + <reference key="parent" ref="0"/> + </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">4</int> + <reference key="object" ref="428280033"/> + <reference key="parent" ref="191373211"/> + </object> + </array> + </object> + <dictionary class="NSMutableDictionary" key="flattenedProperties"> + <string key="-1.CustomClassName">SVRootViewController</string> + <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="-2.CustomClassName">UIResponder</string> + <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/> + <nil key="activeLocalization"/> + <dictionary class="NSMutableDictionary" key="localizations"/> + <nil key="sourceID"/> + <int key="maxID">8</int> + </object> + <object class="IBClassDescriber" key="IBDocument.Classes"/> + <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> + <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> + <int key="IBDocument.defaultPropertyAccessControl">3</int> + <string key="IBCocoaTouchPluginVersion">1929</string> + </data> +</archive> diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVViewController.h b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVViewController.h new file mode 100644 index 0000000..bce6e36 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVViewController.h @@ -0,0 +1,15 @@ +// +// SVViewController.h +// SVPullToRefreshDemo +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@interface SVViewController : UIViewController + +@property (nonatomic, strong) IBOutlet UITableView *tableView; + +@end diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVViewController.m b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVViewController.m new file mode 100644 index 0000000..3cca651 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/SVViewController.m @@ -0,0 +1,88 @@ +// +// SVViewController.m +// SVPullToRefreshDemo +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 Home. All rights reserved. +// + +#import "SVViewController.h" +#import "SVPullToRefresh.h" + +@interface SVViewController () <UITableViewDelegate, UITableViewDataSource> + +@property (nonatomic, strong) NSMutableArray *dataSource; + +@end + +@implementation SVViewController +@synthesize tableView = tableView; + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.dataSource = [NSMutableArray array]; + + for(int i=0; i<15; i++) + [self.dataSource addObject:[NSDate dateWithTimeIntervalSinceNow:-(i*90)]]; + + __weak SVViewController *weakSelf = self; + + // setup pull-to-refresh + [self.tableView addPullToRefreshWithActionHandler:^{ + + int64_t delayInSeconds = 2.0; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + [weakSelf.tableView beginUpdates]; + [weakSelf.dataSource insertObject:[NSDate date] atIndex:0]; + [weakSelf.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationBottom]; + [weakSelf.tableView endUpdates]; + + [weakSelf.tableView.pullToRefreshView stopAnimating]; + }); + }]; + + // setup infinite scrolling + [self.tableView addInfiniteScrollingWithActionHandler:^{ + + int64_t delayInSeconds = 2.0; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + [weakSelf.tableView beginUpdates]; + [weakSelf.dataSource addObject:[weakSelf.dataSource.lastObject dateByAddingTimeInterval:-90]]; + [weakSelf.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:weakSelf.dataSource.count-1 inSection:0]] withRowAnimation:UITableViewRowAnimationTop]; + [weakSelf.tableView endUpdates]; + + [weakSelf.tableView.infiniteScrollingView stopAnimating]; + }); + }]; + + // trigger the refresh manually at the end of viewDidLoad + [tableView triggerPullToRefresh]; +} + +#pragma mark - +#pragma mark UITableViewDataSource + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.dataSource.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *identifier = @"Cell"; + UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:identifier]; + + if (cell == nil) + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; + + NSDate *date = [self.dataSource objectAtIndex:indexPath.row]; + cell.textLabel.text = [NSDateFormatter localizedStringFromDate:date dateStyle:NSDateFormatterNoStyle timeStyle:NSDateFormatterMediumStyle]; + return cell; +} + +@end diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/en.lproj/InfoPlist.strings b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/en.lproj/SVViewController.xib b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/en.lproj/SVViewController.xib new file mode 100644 index 0000000..8ba1cd5 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/en.lproj/SVViewController.xib @@ -0,0 +1,203 @@ +<?xml version="1.0" encoding="UTF-8"?> +<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00"> + <data> + <int key="IBDocument.SystemTarget">1536</int> + <string key="IBDocument.SystemVersion">11E53</string> + <string key="IBDocument.InterfaceBuilderVersion">2809</string> + <string key="IBDocument.AppKitVersion">1138.47</string> + <string key="IBDocument.HIToolboxVersion">569.00</string> + <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> + <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="NS.object.0">1884</string> + </object> + <array key="IBDocument.IntegratedClassDependencies"> + <string>IBProxyObject</string> + <string>IBUITableView</string> + <string>IBUIView</string> + </array> + <array key="IBDocument.PluginDependencies"> + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + </array> + <object class="NSMutableDictionary" key="IBDocument.Metadata"> + <string key="NS.key.0">PluginDependencyRecalculationVersion</string> + <integer value="1" key="NS.object.0"/> + </object> + <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> + <object class="IBProxyObject" id="372490531"> + <string key="IBProxiedObjectIdentifier">IBFilesOwner</string> + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> + </object> + <object class="IBProxyObject" id="843779117"> + <string key="IBProxiedObjectIdentifier">IBFirstResponder</string> + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> + </object> + <object class="IBUIView" id="774585933"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">274</int> + <array class="NSMutableArray" key="NSSubviews"> + <object class="IBUITableView" id="215774682"> + <reference key="NSNextResponder" ref="774585933"/> + <int key="NSvFlags">274</int> + <string key="NSFrameSize">{320, 460}</string> + <reference key="NSSuperview" ref="774585933"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView"/> + <object class="NSColor" key="IBUIBackgroundColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MQA</bytes> + </object> + <bool key="IBUIClipsSubviews">YES</bool> + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> + <bool key="IBUIAlwaysBounceVertical">YES</bool> + <int key="IBUISeparatorStyle">1</int> + <int key="IBUISectionIndexMinimumDisplayRowCount">0</int> + <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool> + <float key="IBUIRowHeight">44</float> + <float key="IBUISectionHeaderHeight">22</float> + <float key="IBUISectionFooterHeight">22</float> + </object> + </array> + <string key="NSFrame">{{0, 20}, {320, 460}}</string> + <reference key="NSSuperview"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="215774682"/> + <object class="NSColor" key="IBUIBackgroundColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC43NQA</bytes> + <object class="NSColorSpace" key="NSCustomColorSpace"> + <int key="NSID">2</int> + </object> + </object> + <bool key="IBUIClearsContextBeforeDrawing">NO</bool> + <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/> + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> + </object> + </array> + <object class="IBObjectContainer" key="IBDocument.Objects"> + <array class="NSMutableArray" key="connectionRecords"> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchOutletConnection" key="connection"> + <string key="label">view</string> + <reference key="source" ref="372490531"/> + <reference key="destination" ref="774585933"/> + </object> + <int key="connectionID">7</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchOutletConnection" key="connection"> + <string key="label">tableView</string> + <reference key="source" ref="372490531"/> + <reference key="destination" ref="215774682"/> + </object> + <int key="connectionID">12</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchOutletConnection" key="connection"> + <string key="label">dataSource</string> + <reference key="source" ref="215774682"/> + <reference key="destination" ref="372490531"/> + </object> + <int key="connectionID">9</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="215774682"/> + <reference key="destination" ref="372490531"/> + </object> + <int key="connectionID">10</int> + </object> + </array> + <object class="IBMutableOrderedSet" key="objectRecords"> + <array key="orderedObjects"> + <object class="IBObjectRecord"> + <int key="objectID">0</int> + <array key="object" id="0"/> + <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="843779117"/> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">6</int> + <reference key="object" ref="774585933"/> + <array class="NSMutableArray" key="children"> + <reference ref="215774682"/> + </array> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">8</int> + <reference key="object" ref="215774682"/> + <reference key="parent" ref="774585933"/> + </object> + </array> + </object> + <dictionary class="NSMutableDictionary" key="flattenedProperties"> + <string key="-1.CustomClassName">SVViewController</string> + <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="-2.CustomClassName">UIResponder</string> + <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/> + <nil key="activeLocalization"/> + <dictionary class="NSMutableDictionary" key="localizations"/> + <nil key="sourceID"/> + <int key="maxID">14</int> + </object> + <object class="IBClassDescriber" key="IBDocument.Classes"> + <array class="NSMutableArray" key="referencedPartialClassDescriptions"> + <object class="IBPartialClassDescription"> + <string key="className">SVViewController</string> + <string key="superclassName">UIViewController</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">triggerRefresh:</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <string key="NS.key.0">triggerRefresh:</string> + <object class="IBActionInfo" key="NS.object.0"> + <string key="name">triggerRefresh:</string> + <string key="candidateClassName">id</string> + </object> + </object> + <object class="NSMutableDictionary" key="outlets"> + <string key="NS.key.0">tableView</string> + <string key="NS.object.0">UITableView</string> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <string key="NS.key.0">tableView</string> + <object class="IBToOneOutletInfo" key="NS.object.0"> + <string key="name">tableView</string> + <string key="candidateClassName">UITableView</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/SVViewController.h</string> + </object> + </object> + </array> + </object> + <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string> + <real value="1536" key="NS.object.0"/> + </object> + <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> + <int key="IBDocument.defaultPropertyAccessControl">3</int> + <string key="IBCocoaTouchPluginVersion">1884</string> + </data> +</archive> diff --git a/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/main.m b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/main.m new file mode 100644 index 0000000..83477c4 --- /dev/null +++ b/Pods/SVPullToRefresh/Demo/SVPullToRefreshDemo/main.m @@ -0,0 +1,18 @@ +// +// main.m +// SVPullToRefreshDemo +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// + +#import <UIKit/UIKit.h> + +#import "SVAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([SVAppDelegate class])); + } +} diff --git a/Pods/SVPullToRefresh/LICENSE.txt b/Pods/SVPullToRefresh/LICENSE.txt new file mode 100644 index 0000000..ce9f4ab --- /dev/null +++ b/Pods/SVPullToRefresh/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright (C) 2012 Sam Vermette + +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.
\ No newline at end of file diff --git a/Pods/SVPullToRefresh/README.textile b/Pods/SVPullToRefresh/README.textile new file mode 100644 index 0000000..ef16bb6 --- /dev/null +++ b/Pods/SVPullToRefresh/README.textile @@ -0,0 +1,118 @@ +__*Upgrading from an earlier version?*: On October 25th, a complete and overdue refactor of this class was pushed that fixes memory issues as well as adds new feature people have been asking for a long time. I tried my best to make this a seamless transition (you will get some deprecation warnings).__ + +__*Important note if your project doesn't use ARC*: you must add the @-fobjc-arc@ compiler flag to @UIScrollView+SVPullToRefresh.m@ and @UIScrollView+SVInfiniteScrolling.m@ in Target Settings > Build Phases > Compile Sources.__ + +h1. SVPullToRefresh + SVInfiniteScrolling + +These UIScrollView categories makes it super easy to add pull-to-refresh and infinite scrolling fonctionalities to any UIScrollView (or any of its subclass). Instead of depending on delegates and/or subclassing @UIViewController@, SVPullToRefresh uses the Objective-C runtime to add the following 2 methods: + +<pre> +- (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler; +- (void)addInfiniteScrollingWithActionHandler:(void (^)(void))actionHandler; +</pre> + +h2. Installation + +* Drag the @SVPullToRefresh/SVPullToRefresh@ folder into your project. +* Add the *QuartzCore* framework to your project. +* Import @UIScrollView+SVPullToRefresh.h@ and/or @UIScrollView+SVInfiniteScrolling.m@ + +h2. Usage + +(see sample Xcode project in @/Demo@) + +h3. Adding Pull to Refresh + +<pre> +[tableView addPullToRefreshWithActionHandler:^{ + // prepend data to dataSource, insert cells at top of table view + // call [tableView.pullToRefreshView stopAnimating] when done +}]; +</pre> + +If you’d like to programmatically trigger the refresh (for instance in viewDidLoad), you can do so with: + +<pre> +[tableView triggerPullToRefresh]; +</pre> + +You can temporarily hide the pull to refresh view by setting the @showsPullToRefresh@ property: + +<pre> +tableView.showsPullToRefresh = NO; +</pre> + +h4. Customization + +The pull to refresh view can be customized using the following properties/methods: + +<pre> +@property (nonatomic, strong) UIColor *arrowColor; +@property (nonatomic, strong) UIColor *textColor; +@property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle; + +- (void)setTitle:(NSString *)title forState:(SVPullToRefreshState)state; +- (void)setSubtitle:(NSString *)subtitle forState:(SVPullToRefreshState)state; +- (void)setCustomView:(UIView *)view forState:(SVPullToRefreshState)state; +</pre> + +You can access these properties through your scroll view's @pullToRefreshView@ property. + +For instance, you would set the @arrowColor@ property using: + +<pre> +tableView.pullToRefreshView.arrowColor = [UIColor whiteColor]; +</pre> + + +h3. Adding Infinite Scrolling + +<pre> +[tableView addInfiniteScrollingWithActionHandler:^{ + // append data to data source, insert new cells at the end of table view +}]; +</pre> + +If you’d like to programmatically trigger the refresh (for instance in viewDidLoad), you can do so with: + +<pre> +[tableView triggerInfiniteScrolling]; +</pre> + +You can temporarily hide the infinite scrolling view by setting the @showsInfiniteScrolling@ property: + +<pre> +tableView.showsInfiniteScrolling = NO; +</pre> + +If you'd like to keep the infinite scrolling view around but disable the action handler and state changing: + +<pre> +tableView.infiniteScrollingView.enabled = NO; +</pre> + +When disabled, the `state` property will always return `SVInfiniteScrollingStateStopped`. + +h4. Customization + +The infinite scrolling view can be customized using the following properties/methods: + +<pre> +@property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle; + +- (void)setCustomView:(UIView *)view forState:(SVInfiniteScrollingState)state; +</pre> + +You can access these properties through your scroll view's @infiniteScrollingView@ property. + +h2. Under the hood + +SVPullToRefresh extends @UIScrollView@ by adding new public methods as well as a dynamic properties (thanks "@seb_morel":http://twitter.com/seb_morel!). It uses key-value observing to track the scrollView's @contentOffset@, which removes the need for the view to be linked to the @UIScrollViewDelegate@ protocol. + +h2. Credits + +SVPullToRefresh is brought to you by "Sam Vermette":http://samvermette.com and "contributors to the project":https://github.com/samvermette/SVPullToRefresh/contributors. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by "creating new issues":https://github.com/samvermette/SVPullToRefresh/issues/new. If you're using SVPullToRefresh in your project, attribution would be nice. + +Big thanks to "@seb_morel":http://twitter.com/seb_morel for his "Demistifying the Objective-C runtime":http://cocoaheadsmtl.s3.amazonaws.com/demistifying-runtime.pdf talk, which permitted the level of abstraction found in SVPullToRefresh. + +Hat tip to "Loren Brichter":http://twitter.com/lorenb for inventing such a great UI mechanism.
\ No newline at end of file diff --git a/Pods/SVPullToRefresh/SVPullToRefresh/SVPullToRefresh.h b/Pods/SVPullToRefresh/SVPullToRefresh/SVPullToRefresh.h new file mode 100644 index 0000000..1031b93 --- /dev/null +++ b/Pods/SVPullToRefresh/SVPullToRefresh/SVPullToRefresh.h @@ -0,0 +1,15 @@ +// +// SVPullToRefresh.h +// SVPullToRefreshDemo +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// +// https://github.com/samvermette/SVPullToRefresh +// + +// this header file is provided for backwards compatibility and will be removed in the future +// here's how you should import SVPullToRefresh now: + +#import "UIScrollView+SVPullToRefresh.h" +#import "UIScrollView+SVInfiniteScrolling.h" diff --git a/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h b/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h new file mode 100644 index 0000000..7ce1650 --- /dev/null +++ b/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h @@ -0,0 +1,45 @@ +// +// UIScrollView+SVInfiniteScrolling.h +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// +// https://github.com/samvermette/SVPullToRefresh +// + +#import <UIKit/UIKit.h> + +@class SVInfiniteScrollingView; + +@interface UIScrollView (SVInfiniteScrolling) + +- (void)addInfiniteScrollingWithActionHandler:(void (^)(void))actionHandler; +- (void)triggerInfiniteScrolling; + +@property (nonatomic, strong, readonly) SVInfiniteScrollingView *infiniteScrollingView; +@property (nonatomic, assign) BOOL showsInfiniteScrolling; + +@end + + +enum { + SVInfiniteScrollingStateStopped = 0, + SVInfiniteScrollingStateTriggered, + SVInfiniteScrollingStateLoading, + SVInfiniteScrollingStateAll = 10 +}; + +typedef NSUInteger SVInfiniteScrollingState; + +@interface SVInfiniteScrollingView : UIView + +@property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle; +@property (nonatomic, readonly) SVInfiniteScrollingState state; +@property (nonatomic, readwrite) BOOL enabled; + +- (void)setCustomView:(UIView *)view forState:(SVInfiniteScrollingState)state; + +- (void)startAnimating; +- (void)stopAnimating; + +@end diff --git a/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m b/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m new file mode 100644 index 0000000..28552bf --- /dev/null +++ b/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m @@ -0,0 +1,303 @@ +// +// UIScrollView+SVInfiniteScrolling.m +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// +// https://github.com/samvermette/SVPullToRefresh +// + +#import <QuartzCore/QuartzCore.h> +#import "UIScrollView+SVInfiniteScrolling.h" + + +static CGFloat const SVInfiniteScrollingViewHeight = 60; + +@interface SVInfiniteScrollingDotView : UIView + +@property (nonatomic, strong) UIColor *arrowColor; + +@end + + + +@interface SVInfiniteScrollingView () + +@property (nonatomic, copy) void (^infiniteScrollingHandler)(void); + +@property (nonatomic, strong) UIActivityIndicatorView *activityIndicatorView; +@property (nonatomic, readwrite) SVInfiniteScrollingState state; +@property (nonatomic, strong) NSMutableArray *viewForState; +@property (nonatomic, weak) UIScrollView *scrollView; +@property (nonatomic, readwrite) CGFloat originalBottomInset; +@property (nonatomic, assign) BOOL wasTriggeredByUser; +@property (nonatomic, assign) BOOL isObserving; + +- (void)resetScrollViewContentInset; +- (void)setScrollViewContentInsetForInfiniteScrolling; +- (void)setScrollViewContentInset:(UIEdgeInsets)insets; + +@end + + + +#pragma mark - UIScrollView (SVInfiniteScrollingView) +#import <objc/runtime.h> + +static char UIScrollViewInfiniteScrollingView; +UIEdgeInsets scrollViewOriginalContentInsets; + +@implementation UIScrollView (SVInfiniteScrolling) + +@dynamic infiniteScrollingView; + +- (void)addInfiniteScrollingWithActionHandler:(void (^)(void))actionHandler { + + if(!self.infiniteScrollingView) { + SVInfiniteScrollingView *view = [[SVInfiniteScrollingView alloc] initWithFrame:CGRectMake(0, self.contentSize.height, self.bounds.size.width, SVInfiniteScrollingViewHeight)]; + view.infiniteScrollingHandler = actionHandler; + view.scrollView = self; + [self addSubview:view]; + + view.originalBottomInset = self.contentInset.bottom; + self.infiniteScrollingView = view; + self.showsInfiniteScrolling = YES; + } +} + +- (void)triggerInfiniteScrolling { + self.infiniteScrollingView.state = SVInfiniteScrollingStateTriggered; + [self.infiniteScrollingView startAnimating]; +} + +- (void)setInfiniteScrollingView:(SVInfiniteScrollingView *)infiniteScrollingView { + [self willChangeValueForKey:@"UIScrollViewInfiniteScrollingView"]; + objc_setAssociatedObject(self, &UIScrollViewInfiniteScrollingView, + infiniteScrollingView, + OBJC_ASSOCIATION_ASSIGN); + [self didChangeValueForKey:@"UIScrollViewInfiniteScrollingView"]; +} + +- (SVInfiniteScrollingView *)infiniteScrollingView { + return objc_getAssociatedObject(self, &UIScrollViewInfiniteScrollingView); +} + +- (void)setShowsInfiniteScrolling:(BOOL)showsInfiniteScrolling { + self.infiniteScrollingView.hidden = !showsInfiniteScrolling; + + if(!showsInfiniteScrolling) { + if (self.infiniteScrollingView.isObserving) { + [self removeObserver:self.infiniteScrollingView forKeyPath:@"contentOffset"]; + [self removeObserver:self.infiniteScrollingView forKeyPath:@"contentSize"]; + [self.infiniteScrollingView resetScrollViewContentInset]; + self.infiniteScrollingView.isObserving = NO; + } + } + else { + if (!self.infiniteScrollingView.isObserving) { + [self addObserver:self.infiniteScrollingView forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self.infiniteScrollingView forKeyPath:@"contentSize" options:NSKeyValueObservingOptionNew context:nil]; + [self.infiniteScrollingView setScrollViewContentInsetForInfiniteScrolling]; + self.infiniteScrollingView.isObserving = YES; + + [self.infiniteScrollingView setNeedsLayout]; + self.infiniteScrollingView.frame = CGRectMake(0, self.contentSize.height, self.infiniteScrollingView.bounds.size.width, SVInfiniteScrollingViewHeight); + } + } +} + +- (BOOL)showsInfiniteScrolling { + return !self.infiniteScrollingView.hidden; +} + +@end + + +#pragma mark - SVInfiniteScrollingView +@implementation SVInfiniteScrollingView + +// public properties +@synthesize infiniteScrollingHandler, activityIndicatorViewStyle; + +@synthesize state = _state; +@synthesize scrollView = _scrollView; +@synthesize activityIndicatorView = _activityIndicatorView; + + +- (id)initWithFrame:(CGRect)frame { + if(self = [super initWithFrame:frame]) { + + // default styling values + self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; + self.autoresizingMask = UIViewAutoresizingFlexibleWidth; + self.state = SVInfiniteScrollingStateStopped; + self.enabled = YES; + + self.viewForState = [NSMutableArray arrayWithObjects:@"", @"", @"", @"", nil]; + } + + return self; +} + +- (void)willMoveToSuperview:(UIView *)newSuperview { + if (self.superview && newSuperview == nil) { + UIScrollView *scrollView = (UIScrollView *)self.superview; + if (scrollView.showsInfiniteScrolling) { + if (self.isObserving) { + [scrollView removeObserver:self forKeyPath:@"contentOffset"]; + [scrollView removeObserver:self forKeyPath:@"contentSize"]; + self.isObserving = NO; + } + } + } +} + +- (void)layoutSubviews { + self.activityIndicatorView.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2); +} + +#pragma mark - Scroll View + +- (void)resetScrollViewContentInset { + UIEdgeInsets currentInsets = self.scrollView.contentInset; + currentInsets.bottom = self.originalBottomInset; + [self setScrollViewContentInset:currentInsets]; +} + +- (void)setScrollViewContentInsetForInfiniteScrolling { + UIEdgeInsets currentInsets = self.scrollView.contentInset; + currentInsets.bottom = self.originalBottomInset + SVInfiniteScrollingViewHeight; + [self setScrollViewContentInset:currentInsets]; +} + +- (void)setScrollViewContentInset:(UIEdgeInsets)contentInset { + [UIView animateWithDuration:0.3 + delay:0 + options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionBeginFromCurrentState + animations:^{ + self.scrollView.contentInset = contentInset; + } + completion:NULL]; +} + +#pragma mark - Observing + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if([keyPath isEqualToString:@"contentOffset"]) + [self scrollViewDidScroll:[[change valueForKey:NSKeyValueChangeNewKey] CGPointValue]]; + else if([keyPath isEqualToString:@"contentSize"]) { + [self layoutSubviews]; + self.frame = CGRectMake(0, self.scrollView.contentSize.height, self.bounds.size.width, SVInfiniteScrollingViewHeight); + } +} + +- (void)scrollViewDidScroll:(CGPoint)contentOffset { + if(self.state != SVInfiniteScrollingStateLoading && self.enabled) { + CGFloat scrollViewContentHeight = self.scrollView.contentSize.height; + CGFloat scrollOffsetThreshold = scrollViewContentHeight-self.scrollView.bounds.size.height; + + if(!self.scrollView.isDragging && self.state == SVInfiniteScrollingStateTriggered) + self.state = SVInfiniteScrollingStateLoading; + else if(contentOffset.y > scrollOffsetThreshold && self.state == SVInfiniteScrollingStateStopped && self.scrollView.isDragging) + self.state = SVInfiniteScrollingStateTriggered; + else if(contentOffset.y < scrollOffsetThreshold && self.state != SVInfiniteScrollingStateStopped) + self.state = SVInfiniteScrollingStateStopped; + } +} + +#pragma mark - Getters + +- (UIActivityIndicatorView *)activityIndicatorView { + if(!_activityIndicatorView) { + _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; + _activityIndicatorView.hidesWhenStopped = YES; + [self addSubview:_activityIndicatorView]; + } + return _activityIndicatorView; +} + +- (UIActivityIndicatorViewStyle)activityIndicatorViewStyle { + return self.activityIndicatorView.activityIndicatorViewStyle; +} + +#pragma mark - Setters + +- (void)setCustomView:(UIView *)view forState:(SVInfiniteScrollingState)state { + id viewPlaceholder = view; + + if(!viewPlaceholder) + viewPlaceholder = @""; + + if(state == SVInfiniteScrollingStateAll) + [self.viewForState replaceObjectsInRange:NSMakeRange(0, 3) withObjectsFromArray:@[viewPlaceholder, viewPlaceholder, viewPlaceholder]]; + else + [self.viewForState replaceObjectAtIndex:state withObject:viewPlaceholder]; + + self.state = self.state; +} + +- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)viewStyle { + self.activityIndicatorView.activityIndicatorViewStyle = viewStyle; +} + +#pragma mark - + +- (void)triggerRefresh { + self.state = SVInfiniteScrollingStateTriggered; + self.state = SVInfiniteScrollingStateLoading; +} + +- (void)startAnimating{ + self.state = SVInfiniteScrollingStateLoading; +} + +- (void)stopAnimating { + self.state = SVInfiniteScrollingStateStopped; +} + +- (void)setState:(SVInfiniteScrollingState)newState { + + if(_state == newState) + return; + + SVInfiniteScrollingState previousState = _state; + _state = newState; + + for(id otherView in self.viewForState) { + if([otherView isKindOfClass:[UIView class]]) + [otherView removeFromSuperview]; + } + + id customView = [self.viewForState objectAtIndex:newState]; + BOOL hasCustomView = [customView isKindOfClass:[UIView class]]; + + if(hasCustomView) { + [self addSubview:customView]; + CGRect viewBounds = [customView bounds]; + CGPoint origin = CGPointMake(roundf((self.bounds.size.width-viewBounds.size.width)/2), roundf((self.bounds.size.height-viewBounds.size.height)/2)); + [customView setFrame:CGRectMake(origin.x, origin.y, viewBounds.size.width, viewBounds.size.height)]; + } + else { + CGRect viewBounds = [self.activityIndicatorView bounds]; + CGPoint origin = CGPointMake(roundf((self.bounds.size.width-viewBounds.size.width)/2), roundf((self.bounds.size.height-viewBounds.size.height)/2)); + [self.activityIndicatorView setFrame:CGRectMake(origin.x, origin.y, viewBounds.size.width, viewBounds.size.height)]; + + switch (newState) { + case SVInfiniteScrollingStateStopped: + [self.activityIndicatorView stopAnimating]; + break; + + case SVInfiniteScrollingStateTriggered: + break; + + case SVInfiniteScrollingStateLoading: + [self.activityIndicatorView startAnimating]; + break; + } + } + + if(previousState == SVInfiniteScrollingStateTriggered && newState == SVInfiniteScrollingStateLoading && self.infiniteScrollingHandler && self.enabled) + self.infiniteScrollingHandler(); +} + +@end diff --git a/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVPullToRefresh.h b/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVPullToRefresh.h new file mode 100644 index 0000000..b795810 --- /dev/null +++ b/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVPullToRefresh.h @@ -0,0 +1,61 @@ +// +// UIScrollView+SVPullToRefresh.h +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// +// https://github.com/samvermette/SVPullToRefresh +// + +#import <UIKit/UIKit.h> +#import <AvailabilityMacros.h> + + +@class SVPullToRefreshView; + +@interface UIScrollView (SVPullToRefresh) + +- (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler; +- (void)triggerPullToRefresh; + +@property (nonatomic, strong, readonly) SVPullToRefreshView *pullToRefreshView; +@property (nonatomic, assign) BOOL showsPullToRefresh; + +@end + + +enum { + SVPullToRefreshStateStopped = 0, + SVPullToRefreshStateTriggered, + SVPullToRefreshStateLoading, + SVPullToRefreshStateAll = 10 +}; + +typedef NSUInteger SVPullToRefreshState; + +@interface SVPullToRefreshView : UIView + +@property (nonatomic, strong) UIColor *arrowColor; +@property (nonatomic, strong) UIColor *textColor; +@property (nonatomic, strong, readonly) UILabel *titleLabel; +@property (nonatomic, strong, readonly) UILabel *subtitleLabel; +@property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle; + +@property (nonatomic, readonly) SVPullToRefreshState state; + +- (void)setTitle:(NSString *)title forState:(SVPullToRefreshState)state; +- (void)setSubtitle:(NSString *)subtitle forState:(SVPullToRefreshState)state; +- (void)setCustomView:(UIView *)view forState:(SVPullToRefreshState)state; + +- (void)startAnimating; +- (void)stopAnimating; + +// deprecated; use setSubtitle:forState: instead +@property (nonatomic, strong, readonly) UILabel *dateLabel DEPRECATED_ATTRIBUTE; +@property (nonatomic, strong) NSDate *lastUpdatedDate DEPRECATED_ATTRIBUTE; +@property (nonatomic, strong) NSDateFormatter *dateFormatter DEPRECATED_ATTRIBUTE; + +// deprecated; use [self.scrollView triggerPullToRefresh] instead +- (void)triggerRefresh DEPRECATED_ATTRIBUTE; + +@end diff --git a/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVPullToRefresh.m b/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVPullToRefresh.m new file mode 100644 index 0000000..55f7e89 --- /dev/null +++ b/Pods/SVPullToRefresh/SVPullToRefresh/UIScrollView+SVPullToRefresh.m @@ -0,0 +1,561 @@ +// +// UIScrollView+SVPullToRefresh.m +// +// Created by Sam Vermette on 23.04.12. +// Copyright (c) 2012 samvermette.com. All rights reserved. +// +// https://github.com/samvermette/SVPullToRefresh +// + +#import <QuartzCore/QuartzCore.h> +#import "UIScrollView+SVPullToRefresh.h" + +//fequalzro() from http://stackoverflow.com/a/1614761/184130 +#define fequalzero(a) (fabs(a) < FLT_EPSILON) + +static CGFloat const SVPullToRefreshViewHeight = 60; + +@interface SVPullToRefreshArrow : UIView + +@property (nonatomic, strong) UIColor *arrowColor; + +@end + + +@interface SVPullToRefreshView () + +@property (nonatomic, copy) void (^pullToRefreshActionHandler)(void); + +@property (nonatomic, strong) SVPullToRefreshArrow *arrow; +@property (nonatomic, strong) UIActivityIndicatorView *activityIndicatorView; +@property (nonatomic, strong, readwrite) UILabel *titleLabel; +@property (nonatomic, strong, readwrite) UILabel *subtitleLabel; +@property (nonatomic, readwrite) SVPullToRefreshState state; + +@property (nonatomic, strong) NSMutableArray *titles; +@property (nonatomic, strong) NSMutableArray *subtitles; +@property (nonatomic, strong) NSMutableArray *viewForState; + +@property (nonatomic, weak) UIScrollView *scrollView; +@property (nonatomic, readwrite) CGFloat originalTopInset; + +@property (nonatomic, assign) BOOL wasTriggeredByUser; +@property (nonatomic, assign) BOOL showsPullToRefresh; +@property (nonatomic, assign) BOOL showsDateLabel; +@property(nonatomic, assign) BOOL isObserving; + +- (void)resetScrollViewContentInset; +- (void)setScrollViewContentInsetForLoading; +- (void)setScrollViewContentInset:(UIEdgeInsets)insets; +- (void)rotateArrow:(float)degrees hide:(BOOL)hide; + +@end + + + +#pragma mark - UIScrollView (SVPullToRefresh) +#import <objc/runtime.h> + +static char UIScrollViewPullToRefreshView; + +@implementation UIScrollView (SVPullToRefresh) + +@dynamic pullToRefreshView, showsPullToRefresh; + +- (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler { + + if(!self.pullToRefreshView) { + SVPullToRefreshView *view = [[SVPullToRefreshView alloc] initWithFrame:CGRectMake(0, -SVPullToRefreshViewHeight, self.bounds.size.width, SVPullToRefreshViewHeight)]; + view.pullToRefreshActionHandler = actionHandler; + view.scrollView = self; + [self addSubview:view]; + + view.originalTopInset = self.contentInset.top; + self.pullToRefreshView = view; + self.showsPullToRefresh = YES; + } +} + +- (void)triggerPullToRefresh { + self.pullToRefreshView.state = SVPullToRefreshStateTriggered; + [self.pullToRefreshView startAnimating]; +} + +- (void)setPullToRefreshView:(SVPullToRefreshView *)pullToRefreshView { + [self willChangeValueForKey:@"SVPullToRefreshView"]; + objc_setAssociatedObject(self, &UIScrollViewPullToRefreshView, + pullToRefreshView, + OBJC_ASSOCIATION_ASSIGN); + [self didChangeValueForKey:@"SVPullToRefreshView"]; +} + +- (SVPullToRefreshView *)pullToRefreshView { + return objc_getAssociatedObject(self, &UIScrollViewPullToRefreshView); +} + +- (void)setShowsPullToRefresh:(BOOL)showsPullToRefresh { + self.pullToRefreshView.hidden = !showsPullToRefresh; + + if(!showsPullToRefresh) { + if (self.pullToRefreshView.isObserving) { + [self removeObserver:self.pullToRefreshView forKeyPath:@"contentOffset"]; + [self removeObserver:self.pullToRefreshView forKeyPath:@"frame"]; + [self.pullToRefreshView resetScrollViewContentInset]; + self.pullToRefreshView.isObserving = NO; + } + } + else { + if (!self.pullToRefreshView.isObserving) { + [self addObserver:self.pullToRefreshView forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self.pullToRefreshView forKeyPath:@"frame" options:NSKeyValueObservingOptionNew context:nil]; + self.pullToRefreshView.isObserving = YES; + } + } +} + +- (BOOL)showsPullToRefresh { + return !self.pullToRefreshView.hidden; +} + +@end + +#pragma mark - SVPullToRefresh +@implementation SVPullToRefreshView + +// public properties +@synthesize pullToRefreshActionHandler, arrowColor, textColor, activityIndicatorViewStyle, lastUpdatedDate, dateFormatter; + +@synthesize state = _state; +@synthesize scrollView = _scrollView; +@synthesize showsPullToRefresh = _showsPullToRefresh; +@synthesize arrow = _arrow; +@synthesize activityIndicatorView = _activityIndicatorView; + +@synthesize titleLabel = _titleLabel; +@synthesize dateLabel = _dateLabel; + + +- (id)initWithFrame:(CGRect)frame { + if(self = [super initWithFrame:frame]) { + + // default styling values + self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; + self.textColor = [UIColor darkGrayColor]; + self.autoresizingMask = UIViewAutoresizingFlexibleWidth; + self.state = SVPullToRefreshStateStopped; + self.showsDateLabel = NO; + + self.titles = [NSMutableArray arrayWithObjects:NSLocalizedString(@"Pull to refresh...",), + NSLocalizedString(@"Release to refresh...",), + NSLocalizedString(@"Loading...",), + nil]; + + self.subtitles = [NSMutableArray arrayWithObjects:@"", @"", @"", @"", nil]; + self.viewForState = [NSMutableArray arrayWithObjects:@"", @"", @"", @"", nil]; + } + + return self; +} + +- (void)willMoveToSuperview:(UIView *)newSuperview { + if (self.superview && newSuperview == nil) { + //use self.superview, not self.scrollView. Why self.scrollView == nil here? + UIScrollView *scrollView = (UIScrollView *)self.superview; + if (scrollView.showsPullToRefresh) { + if (self.isObserving) { + //If enter this branch, it is the moment just before "SVPullToRefreshView's dealloc", so remove observer here + [scrollView removeObserver:self forKeyPath:@"contentOffset"]; + [scrollView removeObserver:self forKeyPath:@"frame"]; + self.isObserving = NO; + } + } + } +} + +- (void)layoutSubviews { + CGFloat remainingWidth = self.superview.bounds.size.width-200; + float position = 0.50; + + CGRect titleFrame = self.titleLabel.frame; + titleFrame.origin.x = ceilf(remainingWidth*position+44); + titleFrame.origin.y = self.bounds.size.height-(self.subtitleLabel.text ? 48 : 40); + self.titleLabel.frame = titleFrame; + + CGRect subtitleFrame = self.subtitleLabel.frame; + subtitleFrame.origin.x = titleFrame.origin.x; + subtitleFrame.origin.y = self.bounds.size.height-32; + self.subtitleLabel.frame = subtitleFrame; + + CGRect arrowFrame = self.arrow.frame; + arrowFrame.origin.x = ceilf(remainingWidth*position); + self.arrow.frame = arrowFrame; + + self.activityIndicatorView.center = self.arrow.center; + + for(id otherView in self.viewForState) { + if([otherView isKindOfClass:[UIView class]]) + [otherView removeFromSuperview]; + } + + id customView = [self.viewForState objectAtIndex:self.state]; + BOOL hasCustomView = [customView isKindOfClass:[UIView class]]; + + self.titleLabel.hidden = hasCustomView; + self.subtitleLabel.hidden = hasCustomView; + self.arrow.hidden = hasCustomView; + + if(hasCustomView) { + [self addSubview:customView]; + CGRect viewBounds = [customView bounds]; + CGPoint origin = CGPointMake(roundf((self.bounds.size.width-viewBounds.size.width)/2), roundf((self.bounds.size.height-viewBounds.size.height)/2)); + [customView setFrame:CGRectMake(origin.x, origin.y, viewBounds.size.width, viewBounds.size.height)]; + } + else { + self.titleLabel.text = [self.titles objectAtIndex:self.state]; + + NSString *subtitle = [self.subtitles objectAtIndex:self.state]; + if(subtitle.length > 0) + self.subtitleLabel.text = subtitle; + + switch (self.state) { + case SVPullToRefreshStateStopped: + self.arrow.alpha = 1; + [self.activityIndicatorView stopAnimating]; + [self rotateArrow:0 hide:NO]; + break; + + case SVPullToRefreshStateTriggered: + [self rotateArrow:(float)M_PI hide:NO]; + break; + + case SVPullToRefreshStateLoading: + [self.activityIndicatorView startAnimating]; + [self rotateArrow:0 hide:YES]; + break; + } + } +} + +#pragma mark - Scroll View + +- (void)resetScrollViewContentInset { + UIEdgeInsets currentInsets = self.scrollView.contentInset; + currentInsets.top = self.originalTopInset; + [self setScrollViewContentInset:currentInsets]; +} + +- (void)setScrollViewContentInsetForLoading { + CGFloat offset = MAX(self.scrollView.contentOffset.y * -1, 0); + UIEdgeInsets currentInsets = self.scrollView.contentInset; + currentInsets.top = MIN(offset, self.originalTopInset + self.bounds.size.height); + [self setScrollViewContentInset:currentInsets]; +} + +- (void)setScrollViewContentInset:(UIEdgeInsets)contentInset { + [UIView animateWithDuration:0.3 + delay:0 + options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionBeginFromCurrentState + animations:^{ + self.scrollView.contentInset = contentInset; + } + completion:NULL]; +} + +#pragma mark - Observing + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if([keyPath isEqualToString:@"contentOffset"]) + [self scrollViewDidScroll:[[change valueForKey:NSKeyValueChangeNewKey] CGPointValue]]; + else if([keyPath isEqualToString:@"frame"]) + [self layoutSubviews]; +} + +- (void)scrollViewDidScroll:(CGPoint)contentOffset { + if(self.state != SVPullToRefreshStateLoading) { + CGFloat scrollOffsetThreshold = self.frame.origin.y-self.originalTopInset; + + if(!self.scrollView.isDragging && self.state == SVPullToRefreshStateTriggered) + self.state = SVPullToRefreshStateLoading; + else if(contentOffset.y < scrollOffsetThreshold && self.scrollView.isDragging && self.state == SVPullToRefreshStateStopped) + self.state = SVPullToRefreshStateTriggered; + else if(contentOffset.y >= scrollOffsetThreshold && self.state != SVPullToRefreshStateStopped) + self.state = SVPullToRefreshStateStopped; + } else { + CGFloat offset = MAX(self.scrollView.contentOffset.y * -1, 0.0f); + offset = MIN(offset, self.originalTopInset + self.bounds.size.height); + UIEdgeInsets contentInset = self.scrollView.contentInset; + self.scrollView.contentInset = UIEdgeInsetsMake(offset, contentInset.left, contentInset.bottom, contentInset.right); + } +} + +#pragma mark - Getters + +- (SVPullToRefreshArrow *)arrow { + if(!_arrow) { + _arrow = [[SVPullToRefreshArrow alloc]initWithFrame:CGRectMake(0, self.bounds.size.height-54, 22, 48)]; + _arrow.backgroundColor = [UIColor clearColor]; + [self addSubview:_arrow]; + } + return _arrow; +} + +- (UIActivityIndicatorView *)activityIndicatorView { + if(!_activityIndicatorView) { + _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; + _activityIndicatorView.hidesWhenStopped = YES; + [self addSubview:_activityIndicatorView]; + } + return _activityIndicatorView; +} + +- (UILabel *)titleLabel { + if(!_titleLabel) { + _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 210, 20)]; + _titleLabel.text = NSLocalizedString(@"Pull to refresh...",); + _titleLabel.font = [UIFont boldSystemFontOfSize:14]; + _titleLabel.backgroundColor = [UIColor clearColor]; + _titleLabel.textColor = textColor; + [self addSubview:_titleLabel]; + } + return _titleLabel; +} + +- (UILabel *)subtitleLabel { + if(!_subtitleLabel) { + _subtitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 210, 20)]; + _subtitleLabel.font = [UIFont systemFontOfSize:12]; + _subtitleLabel.backgroundColor = [UIColor clearColor]; + _subtitleLabel.textColor = textColor; + [self addSubview:_subtitleLabel]; + } + return _subtitleLabel; +} + +- (UILabel *)dateLabel { + return self.showsDateLabel ? self.subtitleLabel : nil; +} + +- (NSDateFormatter *)dateFormatter { + if(!dateFormatter) { + dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateStyle:NSDateFormatterShortStyle]; + [dateFormatter setTimeStyle:NSDateFormatterShortStyle]; + dateFormatter.locale = [NSLocale currentLocale]; + } + return dateFormatter; +} + +- (UIColor *)arrowColor { + return self.arrow.arrowColor; // pass through +} + +- (UIColor *)textColor { + return self.titleLabel.textColor; +} + +- (UIActivityIndicatorViewStyle)activityIndicatorViewStyle { + return self.activityIndicatorView.activityIndicatorViewStyle; +} + +#pragma mark - Setters + +- (void)setArrowColor:(UIColor *)newArrowColor { + self.arrow.arrowColor = newArrowColor; // pass through + [self.arrow setNeedsDisplay]; +} + +- (void)setTitle:(NSString *)title forState:(SVPullToRefreshState)state { + if(!title) + title = @""; + + if(state == SVPullToRefreshStateAll) + [self.titles replaceObjectsInRange:NSMakeRange(0, 3) withObjectsFromArray:@[title, title, title]]; + else + [self.titles replaceObjectAtIndex:state withObject:title]; + + [self setNeedsLayout]; +} + +- (void)setSubtitle:(NSString *)subtitle forState:(SVPullToRefreshState)state { + if(!subtitle) + subtitle = @""; + + if(state == SVPullToRefreshStateAll) + [self.subtitles replaceObjectsInRange:NSMakeRange(0, 3) withObjectsFromArray:@[subtitle, subtitle, subtitle]]; + else + [self.subtitles replaceObjectAtIndex:state withObject:subtitle]; + + [self setNeedsLayout]; +} + +- (void)setCustomView:(UIView *)view forState:(SVPullToRefreshState)state { + id viewPlaceholder = view; + + if(!viewPlaceholder) + viewPlaceholder = @""; + + if(state == SVPullToRefreshStateAll) + [self.viewForState replaceObjectsInRange:NSMakeRange(0, 3) withObjectsFromArray:@[viewPlaceholder, viewPlaceholder, viewPlaceholder]]; + else + [self.viewForState replaceObjectAtIndex:state withObject:viewPlaceholder]; + + [self setNeedsLayout]; +} + +- (void)setTextColor:(UIColor *)newTextColor { + textColor = newTextColor; + self.titleLabel.textColor = newTextColor; + self.subtitleLabel.textColor = newTextColor; +} + +- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)viewStyle { + self.activityIndicatorView.activityIndicatorViewStyle = viewStyle; +} + +- (void)setLastUpdatedDate:(NSDate *)newLastUpdatedDate { + self.showsDateLabel = YES; + self.dateLabel.text = [NSString stringWithFormat:NSLocalizedString(@"Last Updated: %@",), newLastUpdatedDate?[self.dateFormatter stringFromDate:newLastUpdatedDate]:NSLocalizedString(@"Never",)]; +} + +- (void)setDateFormatter:(NSDateFormatter *)newDateFormatter { + dateFormatter = newDateFormatter; + self.dateLabel.text = [NSString stringWithFormat:NSLocalizedString(@"Last Updated: %@",), self.lastUpdatedDate?[newDateFormatter stringFromDate:self.lastUpdatedDate]:NSLocalizedString(@"Never",)]; +} + +#pragma mark - + +- (void)triggerRefresh { + [self.scrollView triggerPullToRefresh]; +} + +- (void)startAnimating{ + if(fequalzero(self.scrollView.contentOffset.y)) { + [self.scrollView setContentOffset:CGPointMake(self.scrollView.contentOffset.x, -self.frame.size.height) animated:YES]; + self.wasTriggeredByUser = NO; + } + else + self.wasTriggeredByUser = YES; + + self.state = SVPullToRefreshStateLoading; +} + +- (void)stopAnimating { + self.state = SVPullToRefreshStateStopped; + + if(!self.wasTriggeredByUser && self.scrollView.contentOffset.y < -self.originalTopInset) + [self.scrollView setContentOffset:CGPointMake(self.scrollView.contentOffset.x, -self.originalTopInset) animated:YES]; +} + +- (void)setState:(SVPullToRefreshState)newState { + + if(_state == newState) + return; + + SVPullToRefreshState previousState = _state; + _state = newState; + + [self setNeedsLayout]; + + switch (newState) { + case SVPullToRefreshStateStopped: + [self resetScrollViewContentInset]; + break; + + case SVPullToRefreshStateTriggered: + break; + + case SVPullToRefreshStateLoading: + [self setScrollViewContentInsetForLoading]; + + if(previousState == SVPullToRefreshStateTriggered && pullToRefreshActionHandler) + pullToRefreshActionHandler(); + + break; + } +} + +- (void)rotateArrow:(float)degrees hide:(BOOL)hide { + [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ + self.arrow.layer.transform = CATransform3DMakeRotation(degrees, 0, 0, 1); + self.arrow.layer.opacity = !hide; + //[self.arrow setNeedsDisplay];//ios 4 + } completion:NULL]; +} + +@end + + +#pragma mark - SVPullToRefreshArrow + +@implementation SVPullToRefreshArrow +@synthesize arrowColor; + +- (UIColor *)arrowColor { + if (arrowColor) return arrowColor; + return [UIColor grayColor]; // default Color +} + +- (void)drawRect:(CGRect)rect { + CGContextRef c = UIGraphicsGetCurrentContext(); + + // the rects above the arrow + CGContextAddRect(c, CGRectMake(5, 0, 12, 4)); // to-do: use dynamic points + CGContextAddRect(c, CGRectMake(5, 6, 12, 4)); // currently fixed size: 22 x 48pt + CGContextAddRect(c, CGRectMake(5, 12, 12, 4)); + CGContextAddRect(c, CGRectMake(5, 18, 12, 4)); + CGContextAddRect(c, CGRectMake(5, 24, 12, 4)); + CGContextAddRect(c, CGRectMake(5, 30, 12, 4)); + + // the arrow + CGContextMoveToPoint(c, 0, 34); + CGContextAddLineToPoint(c, 11, 48); + CGContextAddLineToPoint(c, 22, 34); + CGContextAddLineToPoint(c, 0, 34); + CGContextClosePath(c); + + CGContextSaveGState(c); + CGContextClip(c); + + // Gradient Declaration + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGFloat alphaGradientLocations[] = {0, 0.8f}; + + CGGradientRef alphaGradient = nil; + if([[[UIDevice currentDevice] systemVersion]floatValue] >= 5){ + NSArray* alphaGradientColors = [NSArray arrayWithObjects: + (id)[self.arrowColor colorWithAlphaComponent:0].CGColor, + (id)[self.arrowColor colorWithAlphaComponent:1].CGColor, + nil]; + alphaGradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef)alphaGradientColors, alphaGradientLocations); + }else{ + const CGFloat * components = CGColorGetComponents([self.arrowColor CGColor]); + int numComponents = (int)CGColorGetNumberOfComponents([self.arrowColor CGColor]); + CGFloat colors[8]; + switch(numComponents){ + case 2:{ + colors[0] = colors[4] = components[0]; + colors[1] = colors[5] = components[0]; + colors[2] = colors[6] = components[0]; + break; + } + case 4:{ + colors[0] = colors[4] = components[0]; + colors[1] = colors[5] = components[1]; + colors[2] = colors[6] = components[2]; + break; + } + } + colors[3] = 0; + colors[7] = 1; + alphaGradient = CGGradientCreateWithColorComponents(colorSpace,colors,alphaGradientLocations,2); + } + + + CGContextDrawLinearGradient(c, alphaGradient, CGPointZero, CGPointMake(0, rect.size.height), 0); + + CGContextRestoreGState(c); + + CGGradientRelease(alphaGradient); + CGColorSpaceRelease(colorSpace); +} +@end |
