Skip to content

Commit

Permalink
#10 every time the orientation changes the table goes to the top. bug…
Browse files Browse the repository at this point in the history
… fixed
  • Loading branch information
uzysjung committed Apr 17, 2015
1 parent 787a621 commit feeb903
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Jaehoon JUNG (374MYQPNK3)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
Expand All @@ -772,6 +773,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE = "493e5fa6-79ed-43ce-a031-2158daa5b217";
SDKROOT = iphoneos;
};
name = Debug;
Expand All @@ -792,6 +794,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
Expand All @@ -803,6 +806,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
PROVISIONING_PROFILE = "493e5fa6-79ed-43ce-a031-2158daa5b217";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
Expand All @@ -815,13 +819,13 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Jaehoon JUNG (374MYQPNK3)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "UzysAnimatedGifPullToRefresh/UzysAnimatedGifPullToRefresh-Prefix.pch";
INFOPLIST_FILE = "UzysAnimatedGifPullToRefresh/UzysAnimatedGifPullToRefresh-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "493e5fa6-79ed-43ce-a031-2158daa5b217";
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -839,7 +843,7 @@
INFOPLIST_FILE = "UzysAnimatedGifPullToRefresh/UzysAnimatedGifPullToRefresh-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "493e5fa6-79ed-43ce-a031-2158daa5b217";
WRAPPER_EXTENSION = app;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="d3P-Um-mIb">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7531" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="d3P-Um-mIb">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
</dependencies>
<scenes>
<!--Uzys View Controller-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,15 @@ - (void)resetScrollViewContentInset:(actionHandler)handler animation:(BOOL)anima
}
- (void)setScrollViewContentInset:(UIEdgeInsets)contentInset handler:(actionHandler)handler animation:(BOOL)animation
{
NSLog(@"offset %f",self.scrollView.contentOffset.y);
if(animation)
{
[UIView animateWithDuration:0.3
delay:0
options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionCurveEaseOut|UIViewAnimationOptionBeginFromCurrentState
animations:^{
self.scrollView.contentInset = contentInset;
if(self.isVariableSize) {
if(self.state == UZYSGIFPullToRefreshStateLoading && self.scrollView.contentOffset.y <10) {
self.scrollView.contentOffset = CGPointMake(self.scrollView.contentOffset.x, -1*contentInset.top);
}
}
Expand All @@ -150,7 +151,10 @@ - (void)setScrollViewContentInset:(UIEdgeInsets)contentInset handler:(actionHand
else
{
self.scrollView.contentInset = contentInset;
self.scrollView.contentOffset = CGPointMake(self.scrollView.contentOffset.x, -1*contentInset.top);

if(self.state == UZYSGIFPullToRefreshStateLoading && self.scrollView.contentOffset.y <10) {
self.scrollView.contentOffset = CGPointMake(self.scrollView.contentOffset.x, -1*contentInset.top);
}

if(handler)
handler();
Expand Down Expand Up @@ -365,6 +369,14 @@ - (void)setFrameSizeByLoadingImage
}
}
- (void)orientationChange:(UIDeviceOrientation)orientation {

UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
UIInterfaceOrientation statusBarOrientation = [UIApplication sharedApplication].statusBarOrientation;

if((NSInteger)deviceOrientation !=(NSInteger)statusBarOrientation){
return;
}

if(UIDeviceOrientationIsLandscape(orientation))
{
if(cNotEqualFloats( self.landscapeTopInset , 0.0 , cDefaultFloatComparisonEpsilon))
Expand Down

0 comments on commit feeb903

Please sign in to comment.