If you want to do this with CGPDF functions, you need to read up on how to make a subclass of UIView. That's where you will put the drawRect function you were looking at. Between Apple's site, and Google, you should be able to find lot's of examples.
If you want to do this with CGPDF functions, you need to read up on how to make a subclass of UIView. That's where you will put the drawRect function you were looking at. Between Apple's site, and Google, you should be able to find lot's of examples.
check out this https://github.com/vfr/Reader It uses CATiledLayer.
That is what I used as a basis for my PDF viewer app which I modified the code a bit to make it dual spread pages, page turning effect, etc
There is also Leaves, you can google for that.
This doesn't sound advanced, and I have no idea what you are asking. Using a View Controller to control the view is the normal way. What are you doing?
Somehow you missed the basics of working with a view controller. The only place I know to tell you to look would be "Your First iOS Application" in the developers documentation that comes with XCode. It explains how to set up a simple app with a view controller.
Once you have a simple app with a viewcontroller, add a blank view in Interface Builder, and change the custom class to use the new subclass you just made.
#import "PDFViewerViewController.h"
#import "PDFViewerAppDelegate.h"
@implementation PDFViewerViewController
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle {
if ((self = [super initWithNibName:nibName bundle:nibBundle])) {
// Custom initialization
}
return self;
}
*/
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
self.wantsFullScreenLayout = YES;
View *myView = [[View alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
self.view = myView;
[self.view setBackgroundColor:[UIColor clearColor]];
[myView release];
}
/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end