.Swift 1.2
.Xcode 6.3
####This framework is a bit large and you’d better get ready to download the package while browsing.
### (一)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。
2.Support Swift,Localization and network, landscape and portrait, all of apple mobile devices.
3.based on frameworks as below: CFSnapKit、Haneke、NVActivityIndicatorView
4. please read this readme before get started.
5.This framework was finished on my trip to Zoige grassland. Enjoy the delightful views in this framework materials
6.pod unavailable。
drag folder PhotoBrowser、Frameworks into your project.
#### 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)
}
#### 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)
}
1.photo browser attribute show type: local album with enum value Local counterpart to Network album with enum value Host
2.photo browser’s photo model : PhotoBrowser.PhotoModel with two initialize method as below:
Local photo album: PhotoBrowser.PhotoModel(localImg:...,
Network photo album: PhotoBrowser.PhotoModel(hostHDImgURL:...这个方法。
#### (1) basic display photo browser initial with the current view controller rather than navigationVC or tabBarVC
![image](./PhotoBrowser/Show/1.gif)
add an attribute in info.plist with: View controller-based status bar appearance and set the value
#### (3) NavBar, no TabBar ![image](./PhotoBrowser/Show/3.gif)
#### (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.
![image](./PhotoBrowser/Show/4.gif)
#### (5) NavBar, TabBar ![image](./PhotoBrowser/Show/5.gif)
#### (6) push pattern ##### pbVC.showType = PhotoBrowser.ShowType.Push
#### (7) Modal pattern #####pbVC.showType = PhotoBrowser.ShowType.Modal
#### (8) Zoom pattern: a NetEase style ##### pbVC.showType = PhotoBrowser.ShowType.ZoomAndDismissWithCancelBtnClick
![image](./PhotoBrowser/Show/8.gif)
#### (9)Zoom pattern: a weChat Style #####pbVC.showType = PhotoBrowser.ShowType.ZoomAndDismissWithSingleTap
#### (11) photo backup ![image](./PhotoBrowser/Show/11.gif)
#### (12) browser information by scrolling ![image](./PhotoBrowser/Show/12.gif)
#### (13) one-click pattern: with tile and more details info ![image](./PhotoBrowser/Show/17.gif)
#### (14) one-click pattern: without any info attention: the effect is active under ZoomAndDismissWithSingleTap sence pbVC.hideMsgForZoomAndDismissWithSingleTap = true
![image](./PhotoBrowser/Show/18.gif)
#### (15) using black pic as thumbnail by default ![image](./PhotoBrowser/Show/13.gif)
#### (16) thumbnail load , original pic is loading state: ![image](./PhotoBrowser/Show/14.gif)
#### (17) thumbnail load , original pic load state: ![image](./PhotoBrowser/Show/15.gif)
#### (18) thumbnail load, original pic download and animation style ![image](./PhotoBrowser/Show/16.gif)
My Framework based on MIT License