Skip to content

Instantly share code, notes, and snippets.

@pec1985
Created May 5, 2013 02:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pec1985/5519438 to your computer and use it in GitHub Desktop.
Save pec1985/5519438 to your computer and use it in GitHub Desktop.
Extension to TiUIScrollView to get content size
//
// TiUIScrollViewProxy+Extended.h
// TiGoodies
//
// Created by Pedro Enrique on 4/8/13.
//
//
#define USE_TI_UISCROLLVIEW
#import "TiUIScrollViewProxy.h"
@interface TiUIScrollViewProxy(Extended)
-(id)contentSize;
@end
//
// TiUIScrollViewProxy+Extended.m
// TiGoodies
//
// Created by Pedro Enrique on 4/8/13.
//
//
#import "TiUIScrollViewProxy+Extended.h"
#import "TiUIScrollView.h"
#import "TiRect.h"
@implementation TiUIScrollViewProxy(Extended)
-(id)contentSize
{
TiUIScrollView *selfView = (TiUIScrollView *)[self view];
TiUIScrollViewImpl *scrollView = [selfView scrollView];
TiRect *rect = [[TiRect alloc] init];
[rect setHeight:[NSNumber numberWithFloat: scrollView.contentSize.height]];
[rect setWidth:[NSNumber numberWithFloat: scrollView.contentSize.height]];
return rect;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment