live icons on ios
TRANSCRIPT
![Page 1: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/1.jpg)
Live IconsMartin Kiss, PixelCut
@Tricertops
![Page 2: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/2.jpg)
Images can be generatedCalendar as the first example from Apple
![Page 3: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/3.jpg)
iOS 7 animates Clock icon Some icons are a lie
![Page 4: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/4.jpg)
No APINo fun
![Page 5: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/5.jpg)
Inside appsFun
![Page 6: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/6.jpg)
Icons in UIKit• Tab Bar
• Navigation Bar and Toolbar
• Cell icons
• UIActivity icons
• more
![Page 7: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/7.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/8.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/9.jpg)
ExamplesIn apps I made
![Page 10: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/10.jpg)
Catalog of BooksTab with latest books shows date
![Page 11: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/11.jpg)
Currency conversionShows symbol of last used currency
![Page 12: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/12.jpg)
Notifications buttonShows status of the push notifications
![Page 13: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/13.jpg)
User profileShows user’s photo if there is any
![Page 14: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/14.jpg)
![Page 15: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/15.jpg)
Geography appShows rank of country in UIActivity icon
![Page 16: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/16.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/17.jpg)
How togenerate images in code
![Page 18: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/18.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/19.jpg)
UIGraphicsBeginImageContextWithOptions(size, no, 0)
let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()
view.drawHierarchy(in: view.bounds, afterScreenUpdates: no)
![Page 20: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/20.jpg)
UIGraphicsBeginImageContextWithOptions(size, no, 0)
let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()
view.layer.render(in: UIGraphicsGetCurrentContext()!)
![Page 21: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/21.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/22.jpg)
PaintCode is visualDraw the icon, bind parameters, export StyleKit class.
![Page 23: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/23.jpg)
StyleKit.imageOfClock(seconds: 2400)
StyleKit.imageOfCompass(azimuth: 30)
StyleKit.imageOfMoon(phase: 0.1)
![Page 24: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/24.jpg)
Only basic math is needed for these examples
![Page 25: Live Icons on iOS](https://reader031.vdocuments.net/reader031/viewer/2022022413/58ef3c7a1a28ab1b618b457b/html5/thumbnails/25.jpg)
Thank YouMartin Kiss, PixelCut
@Tricertops