live icons on ios

25
Live Icons Martin Kiss, PixelCut @Tricertops

Upload: martin-kiss

Post on 13-Apr-2017

20 views

Category:

Mobile


0 download

TRANSCRIPT

Page 1: Live Icons on iOS

Live IconsMartin Kiss, PixelCut

@Tricertops

Page 2: Live Icons on iOS

Images can be generatedCalendar as the first example from Apple

Page 3: Live Icons on iOS

iOS 7 animates Clock icon Some icons are a lie

Page 4: Live Icons on iOS

No APINo fun

Page 5: Live Icons on iOS

Inside appsFun

Page 6: Live Icons on iOS

Icons in UIKit• Tab Bar

• Navigation Bar and Toolbar

• Cell icons

• UIActivity icons

• more

Page 7: Live Icons on iOS

Sources of information• Date, month, time, weekday

• Astronomy – moon phase, sunset, sunrise, season

• Location – country, continent, time zone

• Device Motion – compass, gyro, acceleration

• User Preferences – language, units, currency

• App Content – photos, names, dates, anything

Page 8: Live Icons on iOS

No extra permissions

• Astronomy – needs only approximate location

• Location – detect using time zone or IP

• Device Motion – compass for magnetic north

Page 9: Live Icons on iOS

ExamplesIn apps I made

Page 10: Live Icons on iOS

Catalog of BooksTab with latest books shows date

Page 11: Live Icons on iOS

Currency conversionShows symbol of last used currency

Page 12: Live Icons on iOS

Notifications buttonShows status of the push notifications

Page 13: Live Icons on iOS

User profileShows user’s photo if there is any

Page 14: Live Icons on iOS
Page 15: Live Icons on iOS

Geography appShows rank of country in UIActivity icon

Page 16: Live Icons on iOS

Not limited to images

• Automatic night mode based on sunset

• Present optimized content based on country

• Pick correct Earth emoji 🌎🌍🌏 based on location

Page 17: Live Icons on iOS

How togenerate images in code

Page 18: Live Icons on iOS

How to generate

• UIView – set size, attributes, then capture snapshot

• CALayer – create directly or use view.layer

• CoreGraphics – elementary drawing calls

• PaintCode – visual editor that exports code

Page 19: Live Icons on iOS

UIGraphicsBeginImageContextWithOptions(size, no, 0)

let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()

view.drawHierarchy(in: view.bounds, afterScreenUpdates: no)

Page 20: Live Icons on iOS

UIGraphicsBeginImageContextWithOptions(size, no, 0)

let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()

view.layer.render(in: UIGraphicsGetCurrentContext()!)

Page 21: Live Icons on iOS

UIGraphicsBeginImageContextWithOptions(size, no, 0)

let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()

let context = UIGraphicsGetCurrentContext()! UIColor.blue.setFill() context.fill(CGRect(x: 0, y: 0, width: 100, height: 100))

Page 22: Live Icons on iOS

PaintCode is visualDraw the icon, bind parameters, export StyleKit class.

Page 23: Live Icons on iOS

StyleKit.imageOfClock(seconds: 2400)

StyleKit.imageOfCompass(azimuth: 30)

StyleKit.imageOfMoon(phase: 0.1)

Page 24: Live Icons on iOS

Only basic math is needed for these examples

Page 25: Live Icons on iOS

Thank YouMartin Kiss, PixelCut

@Tricertops