Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

added iosStoryboardExample #2803

Merged
merged 1 commit into from

1 participant

lukasz karluk
lukasz karluk
Collaborator

the new iosStoryboardExample demonstrates how ios storyboards can be used with openframeworks.

it is structured very similar to iosNativeExample but uses a storyboard for creating view controllers and the connections between them.

theres been a few requests for this kind of example from the OF community.
and it closes issues #1829 and #2799.

lukasz karluk julapy added iosStoryboardExample
the new iosStoryboardExample demonstrates how ios storyboards can be
used with openframeworks.
41c65a4
lukasz karluk julapy merged commit f6d4b7d into from
lukasz karluk julapy deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 11, 2014
  1. lukasz karluk

    added iosStoryboardExample

    julapy authored
    the new iosStoryboardExample demonstrates how ios storyboards can be
    used with openframeworks.
This page is out of date. Refresh to see the latest.
Showing with 1,000 additions and 0 deletions.
  1. 0  examples/ios/iosStoryboardExample/bin/data/.gitkeep
  2. BIN  examples/ios/iosStoryboardExample/bin/data/fonts/mono0755.ttf
  3. BIN  examples/ios/iosStoryboardExample/bin/data/images/dive.jpg
  4. +11 −0 examples/ios/iosStoryboardExample/src/AppViewControllers/CircleAppViewController.h
  5. +20 −0 examples/ios/iosStoryboardExample/src/AppViewControllers/CircleAppViewController.mm
  6. +11 −0 examples/ios/iosStoryboardExample/src/AppViewControllers/ImageAppViewController.h
  7. +20 −0 examples/ios/iosStoryboardExample/src/AppViewControllers/ImageAppViewController.mm
  8. +11 −0 examples/ios/iosStoryboardExample/src/AppViewControllers/SquareAppViewController.h
  9. +20 −0 examples/ios/iosStoryboardExample/src/AppViewControllers/SquareAppViewController.mm
  10. +11 −0 examples/ios/iosStoryboardExample/src/AppViewControllers/TriangleAppViewController.h
  11. +20 −0 examples/ios/iosStoryboardExample/src/AppViewControllers/TriangleAppViewController.mm
  12. +34 −0 examples/ios/iosStoryboardExample/src/Apps/CircleApp.h
  13. +101 −0 examples/ios/iosStoryboardExample/src/Apps/CircleApp.mm
  14. +34 −0 examples/ios/iosStoryboardExample/src/Apps/ImageApp.h
  15. +102 −0 examples/ios/iosStoryboardExample/src/Apps/ImageApp.mm
  16. +33 −0 examples/ios/iosStoryboardExample/src/Apps/SquareApp.h
  17. +104 −0 examples/ios/iosStoryboardExample/src/Apps/SquareApp.mm
  18. +33 −0 examples/ios/iosStoryboardExample/src/Apps/TriangleApp.h
  19. +102 −0 examples/ios/iosStoryboardExample/src/Apps/TriangleApp.mm
  20. +146 −0 examples/ios/iosStoryboardExample/src/UI/MyApp.storyboard
  21. +15 −0 examples/ios/iosStoryboardExample/src/UI/MyAppDelegate.h
  22. +35 −0 examples/ios/iosStoryboardExample/src/UI/MyAppDelegate.mm
  23. +39 −0 examples/ios/iosStoryboardExample/src/main.mm
  24. +28 −0 examples/ios/iosStoryboardExample/src/ofApp.h
  25. +70 −0 examples/ios/iosStoryboardExample/src/ofApp.mm
