Swift快速集成控件篇(圖片瀏覽)支持網絡url和本地UIImage

老樣子,看圖

  • 1
img.gif
  • 2 請求網絡圖 url
let urllist=["http://pic9.nipic.com/20100902/2029588_234330095230_2.jpg"
            ,"http://pic1a.nipic.com/2008-08-26/200882614319401_2.jpg"
            ,"http://www.ahhnh.com/data/upload/2015-10/2015101940975833.jpg"
            ,"http://pic10.nipic.com/20100929/4879567_114926982000_2.jpg"
            ,"http://img2.imgtn.bdimg.com/it/u=2081796248,4191591232&fm=21&gp=0.jpg"] 
        let describeList=["張三","李四","李四","李四","李四"]
        let vc = ImagePreviewViewController( ImageUrlList: urllist ,IsDescribe: true,DescribeList: describeList )
        self.navigationController?.pushViewController(vc, animated: true )
```

- 3 本地圖
```
      let ImageList = [
            "tutorial_background_00",
            "tutorial_background_01",
            "tutorial_background_02",
            "tutorial_background_03"]
         let describeList=["張三","李四","李四","李四","李四"]
        let vc = ImagePreviewViewController(ImagenamedList: ImageList, IsDescribe: true, DescribeList: describeList )
                self.navigationController?.pushViewController(vc, animated: true )
```

```
  
        let ImageList = [
            UIImage(named:"tutorial_background_00")!,
            UIImage(named:"tutorial_background_01")!,
            UIImage(named:"tutorial_background_02")!,
            UIImage(named:"tutorial_background_03")!]
        let describeList=["張三","李四","李四","李四","李四"]
        let vc = ImagePreviewViewController(UIImageList: ImageList, IsDescribe: true, DescribeList: describeList )
        self.navigationController?.pushViewController(vc, animated: true )
```

如需代碼,請移動到--->http://www.lxweimin.com/p/0f950c180cb8
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容