Skip to content

Commit

Permalink
[TIMOB-7347] fixing up logic
Browse files Browse the repository at this point in the history
  • Loading branch information
srahim authored and Stephen Tramer committed Feb 2, 2012
1 parent b90f227 commit 86ed63c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions iphone/Classes/TiUIScrollViewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@ -(void)_initWithProperties:(NSDictionary *)properties
}

-(TiPoint *) contentOffset{

TiThreadPerformOnMainThread(^{
if ([(TiUIScrollView*)[self view] scrollView] != nil) {
contentOffset = [[TiPoint alloc] initWithPoint:CGPointMake(
[(TiUIScrollView *)[self view] scrollView].contentOffset.x,
[(TiUIScrollView *)[self view] scrollView].contentOffset.y)] ;
}
else{
contentOffset = [[TiPoint alloc] initWithPoint:CGPointMake(0,0)];
}
}, YES);
if([self viewAttached]){
TiThreadPerformOnMainThread(^{
contentOffset = [[TiPoint alloc] initWithPoint:CGPointMake(
[(TiUIScrollView *)[self view] scrollView].contentOffset.x,
[(TiUIScrollView *)[self view] scrollView].contentOffset.y)] ;
}, YES);
}
else{
contentOffset = [[TiPoint alloc] initWithPoint:CGPointMake(0,0)];
}
return [contentOffset autorelease];
}

Expand Down

0 comments on commit 86ed63c

Please sign in to comment.