Latest 1.0.0
Homepage https://github.com/mohit5189/MkImageViewer
License MIT
Platforms ios 8.0
Authors

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

Latest podspec

{
    "name": "MkImageViewer",
    "version": "1.0.0",
    "summary": "MKImageviewer is used to display image in horizontal scrollview",
    "description": "MKImageviewer is used to display image in horizontal scrollview. It helps to load image asyc and provide pagination feature by using its delegate methods.",
    "homepage": "https://github.com/mohit5189/MkImageViewer",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "mohit5189": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mohit5189/MkImageViewer.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "MkImageViewer/Classes/**/*"
}

Pin It on Pinterest

Share This