SlideShare a Scribd company logo
Leaving   Behind
Hello.


• Jake Behrens
• iPhone/Mobile Developer
• UI Designer
Hello.



• Freelancer (as of last Friday!)
Leaving Interface Builder Behind
Leaving Interface Builder Behind
Leaving Interface Builder Behind
Moments



• Choose, but choose wisely.
• Do it for the experience.
30,000 Ft.
Leaving Interface Builder Behind
Leaving Interface Builder Behind
Why?

• Knowledge.
• Code reuse.
• Performance.
• Custom = code.
• Tidbits here and there...
A Story
Leaving Interface Builder Behind
Leaving Interface Builder Behind
Delegates
Delegates



    Outlets
Delegates
              Location

    Outlets
Time
Code Reuse
Code vs. GUI

CGRect submitButtonFrame = CGRectMake(10.0, 276.0, 300.0, 130.0);
UIImage *tempSubmitButtonUp = [UIImage imageNamed:@"SubmitButton_Up.png"];
UIImage *tempSubmitButtonDown = [UIImage imageNamed:@"SubmitButton_Down.png"];
submitButton = [UIButton buttonWithType:UIButtonTypeCustom];
[submitButton setImage:tempSubmitButtonUp forState:UIControlStateNormal];
[submitButton setImage:tempSubmitButtonDown forState:UIControlStateHighlighted];
[submitButton setFrame:submitButtonFrame];
[submitButton addTarget:self action:@selector(submitReport)
   forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:submitButton];
Snippets




www.snippetapp.com
Performance
Performance



• Benchmarks.
Performance

• View-based application
Performance

• View-based application
• With IB: 37ms
Performance

• View-based application
• With IB: 37ms
• Without IB: 23ms
Performance

• View-based application w/
  UIImageView
Performance

• View-based application w/
  UIImageView
• With IB: 47ms
Performance

• View-based application w/
  UIImageView
• With IB: 47ms
• Without IB: 25ms
Leaving Interface Builder Behind
Leaving Interface Builder Behind
Performance
Performance
Performance

1. Build your app.
2. Run
   > Run with Performance Tool
         > Core Animation
Performance
Performance
Performance

• 14 elements in each cell.
Performance

• 14 elements in each cell.
• With IB: 13-23 FPS
Performance

• 14 elements in each cell.
• With IB: 13-23 FPS
• Without IB: 43-60 FPS
Customizing


   Iʼm a button!!
Iʼm
      a
          bu
            tto
               n!
                  !
                      Customizing
Customizing

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0];
[UIView setAnimationDelegate:self];
myButton.transform = CGAffineTransformMakeRotation
  ([Utilities degreesToRadians:45]);
[UIView commitAnimations];
Customizing


   Iʼm a button!!
Iʼm
      a
          bu
            tto
               n!
                  !
                      Customizing
Tidbits &
Food 4 Thought
Source Control
<string key="NSFrame">{{20, 20}, {280, 37}}</string>
<string key="NSFrame">{{20, 20}, {280, 37}}</string>
myButton.frame = CGRectMake(20.0, 20.0, 280.0, 37.0);
myButton.frame = CGRectMake(20.0, 20.0, 280.0, 37.0);
Refactor...



• When changing a method name.
• IB doesnʼt fix your action.
Bug Report



• Great opportunity to tell Apple.
“Premature
optimization is the root
      of all evil.”
So now what?
Leaving Interface Builder Behind
Leaving Interface Builder Behind
Tutorials!
View-based Application
Leaving Interface Builder Behind
Leaving Interface Builder Behind
Leaving Interface Builder Behind
Resources



• Remove .xib files.
main.m

#import <UIKit/UIKit.h>

int main(int argc, char *argv[]) {

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;
}
main.m

#import <UIKit/UIKit.h>


int main(int argc, char *argv[]) {

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, @”AppDelegate”);
    [pool release];
    return retVal;
}
AppDelegate.h

#import <UIKit/UIKit.h>

@class DemoViewController;

@interface AppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    DemoViewController *viewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet DemoViewController *viewController;

@end
AppDelegate.h

#import <UIKit/UIKit.h>

@class DemoViewController;

@interface AppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    DemoViewController *viewController;
}

@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) DemoViewController *viewController;

@end
AppDelegate.m


- (void)applicationDidFinishLaunching:(UIApplication *)application {

    // Override point for customization after app launch
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];
}
AppDelegate.m

- (void)applicationDidFinishLaunching:(UIApplication *)application {
    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
!
!   viewController = [[DemoViewController alloc] init];
!
    // Override point for customization after app launch
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];
}
Custom Xcode
  Templates
Why?



• Set it up the way you want it.
• Include libraries you use.
Path of Originals
AppDelegate.h

