SkillAgentSearch skills...

PhotoBrowser

Photo Browser Terminator

Install / Use

/learn @CharlinFeng/PhotoBrowser
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

image <br/><br/> ###中文文档 ###个人微博时点软件 <br/><br/>

Begin

<br/><br/><br/> Photo Browser Terminator

<br/> .Swift 1.2<br/><br/> .Xcode 6.3 <br/> ####This framework is a bit large and you’d better get ready to download the package while browsing. <br/> ### (一)Summary 1.We already have a OC version of this framework. This time we bring our latest consequent by Swift .https://github.com/nsdictionary/CorePhotoBrowserVC。<br/> 2.Support Swift,Localization and network, landscape and portrait, all of apple mobile devices.<br/> 3.based on frameworks as below: CFSnapKit、Haneke、NVActivityIndicatorView<br/> 4. please read this readme before get started.<br/> 5.This framework was finished on my trip to Zoige grassland. Enjoy the delightful views in this framework materials<br/> 6.pod unavailable。<br/>

<br/><br/><br/> How To Get Started

<br/><br/>

1.Add

drag folder PhotoBrowser、Frameworks into your project.

<br/><br/>

2.introduction to local and network photo album

<br/> #### 2.1 local photo album

/** local photo album */ func showLocal(index: Int){

let pbVC = PhotoBrowser()

/**  set album demonstration style  */
pbVC.showType = showType

/**  set album style  */
pbVC.photoType = PhotoBrowser.PhotoType.Local

//forbid showing all info
pbVC.hideMsgForZoomAndDismissWithSingleTap = true

var models: [PhotoBrowser.PhotoModel] = []

let title = langType == LangType.Chinese ? titleLocalCH : titleEN
let desc = langType == LangType.Chinese ? descLocalCH : descLocalEN

//model data array
for (var i=0; i<9; i++){
    
    let model = PhotoBrowser.PhotoModel(localImg:UIImage(named: "\(i+1).jpg")! , titleStr: title, descStr:desc[i], sourceView: displayView.subviews[i] as! UIView)
    
    models.append(model)
}
/**  set models   */
pbVC.photoModels = models

pbVC.show(inVC: self,index: index)

}

<br/> #### 2.2 network photo album

/** 网络相册相册 */ func showHost(index: Int){

let pbVC = PhotoBrowser()

/**  set album demonstration style  */
pbVC.showType = showType

/**  set album style   */
pbVC.photoType = PhotoBrowser.PhotoType.Host

//forbid showing all info
pbVC.hideMsgForZoomAndDismissWithSingleTap = true

var models: [PhotoBrowser.PhotoModel] = []

let titles = langType == LangType.Chinese ? titleHostCH : titleHostEN
let descs = langType == LangType.Chinese ? descHostCH : descHostEN

//model data array
for (var i=0; i<9; i++){
    
    let model = PhotoBrowser.PhotoModel(hostHDImgURL: hostHDImageUrls[i], hostThumbnailImg: (displayView.subviews[i] as! UIImageView).image, titleStr: titles[i], descStr: descs[i], sourceView: displayView.subviews[i] as! UIView)
    models.append(model)
}

/**  set models  */
pbVC.photoModels = models

pbVC.show(inVC: self,index: index)

}

<br/><br/>

summary of differences between local and network album::<br/>