0  examples/ios/iosStoryboardExample/bin/data/.gitkeep
View
No changes.
BIN  examples/ios/iosStoryboardExample/bin/data/fonts/mono0755.ttf
View
Binary file not shown
BIN  examples/ios/iosStoryboardExample/bin/data/images/dive.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 examples/ios/iosStoryboardExample/src/AppViewControllers/CircleAppViewController.h
View
@@ -0,0 +1,11 @@
+//
+// CircleAppViewController.h
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "ofxiOSViewController.h"
+
+@interface CircleAppViewController : ofxiOSViewController
+
+@end
20 examples/ios/iosStoryboardExample/src/AppViewControllers/CircleAppViewController.mm
View
@@ -0,0 +1,20 @@
+//
+// CircleAppViewController.m
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "CircleAppViewController.h"
+#import "CircleApp.h"
+
+@implementation CircleAppViewController
+
+- (id)initWithCoder:(NSCoder *)aDecoder {
+ self = [super initWithFrame:[UIScreen mainScreen].bounds app:new CircleApp()];
+ if(self != nil) {
+ //
+ }
+ return self;
+}
+
+@end
11 examples/ios/iosStoryboardExample/src/AppViewControllers/ImageAppViewController.h
View
@@ -0,0 +1,11 @@
+//
+// ImageAppViewController.h
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "ofxiOSViewController.h"
+
+@interface ImageAppViewController : ofxiOSViewController
+
+@end
20 examples/ios/iosStoryboardExample/src/AppViewControllers/ImageAppViewController.mm
View
@@ -0,0 +1,20 @@
+//
+// ImageAppViewController.m
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "ImageAppViewController.h"
+#import "ImageApp.h"
+
+@implementation ImageAppViewController
+
+- (id)initWithCoder:(NSCoder *)aDecoder {
+ self = [super initWithFrame:[UIScreen mainScreen].bounds app:new ImageApp()];
+ if(self != nil) {
+ //
+ }
+ return self;
+}
+
+@end
11 examples/ios/iosStoryboardExample/src/AppViewControllers/SquareAppViewController.h
View
@@ -0,0 +1,11 @@
+//
+// SquareAppViewController.h
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "ofxiOSViewController.h"
+
+@interface SquareAppViewController : ofxiOSViewController
+
+@end
20 examples/ios/iosStoryboardExample/src/AppViewControllers/SquareAppViewController.mm
View
@@ -0,0 +1,20 @@
+//
+// SquareAppViewController.m
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "SquareAppViewController.h"
+#import "SquareApp.h"
+
+@implementation SquareAppViewController
+
+- (id)initWithCoder:(NSCoder *)aDecoder {
+ self = [super initWithFrame:[UIScreen mainScreen].bounds app:new SquareApp()];
+ if(self != nil) {
+ //
+ }
+ return self;
+}
+
+@end
11 examples/ios/iosStoryboardExample/src/AppViewControllers/TriangleAppViewController.h
View
@@ -0,0 +1,11 @@
+//
+// TriangleAppViewController.h
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "ofxiOSViewController.h"
+
+@interface TriangleAppViewController : ofxiOSViewController
+
+@end
20 examples/ios/iosStoryboardExample/src/AppViewControllers/TriangleAppViewController.mm
View
@@ -0,0 +1,20 @@
+//
+// TriangleAppViewController.m
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "TriangleAppViewController.h"
+#import "TriangleApp.h"
+
+@implementation TriangleAppViewController
+
+- (id)initWithCoder:(NSCoder *)aDecoder {
+ self = [super initWithFrame:[UIScreen mainScreen].bounds app:new TriangleApp()];
+ if(self != nil) {
+ //
+ }
+ return self;
+}
+
+@end
34 examples/ios/iosStoryboardExample/src/Apps/CircleApp.h
View
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "ofMain.h"
+#include "ofxiOS.h"
+#include "ofxiOSExtras.h"
+
+class CircleApp : public ofxiOSApp {
+
+public:
+
+ CircleApp ();
+ ~CircleApp ();
+
+ void setup();
+ void update();
+ void draw();
+ void exit();
+
+ void touchDown(ofTouchEventArgs &touch);
+ void touchMoved(ofTouchEventArgs &touch);
+ void touchUp(ofTouchEventArgs &touch);
+ void touchDoubleTap(ofTouchEventArgs &touch);
+ void touchCancelled(ofTouchEventArgs &touch);
+
+ void lostFocus();
+ void gotFocus();
+ void gotMemoryWarning();
+ void deviceOrientationChanged(int newOrientation);
+
+ ofTrueTypeFont font;
+
+};
+
+
101 examples/ios/iosStoryboardExample/src/Apps/CircleApp.mm
View
@@ -0,0 +1,101 @@
+#include "CircleApp.h"
+
+//--------------------------------------------------------------
+CircleApp :: CircleApp () {
+ cout << "creating CircleApp" << endl;
+}
+
+//--------------------------------------------------------------
+CircleApp :: ~CircleApp () {
+ cout << "destroying CircleApp" << endl;
+}
+
+//--------------------------------------------------------------
+void CircleApp::setup() {
+ ofBackground(127);
+ ofSetOrientation(OF_ORIENTATION_DEFAULT);
+
+ int fontSize = 8;
+ if (ofxiOSGetOFWindow()-> isRetinaSupportedOnDevice())
+ fontSize *= 2;
+
+ font.loadFont("fonts/mono0755.ttf", fontSize);
+}
+
+//--------------------------------------------------------------
+void CircleApp::update(){
+
+}
+
+//--------------------------------------------------------------
+void CircleApp::draw() {
+ int x = ofGetWidth() * 0.5;
+ int y = ofGetHeight() * 0.5;
+ int r = MIN(ofGetWidth(), ofGetHeight()) * 0.3;
+ int p = 0;
+
+ ofSetColor(ofColor::red);
+ ofCircle(x, y, r);
+
+ x = ofGetWidth() * 0.2;
+ y = ofGetHeight() * 0.11;
+ p = ofGetHeight() * 0.035;
+
+ ofSetColor(ofColor::white);
+ font.drawString("frame num = " + ofToString(ofGetFrameNum() ), x, y+=p);
+ font.drawString("frame rate = " + ofToString(ofGetFrameRate() ), x, y+=p);
+ font.drawString("screen width = " + ofToString(ofGetWidth() ), x, y+=p);
+ font.drawString("screen height = " + ofToString(ofGetHeight() ), x, y+=p);
+}
+
+//--------------------------------------------------------------
+void CircleApp::exit() {
+ //
+}
+
+//--------------------------------------------------------------
+void CircleApp::touchDown(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void CircleApp::touchMoved(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void CircleApp::touchUp(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void CircleApp::touchDoubleTap(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void CircleApp::lostFocus(){
+
+}
+
+//--------------------------------------------------------------
+void CircleApp::gotFocus(){
+
+}
+
+//--------------------------------------------------------------
+void CircleApp::gotMemoryWarning(){
+
+}
+
+//--------------------------------------------------------------
+void CircleApp::deviceOrientationChanged(int newOrientation){
+
+}
+
+
+//--------------------------------------------------------------
+void CircleApp::touchCancelled(ofTouchEventArgs& args){
+
+}
+
34 examples/ios/iosStoryboardExample/src/Apps/ImageApp.h
View
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "ofMain.h"
+#include "ofxiOS.h"
+#include "ofxiOSExtras.h"
+
+class ImageApp : public ofxiOSApp {
+
+public:
+
+ ImageApp ();
+ ~ImageApp ();
+
+ void setup();
+ void update();
+ void draw();
+ void exit();
+
+ void touchDown(ofTouchEventArgs &touch);
+ void touchMoved(ofTouchEventArgs &touch);
+ void touchUp(ofTouchEventArgs &touch);
+ void touchDoubleTap(ofTouchEventArgs &touch);
+ void touchCancelled(ofTouchEventArgs &touch);
+
+ void lostFocus();
+ void gotFocus();
+ void gotMemoryWarning();
+ void deviceOrientationChanged(int newOrientation);
+
+ ofTrueTypeFont font;
+ ofImage image;
+};
+
+
102 examples/ios/iosStoryboardExample/src/Apps/ImageApp.mm
View
@@ -0,0 +1,102 @@
+#include "ImageApp.h"
+
+//--------------------------------------------------------------
+ImageApp :: ImageApp () {
+ cout << "creating ImageApp" << endl;
+}
+
+//--------------------------------------------------------------
+ImageApp :: ~ImageApp () {
+ cout << "destroying ImageApp" << endl;
+}
+
+//--------------------------------------------------------------
+void ImageApp::setup() {
+ ofBackground(127);
+ ofSetOrientation(OF_ORIENTATION_DEFAULT);
+
+ int fontSize = 8;
+ if (ofxiOSGetOFWindow()->isRetinaSupportedOnDevice())
+ fontSize *= 2;
+
+ font.loadFont("fonts/mono0755.ttf", fontSize);
+
+ image.loadImage("images/dive.jpg");
+}
+
+//--------------------------------------------------------------
+void ImageApp::update(){
+
+}
+
+//--------------------------------------------------------------
+void ImageApp::draw() {
+ int x = (ofGetWidth() - image.width) * 0.5;
+ int y = (ofGetHeight() - image.height) * 0.5;
+ int p = 0;
+
+ ofSetColor(ofColor::white);
+ image.draw(x, y);
+
+ x = ofGetWidth() * 0.2;
+ y = ofGetHeight() * 0.11;
+ p = ofGetHeight() * 0.035;
+
+ ofSetColor(ofColor::white);
+ font.drawString("frame num = " + ofToString( ofGetFrameNum() ), x, y+=p);
+ font.drawString("frame rate = " + ofToString( ofGetFrameRate() ), x, y+=p);
+ font.drawString("screen width = " + ofToString( ofGetWidth() ), x, y+=p);
+ font.drawString("screen height = " + ofToString( ofGetHeight() ), x, y+=p);
+}
+
+//--------------------------------------------------------------
+void ImageApp::exit() {
+ //
+}
+
+//--------------------------------------------------------------
+void ImageApp::touchDown(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void ImageApp::touchMoved(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void ImageApp::touchUp(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void ImageApp::touchDoubleTap(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void ImageApp::lostFocus(){
+
+}
+
+//--------------------------------------------------------------
+void ImageApp::gotFocus(){
+
+}
+
+//--------------------------------------------------------------
+void ImageApp::gotMemoryWarning(){
+
+}
+
+//--------------------------------------------------------------
+void ImageApp::deviceOrientationChanged(int newOrientation){
+
+}
+
+
+//--------------------------------------------------------------
+void ImageApp::touchCancelled(ofTouchEventArgs& args){
+
+}
+
33 examples/ios/iosStoryboardExample/src/Apps/SquareApp.h
View
@@ -0,0 +1,33 @@
+#pragma once
+
+#include "ofMain.h"
+#include "ofxiOS.h"
+#include "ofxiOSExtras.h"
+
+class SquareApp : public ofxiOSApp {
+
+public:
+
+ SquareApp ();
+ ~SquareApp ();
+
+ void setup();
+ void update();
+ void draw();
+ void exit();
+
+ void touchDown(ofTouchEventArgs &touch);
+ void touchMoved(ofTouchEventArgs &touch);
+ void touchUp(ofTouchEventArgs &touch);
+ void touchDoubleTap(ofTouchEventArgs &touch);
+ void touchCancelled(ofTouchEventArgs &touch);
+
+ void lostFocus();
+ void gotFocus();
+ void gotMemoryWarning();
+ void deviceOrientationChanged(int newOrientation);
+
+ ofTrueTypeFont font;
+};
+
+
104 examples/ios/iosStoryboardExample/src/Apps/SquareApp.mm
View
@@ -0,0 +1,104 @@
+#include "SquareApp.h"
+
+//--------------------------------------------------------------
+SquareApp :: SquareApp () {
+ cout << "creating SquareApp" << endl;
+}
+
+//--------------------------------------------------------------
+SquareApp :: ~SquareApp () {
+ cout << "destroying SquareApp" << endl;
+}
+
+//--------------------------------------------------------------
+void SquareApp::setup() {
+ ofBackground(127);
+ ofSetOrientation(OF_ORIENTATION_DEFAULT);
+
+ int fontSize = 8;
+ if (ofxiOSGetOFWindow()->isRetinaSupportedOnDevice())
+ fontSize *= 2;
+
+ font.loadFont("fonts/mono0755.ttf", fontSize);
+}
+
+//--------------------------------------------------------------
+void SquareApp::update(){
+
+}
+
+//--------------------------------------------------------------
+void SquareApp::draw() {
+ ofEnableAlphaBlending();
+
+ int w = MIN(ofGetWidth(), ofGetHeight()) * 0.6;
+ int h = w;
+ int x = (ofGetWidth() - w) * 0.5;
+ int y = (ofGetHeight() - h) * 0.5;
+ int p = 0;
+
+ ofSetColor(ofColor::red);
+ ofRect(x, y, w, h);
+
+ x = ofGetWidth() * 0.2;
+ y = ofGetHeight() * 0.11;
+ p = ofGetHeight() * 0.035;
+
+ ofSetColor(ofColor::white);
+ font.drawString("frame num = " + ofToString( ofGetFrameNum() ), x, y+=p);
+ font.drawString("frame rate = " + ofToString( ofGetFrameRate() ), x, y+=p);
+ font.drawString("screen width = " + ofToString( ofGetWidth() ), x, y+=p);
+ font.drawString("screen height = " + ofToString( ofGetHeight() ), x, y+=p);
+}
+
+//--------------------------------------------------------------
+void SquareApp::exit() {
+ //
+}
+
+//--------------------------------------------------------------
+void SquareApp::touchDown(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void SquareApp::touchMoved(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void SquareApp::touchUp(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void SquareApp::touchDoubleTap(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void SquareApp::lostFocus(){
+
+}
+
+//--------------------------------------------------------------
+void SquareApp::gotFocus(){
+
+}
+
+//--------------------------------------------------------------
+void SquareApp::gotMemoryWarning(){
+
+}
+
+//--------------------------------------------------------------
+void SquareApp::deviceOrientationChanged(int newOrientation){
+
+}
+
+
+//--------------------------------------------------------------
+void SquareApp::touchCancelled(ofTouchEventArgs& args){
+
+}
+
33 examples/ios/iosStoryboardExample/src/Apps/TriangleApp.h
View
@@ -0,0 +1,33 @@
+#pragma once
+
+#include "ofMain.h"
+#include "ofxiOS.h"
+#include "ofxiOSExtras.h"
+
+class TriangleApp : public ofxiOSApp {
+
+public:
+
+ TriangleApp ();
+ ~TriangleApp ();
+
+ void setup();
+ void update();
+ void draw();
+ void exit();
+
+ void touchDown(ofTouchEventArgs &touch);
+ void touchMoved(ofTouchEventArgs &touch);
+ void touchUp(ofTouchEventArgs &touch);
+ void touchDoubleTap(ofTouchEventArgs &touch);
+ void touchCancelled(ofTouchEventArgs &touch);
+
+ void lostFocus();
+ void gotFocus();
+ void gotMemoryWarning();
+ void deviceOrientationChanged(int newOrientation);
+
+ ofTrueTypeFont font;
+};
+
+
102 examples/ios/iosStoryboardExample/src/Apps/TriangleApp.mm
View
@@ -0,0 +1,102 @@
+#include "TriangleApp.h"
+
+//--------------------------------------------------------------
+TriangleApp :: TriangleApp () {
+ cout << "creating TriangleApp" << endl;
+}
+
+//--------------------------------------------------------------
+TriangleApp :: ~TriangleApp () {
+ cout << "destroying TriangleApp" << endl;
+}
+
+//--------------------------------------------------------------
+void TriangleApp::setup() {
+ ofBackground(127);
+ ofSetOrientation(OF_ORIENTATION_DEFAULT);
+
+ int fontSize = 8;
+ if (ofxiOSGetOFWindow()->isRetinaSupportedOnDevice())
+ fontSize *= 2;
+
+ font.loadFont("fonts/mono0755.ttf", fontSize);
+}
+
+//--------------------------------------------------------------
+void TriangleApp::update(){
+
+}
+
+//--------------------------------------------------------------
+void TriangleApp::draw() {
+ int a = MIN(ofGetWidth(), ofGetHeight()) * 0.3;
+ int b = sqrt( a * a + a * a );
+ int x = ofGetWidth() * 0.5;
+ int y = ofGetHeight() * 0.5;
+ int p = 0;
+
+ ofSetColor(ofColor::red);
+ ofTriangle(x, y - a, x + b, y + b, x - b, y + b);
+
+ x = ofGetWidth() * 0.2;
+ y = ofGetHeight() * 0.11;
+ p = ofGetHeight() * 0.035;
+
+ ofSetColor(ofColor::white);
+ font.drawString("frame num = " + ofToString( ofGetFrameNum() ), x, y+=p);
+ font.drawString("frame rate = " + ofToString( ofGetFrameRate() ), x, y+=p);
+ font.drawString("screen width = " + ofToString( ofGetWidth() ), x, y+=p);
+ font.drawString("screen height = " + ofToString( ofGetHeight() ), x, y+=p);
+}
+
+//--------------------------------------------------------------
+void TriangleApp::exit() {
+ //
+}
+
+//--------------------------------------------------------------
+void TriangleApp::touchDown(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void TriangleApp::touchMoved(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void TriangleApp::touchUp(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void TriangleApp::touchDoubleTap(ofTouchEventArgs &touch){
+
+}
+
+//--------------------------------------------------------------
+void TriangleApp::lostFocus(){
+
+}
+
+//--------------------------------------------------------------
+void TriangleApp::gotFocus(){
+
+}
+
+//--------------------------------------------------------------
+void TriangleApp::gotMemoryWarning(){
+
+}
+
+//--------------------------------------------------------------
+void TriangleApp::deviceOrientationChanged(int newOrientation){
+
+}
+
+
+//--------------------------------------------------------------
+void TriangleApp::touchCancelled(ofTouchEventArgs& args){
+
+}
+
146 examples/ios/iosStoryboardExample/src/UI/MyApp.storyboard
View
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="hyu-Ep-QGS">
+ <dependencies>
+ <deployment defaultVersion="1280" identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="tZ6-WH-Boo">
+ <objects>
+ <viewController id="hyu-Ep-QGS" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="Kpk-Ie-Ar1">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <subviews>
+ <view contentMode="scaleToFill" id="HJ5-Hy-C4y">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <subviews>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="icX-yO-pX9">
+ <rect key="frame" x="0.0" y="129" width="320" height="80"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.52000000000000002" colorSpace="calibratedRGB"/>
+ <state key="normal" title="CIRCLE">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <segue destination="izb-Er-AlY" kind="push" id="uU3-5V-F57"/>
+ </connections>
+ </button>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="XjV-lo-UfQ">
+ <rect key="frame" x="0.0" y="210" width="320" height="80"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.52000000000000002" colorSpace="calibratedRGB"/>
+ <state key="normal" title="SQUARE">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <segue destination="xGd-F8-nYN" kind="push" id="MhQ-Qv-GPu"/>
+ </connections>
+ </button>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="pFu-zi-aUl">
+ <rect key="frame" x="0.0" y="291" width="320" height="80"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.52000000000000002" colorSpace="calibratedRGB"/>
+ <state key="normal" title="TRIANGLE">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <segue destination="mvv-H3-dqC" kind="push" id="XYP-i2-k90"/>
+ </connections>
+ </button>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="6vo-TN-AwX">
+ <rect key="frame" x="0.0" y="372" width="320" height="80"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.52000000000000002" colorSpace="calibratedRGB"/>
+ <state key="normal" title="IMAGE">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <segue destination="S9Q-Zl-vpC" kind="push" id="Jm2-ve-CxF"/>
+ </connections>
+ </button>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ <navigationItem key="navigationItem" id="dTl-D5-dH6"/>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="UR6-fn-xoh" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="136" y="2"/>
+ </scene>
+ <!--Circle App View Controller-->
+ <scene sceneID="zEc-Xd-284">
+ <objects>
+ <viewController id="izb-Er-AlY" customClass="CircleAppViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="R9v-Wa-bO3">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ <navigationItem key="navigationItem" id="sS7-pf-UfA"/>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="caz-hL-TDQ" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="735" y="-294"/>
+ </scene>
+ <!--Image App View Controller-->
+ <scene sceneID="exp-6P-CMv">
+ <objects>
+ <viewController id="S9Q-Zl-vpC" customClass="ImageAppViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="zrm-h7-zEY">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ <navigationItem key="navigationItem" id="n8Z-Ym-v5k"/>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="2Je-4E-fDZ" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="1107" y="-294"/>
+ </scene>
+ <!--Triangle App View Controller-->
+ <scene sceneID="v5T-Ro-UUd">
+ <objects>
+ <viewController id="mvv-H3-dqC" customClass="TriangleAppViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="upO-cA-Twy">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ <navigationItem key="navigationItem" id="XMD-ma-Pq8"/>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="UgH-Rx-xEW" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="1107" y="371"/>
+ </scene>
+ <!--Square App View Controller-->
+ <scene sceneID="sN6-qz-hdg">
+ <objects>
+ <viewController id="xGd-F8-nYN" customClass="SquareAppViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="zFw-SZ-CDA">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ <navigationItem key="navigationItem" id="ctP-do-pEe"/>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="Lg1-93-qLN" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="735" y="371"/>
+ </scene>
+ </scenes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination" type="retina4"/>
+ </simulatedMetricsContainer>
+</document>
15 examples/ios/iosStoryboardExample/src/UI/MyAppDelegate.h
View
@@ -0,0 +1,15 @@
+//
+// MyAppDelegate.h
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "ofxiOSAppDelegate.h"
+
+@interface MyAppDelegate : ofxiOSAppDelegate {
+ //
+}
+
+@property (nonatomic, retain) UINavigationController* navigationController;
+
+@end
35 examples/ios/iosStoryboardExample/src/UI/MyAppDelegate.mm
View
@@ -0,0 +1,35 @@
+//
+// MyAppDelegate.m
+// Created by lukasz karluk on 11/02/14.
+// http://julapy.com
+//
+
+#import "MyAppDelegate.h"
+
+@implementation MyAppDelegate
+
+@synthesize navigationController;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+
+ [super applicationDidFinishLaunching:application];
+
+ self.navigationController = [[[UINavigationController alloc] init] autorelease];
+ [self.window setRootViewController:self.navigationController];
+
+ UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"MyApp" bundle:nil];
+ [self.navigationController pushViewController:[storyboard instantiateInitialViewController] animated:YES];
+
+ //--- style the UINavigationController
+ self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
+ self.navigationController.navigationBar.topItem.title = @"Home";
+
+ return YES;
+}
+
+- (void) dealloc {
+ self.navigationController = nil;
+ [super dealloc];
+}
+
+@end
39 examples/ios/iosStoryboardExample/src/main.mm
View
@@ -0,0 +1,39 @@
+#include "ofMain.h"
+#include "SquareApp.h"
+
+int main(){
+
+ bool bUseNative = true;
+
+ if (bUseNative){
+ /**
+ *
+ * Below is how you start using a native ios setup.
+ *
+ * First a ofAppiOSWindow is created and added to ofSetupOpenGL()
+ * Notice that no app is being sent to ofRunApp() - this happens later when we actually need the app.
+ *
+ * One last thing that needs to be done is telling ofAppiOSWindow which AppDelegate to use.
+ * This is a custom AppDelegate and inside it you can start coding your native iOS application.
+ * The AppDelegate must extend ofxiOSAppDelegate.
+ *
+ **/
+
+ ofAppiOSWindow * window = new ofAppiOSWindow();
+ window->enableRetina();
+
+ ofSetupOpenGL(ofPtr<ofAppBaseWindow>(window), 1024,768, OF_FULLSCREEN);
+ window->startAppWithDelegate("MyAppDelegate");
+ }
+ else {
+ /**
+ *
+ * This is the normal way of running an app using ofxiOS.
+ * This code has been left in this example to show that ofxiOS still works
+ *
+ **/
+
+ ofSetupOpenGL(1024,768, OF_FULLSCREEN);
+ ofRunApp(new SquareApp());
+ }
+}
28 examples/ios/iosStoryboardExample/src/ofApp.h
View
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "ofMain.h"
+#include "ofxiOS.h"
+#include "ofxiOSExtras.h"
+
+class ofApp : public ofxiOSApp{
+
+ public:
+ void setup();
+ void update();
+ void draw();
+ void exit();
+
+ void touchDown(ofTouchEventArgs & touch);
+ void touchMoved(ofTouchEventArgs & touch);
+ void touchUp(ofTouchEventArgs & touch);
+ void touchDoubleTap(ofTouchEventArgs & touch);
+ void touchCancelled(ofTouchEventArgs & touch);
+
+ void lostFocus();
+ void gotFocus();
+ void gotMemoryWarning();
+ void deviceOrientationChanged(int newOrientation);
+
+};
+
+
70 examples/ios/iosStoryboardExample/src/ofApp.mm
View
@@ -0,0 +1,70 @@
+#include "ofApp.h"
+
+//NOTE: in this example ofApp ( this class ) is not used.
+// look inside Apps/ to see the native iOS implementation
+
+//--------------------------------------------------------------
+void ofApp::setup(){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::update(){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::draw(){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::exit(){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::touchDown(ofTouchEventArgs & touch){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::touchMoved(ofTouchEventArgs & touch){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::touchUp(ofTouchEventArgs & touch){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::touchDoubleTap(ofTouchEventArgs & touch){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::touchCancelled(ofTouchEventArgs & touch){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::lostFocus(){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::gotFocus(){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::gotMemoryWarning(){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::deviceOrientationChanged(int newOrientation){
+
+}
+
Something went wrong with that request. Please try again.