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

Size: px
Start display at page:

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

Transcription

1 UICollectionView NSCoder Milwaukee 2 April 2013 John Psuik 1

2 UICollectionView New to ios 6 Layouts determine placement of items (flowlayout and custom layout) UITableView concepts, but you can do so much more... Displaying a simple column... All images used without permission of any kind. 2

3 UICollectionView New to ios 6 Layouts determine placement of items (flowlayout and custom layout) UITableView concepts, but you can do so much more... Displaying a simple column, row... 3

4 UICollectionView New to ios 6 Layouts determine placement of items (flowlayout and custom layout) UITableView concepts, but you can do so much more... Displaying a simple column, row, or grid This example requires very little code 4

5 UICollectionView It doesn t take much more to do something like this... 5

6 UICollectionView It doesn t take much more to do something like this... or this. 6

7 UICollectionView It doesn t take much more to do something like this... or this. Use your imagination to create any layout you wish 7

8 Getting Started Similarities to UITableView UICollectionView UICollectionViewCell UICollectionViewDelegate UICollectionViewDataSource UICollectionViewFlowLayout Concrete class that handles grid, column, row layouts. Very simple to use. UICollectionViewLayout Subclass this abstract base class to create your own layouts. Can become quite complex, but doesn t have to be. 8

9 Additional Features Supplementary Views Optional Data driven views Similar to header/footer views in UITableView Not selectable by user Decoration Views Like the name implies, visual adornments Think thumbtack on a picture Not selectable by user 9

10 What is a layout? A layout is used to specify the location of all cells, decoration views and supplementary views. The layout ONLY provides the positioning and size of the items, it doesn t create the views. A layout works with UICollectionViewLayoutAttributes supplied for each item to define the position, size, visibility, z-index as well as a 3D transform. For basic grids or vertical/horizontal list scroll views, the UICollectionViewFlowLayout handles much of this for you. 10