1.photo browser attribute show type: local album with enum value Local counterpart to Network album with enum value Host<br/> 2.photo browser’s photo model : PhotoBrowser.PhotoModel with two initialize method as below:<br/> Local photo album: PhotoBrowser.PhotoModel(localImg:...,<br/> Network photo album: PhotoBrowser.PhotoModel(hostHDImgURL:...这个方法。

<br/><br/><br/>

3.USAGE:

<br/> #### (1) basic display photo browser initial with the current view controller rather than navigationVC or tabBarVC<br/> ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/1.gif)<br/> <br/>

(2) no NavBar and TabBar

add an attribute in info.plist with: View controller-based status bar appearance and set the value<br/> image<br/>

<br/> #### (3) NavBar, no TabBar ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/3.gif)<br/> <br/> #### (4) tabBar, no NavBar attention: the photo browser is based on a vc. you’d better not use vc.edgesForExtendedLayout . in case of the photo browser with a non-full-screen state.<br/> ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/4.gif)<br/> <br/> #### (5) NavBar, TabBar ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/5.gif)<br/> <br/> #### (6) push pattern ##### pbVC.showType = PhotoBrowser.ShowType.Push <br/>

image<br/>

<br/> #### (7) Modal pattern #####pbVC.showType = PhotoBrowser.ShowType.Modal <br/>

image<br/>

<br/> #### (8) Zoom pattern: a NetEase style ##### pbVC.showType = PhotoBrowser.ShowType.ZoomAndDismissWithCancelBtnClick <br/> ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/8.gif)<br/> <br/> #### (9)Zoom pattern: a weChat Style #####pbVC.showType = PhotoBrowser.ShowType.ZoomAndDismissWithSingleTap <br/>

image<br/> <br/>

(10) lanscape pattern

image<br/>

<br/> #### (11) photo backup ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/11.gif)<br/> <br/> #### (12) browser information by scrolling ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/12.gif)<br/> <br/> #### (13) one-click pattern: with tile and more details info ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/17.gif)<br/> <br/> #### (14) one-click pattern: without any info attention: the effect is active under ZoomAndDismissWithSingleTap sence pbVC.hideMsgForZoomAndDismissWithSingleTap = true<br/> ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/18.gif)<br/> <br/> #### (15) using black pic as thumbnail by default ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/13.gif)<br/> <br/> #### (16) thumbnail load , original pic is loading state: ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/14.gif)<br/> <br/> #### (17) thumbnail load , original pic load state: ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/15.gif)<br/> <br/> #### (18) thumbnail load, original pic download and animation style ![image](https://github.com/CharlinFeng/Resource/blob/master/PhotoBrowser/Show/16.gif)<br/>

<br/><br/><br/> License

My Framework based on MIT License

<br/><br/> ###English Document <br/><br/><br/> 照片浏览器终结者(关注信息公告牌

<br/> .Swift 2<br/><br/> .Xcode 6.3 <br/> ####本框架包比较大,你最好现在先开始下载。不然你可能会等很久。 ##### 感谢charlin 3群 @Simn 提供的英文翻译帮助! <br/> ### (一)总体说明 1.本框架有OC版本,本次主要是汲取了OC版本所有bug与不足,同时听取在大量使用者的反馈与心声、修复与极大的改善了之前的OC版本并在此基础之上精心推出的Swift完美版,https://github.com/nsdictionary/CorePhotoBrowserVC。<br/> 2.纯swift支持,本地与网络支持,横竖屏支持,iPhone所有屏幕支持,iPad平板也支持并力求零Bug。<br/> 3.依赖框架说明:CFSnapKit(布局库)、Haneke(图片缓存库)、NVActivityIndicatorView(加载视图)<br/> 4.本次的文档会比较有趣,是以图片各功能来讲述的,请认真查看图片说明文字,使用也内嵌在这些图片说明中。<br/> 5.本框架基本是在我去若尔盖大草原上的长途汽车途中完成的,所以里面有大量若尔盖风景!<br/> 6.不支持pod。<br/>

<br/><br/><br/> 快速集成

<br/><br/>

1.添加库

拖拽PhotoBrowser文件夹到你的项目,拖拽Frameworks中的依赖库到您的项目中。

<br/><br/>

2.展示相册:分本地相册和网络相册

<br/> #### 2.1展示本地相册

/** 本地相册 */ func showLocal(index: Int){

let pbVC = PhotoBrowser()

/**  设置相册展示样式  */
pbVC.showType = showType

/**  设置相册类型  */
pbVC.photoType = PhotoBrowser.PhotoType.Local

//强制关闭显示一切信息
pbVC.hideMsgForZoomAndDismissWithSingleTap = true

var models: [PhotoBrowser.PhotoModel] = []

let title = langType == LangType.Chinese ? titleLocalCH : titleEN
let desc = langType == LangType.Chinese ? descLocalCH : descLocalEN

//模型数据数组
for (var i=0; i<9; i++){
    
    let model = PhotoBrowser.PhotoModel(localImg:UIImage(named: "\(i+1).jpg")! , titleStr: title, descStr:desc[i], sourceView: displayView.subviews[i] as! UIView)
    
    models.append(model)
}
/**  设置数据  */
pbVC.photoModels = models

pbVC.show(inVC: self,index: index)

}

<br/> #### 2.2展示网络相册

/** 网络相册相册 */ func showHost(index: Int){

let pbVC = PhotoBrowser()

/**  设置相册展示样式  */
pbVC.showType = showType

/**  设置相册类型  */
pbVC.photoType = PhotoBrowser.PhotoType.Host

//强制关闭显示一切信息
pbVC.hideMsgForZoomAndDismissWithSingleTap = true

var models: [PhotoBrowser.PhotoModel] = []

let titles = langType == LangType.Chinese ? titleHostCH : titleHostEN
let descs = langType == LangType.Chinese ? descHostCH : descHostEN

//模型数据数组
for (var i=0; i<9; i++){
    
    let model = PhotoBrowser.PhotoModel(hostHDImgURL: hostHDImageUrls[i], hostThumbnailImg: (displayView.subviews[i] as! UIImageView).image, titleStr: titles[i], descStr: descs[i], sourceView: displayView.subviews[i] as! UIView)
    models.append(model)
}

/**  设置数据  */
pbVC.photoModels = models

pbVC.show(inVC: self,index: index)

}

<br/><br/> ####本地相册和网络相册不同点总结如下:<br/> 1.照片浏览器属性showType:本地相册是枚举值Local,网络相册是枚举值Host<br/> 2.照片浏览器的相册模型是PhotoBrowser.PhotoModel类型,他有两个初始化方法:<br/> 本地相册请调用初始化方法PhotoBrowser.PhotoModel(localImg:...,<br/> 网络相册请调用初始化方法PhotoBrowser.PhotoModel(hostHDImgURL:...这个方法。

<br/><br/><br/>

3.功能详解(图文使用,请认真查看):

<br/> #### (1) 基本展示 ##### 可以直接展示照片浏览器,且可指定page显示. 之前我看过的几乎所有的照片浏览器基本都是直接添加在window上的,这样做最简单但有致命缺陷就是设置旋转之后,window上的照片浏览器并不知道。所以我在这里更改了传统做法。照片浏览器初始化传入的vc,请传当前业务控制器即可,不要乱传其他
View on GitHub
GitHub Stars616
CategoryDevelopment
Updated12d ago
Forks116

Languages

Swift

Security Score

95/100

Audited on Mar 17, 2026

No findings