Latest 0.1.3
Homepage https://github.com/Fortyfox/MomentsGallery
License MIT
Platforms ios 8.2, requires ARC
Dependencies HanekeSwift
Frameworks UIKit
Authors

Version
License
Platform

MomentsGallery is a gallery view controller inspired by Twitter’s Moments. It includes a parallax effect while swiping between photos, tap to view the full photo and the ability to add a title and a caption.

MomentsGallery Exmaple

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Local images

var images = ["1.jpg", "2.jpg", "3.jpg"]
var moments: [Moment] = []

for imagePath in images {
    let moment = Moment(image: UIImage(named: imagePath))
    moments.append(moment)
}

let momentsVC = MomentsGallery(moments: moments)
self.presentViewController(momentsVC, animated: true, completion: nil)

Images from the web

var images = ["http://url.com/1.jpg", "http://url.com/2.jpg", "http://url.com/3.jpg"]
var moments: [Moment] = []

for imageUrl in images {
    let moment = Moment(url: imageUrl)
    moments.append(moment)
}

let momentsVC = MomentsGallery(moments: moments)
self.presentViewController(momentsVC, animated: true, completion: nil)

Controlling the page index

let momentsVC = MomentsGallery(moments: [moment, moment, moment])
momentsVC.initialPageIndex = 2 // Set initial index before presenting, not animated
self.presentViewController(momentsVC, animated: true, completion: nil)

momentsVC.scrollToIndex(2) // Set index after view controller is presented, animated

Requirements

  • Swift 2.1
  • iOS 8.2

Dependencies

Installation

MomentsGallery is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "MomentsGallery"

To install MomentsView with Carthage add the following line to your cartfile

github "Fortyfox/MomentsGallery" ~> 0.1.0

Author

Melvin Beemer, [email protected]

License

MomentsGallery is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "MomentsGallery",
    "version": "0.1.3",
    "summary": "A gallery view controller inspired by Twitter's Moments.",
    "description": "MomentsGallery is a gallery view controller inspired by Twitter's Moments. It includes a parallax effect while swiping between photos, tap to view the full photo and the ability to add a title and a caption.",
    "homepage": "https://github.com/Fortyfox/MomentsGallery",
    "screenshots": "https://i.imgur.com/F5DzQIw.gif",
    "license": "MIT",
    "authors": {
        "Melvin Beemer": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Fortyfox/MomentsGallery.git",
        "tag": "0.1.3"
    },
    "social_media_url": "https://twitter.com/melvinbeemer",
    "platforms": {
        "ios": "8.2"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "frameworks": "UIKit",
    "dependencies": {
        "HanekeSwift": [
            "~> 0.10.0"
        ]
    }
}

Pin It on Pinterest

Share This