11 Let s start with the cell Nothing fancy here, simply adding an image to the cell (to it s MyCollectionViewCell () // derives from (nonatomic, strong) MyCollectionViewCell - (id)initwithframe:(cgrect)frame if (!(self = [super initwithframe:frame])) return nil; CGRect imagerect = CGRectInset (CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame)), 5, 5); self.imageview = [[UIImageView alloc] initwithframe:imagerect]; self.imageview.autoresizingmask = UIViewAutoresizingFlexibleHeight UIViewAutoresizingFlexibleWidth; [self.contentview addsubview:self.imageview]; self.backgroundcolor = [UIColor whitecolor]; return self; -(void)prepareforreuse // cleanup for cell reuse [self setimage:nil]; 11

12 Cell views/selection/highlighting Properties similar to UITableViewCell contentview Read-only. Add custom subviews to this view. backgroundview Optional, automatically sized and placed behind content view. selectedbackgroundview Optional view, displayed when cell is selected. highlighted and selected states Cells are retrieved for use by registering the class or nib file containing your cell then calling dequeuereusablecellwithreuseidentifier 12

13 Cell views/selection/highlighting Properties similar to UITableViewCell contentview Read-only. Add custom subviews to this view. backgroundview Optional, automatically sized and placed behind content view. selectedbackgroundview Optional view, displayed when cell is selected. highlighted and selected states Cells are retrieved for use by registering the class or nib file containing your cell then calling dequeuereusablecellwithreuseide ntifier 13

14 Using the UICollectionViewFlowLayout The flow layout does most of the hard work in implementing a grid or scrolling column/row. We only need to specify the cell size, spacing and MyCollectionViewFlowLargeLayout if (!(self = [super init])) return nil; self.itemsize = CGSizeMake (130, 130); self.sectioninset = UIEdgeInsetsMake (10, 10, 10, 10); self.minimuminteritemspacing = 10; self.minimumlinespacing = 10; self.scrolldirection = UICollectionViewScrollDirectionVertical; /* specify sizes for header and footer views if not set, headers and footers will not be visible self.headerreferencesize = CGSizeMake (width, height); self.footerreferencesize = CGSizeMake (width, height); */ return 14

15 Creating your UICollectionView static NSString MyViewController -(void)loadview self.largelayout = [[MyCollectionViewFlowLayout alloc] init]; self.sinelayout = [[SineLayout alloc] init]; // specify the initial layout when creating // you may change the layout at anytime self.collectionview = [[UICollectionView alloc] initwithframe:cgrectzero collectionviewlayout:self.smalllayout]; // register your reusable cell. Can also use registernib... [self.collectionview registerclass:[mycollectionviewcell class] forcellwithreuseidentifier:itemreuseidentifier]; // standard stuff just like UITableView self.collectionview.delegate = self; self.collectionview.datasource = self; self.collectionview.indicatorstyle = UIScrollViewIndicatorStyleWhite; 15

16 Data Source & Delegate Methods Again, very similar to working with UITableView // this is all that s needed in the data source and delegate to generate // the views shown in the previous screen shots // the slightly more complex layouts of the circle and sine wave // are handled all within the layouts. these methods remain untouched. -(NSInteger)collectionView:(UICollectionView *)collectionview numberofitemsinsection:(nsinteger)section return 200; -(UICollectionViewCell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath // a cell will automatically be created if necessary // remember, we registered the cell class earlier MyCollectionViewCell *cell = (AFCollectionViewCell *) [collectionview dequeuereusablecellwithreuseidentifier:itemreuseidentifier forindexpath:indexpath]; [cell setimage:[uiimage imagenamed: [NSString stringwithformat:@"meetup%d.jpg", indexpath.item % 14]]]; return cell; 16

17 UICollectionViewDelegateFlowLayout Let s see what else we can do with the flow layout // UICollectionViewDelegateFlowLayout // we'll override the size specified in our own flow layouts - (CGSize)collectionView:(UICollectionView *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout sizeforitematindexpath:(nsindexpath *)indexpath CGFloat squaresize = (indexpath.item + 2) * 8; CGSize itemsize = CGSizeMake(squareSize, squaresize); return itemsize; - (UIEdgeInsets)collectionView:(UICollectionView *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout insetforsectionatindex:(nsinteger)section return UIEdgeInsetsMake(3, 3, 3, 3); 17

18 The results - (CGSize)collectionView:(UICollectionView *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout sizeforitematindexpath:(nsindexpath *)indexpath CGFloat squaresize = (indexpath.item + 2) * 8; CGSize itemsize = CGSizeMake(squareSize, squaresize); return itemsize; - (UIEdgeInsets)collectionView:(UICollectionView *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout insetforsectionatindex:(nsinteger)section return UIEdgeInsetsMake(3, 3, 3, 3); 18

19 Adding a header/supplementary view. UICollectionReusableView FYI: UICollectionViewCell is a specialized subclass of UICollectionReusableView // this is a subclass of MyHeaderView - (id)initwithframe:(cgrect)frame self = [super initwithframe:frame]; if (!self) return nil; UIImageView* iv = [[UIImageView alloc]initwithimage: [UIImage imagenamed:@"meetuplogo.png"]]; iv.contentmode = UIViewContentModeCenter; iv.frame = CGRectMake (0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame)); iv.autoresizingmask = UIViewAutoresizingFlexibleWidth UIViewAutoresizingFlexibleHeight; [self addsubview:iv]; return self; 19

20 Supplementary View Register our header view for reuse // in the view controller // define a reuse identifier for our header static NSString * MySectionTitleReuseId -(void)loadview //... do stuff here... // register our supplementary view (section title/header) // this is needed for reuse // myheaderview is a subclass of UICollectionReusableView // UICollectionElementKindSectionHeader specifies type // MySectionTitleReuseId is the reuse identifier [self.collectionview registerclass:[myheaderview class] forsupplementaryviewofkind:uicollectionelementkindsectionheader withreuseidentifier:mysectiontitlereuseid]; 20

21 Supplementary View Dequeueing the section header view // UICollectionViewDataSource method - (UICollectionReusableView *)collectionview:(uicollectionview *)collectionview viewforsupplementaryelementofkind:(nsstring *)kind atindexpath:(nsindexpath *)indexpath // since we're using only one section, we don't need to handle // the case of supplying different headers per section if (![kind isequaltostring:uicollectionelementkindsectionheader]) return nil; MyHeaderView* headerview = [collectionview dequeuereusablesupplementaryviewofkind:uicollectionelementkindsectionheader withreuseidentifier:mysectiontitlereuseid forindexpath:indexpath]; return headerview; 21

22 Supplementary View Customizing the look of the header via transform // apply a transform to the item // using it's MyCollectionViewFlowSmallLayout -(NSArray *)layoutattributesforelementsinrect:(cgrect)rect // grab the current layout attributes for every item NSArray* attributesarray = [super layoutattributesforelementsinrect:rect]; for (UICollectionViewLayoutAttributes* attr in attributesarray) // is this the header item? if ([attr.representedelementkind isequaltostring: UICollectionElementKindSectionHeader]) // apply some transform to it attr.transform3d = CATransform3DMakeRotation(0.8, 10, 0, 3); return attributesarray; 22

23 Supplementary View Results! Note: The supplementary views will scroll with the content. It is possible, though not trivial to keep the header in place by further customizing your layout. (it felt like a real hack trying to do that) Header and Footer sizing is limited by the scrolling direction. For a vertically scrolling view only the height will be honored, the width is fixed. 23

24 Custom anything-goes layouts The collection view simply asks it s current layout where things should go. It s up to you to supply all of the info. 24

25 Sine wave layout Base class UICollectionViewLayout...Means we need to do all of the work. Not really that difficult though. SineLayout : UICollectionViewLayout #define ITEM_SIZE 60 #define PADDING_SIZE SineLayout - (UICollectionViewLayoutAttributes *)layoutattributesforitematindexpath:(nsindexpath *)path // sine wave layout UICollectionViewLayoutAttributes* attributes = [UICollectionViewLayoutAttributes layoutattributesforcellwithindexpath:path]; attributes.size = CGSizeMake(ITEM_SIZE, ITEM_SIZE); CGSize size = self.collectionview.frame.size; CGFloat availwidth = size.width - (PADDING_SIZE * 2) - ITEM_SIZE; CGFloat xoffset = PADDING_SIZE + ITEM_SIZE / 2.0; // divide display width into units CGFloat unitwidth = availwidth / (float)self.cellcount ; CGFloat xcenter = xoffset + ((float)path.item * unitwidth) + unitwidth / 2.0; CGFloat ycenter = self.center.y - sinf(xcenter * 2.0 * M_PI / availwidth) * (float)((size.height - ITEM_SIZE - PADDING_SIZE) / 2.0); attributes.center = CGPointMake(xCenter, ycenter); CGFloat angle = M_PI / 12.0 * (float)path.item; attributes.transform3d = CATransform3DMakeRotation(angle, 0, 0, 1.0); return attributes; 25

26 Sine wave layout Base class UICollectionViewLayout And that s pretty much all that s needed for basic customization! // create an array of layout attributes for all of the items visible in the view // in this case it s not checking to see if the items are in bounds, but for performance // with a large number of items it s best to only include those items that are visible -(NSArray*)layoutAttributesForElementsInRect:(CGRect)rect NSMutableArray* attributes = [NSMutableArray array]; for (NSInteger i = 0; i < self.cellcount; i++) NSIndexPath* indexpath = [NSIndexPath indexpathforitem:i insection:0]; UICollectionViewLayoutAttributes* attributesforitem = [self layoutattributesforitematindexpath:indexpath]; [attributes addobject:attributesforitem]; return attributes; 26

27 UICollectionViewLayout Overview of the methods to implement collectionviewcontentsize used to determine whether scrolling will be enabled (vs the view size) layoutattributesforelementsinrect: Called to retrieve an array of the layout attributes for all visible items layoutattributesforitematindexpath: Called for every item/element to retrieve it s size, visibility, location layoutattributesforsupplementaryviewofkind:atindexpath: Used in conjunction with header/footer supplementary views layoutattributesfordecorationviewofkind:atindexpath: Used with decoration views 27

28 UICollectionViewLayout Overview of the methods to implement Handling item insertions/deletions (animations) initiallayoutattributesforappearingitematindexpath: Think of this as the initial animation position for an item that will be added to the collection view initiallayoutattributesforappearingsupplementary/ DecorationElementOfKind:atIndexPath: Same as above but for supplementary/decoration views finallayoutattributesfordisappearingitematindexpath: The final layout and display attributes for an item being removed from the collection view. It will be animated to that position. Think along the lines of tossing something into a trash can/fading out. finallayoutattributesfordisappearingsupplementary/ DecorationElementOfKind:atIndexPath: Again, same as above but for supplementary/decoration views And there s more, but much of what remains is similar to UITableView 28

29 Support for < ios 6.0 See PSTCollectionView (support for ios 4.3 and later) PSTCollectionView 29

30 Other stuff More channels for dev info/collaboration IRC channels: #iphonedev #devmke #parse you ll find me online as PinkRunner Somewhat new to ios? raywenderlich.com for tutorials. stackoverflow.com is a great resource. Apple dev site: WWDC videos and forums 30

31 NSCoder Milwaukee Thank you for the opportunity to present Great to see such a large group! Reach out to others in the group for help Invite your friends to join the next meetup! I need a beer 31

INTRODUCTION TO COLLECTION VIEWS

INTRODUCTION TO COLLECTION VIEWS INTRODUCTION TO COLLECTION VIEWS Using MonoTouch and C# Mike Bluestein Xamarin 11/7/2012 MONOTOUCH Platform for creating ios application with C# from Xamarin Bindings to native APIs Reuse of C# code and

More information

Collection Views. Dr. Sarah Abraham

Collection Views. Dr. Sarah Abraham Collection Views Dr. Sarah Abraham University of Texas at Austin CS329e Fall 2016 What is a Collection View? Presents an ordered set of data items in a flexible layout Subclass of UIScrollView (like UITableView)

More information

ITP 342 Mobile App Dev. Collection View

ITP 342 Mobile App Dev. Collection View ITP 342 Mobile App Dev Collection View Collection View A collection view manages an ordered collection of items and presents them in a customizable layout. A collection view: Can contain optional views

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

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

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

ptg

ptg ios UICollectionView: The Complete Guide Second Edition Addison-Wesley Mobile Programming Series Visit informit.com/mobile for a complete list of available publications. The Addison-Wesley Mobile Programming

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

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

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

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

What s New in NSCollectionView Session 225

What s New in NSCollectionView Session 225 App Frameworks #WWDC15 What s New in NSCollectionView Session 225 Troy Stephens Application Frameworks Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

Naviga&on and Tab Bar Controllers and Table View

Naviga&on and Tab Bar Controllers and Table View Naviga&on and Tab Bar Controllers and Table View UINaviga)onController Stack of view controllers Naviga)on bar How It Fits Together Top view controller s view Top view controller s )tle Previous view controller

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

