ios Application Development Lecture 5: Protocols, Extensions,TabBar an Scroll Views

Size: px
Start display at page:

Download "ios Application Development Lecture 5: Protocols, Extensions,TabBar an Scroll Views"

Transcription

1 ios Application Development Lecture 5: Protocols, Extensions,TabBar an Scroll Views Dr. Simon Völker & Philipp Wacker Media Computing Group RWTH Aachen University Winter Semester 2017/2018

2 Swift Protocols and Extensions 2

3 Protocols A protocols defines a blueprint of methods, properties and other requirements Protocols can be adopted by another type that implements these requirements Swift utilizes many protocols such as: CustomStringConvertible Equatable Comparable 3

4 CustomStringConvertible let string = "Hello, world!" print(string) // Output: Hello, world! let number = 42 print(number) // Output: 42 let boolean = false print(boolean) // Output: false 4

5 CustomStringConvertible class Shoe { let color: String let size: Int let haslaces: Bool let myshoe = Shoe(color: "Black", size: 12, haslaces: true) let yourshoe = Shoe(color: "Red", size: 8, haslaces: false) init(color: String, size: Int, haslaces: Bool) { self.color = color self.size = size self.haslaces = haslaces print(myshoe) // Output: Shoe print(yourshoe) // Output: Shoe 5

6 CustomStringConvertible class Shoe : CustomStringConvertible { let color: String let size: Int let haslaces: Bool init(color: String, size: Int, haslaces: Bool) { self.color = color self.size = size self.haslaces = haslaces var description: String { return "Shoe(color: \(color), size: \(size), haslaces: \(haslaces))" let myshoe = Shoe(color: "Black", size: 12, haslaces: true) let yourshoe = Shoe(color: "Red", size: 8, haslaces: false) print(myshoe) // Output: Shoe(color: Black, size: 12, haslaces: true) print(yourshoe) // Output: Shoe(color: Red, size: 8, haslaces: false) 6

7 Equatable struct Employee { var firstname: String var lastname: String var jobtitle: String var phonenumber: String let employeea = Employee(...) let employeeb = Employee(...) if employeeb == employeea { // Do Something else { // Do Something else 7

8 Equatable struct Employee : Equatable { var firstname: String var lastname: String var jobtitle: String var phonenumber: String static func ==(lhs: Employee, rhs: Employee) -> Bool { return lhs.firstname == rhs.firstname && lhs.lastname == rhs.lastname && lhs.companyid == rhs.companyid let employeea = Employee(...) let employeeb = Employee(...) if employeeb == employeea { // Do Something else { // Do Something else 8

9 Comparable struct Employee { var firstname: String var lastname: String var jobtitle: String var phonenumber: String let employees = [employee1, employee2, employee3, employee4, employee5] let sortedemployees = employees.sorted(by: <) static func ==(lhs: Employee, rhs: Employee) -> Bool { return lhs.firstname == rhs.firstname && lhs.lastname == rhs.lastname && lhs.companyid == rhs.companyid 9

10 Comparable struct Employee : Comparable { var firstname: String var lastname: String var jobtitle: String var phonenumber: String let employees = [employee1, employee2, employee3, employee4, employee5] let sortedemployees = employees.sorted(by: <) static func ==(lhs: Employee, rhs: Employee) -> Bool { return lhs.firstname == rhs.firstname && lhs.lastname == rhs.lastname && lhs.companyid == rhs.companyid static func < (lhs: Employee, rhs: Employee) -> Bool { return lhs.lastname < rhs.lastname 10

11 Creating a Protocol protocol FullyNamed { var fullname: String { get func sayfullname() 11

12 Creating a Protocol protocol FullyNamed { var fullname: String { get func sayfullname() struct Person: FullyNamed { var firstname: String var lastname: String var fullname: String { return "\(firstname) \(lastname)" func sayfullname() { print(fullname) 12

13 Delegation Design pattern that delegates functionality an instance of a class or structure Mostly implemented using Protocols Commonly used in UIKit UITableViewDelegate UIPickerViewDelegate From SpriteKit: SKPhysicsContactDelegate In contrast to normal protocols they often provide optional protocol requirements 13

14 Optional Protocol protocol CounterDataSource optional func increment(forcount count: Int) -> optional var fixedincrement: Int { get Functions or parameters with optional modifier don t have to be implemented Works only with with Protocols can only be adapted by Objective-C classes 14

15 Optional Protocol protocol CounterDataSource optional func increment(forcount count: Int) -> optional var fixedincrement: Int { get Functions or parameters with optional modifier don t have to be implemented Works only with with Protocols can only be adapted by Objective-C classes 15

16 Optional Protocol Requirements The SKPhysicsContactDelegate from SpriteKit public protocol SKPhysicsContactDelegate : NSObjectProtocol { optional public func didbegin(_ contact: SKPhysicsContact) optional public func didend(_ contact: SKPhysicsContact) 16

17 Extensions Extensions add functionality to types that are already defined. You can add: extension SomeType { // new functionality to add to // SomeType goes here computed properties, define methods, provide new initializers, or conform an existing type to a protocol You cannot add properties! extension UIColor { static var favoritecolor: UIColor { return UIColor(red: 0.5, green: 0.1, blue: 0.5, alpha: 1.0) 17

18 Extensions struct Employee { var firstname: String var lastname: String var jobtitle: String var phonenumber: String struct Employee { var firstname: String var lastname: String var jobtitle: String var phonenumber: String static func ==(lhs: Employee, rhs: Employee) -> Bool { return lhs.firstname == rhs.firstname && lhs.lastname == rhs.lastname && lhs.companyid == rhs.companyid extension Employee : Equatable { static func ==(lhs: Employee, rhs: Employee) -> Bool { return lhs.firstname == rhs.firstname && lhs.lastname == rhs.lastname && lhs.companyid == rhs.companyid 18

19 UIView Controllers 19

20 Tab Bar Controller 20

21 View Controller Life Cycle Not Loaded View Controllers can be in one of these stats: viewdidload() View not loaded View appearing viewwillappear(_:) View appeared View disappearing View disappeared Disappeared viewdiddisappear(_:) Appear viewdidappear(_:) viewwilldisappear(_:) 21

22 Application Life Cycle 22

23 AppDelegate.swift func application(_ application: UIApplication, didfinishlaunchingwithoptions launchoptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { return true func applicationwillresignactive(_ application: UIApplication) { func applicationdidenterbackground(_ application: UIApplication) { func applicationwillenterforeground(_ application: UIApplication) { func applicationdidbecomeactive(_ application: UIApplication) { func applicationwillterminate(_ application: UIApplication) { 23

24 Scroll Views 24

25 ScrollView UIScrollView Parent of UITableView Allows to show content that does not fit on one screen.frame property Where on the screen is the ScrollView?.contentSize property How large is the scrollable area? 25

26 Setting the contentsize let aview = UIView.init(frame: CGRect.init( x: 0, y: 0, width: 2000, height: 2000)) self.thescrollview.addsubview(aview) self.thescrollview.contentsize = aview.frame.size 26

27 ScrollView with StackView Size of a StackView is defined by its content 27

28 Content Insets Use insets to provide padding to your content e.g., on the bottom when displaying the keyboard 28

29 Content Insets let contentinsets = UIEdgeInsetsMake(0.0, 0.0, 300, 0.0) self.thescrollview.contentinset = contentinsets self.thescrollview.scrollindicatorinsets = contentinsets 29

30 UIScrollViewDelegate func scrollviewdidscroll(_ scrollview: UIScrollView) { func viewforzooming(in scrollview: UIScrollView) -> UIView? { func scrollviewdidendscrollinganimation(_ scrollview: UIScrollView) { func scrollviewwillbegindragging(_ scrollview: UIScrollView) { func scrollviewwillbegindecelerating(_ scrollview: UIScrollView) {... 30

31 MVC in ios User action Controller Controller ViewController ModelController Update View Model Storyboard Update Notify Model Classes Persistent Storage 31

DÉVELOPPER UNE APPLICATION IOS

DÉVELOPPER UNE APPLICATION IOS DÉVELOPPER UNE APPLICATION IOS PROTOCOLES CE COURS EST EXTRAIT DU LIVRE APP DEVELOPMENT WITH SWIFT 1 PROTOCOLES Définit un plan de méthodes, de propriétés et d'autres exigences qui conviennent à une tâche

More information

iphone Application Programming Lab 2: MVC and Delegation + A01 discussion

iphone Application Programming Lab 2: MVC and Delegation + A01 discussion Lab 2: MVC and Delegation + A01 discussion Nur Al-huda Hamdan RWTH Aachen University Winter Semester 2015/2016 http://hci.rwth-aachen.de/iphone Learning Objectives Discuss A01 + demo Concepts: debugging

More information

Document Version Date: 1st March, 2015

Document Version Date: 1st March, 2015 7 Minute Fitness: ios(swift) Application Document Version 1.0.1 Date: 1st March, 2015 2 [7 MINUTE FITNESS: APP DOCUMENTATION] Important Notes:... 5 AppDelegate Class Reference... 6 Tasks... 6 Instance

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

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

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

News- ipad: ios(swift) Application

News- ipad: ios(swift) Application News- ipad: ios(swift) Application Document Version 1.0.1 Date: 9 th Nov, 2014 2 [NEWS- IPAD: APP DOCUMENTATION] Important Notes:... 6 AppDelegate Class Reference... 7 Tasks... 7 Instance Methods... 7

More information

Lecture 8 Demo Code: Cassini Multithreading

Lecture 8 Demo Code: Cassini Multithreading Lecture 8 Demo Code: Cassini Multithreading 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

ios Application Development Lecture 2: Seminar and Unit 1

ios Application Development Lecture 2: Seminar and Unit 1 ios Application Development Lecture 2: Seminar and Unit 1 Dr. Simon Völker & Philipp Wacker Media Computing Group RWTH Aachen University Winter Semester 2017/2018 http://hci.rwth-aachen.de/ios Swift 18

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

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

Protocols and Delegates. Dr. Sarah Abraham

Protocols and Delegates. Dr. Sarah Abraham Protocols and Delegates Dr. Sarah Abraham University of Texas at Austin CS329e Fall 2016 Protocols Group of related properties and methods that can be implemented by any class Independent of any class

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

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

COMP327 Mobile Computing Session: Lecture Set 1a - Swift Introduction and the Foundation Framework Part 2

COMP327 Mobile Computing Session: Lecture Set 1a - Swift Introduction and the Foundation Framework Part 2 COMP327 Mobile Computing Session: 2018-2019 Lecture Set 1a - Swift Introduction and the Foundation Framework Part 2 73 Other Swift Guard Already seen that for optionals it may be necessary to test that

More information

iphone Application Programming Lab 3: Swift Types and Custom Operator + A02 discussion

iphone Application Programming Lab 3: Swift Types and Custom Operator + A02 discussion Lab 3: Swift Types and Custom Operator + A02 discussion Nur Al-huda Hamdan RWTH Aachen University Winter Semester 2015/2016 http://hci.rwth-aachen.de/iphone Learning Objectives Discuss A02 Another implementation

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

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

ios Application Development Lecture 3: Unit 2

ios Application Development Lecture 3: Unit 2 ios Application Development Lecture 3: Unit 2 Dr. Simon Völker & Philipp Wacker Media Computing Group RWTH Aachen University Winter Semester 2017/2018 http://hci.rwth-aachen.de/ios Recap Basics of Swift

More information

Cocoa Touch Best Practices

Cocoa Touch Best Practices App Frameworks #WWDC15 Cocoa Touch Best Practices Session 231 Luke Hiesterman UIKit Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

imate: ios Application

imate: ios Application imate: ios Application Document Version 1.0.1 Date: 27 th May, 2014 2 [IMATE: IOS APPLICATION] Contents AppDelegate Class Reference... 4 Tasks... 4 Properties... 4 Instance Methods... 4 ChatMenuViewController

More information

ITP 342 Mobile App Dev. Animation

ITP 342 Mobile App Dev. Animation ITP 342 Mobile App Dev Animation Core Animation Introduced in Mac OS X Leopard Uses animatable "layers" built on OpenGL UIKit supports Core Animation out of the box Every UIView has a CALayer behind it

More information

Enhancing your apps for the next dimension of touch

Enhancing your apps for the next dimension of touch App Frameworks #WWDC16 A Peek at 3D Touch Enhancing your apps for the next dimension of touch Session 228 Tyler Fox UIKit Frameworks Engineer Peter Hajas UIKit Frameworks Engineer 2016 Apple Inc. All rights

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

iphone Application Programming Lecture 3: Swift Part 2

iphone Application Programming Lecture 3: Swift Part 2 Lecture 3: Swift Part 2 Nur Al-huda Hamdan RWTH Aachen University Winter Semester 2015/2016 http://hci.rwth-aachen.de/iphone Review Type aliasing is useful! Escaping keywords could be useful! If you want

More information

ITP 342 Mobile App Dev. Delegates

ITP 342 Mobile App Dev. Delegates ITP 342 Mobile App Dev Delegates Protocol A protocol is a declaration of a list of methods Classes that conform to the protocol implement those methods A protocol can declare two kinds of methods: required

More information

Mobile Application Programing: ios. Messaging

Mobile Application Programing: ios. Messaging Mobile Application Programing: ios Messaging Application Model View Controller (MVC) Application Controller User Action Update View Notify Update Model Messaging Controller User Action Update Notify Update

More information

COMP327 Mobile Computing Session:

COMP327 Mobile Computing Session: COMP327 Mobile Computing Session: 2018-2019 Lecture Set 5a - + Comments on Lab Work & Assignments [ last updated: 22 October 2018 ] 1 In these Slides... We will cover... Additional Swift 4 features Any

More information

Mobile Applications Development. Swift, Cocoa and Xcode

Mobile Applications Development. Swift, Cocoa and Xcode Mobile Applications Development Swift, Cocoa and Xcode Swift programming language Swift is the programming language for ios, macos, watchos, and tvos app development First version in 2014 Current version

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

Graphics and Animation

Graphics and Animation Graphics and Animation Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline ios frameworks for graphics

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

ITP 342 Mobile App Dev. Animation

ITP 342 Mobile App Dev. Animation ITP 342 Mobile App Dev Animation Views Views are the fundamental building blocks of your app's user interface, and the UIView class defines the behaviors that are common to all views. Responsibilities

More information

Your First ios 7 App. Everything you need to know to build and submit your first ios app. Ash Furrow

Your First ios 7 App. Everything you need to know to build and submit your first ios app. Ash Furrow Your First ios 7 App Everything you need to know to build and submit your first ios app. Ash Furrow This book is for sale at http://leanpub.com/your-first-ios-app This version was published on 2014-09-13

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 Today Organization Introduction to ios programming Hello World Assignment 1 2 Organization 6 ECTS

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

A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController.

A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController. WordPlay App: A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController. Create a new project Create a new Xcode project

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 3: Swift Part 2

iphone Application Programming Lecture 3: Swift Part 2 Lecture 3: Swift Part 2 Nur Al-huda Hamdan RWTH Aachen University Winter Semester 2015/2016 http://hci.rwth-aachen.de/iphone Properties Properties are available for classes, enums or structs Classified

More information

ios Application Development Lecture 4: Navigation and Workflow

ios Application Development Lecture 4: Navigation and Workflow ios Application Development Lecture 4: Navigation and Workflow Dr. Simon Völker & Philipp Wacker Media Computing Group RWTH Aachen University Winter Semester 2017/2018 http://hci.rwth-aachen.de/ios Auto

More information

UI Design and Storyboarding

UI Design and Storyboarding UI Design and Storyboarding Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline Model-View-Controller

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

Object-oriented Programming for Automation & Robotics Carsten Gutwenger LS 11 Algorithm Engineering

Object-oriented Programming for Automation & Robotics Carsten Gutwenger LS 11 Algorithm Engineering Object-oriented Programming for Automation & Robotics Carsten Gutwenger LS 11 Algorithm Engineering Lecture 3 Winter 2011/12 Oct 25 Visual C++: Problems and Solutions New section on web page (scroll down)

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

ITP 342 Mobile App Dev. Web View

ITP 342 Mobile App Dev. Web View ITP 342 Mobile App Dev Web View Web View 2 WebKit The WebKit provides a set of core classes to display web content in windows, and by default, implements features such as following links clicked by the

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

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

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

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

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

Adaptive Layout Hands-On Challenges

Adaptive Layout Hands-On Challenges Adaptive Layout Hands-On Challenges Copyright 2015 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

SWIFT - PROTOCOLS. Protocols also follow the similar syntax as that of classes, structures, and enumerations:

SWIFT - PROTOCOLS. Protocols also follow the similar syntax as that of classes, structures, and enumerations: http://www.tutorialspoint.com/swift/swift_protocols.htm SWIFT - PROTOCOLS Copyright tutorialspoint.com Protocols provide a blueprint for Methods, properties and other requirements functionality. It is

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

COMP-520 GoLite Tutorial

COMP-520 GoLite Tutorial COMP-520 GoLite Tutorial Alexander Krolik Sable Lab McGill University Winter 2019 Plan Target languages Language constructs, emphasis on special cases General execution semantics Declarations Types Statements

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

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

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

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

Notifications. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder

Notifications. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Notifications Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline Alerts Internal notifications Local

More information

CS ios. Extensions, Protocols, and Generics

CS ios. Extensions, Protocols, and Generics CS4962 - ios Extensions, Protocols, and Generics Package Management Application level package managers CocoaPods Carthage SPM (Swift Package Manager) CocoaPods Centralized, searchable repository Automatically

More information

Tables. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder

Tables. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Tables Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline Table View Controller Table View Table Cells

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

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

Monetize and Promote Your App with iad

Monetize and Promote Your App with iad Media #WWDC15 Monetize and Promote Your App with iad From design to launch Session 503 Carol Teng Shashank Phadke 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

Mobile Development Lab 3

Mobile Development Lab 3 Mobile Development Lab 3 Objectives Illustrate closures through examples Have fun with maps, location and geolocation Have fun with animations Closures implemented in Swift Closures are self-contained

More information

Patterns & practices for unit-testing Swift-ly. Jakub Turek 18th June, 2018

Patterns & practices for unit-testing Swift-ly. Jakub Turek 18th June, 2018 Patterns & practices for unit-testing Swift-ly Jakub Turek 18th June, 2018 About me Jakub Turek https://jakubturek.com @KubaTurek turekj EL Passion 1 Agenda 1. Introduction to unit-testing. Test Driven

More information

Chapter 22 TableView TableView. TableView ios. ViewController. Cell TableViewCell TableView

Chapter 22 TableView TableView. TableView ios. ViewController. Cell TableViewCell TableView Chapter 22 TableView TableView Android TableView ListView App 22.1 TableView TableView Storyboard Table View ViewController TableView ios Cell TableViewCell TableView Table View Cell Cell ImageView (imageview)

More information

CarPlay Audio and Navigation Apps

CarPlay Audio and Navigation Apps #WWDC18 CarPlay Audio and Navigation Apps Tunes and turns Jonathan Hersh, ios Car Experience Albert Wan, ios Car Experience Mike Knippers, ios Car Experience 2018 Apple Inc. All rights reserved. Redistribution

More information

ios Development Lecture 2 ios SDK and UIKit Ing. Simone Cirani

ios Development Lecture 2 ios SDK and UIKit Ing. Simone Cirani ios Development Lecture 2 ios SDK and UIKit Ing. Simone Cirani email: simone.cirani@unipr.it http://www.tlc.unipr.it/cirani Corso IFTS Cisita ios Development 2014 Parma Università degli Studi di Parma

More information

Introduction to programming with Python

Introduction to programming with Python Introduction to programming with Python Ing. Lelio Campanile 1/61 Main Goal - Introduce you to programming - introduce you to the most essential feature of python programming 2/61 Before to start The name

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

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

G, H I, J. Event-based motion device attitude, 677 gyroscope values, 677 Single View Application project, 674

G, H I, J. Event-based motion device attitude, 677 gyroscope values, 677 Single View Application project, 674 Index A Accelerometer applications, 695 baked-in shaking, 683 ball movement, 692 694 ball view, 690 692 core motion framework, 673 detecting shakes, 683 floating-point value, 681 gravity values, device

More information

! A program is a set of instructions that the. ! It must be translated. ! Variable: portion of memory that stores a value. char

! A program is a set of instructions that the. ! It must be translated. ! Variable: portion of memory that stores a value. char Week 1 Operators, Data Types & I/O Gaddis: Chapters 1, 2, 3 CS 5301 Fall 2016 Jill Seaman Programming A program is a set of instructions that the computer follows to perform a task It must be translated

More information

CSC 581: Mobile App Development Spring 2019

CSC 581: Mobile App Development Spring 2019 CSC 581: Mobile App Development Spring 2019 Unit 1: Getting Started with App Development Xcode installing XCode, creating a project, MVC pattern interface builder, storyboards, object library outlets vs.

More information

(infinitespeak.wordpress.com) Classes and Structs. Dr. Sarah Abraham

(infinitespeak.wordpress.com) Classes and Structs. Dr. Sarah Abraham (infinitespeak.wordpress.com) Classes and Structs Dr. Sarah Abraham University of Texas at Austin CS329e Fall 2018 Classes and Structures General-purpose, flexible constructs to build blocks of code Properties

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

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

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

itunes Extras/iTunes LP Development: TuneKit Programming Guide v1.0

itunes Extras/iTunes LP Development: TuneKit Programming Guide v1.0 itunes Extras/iTunes LP Development page 1 itunes Extras/iTunes LP Development: apple 11-18-2009 itunes Extras/iTunes LP Development page 2 Contents TuneKit Reference 3 TKController 3 View 3 Outlets 3

More information

Mobile Application Programming. Messaging and Delegation

Mobile Application Programming. Messaging and Delegation Mobile Application Programming Messaging and Delegation Color Chooser Color Chooser MFColorChooserView UIControl or UIView MFColorChooserWheelView UIControl MFColorChooserValueSliderView UIControl MFColorChooserAlphaSliderView

More information

What s New in imessage Apps

What s New in imessage Apps Session App Frameworks #WWDC17 What s New in imessage Apps 234 Eugene Bistolas, Messages Engineer Jay Chae, Messages Engineer Stephen Lottermoser, Messages Engineer 2017 Apple Inc. All rights reserved.

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

Lua Framework. Version , Georges Dimitrov

Lua Framework. Version , Georges Dimitrov Lua Framework Version 1.1 2015, Georges Dimitrov Contents Introduction...2 Installation...2 LuaReader Basics...3 Representation of Lua values in MoonSharp... 3 Executing Lua scripts with MoonSharp... 3

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 Emoji Art Demo continued UITextField Editable text input control Demo: Add a text field to Emoji Art Demo Emoji Art Make our Emoji Art scrollable/zoomable/centered

More information

What s New in tvos 12

What s New in tvos 12 #WWDC18 What s New in tvos 12 Session 208 Hans Kim, tvos Engineering 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Agenda Agenda

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. Connections

ITP 342 Mobile App Dev. Connections ITP 342 Mobile App Dev Connections User Interface Interactions First project displayed information to the user, but there was no interaction. We want the users of our app to touch UI components such as

More information

CSCE 121 ENGR 112 List of Topics for Exam 1

CSCE 121 ENGR 112 List of Topics for Exam 1 List of Topics for Exam 1 If statements o How is an if statement constructed? o Does every if need an else? Looping o While loop! What does a while loop look like?! How do you ensure you will not have

More information

Deploying a Signed ios Application to the Enterprise using Oracle Business Intelligence Mobile Security Toolkit

Deploying a Signed ios Application to the Enterprise using Oracle Business Intelligence Mobile Security Toolkit Oracle Fusion Middleware Deploying a Signed ios Application to the Enterprise using Oracle Business Intelligence Mobile SecurityToolkit 12c Release 1 E92654-01 February 2018 Deploying a Signed ios Application

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

App. Chapter 19 App. App (ViewController) App. Single View Application Single View Application View. (View Controller)

App. Chapter 19 App. App (ViewController) App. Single View Application Single View Application View. (View Controller) Chapter 19 App App (ViewController) App 19.1 App App Single View Application Single View Application View Controller View Controller Label Button Button (View Controller) 2 View Controller Utility Area

More information

What s New in LLDB. Debug your way to fame and glory #WWDC15. Developer Tools. Session 402

What s New in LLDB. Debug your way to fame and glory #WWDC15. Developer Tools. Session 402 Developer Tools #WWDC15 What s New in LLDB Debug your way to fame and glory Session 402 Kate Stone Software Behavioralist Sean Callanan Master of Expressions Enrico Granata Data Wizard 2015 Apple Inc.

More information

Event Delivery: The Responder Chain

Event Delivery: The Responder Chain When you design your app, it s likely that you want to respond to events dynamically. For example, a touch can occur in many different objects onscreen, and you have to decide which object you want to

More information

This book contains code samples available under the MIT License, printed below:

This book contains code samples available under the MIT License, printed below: Bluetooth Low Energy in ios Swift by Tony Gaitatzis Copyright 2015 All Rights Reserved All rights reserved. This book or any portion thereof may not be reproduced or used in any manner whatsoever without

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

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

Rx in the real world. 1 Rob Ciolli

Rx in the real world. 1 Rob Ciolli Rx in the real world 1 Rob Ciolli 2 Rob Ciolli 3 Rob Ciolli The App 4 Rob Ciolli Quick architecture overview 5 Rob Ciolli MV - WTF 6 Rob Ciolli Model Simple, immutable data struct returned from DB or APIs

More information

CSC 581: Mobile App Development Spring 2018

CSC 581: Mobile App Development Spring 2018 CSC 581: Mobile App Development Spring 2018 Unit 2: Introduciton to the UIKit UIKit, UIViews UIControl subclasses 1 UIKit the UIKit is a code framework for building mobile apps the foundational class for

More information

SAMPLE CHAPTER. Brendan G. Lim Martin Conte Mac Donell MANNING

SAMPLE CHAPTER. Brendan G. Lim Martin Conte Mac Donell MANNING SAMPLE CHAPTER Brendan G. Lim Martin Conte Mac Donell MANNING ios 7 in Action by Brendan G. Lim Martin Conte Mac Donell Chapter 2 Copyright 2014 Manning Publications brief contents PART 1 BASICS AND NECESSITIES...1

More information