diff --git a/.gitignore b/.gitignore index edc082c..5a4e6ce 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ build/* xcuserdata profile *.moved-aside +.DS_Store diff --git a/Classes/DemoTableViewController.h b/Classes/DemoTableViewController.h index fdc98d5..ca0377c 100644 --- a/Classes/DemoTableViewController.h +++ b/Classes/DemoTableViewController.h @@ -7,7 +7,7 @@ // #import -#import "PullRefreshTableViewController.h" +#import @interface DemoTableViewController : PullRefreshTableViewController { NSMutableArray *items; diff --git a/Classes/PullRefreshTableViewController.h b/Classes/PullRefreshTableViewController.h index 92429f3..4bc98c6 100644 --- a/Classes/PullRefreshTableViewController.h +++ b/Classes/PullRefreshTableViewController.h @@ -42,10 +42,28 @@ NSString *textLoading; } -@property (nonatomic, retain) UIView *refreshHeaderView; -@property (nonatomic, retain) UILabel *refreshLabel; -@property (nonatomic, retain) UIImageView *refreshArrow; -@property (nonatomic, retain) UIActivityIndicatorView *refreshSpinner; +#ifndef PTR_STRONG +#if __has_feature(objc_arc) +#define PTR_STRONG strong +#else +#define PTR_STRONG retain +#endif +#endif + +#ifndef PTR_WEAK +#if __has_feature(objc_arc_weak) +#define PTR_WEAK weak +#elif __has_feature(objc_arc) +#define PTR_WEAK unsafe_unretained +#else +#define PTR_WEAK assign +#endif +#endif + +@property (nonatomic, PTR_STRONG) UIView *refreshHeaderView; +@property (nonatomic, PTR_STRONG) UILabel *refreshLabel; +@property (nonatomic, PTR_STRONG) UIImageView *refreshArrow; +@property (nonatomic, PTR_STRONG) UIActivityIndicatorView *refreshSpinner; @property (nonatomic, copy) NSString *textPull; @property (nonatomic, copy) NSString *textRelease; @property (nonatomic, copy) NSString *textLoading; diff --git a/Classes/PullRefreshTableViewController.m b/Classes/PullRefreshTableViewController.m index 3391bb6..6fa96da 100644 --- a/Classes/PullRefreshTableViewController.m +++ b/Classes/PullRefreshTableViewController.m @@ -27,7 +27,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -#import #import "PullRefreshTableViewController.h" #define REFRESH_HEADER_HEIGHT 52.0f @@ -66,22 +65,24 @@ - (void)viewDidLoad { [self addPullToRefreshHeader]; } -- (void)setupStrings{ +- (void)setupStrings { textPull = [[NSString alloc] initWithString:@"Pull down to refresh..."]; textRelease = [[NSString alloc] initWithString:@"Release to refresh..."]; textLoading = [[NSString alloc] initWithString:@"Loading..."]; } - (void)addPullToRefreshHeader { - refreshHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 - REFRESH_HEADER_HEIGHT, 320, REFRESH_HEADER_HEIGHT)]; + CGFloat width = [[UIScreen mainScreen] bounds].size.width; + refreshHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 - REFRESH_HEADER_HEIGHT, width, REFRESH_HEADER_HEIGHT)]; refreshHeaderView.backgroundColor = [UIColor clearColor]; - refreshLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, REFRESH_HEADER_HEIGHT)]; - refreshLabel.backgroundColor = [UIColor clearColor]; - refreshLabel.font = [UIFont boldSystemFontOfSize:12.0]; - refreshLabel.textAlignment = UITextAlignmentCenter; + refreshLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, REFRESH_HEADER_HEIGHT)]; + refreshLabel.backgroundColor = [UIColor clearColor]; + refreshLabel.font = [UIFont boldSystemFontOfSize:12.0]; + refreshLabel.textAlignment = UITextAlignmentCenter; + refreshLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; - refreshArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow.png"]]; + refreshArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"PullToRefresh.framework/arrow.png"]]; refreshArrow.frame = CGRectMake(floorf((REFRESH_HEADER_HEIGHT - 27) / 2), (floorf(REFRESH_HEADER_HEIGHT - 44) / 2), 27, 44); @@ -114,11 +115,11 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (scrollView.contentOffset.y < -REFRESH_HEADER_HEIGHT) { // User is scrolling above the header refreshLabel.text = self.textRelease; - [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI, 0, 0, 1); - } else { + refreshArrow.transform = CGAffineTransformMakeRotation(M_PI); + } else { // User is scrolling somewhere within the header refreshLabel.text = self.textPull; - [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI * 2, 0, 0, 1); + refreshArrow.transform = CGAffineTransformMakeRotation(0); } }]; } @@ -154,7 +155,7 @@ - (void)stopLoading { // Hide the header [UIView animateWithDuration:0.3 animations:^{ self.tableView.contentInset = UIEdgeInsetsZero; - [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI * 2, 0, 0, 1); + refreshArrow.transform = CGAffineTransformMakeRotation(0); } completion:^(BOOL finished) { [self performSelector:@selector(stopLoadingComplete)]; @@ -174,6 +175,7 @@ - (void)refresh { [self performSelector:@selector(stopLoading) withObject:nil afterDelay:2.0]; } +#if !__has_feature(objc_arc) - (void)dealloc { [refreshHeaderView release]; [refreshLabel release]; @@ -184,5 +186,6 @@ - (void)dealloc { [textLoading release]; [super dealloc]; } +#endif @end diff --git a/PullToRefresh.xcodeproj/project.pbxproj b/PullToRefresh.xcodeproj/project.pbxproj index 1b23836..5ee5d7e 100755 --- a/PullToRefresh.xcodeproj/project.pbxproj +++ b/PullToRefresh.xcodeproj/project.pbxproj @@ -15,10 +15,24 @@ 28C286E10D94DF7D0034E888 /* DemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */; }; 4CAFBC8011FC96FC00651784 /* PullRefreshTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */; }; 4CAFBCEF11FC994F00651784 /* README.markdown in Resources */ = {isa = PBXBuildFile; fileRef = 4CAFBCEE11FC994F00651784 /* README.markdown */; }; - 4CAFBD0111FC9B2100651784 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */; }; 4CBE3BEE11FE21CB007696B3 /* arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CBE3BED11FE21CB007696B3 /* arrow.png */; }; + 82C4AD4015FE568C004E4CFE /* arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CBE3BED11FE21CB007696B3 /* arrow.png */; }; + 82C4AD4115FE5695004E4CFE /* PullRefreshTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */; }; + 82C4AD4415FE56AE004E4CFE /* PullRefreshTableViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82C4AD4815FE5AA6004E4CFE /* PullToRefresh.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82C4AD3315FE52AC004E4CFE /* PullToRefresh.framework */; }; + 82C4AD4915FE5AAE004E4CFE /* PullToRefresh.framework in Resources */ = {isa = PBXBuildFile; fileRef = 82C4AD3315FE52AC004E4CFE /* PullToRefresh.framework */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 82C4AD4615FE5A9A004E4CFE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 82C4AD3215FE52AC004E4CFE; + remoteInfo = "PullToRefresh Framework"; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1D3623240D0F684500981E51 /* PullToRefreshAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PullToRefreshAppDelegate.h; sourceTree = ""; }; @@ -30,11 +44,11 @@ 28C286DF0D94DF7D0034E888 /* DemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoTableViewController.h; sourceTree = ""; }; 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoTableViewController.m; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PullRefreshTableViewController.h; sourceTree = ""; }; - 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PullRefreshTableViewController.m; sourceTree = ""; }; + 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PullRefreshTableViewController.h; path = Classes/PullRefreshTableViewController.h; sourceTree = ""; }; + 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PullRefreshTableViewController.m; path = Classes/PullRefreshTableViewController.m; sourceTree = ""; }; 4CAFBCEE11FC994F00651784 /* README.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.markdown; sourceTree = ""; }; - 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 4CBE3BED11FE21CB007696B3 /* arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow.png; sourceTree = ""; }; + 82C4AD3315FE52AC004E4CFE /* PullToRefresh.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PullToRefresh.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8D1107310486CEB800E47090 /* PullToRefresh-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "PullToRefresh-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -43,26 +57,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 82C4AD4815FE5AA6004E4CFE /* PullToRefresh.framework in Frameworks */, 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, - 4CAFBD0111FC9B2100651784 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 82C4AD3015FE52AC004E4CFE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { + 080E96DDFE201D6D7F000001 /* Example */ = { isa = PBXGroup; children = ( 1D3623240D0F684500981E51 /* PullToRefreshAppDelegate.h */, 1D3623250D0F684500981E51 /* PullToRefreshAppDelegate.m */, 28C286DF0D94DF7D0034E888 /* DemoTableViewController.h */, 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */, - 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */, - 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */, ); + name = Example; path = Classes; sourceTree = ""; }; @@ -70,6 +90,7 @@ isa = PBXGroup; children = ( 1D6058910D05DD3D006BFB54 /* PullToRefresh.app */, + 82C4AD3315FE52AC004E4CFE /* PullToRefresh.framework */, ); name = Products; sourceTree = ""; @@ -77,7 +98,8 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - 080E96DDFE201D6D7F000001 /* Classes */, + 82C4AD2A15FE4C74004E4CFE /* PullToRefresh */, + 080E96DDFE201D6D7F000001 /* Example */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, @@ -108,7 +130,6 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( - 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */, 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 1D30AB110D05D00D00671497 /* Foundation.framework */, 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, @@ -116,12 +137,32 @@ name = Frameworks; sourceTree = ""; }; + 82C4AD2A15FE4C74004E4CFE /* PullToRefresh */ = { + isa = PBXGroup; + children = ( + 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */, + 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */, + ); + name = PullToRefresh; + sourceTree = ""; + }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 82C4AD4315FE56A8004E4CFE /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 82C4AD4415FE56AE004E4CFE /* PullRefreshTableViewController.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* PullToRefresh */ = { + 1D6058900D05DD3D006BFB54 /* PullToRefresh Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PullToRefresh" */; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PullToRefresh Example" */; buildPhases = ( 1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588E0D05DD3D006BFB54 /* Sources */, @@ -130,12 +171,32 @@ buildRules = ( ); dependencies = ( + 82C4AD4715FE5A9A004E4CFE /* PBXTargetDependency */, ); - name = PullToRefresh; + name = "PullToRefresh Example"; productName = PullToRefresh; productReference = 1D6058910D05DD3D006BFB54 /* PullToRefresh.app */; productType = "com.apple.product-type.application"; }; + 82C4AD3215FE52AC004E4CFE /* PullToRefresh Framework */ = { + isa = PBXNativeTarget; + buildConfigurationList = 82C4AD3D15FE52AC004E4CFE /* Build configuration list for PBXNativeTarget "PullToRefresh Framework" */; + buildPhases = ( + 82C4AD2F15FE52AC004E4CFE /* Sources */, + 82C4AD3015FE52AC004E4CFE /* Frameworks */, + 82C4AD3115FE52AC004E4CFE /* Resources */, + 82C4AD4315FE56A8004E4CFE /* Headers */, + 82C4AD4515FE57E6004E4CFE /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "PullToRefresh Framework"; + productName = "PullToRefresh Framework"; + productReference = 82C4AD3315FE52AC004E4CFE /* PullToRefresh.framework */; + productType = "com.apple.product-type.bundle"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -143,6 +204,7 @@ isa = PBXProject; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PullToRefresh" */; compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, @@ -155,7 +217,8 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 1D6058900D05DD3D006BFB54 /* PullToRefresh */, + 1D6058900D05DD3D006BFB54 /* PullToRefresh Example */, + 82C4AD3215FE52AC004E4CFE /* PullToRefresh Framework */, ); }; /* End PBXProject section */ @@ -167,11 +230,36 @@ files = ( 4CAFBCEF11FC994F00651784 /* README.markdown in Resources */, 4CBE3BEE11FE21CB007696B3 /* arrow.png in Resources */, + 82C4AD4915FE5AAE004E4CFE /* PullToRefresh.framework in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 82C4AD3115FE52AC004E4CFE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 82C4AD4015FE568C004E4CFE /* arrow.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 82C4AD4515FE57E6004E4CFE /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Script to build the framework as universal from:\n# https://github.com/jverkoey/iOS-Framework#step-3-build-the-other-platform\n# With some changes to adapt it to use this method:\n# http://db-in.com/blog/2011/05/creating-universal-framework-to-iphone-ios/#list_contents\nset -e\nset +u\n\n# Avoid recursively calling this script.\nif [[ $SF_MASTER_SCRIPT_RUNNING ]]\nthen\nexit 0\nfi\nset -u\nexport SF_MASTER_SCRIPT_RUNNING=1\n\nSF_TARGET_NAME=${PROJECT_NAME}\nSF_EXECUTABLE_PATH=\"${SF_TARGET_NAME}\"\nSF_WRAPPER_NAME=\"${SF_TARGET_NAME}.framework\"\n\n# The following conditionals come from\n# https://github.com/kstenerud/iOS-Universal-Framework\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\nSF_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\necho \"Could not find platform name from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\nSF_SDK_VERSION=${BASH_REMATCH[1]}\nelse\necho \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\nif [[ \"$SF_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\nSF_OTHER_PLATFORM=iphonesimulator\nelse\nSF_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$SF_SDK_PLATFORM$ ]]\nthen\nSF_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}\"\nelse\necho \"Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR\"\nexit 1\nfi\n\n# Build the other platform\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" OBJROOT=\"${OBJROOT}\" BUILD_ROOT=\"${BUILD_ROOT}\" SYMROOT=\"${SYMROOT}\" $ACTION\n\n# Smash the two static libraries into one fat binary and store it in a temporal file\nrm -f \"${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}\"\nlipo -create \"${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/${SF_EXECUTABLE_PATH}\" \"${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/${SF_EXECUTABLE_PATH}\" -output \"${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}\"\n\n# Copy the generated framework to the build directory\nif [ -d \"${SRCROOT}/build\" ]; then\nrm -fr \"${SRCROOT}/build\"\nfi\n\nmkdir -p \"${SRCROOT}/build\"\ncp -fR \"${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}\" \"${SRCROOT}/build/${SF_WRAPPER_NAME}\"\n\n# Copy the universal binary to the framework\ncp -a \"${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}\" \"${SRCROOT}/build/${SF_WRAPPER_NAME}\"\nrm -f \"${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 1D60588E0D05DD3D006BFB54 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -184,8 +272,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82C4AD2F15FE52AC004E4CFE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 82C4AD4115FE5695004E4CFE /* PullRefreshTableViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 82C4AD4715FE5A9A004E4CFE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 82C4AD3215FE52AC004E4CFE /* PullToRefresh Framework */; + targetProxy = 82C4AD4615FE5A9A004E4CFE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; @@ -197,7 +301,10 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = PullToRefresh_Prefix.pch; INFOPLIST_FILE = "PullToRefresh-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 4.0; PRODUCT_NAME = PullToRefresh; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -209,11 +316,88 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = PullToRefresh_Prefix.pch; INFOPLIST_FILE = "PullToRefresh-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 4.0; PRODUCT_NAME = PullToRefresh; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; + 82C4AD3E15FE52AC004E4CFE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = ( + armv6, + armv7, + ); + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + INFOPLIST_FILE = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + MACOSX_DEPLOYMENT_TARGET = ""; + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = PullToRefresh; + SDKROOT = iphoneos; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 82C4AD3F15FE52AC004E4CFE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = ( + armv6, + armv7, + ); + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + INFOPLIST_FILE = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + MACOSX_DEPLOYMENT_TARGET = ""; + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = PullToRefresh; + SDKROOT = iphoneos; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -244,7 +428,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PullToRefresh" */ = { + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PullToRefresh Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 1D6058940D05DD3E006BFB54 /* Debug */, @@ -253,6 +437,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 82C4AD3D15FE52AC004E4CFE /* Build configuration list for PBXNativeTarget "PullToRefresh Framework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 82C4AD3E15FE52AC004E4CFE /* Debug */, + 82C4AD3F15FE52AC004E4CFE /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PullToRefresh" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/README.markdown b/README.markdown index 9188839..75ffb41 100644 --- a/README.markdown +++ b/README.markdown @@ -13,15 +13,19 @@ and [EGOTableViewPullRefresh](http://github.com/enormego/EGOTableViewPullRefresh How to install -1. Copy the files, [PullRefreshTableViewController.h](https://raw.github.com/leah/PullToRefresh/master/Classes/PullRefreshTableViewController.h), -[PullRefreshTableViewController.m](https://raw.github.com/leah/PullToRefresh/master/Classes/PullRefreshTableViewController.m), -and [arrow.png](http://github.com/leah/PullToRefresh/raw/master/arrow.png) into your project. +1. Download the PullToRefresh source code from https://github.com/leah/PullToRefresh -2. Link against the QuartzCore framework (used for rotating the arrow image). +2. Select as active scheme "PullToRefresh Framework" for *iPhone/iPad simulator* and build it +![](https://raw.github.com/JoseExposito/PullToRefresh/master/screenshots/screenshot1.png) -3. Create a TableViewController that is a subclass of PullRefreshTableViewController. +3. Go to the PullToRefresh source code folder, a "build" folder was generated with the "PullToRefresh.framework" in -4. Customize by adding your own refresh() method. +4. In your project, go to your target and in "Build Phases" tab and add the "PullToRefresh.framework" in the "Copy Bundle Resources" and in the "Link Binary With Libraries" sections using the "+" button +![](https://raw.github.com/JoseExposito/PullToRefresh/master/screenshots/screenshot2.png) + +5. Create a TableViewController that is a subclass of PullRefreshTableViewController. + +6. Customize by adding your own refresh() method. Enjoy! diff --git a/screenshots/screenshot1.png b/screenshots/screenshot1.png new file mode 100644 index 0000000..e072a62 Binary files /dev/null and b/screenshots/screenshot1.png differ diff --git a/screenshots/screenshot2.png b/screenshots/screenshot2.png new file mode 100644 index 0000000..f019c8f Binary files /dev/null and b/screenshots/screenshot2.png differ