CS193p Spring 2010 Monday, April 12, 2010

Size: px
Start display at page:

Download "CS193p Spring 2010 Monday, April 12, 2010"

Transcription

1 CS193p Spring 2010

2 Announcements Axess! Make sure your grading option matches what you were approved for Sonali s Office Hours Changed Friday 11am to 1pm Thursday 10am to noon Gates B26B Any questions about the Homework? Did everyone get the about entering numbers?

3 Communication Questions are best sent to Sending directly to instructor or TA s risks slow response. Web Site Very Important! All lectures, assignments, code, etc. will be there. This site will be your best friend when it comes to getting info.

4 Today s Topics Protocols and Delegates Views Core Graphics Demo

5 Protocols Very similar but no Foo (NSArray Classes then proclaim they implement a MyClass : NSObject

6 Protocols Declaring arguments to require a protocol - (void)givemetheobject:(id <Foo>)anObjectImplementingFoo Declaring variables to require a protocol id <Foo> obj = [[MyClass alloc] init]; [obj dosomething]; // will not warn (and should be okay) Compiler will warn of misbehavior Class says it implements protocol Foo, but doesn t implement required methods Assigning an object which does not implement Foo to a variable like obj above Passing an object which does not implement Foo through an argument which requires it (like above)

7 Delegates Used to delegate responsibility to other objects Protocol defines what the responsibility is Great way to maintain MVC but with flexibility Oftentimes View objects do this Will see example of this in demo Very common paradigm in UIKit

8 Views Rectangular area on screen Draws and handles events in that rectangle Hierarchical Only one superview: - (UIView *)superview Can have many (or zero) subviews: - (NSArray *)subviews Subview order matters: those later in the array are on top of earlier UIWindow The UIView at the top of the view hierarchy Only have one UIWindow in an iphone application (it s all about views)

9 View Hierarchy Hierarchy often constructed in IB Even custom views can be added to the hierarchy in IB How to do it in code though? - (void)addsubview:(uiview *)aview; - (void)removefromsuperview; How to manage the order of subviews - (void)insertsubview:(uiview *)sv atindex:(int)index; - (void)insertsubview:(uiview *)sv belowsubview:(uiview *)otherview; - (void)insertsubview:(uiview *)sv abovesubview:(uiview *)otherview;

10 Transparency of Views What happens when views overlap? Order of subviews list determines who s in front, but lower ones can show through transparent views on top of them When you are drawing (covered later), you can draw with transparency (partial or fully) Default is fully opaque drawing If you want to hide a view completely, you can just set the hidden property to YES No need to remove the view from the hierarchy to hide it

11 View Memory Mgmt Superviews retain their subviews Once you put a view into the hierarchy you can release your ownership if you want Note that we retain IBOutlet variables But we don t really need to as long as they are always in the hierarchy. It s more of a convention to retain them. But be careful! If you remove a view from the view hierarchy it may deallocate immediately (no autorelease happens). So, retain it first, then call removefromsuperview.

12 Coordinates CGFloat Just a floating point number, but always use CGFloat for graphics. CGPoint C struct with two CGFloats in it: x and y. Create with CGPointMake(x, y) CGSize C struct with two CGFloats in it: width and height. Create with CGSizeMake(width, height) CGRect C struct with a CGPoint origin and a CGSize size. Create with CGRectMake(x, y, width, height)

13 (0,0) increasing x Coordinates Origin of View s coordinate system is upper left Units are pixels No matter what the dps of the screen is (250, 85) View property bounds is the local coordinate space self.bounds.origin: decide what it means for your view self.bounds.size.width/height is how wide/tall your view is Use this rectangle when you are inside the implementation of a view increasing y View s frame and center properties center is the center of the View in its superview s co ordinates frame is the smallest rectangle which will contain the view So is frame.size always the same as bounds.size? No: rotation. Use center and frame to position/size the view in its superview.

14 140, , View A , 0 View B 320 View B s bounds is ((0,0),(200,250)) View B s frame is ((140,65),(320,320)) View B s center is (300, 225)

15 Creating Views Most often you create views in IB Even though custom views are not IB, you drag out generic UIView from the Library window, then use the Inspector to change the class to your custom class How do you create them in code? - (id)initwithframe:(cgrect)arect is designated initializer Example: CGRect buttonrect = CGRectMake(20, 20, 120, 37); UIButton *button = [[UIButton alloc] initwithframe:buttonrect]; button.titlelabel.text Do it! ; [window addsubview:button]; [button release];

16 Custom Views When do I want to create my own view? I want to do my own drawing on screen And/or I want to handle touch events Create a subclass of UIView To do your own drawing, implement drawrect: - (void)drawrect:(cgrect)cliprect; You can optimize by not drawing outside of cliprect, but not required NEVER call drawrect:!! EVER! Instead, let system know view is out of date and needs a redraw. It will then call your drawrect: at an appropriate time. - (void)setneedsdisplay - (void)setneedsdisplayinrect:(cgrect)cliprect

17 Custom Views To handle events, you must implement all of these - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event; - (void)touchesmoved:(nsset *)touches withevent:(uievent *)event; - (void)touchesended:(nsset *)touches withevent:(uievent *)event; - (void)touchescancelled:(nsset *)touches withevent:(uievent *)event; Or use a UIGestureRecognizer We ll talk about touches and gestures later

18 Drawing How do you implement drawrect:? Draw with Quartz2D Quartz2D is part of Core Graphics Framework It is a C API (not object-oriented) Concepts Get a context to draw into Apply transformations Create paths Set colors, fonts, textures, linewidths, linecaps, etc. Stroke or fill those paths

19 Context Context determines where your drawing goes Screen Offscreen Bitmap PDF Printer UIKit sets up a context for you in drawrect: Only valid during that execution of drawrect: So never cache the context! You ll get a new one each time Get the context in drawrect: with this method - (CGContextRef)UIGraphicsGetCurrentContext(); CGContextRef context = UIGraphicsGetCurrentContext();

20 Graphics State Setup graphics state of the context Many different properties, e.g., CGContextSetLineWidth(context, 1.0); The context UIKit provides has sensible defaults Colors have some object-oriented support in UIKit UIColor *mycolor = [UIColor bluecolor]; UIColor *rgb = [UIColor colorwithred:0.5 green:1.0 blue:0.125 alpha:1.0]; [mycolor set]; [mycolor setstroke]; [rgb setfill];

21 Define a Path Begin the path CGContextBeginPath(context) Move around and add lines or arcs to the path CGContextMoveToPoint(context, 75, 10); CGContextAddLineToPoint(context, 10, 150); CGContextAddLineToPoint(context, 160, 150); Close the path (connects last point back to first) CGContextClosePath(context); // not strictly required Set any graphics state and then draw the path [[UIColor greencolor] setfill]; [[UIColor redcolor] setstroke]; CGContextDrawPath(context, kcgpathfillstroke);

22 Define a Path It s also possible to save paths and reuse them See functions in the docs that start with CGPath instead of CGContext

23 Graphics State Defining a method to draw something What if that method sets graphics state? It might mess up the graphics state of the calling method You can push the current graphics state, then pop UIGraphicsPushContext(context); <do whatever you want with the graphics state> UIGraphicsPopContext();

24 Drawing Text Use UILabel, but if you feel you must... Object in UIKit to get a font UIFont *myfont = [UIFont systemfontofsize:12.0]; UIFont *thefont = [UIFont fontwithname:@ Helvetica size:36.0]; NSArray *availablefonts = [UIFont familynames]; Special methods in NSString to draw text NSString *text =...; [text drawatpoint:(cgpoint)p withfont:thefont]; CGSize textsize = [text sizewithfont:myfont]; Check out NSString(UIStringDrawing) in docs

25 Drawing Images Use UIImageView, but if you must... Create an image from a file in your Resources UIImage *image = [UIImage imagenamed:@ foo.jpg ]; Create an image from a file or from raw data UIImage *image = [[UIImage alloc] initwithcontentsoffile:(nsstring *)path; UIImage *image = [[UIImage alloc] initwithdata:(nsdata *)data]; Create an image using CGContext functions UIGraphicsBeginImageContext((CGSize)size); <draw with CGContext functions as usual> UIImage *myimage = UIGraphicsGetImageFromCurrentContext(); UIGraphicsEndImageContext();

26 Drawing Images Blasting the bits into the current context UIImage *image =...; [image drawatpoint:(cgpoint)p]; // p is upper left corner of image [image drawinrect:(cgrect)rect]; // scales the image [image drawaspatterninrect:(cgrect)rect]; // tiles the image Aside: You can get your UIImage as PNG or JPG NSData *jpgdata = UIImageJPGRepresentation((UIImage *)myimage); NSData *pngdata = UIImagePNGRepresentation((UIImage *)myimage);

27 Demo UISlider Custom View with drawrect: Delegate Quartz 2D

28 Wednesday Application Structure & Lifecycle Application Delegate UINavigationController Demo of AppDelegate and UINavigationController Homework Explanation

29 Homework Tomorrow at 11:59pm!

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011 Developing Applications for ios Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Draws and handles events in that rectangle Hierarchical A view has only one

More information

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010 Developing Applications for iphone 4, ipod Touch, & ipad Today One last Objective-C topic: Protocols Using protocols to define/implement/use a data source and/or delegate Views UIView and UIWindow classes

More information

Views. A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space

Views. A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Draws and handles events in that rectangle Hierarchical A view has only one superview - (UIView *)superview

More information

Stanford CS193p. Developing Applications for ios. Spring Stanford CS193p. Spring 2012

Stanford CS193p. Developing Applications for ios. Spring Stanford CS193p. Spring 2012 Developing Applications for ios Foundation Framework NSObject Base class for pretty much every object in the ios SDK Implements introspection methods, etc. - (NSString *)description is a useful method

More information

View Hierarchy - UIWindow

View Hierarchy - UIWindow Views and Drawing Views View Fundamentals Rectangular area on screen Draws content Handles events Subclass of UIResponder (event handling class) Views arranged hierarchically every view has one superview

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lecture 4: Views, Autorotation and Gestures Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Content Views Drawing

More information

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016 Stanford Developing Applications for ios Today Views Custom Drawing Demo FaceView Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space For drawing And for handling

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017 Stanford Developing Applications for ios Today Views Custom Drawing Demo FaceView Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space For drawing And for handling

More information

ios Mobile Development

ios Mobile Development ios Mobile Development Today Views How to draw custom stuff on screen. Gestures How to react to user s touch gestures. Demo SuperCard Views A view (i.e. UIView subclass) represents a rectangular area Defines

More information

Today s Topics. Views Drawing Text & Images Animation

Today s Topics. Views Drawing Text & Images Animation Today s Topics Views Drawing Text & Images Animation 4 Views 5 View Fundamentals Rectangular area on screen Draws content Handles events Subclass of UIResponder (event handling class) Views arranged hierarchically

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015 Stanford CS193p Developing Applications for ios Today Objective-C Compatibility Bridging Property List NSUserDefaults Demo: var program in CalculatorBrain Views Custom Drawing Demo FaceView Bridging Objective-C

More information

COMP327 Mobile Computing. Lecture Set 9 - Model, View, Controller

COMP327 Mobile Computing. Lecture Set 9 - Model, View, Controller COMP327 Mobile Computing Lecture Set 9 - Model, View, Controller 1 In this Lecture Set Anatomy of an Application Model View Controller Interface Builder and Nibs View Classes Views Drawing Text and Images

More information

Monday, 1 November The ios System

Monday, 1 November The ios System The ios System System Overview System Overview System Overview System Overview System Overview System Overview Foundation Classes (Useful) Foundation Framework Value and collection classes User defaults

More information

Announcements. Lab 3. Lab 2 is due on Monday Sept 21 st. Lab 3 is posted Due September 30 th

Announcements. Lab 3. Lab 2 is due on Monday Sept 21 st. Lab 3 is posted Due September 30 th Announcements Lab 2 is due on Monday Sept 21 st Lab 3 is posted Due September 30 th 1 Extensible - CSE 436 Software Networking Engineering Platform Workshop 1 Lab 3 2 Extensible - CSE 436 Software Networking

More information

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall Stanford Developing Applications for ios Today Miscellaneous Error Handling Any Other Interesting Classes Views Custom Drawing Demo: Draw a Playing Card enum Thrown Errors In Swift, methods can throw errors

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lecture 5: Views, Drawing and Gestures Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Content Views, Drawing and

More information

Custom Drawing & Animation. CS 442: Mobile App Development Michael Saelee

Custom Drawing & Animation. CS 442: Mobile App Development Michael Saelee Custom Drawing & Animation CS 442: Mobile App Development Michael Saelee 1 Frameworks - UIKit - Core Graphics / Quartz - Core Animation - OpenGL ES 2 UIKit OpenGL ES Core Graphics Core Animation

More information

Custom Drawing & Animation. CS 442: Mobile App Development Michael Saelee

Custom Drawing & Animation. CS 442: Mobile App Development Michael Saelee Custom Drawing & Animation CS 442: Mobile App Development Michael Saelee Frameworks - UIKit - Core Graphics / Quartz - Core Animation - OpenGL ES UIKit OpenGL ES Core Graphics Core Animation

More information

Views, Drawing, and Events. Lecture 5

Views, Drawing, and Events. Lecture 5 Views, Drawing, and Events Lecture 5 First - Representing Points and Areas NSPoint // Represents a point in a Cartesian coordinate system. typedef struct _NSPoint { CGFloat x; CGFloat y; } NSPoint Pair

More information

Custom Views and Events. Lecture 7

Custom Views and Events. Lecture 7 Custom Views and Events Lecture 7 First Representing Points and Areas NSPoint typedef struct _NSPoint { CGFloat x; CGFloat y; } NSPoint; Pair of x, y coordinates NSZeroPoint represents the bottom left

More information

Custom Views and Drawing. Lecture 5

Custom Views and Drawing. Lecture 5 Custom Views and Drawing Lecture 5 First - Representing Points and Areas NSPoint typedef struct _NSPoint { CGFloat x; CGFloat y; } NSPoint Pair of x, y coordinates NSZeroPoint represents the origin Create

More information

Core Graphics & Animation. ios App Development Fall 2010 Lecture 17

Core Graphics & Animation. ios App Development Fall 2010 Lecture 17 Core Graphics & Animation ios App Development Fall 2010 Lecture 17 Questions? Announcements Assignment #5 out later this week Last of the short assignments Today s Topics Custom UIViews -drawrect: Core

More information

lecture 10 UI/UX and Programmatic Design cs : spring 2018

lecture 10 UI/UX and Programmatic Design cs : spring 2018 lecture 10 UI/UX and Programmatic Design cs198-001 : spring 2018 1 Announcements custom app progress form due before lab (~1 minute) will be released after lecture only 2 labs left (both very important)

More information

CS193p Spring 2010 Wednesday, March 31, 2010

CS193p Spring 2010 Wednesday, March 31, 2010 CS193p Spring 2010 Logistics Lectures Building 260 (History Corner) Room 034 Monday & Wednesday 4:15pm - 5:30pm Office Hours TBD Homework 7 Weekly Assignments Assigned on Wednesdays (often will be multiweek

More information

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content View Concepts iphone Application Programming Lecture 4: User Interface Design SDK provide many types of Views to show your content At run-time Views are organized as a tree Chat Wacharamanotham Media Computing

More information

CS193p Spring 2010 Thursday, April 29, 2010

CS193p Spring 2010 Thursday, April 29, 2010 CS193p Spring 2010 Announcements You should have received an e-mail by now If you received e-mail approving enrollment, but are not in Axess, do it! If you have any questions, please ask via e-mail or

More information

Announcements. Lab 2 is due next Monday (Sept 25 th ) by 11:59 PM. Late policy is 10% of lab total per day late. So -7.5 points per day late for lab 2

Announcements. Lab 2 is due next Monday (Sept 25 th ) by 11:59 PM. Late policy is 10% of lab total per day late. So -7.5 points per day late for lab 2 Announcements Lab 2 is due next Monday (Sept 25 th ) by 11:59 PM Late policy is 10% of lab total per day late So -7.5 points per day late for lab 2 Labs 3 and 4 are posted on the course website Extensible

More information

Graphics and Animation on ios

Graphics and Animation on ios Graphics and Animation on ios Graphics and Animation on ios Vandad Nahavandipoor Beijing Cambridge Farnham Köln Sebastopol Tokyo Graphics and Animation on ios by Vandad Nahavandipoor Copyright 2011 Vandad

More information

CS193P - Lecture 8. iphone Application Development. Scroll Views & Table Views

CS193P - Lecture 8. iphone Application Development. Scroll Views & Table Views CS193P - Lecture 8 iphone Application Development Scroll Views & Table Views Announcements Presence 1 due tomorrow (4/28)! Questions? Presence 2 due next Tuesday (5/5) Announcements Enrolled students who

More information

Assignment III: Graphing Calculator

Assignment III: Graphing Calculator Assignment III: Graphing Calculator Objective The goal of this assignment is to reuse your CalculatorBrain and CalculatorViewController objects to build a Graphing Calculator. By doing this, you will gain

More information

The Best of Both Worlds: Using UIKit with OpenGL

The Best of Both Worlds: Using UIKit with OpenGL The Best of Both Worlds: Using UIKit with OpenGL Noel Llopis Snappy Touch Twitter: @snappytouch About Me iphone development full time for a year and a half. Flower Garden on the app store. Interesting

More information

OVERVIEW. Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net

OVERVIEW. Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net OVERVIEW Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net Microsoft MVP for 4 years C#, WinForms, WPF, Silverlight Joined Cynergy about

More information

View Controller Lifecycle

View Controller Lifecycle View Controller Lifecycle View Controllers have a Lifecycle A sequence of messages is sent to them as they progress through it Why does this matter? You very commonly override these methods to do certain

More information

Core Graphics and OpenGL ES. Dr. Sarah Abraham

Core Graphics and OpenGL ES. Dr. Sarah Abraham Core Graphics and OpenGL ES Dr. Sarah Abraham University of Texas at Austin CS329e Fall 2018 Core Graphics Apple s vector-drawing framework Previously known as Quartz or Quartz2D Includes handling for:

More information

Building GUIs with UIKit. Kevin Cathey

Building GUIs with UIKit. Kevin Cathey Building GUIs with UIKit Kevin Cathey Building GUIs with UIKit acm.uiuc.edu/macwarriors/devphone Building GUIs with UIKit What is UIKit? acm.uiuc.edu/macwarriors/devphone Building GUIs with UIKit What

More information

CSE 438: Mobile Application Development Lab 2: Virtual Pet App

CSE 438: Mobile Application Development Lab 2: Virtual Pet App CSE 438: Mobile Application Development Lab 2: Virtual Pet App Overview In this lab, you will create an app to take care of your very own virtual pets! The app will only have one screen and simple logic,

More information

Objective-C Primer. iphone Programmer s Association. Lorenzo Swank September 10, 2008

Objective-C Primer. iphone Programmer s Association. Lorenzo Swank September 10, 2008 Objective-C Primer iphone Programmer s Association Lorenzo Swank September 10, 2008 Disclaimer Content was blatantly and unapologetically stolen from the WWDC 2007 Fundamentals of Cocoa session, as well

More information

Advanced ios. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 20 11/01/2012

Advanced ios. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 20 11/01/2012 Advanced ios CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 20 11/01/2012 1 Goals of the Lecture Present a few additional topics and concepts related to ios programming persistence serialization

More information

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011 Developing Applications for ios Today UI Element of the Week UIToolbar ipad Split View Popover Universal (iphone + ipad) Application Demo Friday Section AVFoundation framework - Capturing and manipulating

More information

Apple introduced MapKit with ios, maps were based on Google.

Apple introduced MapKit with ios, maps were based on Google. History: Apple introduced MapKit with ios, maps were based on Google. With ios 6.0, Apple provided its own mapping service, which lacked some quality, especially level-of-detail. With ios 7 Apple opened

More information

User Experience: Windows & Views

User Experience: Windows & Views View Programming Guide for ios User Experience: Windows & Views 2010-07-07 Apple Inc. 2010 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or

More information

Assignment III: Graphing Calculator

Assignment III: Graphing Calculator Assignment III: Graphing Calculator Objective The goal of this assignment is to reuse your CalculatorBrain and CalculatorViewController objects to build a Graphing Calculator for iphone and ipad. By doing

More information

epicurious Anatomy of an ios app Robert Tolar Haining June 25, 2010 ConvergeSE

epicurious Anatomy of an ios app Robert Tolar Haining June 25, 2010 ConvergeSE epicurious Anatomy of an ios app Robert Tolar Haining June 25, 2010 ConvergeSE + = Prototype iphone ipad Why iphone apps Simplicity Control Speed Revenue Epicurious Defined as a Recipe Utility Cookbook

More information

What's New in UIKit Dynamics and Visual Effects Session 229

What's New in UIKit Dynamics and Visual Effects Session 229 App Frameworks #WWDC15 What's New in UIKit Dynamics and Visual Effects Session 229 Michael Turner UIKit Engineer David Duncan UIKit Engineer 2015 Apple Inc. All rights reserved. Redistribution or public

More information

CS193P - Lecture 3. iphone Application Development. Custom Classes Object Lifecycle Autorelease Properties

CS193P - Lecture 3. iphone Application Development. Custom Classes Object Lifecycle Autorelease Properties CS193P - Lecture 3 iphone Application Development Custom Classes Object Lifecycle Autorelease Properties 1 Announcements Assignments 1A and 1B due Wednesday 1/13 at 11:59 PM Enrolled Stanford students

More information

Designing iphone Applications

Designing iphone Applications Designing iphone Applications 4 Two Flavors of Mail 5 Organizing Content 6 Organizing Content 6 Organizing Content 6 Organizing Content 6 Organizing Content Focus on your user s data 6 Organizing Content

More information

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content View Concepts iphone Application Programming Lecture 4: User Interface Design SDK provide many types of Views to show your content At run-time Views are organized as a tree Chat Wacharamanotham Media Computing

More information

Apple Development Technology Workshops

Apple Development Technology Workshops Apple Development Technology Workshops Workshop 10 Table Views Building iphone Apps. Pt 2 Fall 2008 Hafez Rouzati Fall 2008 Zach Pousman Last Week UIViewControllers Organizing Content & Building iphone

More information

Widget Tour. iphone and ipod touch Development Fall 2009 Lecture 7

Widget Tour. iphone and ipod touch Development Fall 2009 Lecture 7 Widget Tour iphone and ipod touch Development Fall 2009 Lecture 7 Questions? Announcements Assignment #2 due Tonight by 11:59pm Today s Topics Controls Buttons Switches Sliders Segmented Controls Text

More information

Assignment III: Graphing Calculator

Assignment III: Graphing Calculator Assignment III: Graphing Calculator Objective You will enhance your Calculator to create a graph of the program the user has entered which can be zoomed in on and panned around. Your app will now work

More information

Announcement. Final Project Proposal Presentations and Updates

Announcement. Final Project Proposal Presentations and Updates Announcement Start Final Project Pitches on Wednesday Presentation slides dues by Tuesday at 11:59 PM Email slides to cse438ta@gmail.com Extensible Networking Platform 1 1 - CSE 438 Mobile Application

More information

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010 Developing Applications for iphone 4, ipod Touch, & ipad Today Blocks Language syntax for declaring a function on the fly. Grand Central Dispatch C API for leveraging blocks to make writing multithreaded

More information

Acollada ios Charting Components

Acollada ios Charting Components Acollada ios Charting Components Acollada ios Charting Components... 1 LineChartView... 3 Description... 3 Screenshot... 3 Protocols to be implemented... 3 Customizing the LineChartView aspect... 4 How

More information

Praktikum Entwicklung von Mediensystemen mit

Praktikum Entwicklung von Mediensystemen mit Praktikum Entwicklung von Mediensystemen mit Sommersemester 2013 Fabius Steinberger, Dr. Alexander De Luca Honors Degree in Technology Management at the Center for Digital Technology and Management (Barerstr.

More information

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall Stanford Developing Applications for ios Today Drag and Drop Transferring information around within and between apps. EmojiArt Demo Drag and drop an image to get our EmojiArt masterpieces started. UITableView

More information

iphone Application Programming Lecture 5: View Programming

iphone Application Programming Lecture 5: View Programming Lecture 5: View Programming Nur Al-huda Hamdan RWTH Aachen University Winter Semester 2015/2016 http://hci.rwth-aachen.de/iphone Name the UI Elements In the Screen 2 View Programming 3 View Programming

More information

Assignment III: Graphing Calculator

Assignment III: Graphing Calculator Assignment III: Graphing Calculator Objective You will enhance your Calculator to create a graph of the program the user has entered which can be zoomed in on and panned around. Your app will now work

More information

Praktikum Entwicklung von Mediensystemen mit ios

Praktikum Entwicklung von Mediensystemen mit ios Praktikum Entwicklung von Mediensystemen mit ios WS 2011 Prof. Dr. Michael Rohs michael.rohs@ifi.lmu.de MHCI Lab, LMU München Today Storyboards Automatic Reference Counting Animations Exercise 3 2 Timeline

More information

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016 Stanford Developing Applications for ios Today Memory Management for Reference Types Controlling when things leave the heap Closure Capture Closures capture things into the heap too Extensions A simple,

More information

iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department

iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department pmadden@acm.org http://optimal.cs.binghamton.edu General Outline Overview of the tools, and where to get more information

More information

Introduction to WatchKit. CS193W - Spring Lecture 1

Introduction to WatchKit. CS193W - Spring Lecture 1 Introduction to WatchKit CS193W - Spring 2016 - Lecture 1 appleᴡᴀᴛᴄʜ Released April 24, 2015 No updates to the hardware yet. Three collections, over 30 models Two sizes The Screen OLED (organic light-emitting

More information

iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin Flashlight CodeTour TouchCount CodeTour

iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin Flashlight CodeTour TouchCount CodeTour iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin 1 Legal Info iphone is a trademark of Apple Inc. Servin is a trademark of Servin Corporation 2 Welcome Welcome! Thank you! My promise

More information

CS193P - Lecture 10. iphone Application Development. Performance

CS193P - Lecture 10. iphone Application Development. Performance CS193P - Lecture 10 iphone Application Development Performance 1 Announcements 2 Announcements Paparazzi 2 is due next Wednesday at 11:59pm 2 Announcements Paparazzi 2 is due next Wednesday at 11:59pm

More information

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5 iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5 Questions? Announcements Assignment #1 due this evening by 11:59pm Remember, if you wish to use a free late you must email me before

More information

Contents. iphone Training. Industry Trainers. Classroom Training Online Training ON-DEMAND Training. Read what you need

Contents. iphone Training. Industry Trainers. Classroom Training Online Training ON-DEMAND Training. Read what you need iphone Training Contents About iphone Training Our ios training classes can help you get off to a running start in iphone, ipod and ipad app development. Learn from expert Objective-C developers with years

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015 Stanford CS193p Developing Applications for ios Interface Builder Today Demo: Viewing and Editing your custom UIViews in your storyboard (FaceView) The Happiness MVC s Model It s happiness, of course!

More information

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall Stanford Developing Applications for ios Today Mostly more Swift but some other stuff too Quick demo of mutating protocols String NSAttributedString Closures (and functions as types in general) Data Structures

More information

Assignment I Walkthrough

Assignment I Walkthrough Assignment I Walkthrough Objective Reproduce the demonstration (building a calculator) given in class. Materials By this point, you should have been sent an invitation to your sunet e-mail to join the

More information

Assignment IV: Smashtag Mentions

Assignment IV: Smashtag Mentions Assignment IV: Smashtag Mentions Objective In this assignment, you will enhance the Smashtag application that we built in class to give ready-access to hashtags, urls, images and users mentioned in a tweet.

More information

Stanford CS193p. Developing Applications for ios. Spring Stanford CS193p. Spring 2012

Stanford CS193p. Developing Applications for ios. Spring Stanford CS193p. Spring 2012 Developing Applications for ios Today Blocks Objective-C language feature for in-lining blocks of code Foundation of multi-threaded support (GCD) What is a block? A block of code (i.e. a sequence of statements

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017 Stanford Developing Applications for ios Today Timer Periodically execute a block of code Blinking FaceIt Demo Animation Animating changes to UIViews Smoother Blinking FaceIt Head-shaking FaceIt Animating

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lab 2: RPN Calculator App (1 of 3) Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Task 1 Task: Create a new application

More information

let w = UIWindow(frame: UIScreen.mainScreen().bounds)

let w = UIWindow(frame: UIScreen.mainScreen().bounds) PART I Views The things that appear in your app s interface are, ultimately, views. A view is a unit of your app that knows how to draw itself. A view also knows how to sense that the user has touched

More information

Data Delivery with Drag and Drop

Data Delivery with Drag and Drop Session App Frameworks #WWDC17 Data Delivery with Drag and Drop 227 Dave Rahardja, UIKit Tanu Singhal, UIKit 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

Intro to Native ios Development. Dave Koziol Arbormoon Software, Inc.

Intro to Native ios Development. Dave Koziol Arbormoon Software, Inc. Intro to Native ios Development Dave Koziol Arbormoon Software, Inc. About Me Long time Apple Developer (20 WWDCs) Organizer Ann Arbor CocoaHeads President & ios Developer at Arbormoon Software Inc. Wunder

More information

UICollectionView. NSCoder Milwaukee. 2 April John Psuik. Tuesday, April 2, 13

UICollectionView. NSCoder Milwaukee. 2 April John Psuik. Tuesday, April 2, 13 UICollectionView NSCoder Milwaukee 2 April 2013 John Psuik 1 UICollectionView New to ios 6 Layouts determine placement of items (flowlayout and custom layout) UITableView concepts, but you can do so much

More information

Stanford CS193p. Developing Applications for ios. Spring Stanford CS193p. Spring 2012

Stanford CS193p. Developing Applications for ios. Spring Stanford CS193p. Spring 2012 Developing Applications for ios Today Shutterbug Map Demo Final part: customizing the callout. Final Projects Requirements Some ideas from the Stanford community Persistence (time-permitting) More ways

More information

Questions. Exams: no. Get by without own Mac? Why ios? ios vs Android restrictions. Selling in App store how hard to publish? Future of Objective-C?

Questions. Exams: no. Get by without own Mac? Why ios? ios vs Android restrictions. Selling in App store how hard to publish? Future of Objective-C? Questions Exams: no Get by without own Mac? Why ios? ios vs Android restrictions Selling in App store how hard to publish? Future of Objective-C? Grading: Lab/homework: 40%, project: 40%, individual report:

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lecture 4: More Swift, Views Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Content More Swift: Inheritance Initialization

More information

ITP 342 Mobile App Dev. Interface Builder in Xcode

ITP 342 Mobile App Dev. Interface Builder in Xcode ITP 342 Mobile App Dev Interface Builder in Xcode New Project From the Main Menu, select the File à New à Project option For the template, make sure Application is selected under ios on the left-hand side

More information

ios DeCal : Lecture 2 Structure of ios Applications: MVC and Auto Layout

ios DeCal : Lecture 2 Structure of ios Applications: MVC and Auto Layout ios DeCal : Lecture 2 Structure of ios Applications: MVC and Auto Layout Overview : Today s Lecture Model View Controller Design Pattern Creating Views in Storyboard Connecting your Views to Code Auto

More information

Science. Computer Science

Science. Computer Science Introductions CS 442: Mobile App Development Michael Saelee Michael (Sae) Lee - lee@iit.edu - moss.cs.iit.edu - Office: SB 226A Agenda - Syllabus & Administrivia - Course overview Android

More information

How to...create a Video VBOX Gauge in Inkscape. So you want to create your own gauge? How about a transparent background for those text elements?

How to...create a Video VBOX Gauge in Inkscape. So you want to create your own gauge? How about a transparent background for those text elements? BASIC GAUGE CREATION The Video VBox setup software is capable of using many different image formats for gauge backgrounds, static images, or logos, including Bitmaps, JPEGs, or PNG s. When the software

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017 Stanford Developing Applications for ios Today Error Handling in Swift try Extensions A simple, powerful, but easily overused code management syntax Protocols Last (but certainly not least important) typing

More information

CS 47. Beginning iphone Application Development

CS 47. Beginning iphone Application Development CS 47 Beginning iphone Application Development Introductions Who, why, which? Shameless Plug: LoudTap Wifi Access (If it works..) SSID: Stanford Username/password: csp47guest Expectations This is a programming

More information

CUSTOM VIEWS. The View Hierarchy. Chapter 12

CUSTOM VIEWS. The View Hierarchy. Chapter 12 Chapter 12 CUSTOM VIEWS A ll the visible objects in an application are either windows or views. In this chapter, you will create a subclass of NSView. From time to time, you will create a custom view to

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lecture 7: View Controller Lifecycle and UIKit Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Content View Controller

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015 Stanford CS193p Developing Applications for ios Today UITextField Bonus Topic! Table View A UIView for displaying long lists or tables of data UITextField Like UILabel, but editable Typing things in on

More information

Today s Topics. Scroll views Table views. UITableViewController Table view cells. Displaying data Controlling appearance & behavior

Today s Topics. Scroll views Table views. UITableViewController Table view cells. Displaying data Controlling appearance & behavior Today s Topics Scroll views Table views Displaying data Controlling appearance & behavior UITableViewController Table view cells Scroll Views UIScrollView For displaying more content than can fit on the

More information

CS193E Lecture 7. Document-based Applications NSTableView Key-Value Coding

CS193E Lecture 7. Document-based Applications NSTableView Key-Value Coding CS193E Lecture 7 Document-based Applications NSTableView Key-Value Coding Agenda Questions? Review: delegates, MVC Document-based apps Table views Key Value Coding Model, View, Controller Controller Model

More information

Mobile Application Programming. Controls

Mobile Application Programming. Controls Mobile Application Programming Controls Views UIView instances and subclasses Form a tree rooted at the window Have a backing store of pixels that are drawn seldomly, then composited to form the full user

More information

ios Mobile Development

ios Mobile Development ios Mobile Development Today UITextView Scrollable, editable/selectable view of a mutable attributed string. View Controller Lifecycle Finding out what s happening as a VC is created, hooked up to the

More information

Structuring an App Copyright 2013 Apple Inc. All Rights Reserved.

Structuring an App Copyright 2013 Apple Inc. All Rights Reserved. Structuring an App App Development Process (page 30) Designing a User Interface (page 36) Defining the Interaction (page 42) Tutorial: Storyboards (page 47) 29 App Development Process Although the task

More information

Announcements. Today s Topics

Announcements. Today s Topics Announcements Lab 2 is due tonight by 11:59 PM Late policy is 10% of lab total per day late So -7.5 points per day late for lab 2 Labs 3 and 4 are posted on the course website Extensible Networking Platform

More information

EXERCISES RELATED TO ios PROGRAMMING

EXERCISES RELATED TO ios PROGRAMMING EXERCISES RELATED TO ios PROGRAMMING Kari Laitinen http://www.naturalprogramming.com 2017-08-30 File created. 2017-09-21 Last modification. 1 Kari Laitinen EXERCISES WITH PROGRAM Animals.swift With these

More information

Lecture 5 Demo Code: FaceIt MVC and Gestures

Lecture 5 Demo Code: FaceIt MVC and Gestures Lecture 5 Demo Code: FaceIt MVC and Gestures Objective Included below is the source code for the demo in lecture. It is provided under the same Creative Commons licensing as the rest of CS193p s course

More information

Announcements. Today s Topics

Announcements. Today s Topics Announcements Lab 2 is due tonight Lab 3 is posted Due next Wednesday Sept 30 th 1 Extensible - CSE 436 Software Networking Engineering Platform Workshop 1 Today s Topics Designing iphone Applica;ons Model-

More information

iphone Application Tutorial

iphone Application Tutorial iphone Application Tutorial 2008-06-09 Apple Inc. 2008 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any

More information

Review. iphone Application Programming Lecture 2: Objective-C, Cocoa. History. Objective-C. Device restrictions. Interaction paradigm changes

Review. iphone Application Programming Lecture 2: Objective-C, Cocoa. History. Objective-C. Device restrictions. Interaction paradigm changes Review iphone Application Programming Lecture 2: Objective-C, Cocoa Device restrictions Gero Herkenrath Media Computing Group RWTH Aachen University Winter Semester 2013/2014 http://hci.rwth-aachen.de/iphone

More information

Praktikum Entwicklung von Mediensystemen mit ios

Praktikum Entwicklung von Mediensystemen mit ios Praktikum Entwicklung von Mediensystemen mit ios SS 2012 Prof. Dr. Michael Rohs michael.rohs@ifi.lmu.de MHCI Lab, LMU München Today Animations Prototyping 2 Timeline # Date Topic 19.4. Introduction & Brainstorming

More information