Updating extensions for iOS 13: Difference between revisions

From iPhone Development Wiki
m (Adding PoomSmart's changes)
(Generating an apps icon image)
Line 8: Line 8:


= What has changed in iOS 13? (Classes, frameworks, etc.) =
= What has changed in iOS 13? (Classes, frameworks, etc.) =
== Generating an apps icon image ==
Previously an icon image could be generated from an icon object like so
<source lang="objc">
SBIcon *icon = someIcon;
UIImage *iconImage = [icon generateIconImage:2];
</source>
In iOS 13 this method was changed to <code>-generateIconImageWithInfo:(struct SBIconImageInfo)info</code>
<source lang="objc">
struct SBIconImageInfo {
    struct CGSize size;
    double scale;
    double continuousCornerRadius;
};
</source>
<source lang="objc">
SBIconController *iconController = [NSClassFromString(@"SBIconController") sharedInstance];
SBIcon *icon = [iconController.model expectedIconForDisplayIdentifier:@"com.apple.Music"];
struct CGSize imageSize;
imageSize.height = 60;
imageSize.width = 60;
struct SBIconImageInfo imageInfo;
imageInfo.size  = imageSize;
imageInfo.scale = [UIScreen mainScreen].scale;
imageInfo.continuousCornerRadius = 12;
UIImage *iconImage = [icon generateIconImageWithInfo:imageInfo];
</source>

Revision as of 00:11, 14 November 2019

Let's collect knowledge like we did with iOS 12, iOS 11, iOS 10, iOS 9, iOS 8 and iOS 7 – paste in your notes and share what you've learned, and somebody else will organize it later. :) If you want to ask questions and share tips over chat with other developers, see How to use IRC for how to connect to #theos and #iphonedev.

Hey developer, you can add your knowledge here! Yes, you! Make an account and edit this page!

If you want to see what's been recently updated on this page, you can use the wiki's history feature to compare the revisions (to look at the diff) since the last time you visited this page.

What has changed in iOS 13? (Classes, frameworks, etc.)

Generating an apps icon image

Previously an icon image could be generated from an icon object like so

SBIcon *icon = someIcon;
UIImage *iconImage = [icon generateIconImage:2];

In iOS 13 this method was changed to -generateIconImageWithInfo:(struct SBIconImageInfo)info

struct SBIconImageInfo {
    struct CGSize size;
    double scale;
    double continuousCornerRadius;
};
SBIconController *iconController = [NSClassFromString(@"SBIconController") sharedInstance];
SBIcon *icon = [iconController.model expectedIconForDisplayIdentifier:@"com.apple.Music"];

struct CGSize imageSize;
imageSize.height = 60;
imageSize.width = 60;

struct SBIconImageInfo imageInfo;
imageInfo.size  = imageSize;
imageInfo.scale = [UIScreen mainScreen].scale;
imageInfo.continuousCornerRadius = 12;

UIImage *iconImage = [icon generateIconImageWithInfo:imageInfo];