Giter Club home page Giter Club logo

mkimageviewer's Introduction

MkImageViewer

MKImageViewer is used to display images in horizontal scrollview. It is very easy to integrate in your project.

Example

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

Requirements

iOS 8 OR greater

Installation

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

pod 'MkImageViewer'

Integration Steps

To integrate MKImageViewer, you just need to follow following steps:

  1. Import MKImageViewer on top of your file.
import MkImageViewer
  1. Use following lines of code to display images:
let controller:MKImageViewController = MKImageViewController()
controller.images = [MKImage(url: URL(string: "https://images.pexels.com/photos/34950/pexels-photo.jpg")),MKImage(url: URL(string: "https://images.pexels.com/photos/459225/pexels-photo-459225.jpeg")),MKImage(url: URL(string: "https://i.ytimg.com/vi/c2NmyoXBXmE/maxresdefault.jpg")),MKImage(url: URL(string: "https://www.nmfnewsonline.com/upload/news/lifestyle/Nmf2adb21_02_01_slide_nature.jpg")),MKImage(image: UIImage.init(named: "water"))];

controller.delegate = self;

controller.placeholderImage = UIImage(named: "Placeholder")

self.navigationController?.pushViewController(controller, animated: true)

In above example you can see that this library provide you options for passing Images object Via URL OR direct UIImage Object.

You can set delegate if you want to handle pagination. Delegate method will call on scroll of every image. You can fetch new images record from API and can append to image viewer as given below:

func willDisplayImage(index:Int) -> Void{

// fetch new image as per your requirement and append as given below:

    controller.appendImages([List of MKImage object])
}}

Warning

Library is designed for portrait mode only.

Author

mohit5189, [email protected]

License

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

mkimageviewer's People

Stargazers

 avatar  avatar

Watchers

 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.