LoginSignup
2
2

More than 5 years have passed since last update.

Base64からUIImageを生成する方法

Posted at

ふと、とある脱獄Tweakを作っている時に独自アイコンをリソースから読み込むのはなんだかなぁーと思っていたところBase64があるじゃないか!と思って調べてみたのでφ(..)メモメモ

やり方

ざっとした流れとしては
NSURL→NSData→UIImageという感じです

NSURL *baseImage = [NSURL URLWithString:@"data:image/png;base64,…"];    
NSData *Imagedata = [NSData dataWithContentsOfURL:baseImage];
UIImage *Image = [UIImage imageWithData:Imagedata];

このやり方だと全部のiOSに対応してるはず。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2