#import <UIKit/UIKit.h>

@class ___PROJECTNAMEASIDENTIFIER___ViewController;

@interface ___PROJECTNAMEASIDENTIFIER___AppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    ___PROJECTNAMEASIDENTIFIER___ViewController *viewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet ___PROJECTNAMEASIDENTIFIER___ViewController
*viewController;

@end
Points of Interest



• Delete the build folder.
• .xcodeproj
Issues with updates...
Path to Customs
http://github.com/withfoam
Graphical Elements
     In Code
.h

#import <UIKit/UIKit.h>

@interface DemoViewController : UIViewController {
! UILabel *displayText;
}

@property (nonatomic, retain) UILabel *displayText;

@end
.m
#import "DemoViewController.h"

@implementation DemoViewController

@synthesize displayText;

#pragma mark -
#pragma mark Application lifecycle

- (void)loadView {
! [super loadView];
!
! displayText = [[UILabel alloc] init];
! [displayText setFrame:CGRectMake(20.0, 20.0, 280.0, 30.0)];
! [displayText setText:@"Hello 360iDev!"];
! [displayText setFont:[UIFont fontWithName:@"Helvetica" size:14.0]];
! [self.view addSubview:displayText];
}
.m

- (void)dealloc {
! [displayText release];
  [super dealloc];
}
Yay...
.m

- (void)loadView {
! [super loadView];
!
! displayText = [[UILabel alloc] init];
! [displayText setFrame:CGRectMake(20.0, 20.0, 280.0, 30.0)];
! [displayText setText:@"Hello 360iDev!"];
! [displayText setFont:[UIFont fontWithName:@"Helvetica" size:24.0]];
! [displayText setBackgroundColor:[UIColor blackColor]];
! [displayText setTextColor:[UIColor greenColor]];
! [displayText setTextAlignment:UITextAlignmentCenter];
! [self.view addSubview:displayText];
}
Yay...
UIButton...again.

CGRect submitButtonFrame = CGRectMake(10.0, 276.0, 300.0, 130.0);
UIImage *tempSubmitButtonUp = [UIImage imageNamed:@"SubmitButton_Up.png"];
UIImage *tempSubmitButtonDown = [UIImage imageNamed:@"SubmitButton_Down.png"];
submitButton = [UIButton buttonWithType:UIButtonTypeCustom];
[submitButton setImage:tempSubmitButtonUp forState:UIControlStateNormal];
[submitButton setImage:tempSubmitButtonDown forState:UIControlStateHighlighted];
[submitButton setFrame:submitButtonFrame];
[submitButton addTarget:self action:@selector(submitReport)
forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:submitButton];
RE:cap


• Increased performance.
• Organization.
• Little things.
Tuts


• Revert apps created for IB.
• Create customized project templates.
• Create graphical elements and
  objects in code.
Yell at me.

• http://jakebehrens.com

• @withfoam
• http://withfoam.com
• http://github.com/withfoam
Feel lucky?
• R634EJ39MA44
• 77Y7YEL9F6AR
• 3EKR3FAETJPF
• 4KT7EMWHP47P
• EMM4H9XTF6JT
• ERMFPKRR69X6
Hecklers? Questions?

More Related Content

PDF
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
PPTX
AngularJS Internal
PDF
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
PDF
Promises are so passé - Tim Perry - Codemotion Milan 2016
PPTX
AngularJs $provide API internals & circular dependency problem.
PDF
Side effects-con-redux
PDF
iphonedevcon 2010: Cooking with iAd
PDF
Ui perfomance
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
AngularJS Internal
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Promises are so passé - Tim Perry - Codemotion Milan 2016
AngularJs $provide API internals & circular dependency problem.
Side effects-con-redux
iphonedevcon 2010: Cooking with iAd
Ui perfomance

What's hot (19)

PPTX
Academy PRO: React native - building first scenes
PDF
Google App Engine in 40 minutes (the absolute essentials)
PPTX
IndexedDB - Querying and Performance
PPTX
Academy PRO: React native - navigation
PPTX
AngularJS with TypeScript and Windows Azure Mobile Services
PDF
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
PDF
Animating angular applications
PDF
Angular2 & ngrx/store: Game of States
PPTX
AngularJS Animations
PPTX
React native introduction
PDF
GDayX - Advanced Angular.JS
PPTX
PDF
Everything You (N)ever Wanted to Know about Testing View Controllers
PPTX
AngularJS Architecture
PPTX
JavaScript code generator with Yeoman
PDF
Andriod dev toolbox part 2
PDF
Practical Protocol-Oriented-Programming
PDF
3D Touch Implementation for Shortcuts and Peek/Pop Functionality
PDF
Android best practices
Academy PRO: React native - building first scenes
Google App Engine in 40 minutes (the absolute essentials)
IndexedDB - Querying and Performance
Academy PRO: React native - navigation
AngularJS with TypeScript and Windows Azure Mobile Services
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Animating angular applications
Angular2 & ngrx/store: Game of States
AngularJS Animations
React native introduction
GDayX - Advanced Angular.JS
Everything You (N)ever Wanted to Know about Testing View Controllers
AngularJS Architecture
JavaScript code generator with Yeoman
Andriod dev toolbox part 2
Practical Protocol-Oriented-Programming
3D Touch Implementation for Shortcuts and Peek/Pop Functionality
Android best practices
Ad

