Giter VIP home page Giter VIP logo

photobrowser's Introduction

image

###中文文档




Photo Browser Terminator


.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。




How To Get Started



1.Add

drag folder PhotoBrowser、Frameworks into your project.



2.introduction to local and network photo album


#### 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)

}



summary of differences between local and network album::

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:...这个方法。




3.USAGE:


#### (1) basic display photo browser initial with the current view controller rather than navigationVC or tabBarVC
![image](./PhotoBrowser/Show/1.gif)

(2) no NavBar and TabBar

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


#### (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

image


#### (7) Modal pattern #####pbVC.showType = PhotoBrowser.ShowType.Modal

image


#### (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

image

(10) lanscape pattern

image


#### (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)




License

My Framework based on MIT License

photobrowser's People

Contributors

charlinfeng avatar

Watchers

James Cloos avatar fuzhiqiang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.