This is the follow up to the original 2009 article iPhone Programming for Apple IIGS developers, that taught iPhone development using web technologies. My son Lim Ding Wen ported his Apple IIGS program Doodle Kids to iPhone and iPad using this method.
This article is about developing native application for iOS devices. You can now develop your iOS application based on GSView - an UIView enhancement loosely based on QuickDraw API and the Apple IIGS 16-color palette! GSView can be downloaded here from Virtual GS.
Step 1: Create GSView
Create an Xcode project, and create a view-based application. Copy GSView.h and GSView.m into your project. Create an Objective-C class and make it a subclass of UIView. Give it a name eg StarView. Add #import "GSView.h" into the header file (eg StarView.h) and replaced the text UIView by GSView. This means you are creating a GSView object rather than UIView object.
#import "GSView.h"
@interface StarView : GSView
Step 2: Add GSView to Application
Go to the controller file, find and uncomment the viewDidLoad method. Add your object (eg StarView) to the controller file by adding the following codes to viewDidLoad method.
- (void) viewDidLoad {
StarView *starView = [[StarView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.view = starView;
[starView release];
[super viewDidLoad];
}

Step 3: Program GSView
Have fun programming! Here's a sample star fields program (eg StarView.m).
- (void) drawRect:(CGRect)rect {
graph();
for (int i = 0; i < 30; i++) {
setColor(color(i % 15 + 1));
paintCircle(random() % 320, random() % 480, i % 3 + 1);
}
}
© 2013 Created by James.
Powered by
You need to be a member of RetroMacCast to add comments!
Join RetroMacCast