ios UICollectionView: The Complete Guide Second Edition

ios UICollectionView: The Complete Guide Second Edition ios UICollectionView: The Complete Guide Second Edition Addison-Wesley Mobile Programming Series Visit informit.com/mobile for a complete list of available publications. The Addison-Wesley Mobile Programming

More information

Phone. Making a phone call within app ( and returning to app after call ends ) is as easy as :

Phone. Making a phone call within app ( and returning to app after call ends ) is as easy as : Phone Making a phone call within app ( and returning to app after call ends ) is as easy as : -(void)makecall { UIApplication *application = [UIApplication sharedapplication]; NSURL *URL = [NSURL URLWithString:

More information

ITP 342 Mobile App Dev. Table Views

ITP 342 Mobile App Dev. Table Views ITP 342 Mobile App Dev Table Views Table Views The most common mechanism used to display lists of data to the user Highly configurable objects that can be made to look practically any way you want them

More information

Generic Programming with Protocol in Swift. ios

Generic Programming with Protocol in Swift. ios Generic Programming with Protocol in Swift ios Generic Programming with Protocol in Swift ios func swapint(inout a: Int, inout _ b: Int) { let tmp = a a = b b = tmp var someint = 1 var anotherint = 5

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

Social Pinboard: ios(swift) Application

Social Pinboard: ios(swift) Application Social Pinboard: ios(swift) Application Document Version 1.0.1 Date: 15 th May, 2015 2 [SOCIAL PINBOARD: APP DOCUMENTATION] Important Notes:... 5 AppDelegate Class Reference... 6 Tasks... 6 Instance Methods...

More information

AdFalcon ios Native Ad SDK Developer's Guide. AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group

AdFalcon ios Native Ad SDK Developer's Guide. AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group AdFalcon ios Native Ad SDK 3.1.0 Developer's Guide AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group Table of Contents 1 Introduction... 4 Native Ads Overview... 4 OS version support...

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

Mobile Development - Lab 2

Mobile Development - Lab 2 Mobile Development - Lab 2 Objectives Illustrate the delegation mechanism through examples Use a simple Web service Show how to simply make a hybrid app Display data with a grid layout Delegation pattern

More information

ITP 342 Mobile App Dev. Table Views

ITP 342 Mobile App Dev. Table Views ITP 342 Mobile App Dev Table Views Tables A table presents data as a scrolling, singlecolumn list of rows that can be divided into sections or groups. Use a table to display large or small amounts of information

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

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

ios Mobile Development

ios Mobile Development ios Mobile Development Today UITableView! Data source-driven vertical list of views.! ipad! Device-specific UI idioms.! Demo! Shutterbug UITableView Very important class for displaying data in a table!

More information

Scroll View School Hands-On Challenges

Scroll View School Hands-On Challenges Scroll View School Hands-On Challenges Copyright 2014 Razeware LLC. All rights reserved. No part of this book or corresponding materials (such as text, images, or source code) may be reproduced or distributed

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

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

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

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

IPHONE DEVELOPMENT. Getting Started with the iphone SDK

IPHONE DEVELOPMENT. Getting Started with the iphone SDK IPHONE DEVELOPMENT Getting Started with the iphone SDK OBJECTIVE-C The Big Picture STRICT SUPERSET OF C The Objective C Language Any C stuff applies Standard libs are here (time, sqrt etc) The C Language

More information

Introductory ios Development

Introductory ios Development Introductory ios Development 152-164 Unit 5 - Multi-View Apps Quick Links & Text References What is a Delegate? What is a Protocol? Delegates, Protocols and TableViews Creating a Master-Detail App Modifying

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

Objective-C. Deck.m. Deck.h. Let s look at another class. This one represents a deck of cards. #import <Foundation/Foundation.h> #import "Deck.

Objective-C. Deck.m. Deck.h. Let s look at another class. This one represents a deck of cards. #import <Foundation/Foundation.h> #import Deck. Deck.h #import @interface Deck : NSObject @interface Deck() @implementation Deck Deck.m Let s look at another class. This one represents a deck of cards. Deck.h #import

More information

CS193p Spring 2010 Monday, April 12, 2010

CS193p Spring 2010 Monday, April 12, 2010 CS193p Spring 2010 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

More information

COMPLETE TUTORIAL COURSE. Learn to make tvos LE. apps with real-worldam S F

COMPLETE TUTORIAL COURSE. Learn to make tvos LE. apps with real-worldam S F HACKING WITH SWIFT COMPLETE TUTORIAL COURSE Learn to make tvos LE P apps with real-worldam S Swift projects REEPaul Hudson F Project 1 Randomly Beautiful 2 www.hackingwithswift.com Setting up In this first

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

Guide - The limitations in screen layout using the Item Placement Tool

Guide - The limitations in screen layout using the Item Placement Tool Guide - The limitations in screen layout using the Item Placement Tool 1/8 Guide - The limitations in screen layout using the Item Placement Tool I the B1 Usability Package we have the Item Placement Tool

More information

QUICK EXCEL TUTORIAL. The Very Basics

QUICK EXCEL TUTORIAL. The Very Basics QUICK EXCEL TUTORIAL The Very Basics You Are Here. Titles & Column Headers Merging Cells Text Alignment When we work on spread sheets we often need to have a title and/or header clearly visible. Merge

More information

Mobile Application Development

Mobile Application Development Mobile Application Development Lecture 13 Introduction to ObjectiveC Part II 2013/2014 Parma Università degli Studi di Parma Lecture Summary Object creation Memory management Automatic Reference Counting

More information

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document. 1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document. 2. W3Schools has a lovely html tutorial here (it s worth the time): http://www.w3schools.com/html/default.asp

More information

View Controller Advancements for ios8

View Controller Advancements for ios8 Frameworks #WWDC14 View Controller Advancements for ios8 Session 214 Bruce D. Nilo Manager, UIKit Fundamentals 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without

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

ORB Education Quality Teaching Resources

ORB Education Quality Teaching Resources These basic resources aim to keep things simple and avoid HTML and CSS completely, whilst helping familiarise students with what can be a daunting interface. The final websites will not demonstrate best

More information

VET DENTAL REPORT CREATION IN WORD

VET DENTAL REPORT CREATION IN WORD PLEASE NOTE: Create a separate report for each patient and send each individual, compressed.docx file to me. These reports are all stored to be retrievable by Mission and Patient name, and so cannot be

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

OpenCanvas 1.1 Networking Tutorial

OpenCanvas 1.1 Networking Tutorial OpenCanvas 1.1 Networking Tutorial Author : kainnero@yahoo.com KainNeroHiryuuStrife / KainNero / MaverickDragoon / Nirakone etc. Date Written : 2005 / April / 29 Disclaimer : OpenCanvas belongs to and

More information

Data IAP 2010 iphonedev.csail.mit.edu edward benson / Thursday, January 14, 2010

Data IAP 2010 iphonedev.csail.mit.edu edward benson / Thursday, January 14, 2010 Data IAP 2010 iphonedev.csail.mit.edu edward benson / eob@csail.mit.edu Today Property Lists User Defaults Settings Panels CoreData Property Lists Today Add persistence. plist 1. Using Property Lists in

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

Mobile Application Programming. Layout Techniques

Mobile Application Programming. Layout Techniques Mobile Application Programming Layout Techniques Legend View Controller Containers & Content Window Container View Content View View Property View Controller Reference Delegate Root View Header View Add

More information

ios Developer s Guide Version 1.0

ios Developer s Guide Version 1.0 HealthyFROGS ios Developer s Guide ios Developer s Guide Version 1.0 Tuesday May 7, 2013 2012-2013 Computer Science Department, Texas Christian University - All Rights Reserved HealthyFROGS ios Developer

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

Copyright. For more information, please read the Disclosures and Disclaimers section at the end of this ebook. First PDF Edition, February 2013

Copyright. For more information, please read the Disclosures and Disclaimers section at the end of this ebook. First PDF Edition, February 2013 Copyright This ebook is Copyright 2013 Teresa Miller (the Author ). All Rights Reserved. Published in the United States of America. The legal notices, disclosures, and disclaimers in the front and back

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

Mastering UIKit on tvos

Mastering UIKit on tvos App Frameworks #WWDC16 Mastering UIKit on tvos Session 210 Justin Voss UIKit Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from

More information

View Controllers CPRE 388

View Controllers CPRE 388 View Controllers CPRE 388 View Controllers Manage views in model view controller design template. Many types: custom view controller; container view controller; modal view controller. Custom View controllers

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

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

MS Word Professional Document Alignment

MS Word Professional Document Alignment MS Word Professional Document Alignment Table of Contents CHARACTER VS. PARAGRAPH FORMATTING...5 Character formatting...5 Paragraph Formatting...5 USING SHOW/HIDE TO REVEAL NON-PRINTING CHARACTERS...5

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

Objective-C. Stanford CS193p Fall 2013

Objective-C. Stanford CS193p Fall 2013 New language to learn! Strict superset of C Adds syntax for classes, methods, etc. A few things to think differently about (e.g. properties, dynamic binding) Most important concept to understand today:

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

LESSONS LEARNED. SWIFT. Dagna Bieda, 7th April 2016

LESSONS LEARNED. SWIFT. Dagna Bieda, 7th April 2016 LESSONS LEARNED. SWIFT Dagna Bieda, 7th April 2016 SWIFT & XCODE Brief Intro Language that essentially marries the readability of Python with the speed of C++. @jeremyconkin SWIFT mix of good practices

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

Porting Objective-C to Swift. Richard Ekle

Porting Objective-C to Swift. Richard Ekle Porting Objective-C to Swift Richard Ekle rick@ekle.org Why do we need this? 1.2 million apps in the ios App Store http://www.statista.com/statistics/276623/numberof-apps-available-in-leading-app-stores/

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

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

SciGraphica. Tutorial Manual - Tutorials 1and 2 Version 0.8.0

SciGraphica. Tutorial Manual - Tutorials 1and 2 Version 0.8.0 SciGraphica Tutorial Manual - Tutorials 1and 2 Version 0.8.0 Copyright (c) 2001 the SciGraphica documentation group Permission is granted to copy, distribute and/or modify this document under the terms

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

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

Cognos. Active Reports Development. Presented by: Craig Randell

Cognos. Active Reports Development. Presented by: Craig Randell Cognos Active Reports Development Presented by: Craig Randell Objectives: Understand the purpose and benefits of Active Reports Through theory and demonstration introduce the different Active Report Components

More information

When we re first learning Cocoa (or Java, or Qt, or any other application framework),

When we re first learning Cocoa (or Java, or Qt, or any other application framework), MacDevCenter http://www.macdevcenter.com/lpt/a/4752 6 April 2004 The Cocoa Controller Layer by Michael Beam When we re first learning Cocoa (or Java, or Qt, or any other application framework), one of

More information

Building Apps with Dynamic Type

Building Apps with Dynamic Type Session App Frameworks #WWDC17 Building Apps with Dynamic Type 245 Clare Kasemset, Software Engineering Manager Nandini Sundar, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or

More information

Magazine-style websites often have lots of small items on a page. First you re going to create a heading and background for your magazine.

Magazine-style websites often have lots of small items on a page. First you re going to create a heading and background for your magazine. Magazine Introduction In this project, you ll learn how to use HTML and CSS to create a multi-page magazine website with a two page layout. You ll also revisit lots of HTML and CSS techiques from other

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

Azon Master Class. By Ryan Stevenson Guidebook #7 Site Construction 2/3

Azon Master Class. By Ryan Stevenson   Guidebook #7 Site Construction 2/3 Azon Master Class By Ryan Stevenson https://ryanstevensonplugins.com/ Guidebook #7 Site Construction 2/3 Table of Contents 1. Creation of Site Pages 2. Category Pages Creation 3. Home Page Creation Creation

More information

My First iphone App. 1. Tutorial Overview

My First iphone App. 1. Tutorial Overview My First iphone App 1. Tutorial Overview In this tutorial, you re going to create a very simple application on the iphone or ipod Touch. It has a text field, a label, and a button. You can type your name

More information

Filling Space with Random Line Segments

Filling Space with Random Line Segments Filling Space with Random Line Segments John Shier Abstract. The use of a nonintersecting random search algorithm with objects having zero width ("measure zero") is explored. The line length in the units

More information

Clickteam Fusion 2.5 Creating a Debug System - Guide

Clickteam Fusion 2.5 Creating a Debug System - Guide INTRODUCTION In this guide, we will look at how to create your own 'debug' system in Fusion 2.5. Sometimes when you're developing and testing a game, you want to see some of the real-time values of certain

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

Excel Basics Fall 2016

Excel Basics Fall 2016 If you have never worked with Excel, it can be a little confusing at first. When you open Excel, you are faced with various toolbars and menus and a big, empty grid. So what do you do with it? The great

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

AGENT123. Full Q&A and Tutorials Table of Contents. Website IDX Agent Gallery Step-by-Step Tutorials

AGENT123. Full Q&A and Tutorials Table of Contents. Website IDX Agent Gallery Step-by-Step Tutorials AGENT123 Full Q&A and Tutorials Table of Contents Website IDX Agent Gallery Step-by-Step Tutorials WEBSITE General 1. How do I log into my website? 2. How do I change the Meta Tags on my website? 3. How

More information

The first thing we ll need is some numbers. I m going to use the set of times and drug concentration levels in a patient s bloodstream given below.

The first thing we ll need is some numbers. I m going to use the set of times and drug concentration levels in a patient s bloodstream given below. Graphing in Excel featuring Excel 2007 1 A spreadsheet can be a powerful tool for analyzing and graphing data, but it works completely differently from the graphing calculator that you re used to. If you

More information

Lutheran High North Technology The Finder

Lutheran High North Technology  The Finder Lutheran High North Technology shanarussell@lutheranhighnorth.org www.lutheranhighnorth.org/technology The Finder Your Mac s filing system is called the finder. In this document, we will explore different

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

Bindings Example Exercise James Dempsey - WWDC Pre-Show Cocoa Workshop

Bindings Example Exercise James Dempsey - WWDC Pre-Show Cocoa Workshop Bindings Example Exercise James Dempsey - WWDC Pre-Show Cocoa Workshop In this exercise you will create a basic document-based application using Cocoa Bindings. This application will allow the user to

More information

Integrating Game Center into a BuzzTouch 1.5 app

Integrating Game Center into a BuzzTouch 1.5 app into a BuzzTouch 1.5 app This tutorial assumes you have created your app and downloaded the source code; created an App ID in the ios Provisioning Portal, and registered your app in itunes Connect. Step

More information

Table Basics. The structure of an table

Table Basics. The structure of an table TABLE -FRAMESET Table Basics A table is a grid of rows and columns that intersect to form cells. Two different types of cells exist: Table cell that contains data, is created with the A cell that

More information

Why Model-View-Controller?

Why Model-View-Controller? View Controllers Why Model-View-Controller? Ever used the word spaghetti to describe code? Clear responsibilities make things easier to maintain Avoid having one monster class that does everything Why

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

Introduction to Excel

Introduction to Excel Introduction to Excel Written by Jon Agnone Center for Social Science Computation & Research 145 Savery Hall University of Washington Seattle WA 98195 U.S.A. (206)543-8110 November 2004 http://julius.csscr.washington.edu/pdf/excel.pdf

More information

Learn to make desktop LE

Learn to make desktop LE HACKING WITH SWIFT COMPLETE TUTORIAL COURSE Learn to make desktop LE P apps with real-worldam S Swift projects REEPaul Hudson F Project 1 Storm Viewer Get started coding in Swift by making an image viewer

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

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lab 10: Nearby Deals (6 of 6) Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Task 1 Task: Save the favorite deals

More information

The Stack, Free Store, and Global Namespace

The Stack, Free Store, and Global Namespace Pointers This tutorial is my attempt at clarifying pointers for anyone still confused about them. Pointers are notoriously hard to grasp, so I thought I'd take a shot at explaining them. The more information

More information

FLIR Tools+ and Report Studio

FLIR Tools+ and Report Studio Creating and Processing Word Templates http://www.infraredtraining.com 09-20-2017 2017, Infrared Training Center. 1 FLIR Report Studio Overview Report Studio is a Microsoft Word Reporting module that is

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