facebook twitter hatena line email

Ios/swift/外部ライブラリ/SDWebImage

提供: 初心者エンジニアの簡易メモ
2016年6月21日 (火) 18:24時点におけるAdmin (トーク | 投稿記録)による版 (ページの作成:「==SDWebImageとは== 外部画像取得ライブラリ 非同期取得で、キャッシュ機能などがある。 ==インストール== -Podfile platform :ios, '9.0...」)

(差分) ←前の版 | 最新版 (差分) | 次の版→ (差分)
移動: 案内検索

SDWebImageとは

外部画像取得ライブラリ

非同期取得で、キャッシュ機能などがある。

インストール

-Podfile

platform :ios, '9.0'
target 'Helloworld' do
  use_frameworks!
  pod 'SDWebImage', '~>3.6'
end
$ pod install

swfit記述

import SDWebImage
       let image1:UIImage? = UIImage(named:"loading.png")
       let imageView1 = UIImageView(image:image1)
       let imageURL = NSURL(string: "https://www.google.co.jp/logos/doodles/2016/first-day-of-summer-2016-northern-hemisphere-5669295896920064.2-hp.gif")
       imageView1.sd_setImageWithURL(imageURL)
       imageView1.center = CGPointMake(200, 200)
       self.view.addSubview(imageView1)