1

In some of Apple's apps like Photos in iOS 11 if you hold down on a tab bar icon while your phone is in landscape and you have the larger accessibility size Dynamic Text turned on a large preview of the tab you are holding appearing. How do I support this in my app? Is it a new API or do I have to build it myself? large tab bar preview

Steve Moser
  • 7,647
  • 5
  • 55
  • 94

2 Answers2

4

You can use PDF image assets and get large tab bar preview behavior for free.

Check the "Preserve Vector Data" button in the attributes inspector for the PDF image asset.

https://developer.apple.com/videos/play/wwdc2017/204/

Check Preserve Vector Data

enter image description here

Brandon Nott
  • 536
  • 2
  • 15
2

The new property is:

// Higher-resolution version of the standard image. Default is nil. Used for rendering assistive UI (e.g. for users with visual impairments who need large text). If not provided, the system may attempt to generate an image based on the standard image (for instance, by rasterizing matching PDF representations at a higher resolution).
@property(nullable, nonatomic, strong) UIImage *largeContentSizeImage API_AVAILABLE(ios(11.0));

Which is on UIBarItem (which UITabBarItem inherits from). I've left the comment in from the header file as it's relevant.

It's also possible to set this under the 'accessibility' property in Interface Builder.

InsertWittyName
  • 3,930
  • 1
  • 22
  • 27