Similar to Leaving Interface Builder Behind (20)

PDF
MOPCON 2014 - Best software architecture in app development
PDF
I os 11
PDF
Quick Start to iOS Development
KEY
iOSインタラクションデザイン
KEY
CocoaHeads Toulouse - Guillaume Cerquant - UIView
KEY
Desenvolvimento iOS - Aula 4
PPT
iOS Training Session-3
PDF
IOS APPs Revision
PPT
Beginning iphone 4_devlopement_chpter7_tab_b
PDF
iOS 7 SDK特訓班
PDF
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
KEY
PhotoFlipCardView
PDF
Our Choice:电子书的新交互方式探讨
PDF
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
PDF
Ruby motion勉強会 2012年7月
PDF
2013-05-15 threads. why and how
PPTX
Advance UIAutomator : Documentaion
PDF
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
MOPCON 2014 - Best software architecture in app development
I os 11
Quick Start to iOS Development
iOSインタラクションデザイン
CocoaHeads Toulouse - Guillaume Cerquant - UIView
Desenvolvimento iOS - Aula 4
iOS Training Session-3
IOS APPs Revision
Beginning iphone 4_devlopement_chpter7_tab_b
iOS 7 SDK特訓班
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
PhotoFlipCardView
Our Choice:电子书的新交互方式探讨
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Ruby motion勉強会 2012年7月
2013-05-15 threads. why and how
Advance UIAutomator : Documentaion
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Ad

More from John Wilker (20)

PDF
Cranking Floating Point Performance Up To 11
PDF
Introtoduction to cocos2d
PDF
Getting Started with OpenGL ES
PDF
User Input in a multi-touch, accelerometer, location aware world.
PDF
Physics Solutions for Innovative Game Design
PDF
Getting Oriented with MapKit: Everything you need to get started with the new...
PDF
Getting Started with iPhone Game Development
PDF
Internationalizing Your Apps
PDF
Optimizing Data Caching for iPhone Application Responsiveness
PDF
I Phone On Rails
PDF
Integrating Push Notifications in your iPhone application with iLime
PDF
Starting Core Animation
PDF
P2P Multiplayer Gaming
PDF
Using Concurrency To Improve Responsiveness
PDF
Mobile WebKit Development and jQTouch
PDF
Accelerometer and OpenGL
PDF
Deep Geek Diving into the iPhone OS and Framework
PDF
NSNotificationCenter vs. AppDelegate
PDF
Using SQLite
PDF
From Flash to iPhone
Cranking Floating Point Performance Up To 11
Introtoduction to cocos2d
Getting Started with OpenGL ES
User Input in a multi-touch, accelerometer, location aware world.
Physics Solutions for Innovative Game Design
Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Started with iPhone Game Development
Internationalizing Your Apps
Optimizing Data Caching for iPhone Application Responsiveness
I Phone On Rails
Integrating Push Notifications in your iPhone application with iLime
Starting Core Animation
P2P Multiplayer Gaming
Using Concurrency To Improve Responsiveness
Mobile WebKit Development and jQTouch
Accelerometer and OpenGL
Deep Geek Diving into the iPhone OS and Framework
NSNotificationCenter vs. AppDelegate
Using SQLite
From Flash to iPhone

Recently uploaded (20)

PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
A Presentation on Artificial Intelligence
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Hybrid model detection and classification of lung cancer
PDF
project resource management chapter-09.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
TLE Review Electricity (Electricity).pptx
A novel scalable deep ensemble learning framework for big data classification...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Web App vs Mobile App What Should You Build First.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
1 - Historical Antecedents, Social Consideration.pdf
Chapter 5: Probability Theory and Statistics
A Presentation on Artificial Intelligence
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Tartificialntelligence_presentation.pptx
Group 1 Presentation -Planning and Decision Making .pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Hybrid model detection and classification of lung cancer
project resource management chapter-09.pdf
Zenith AI: Advanced Artificial Intelligence
TLE Review Electricity (Electricity).pptx

Leaving Interface Builder Behind