Latest3.0.2
Homepagehttps://github.com/0x0c/RDImageViewerController
LicenseMIT
Platformsios 8.0, requires ARC
Authors

Simple image or custom view viewer.

[![CI Status](http://img.shields.io/travis/Akira Matsuda/RDImageViewerController.svg?style=flat)](https://travis-ci.org/Akira Matsuda/RDImageViewerController)
Version
License
Platform

RDImageViewerController
RDImageViewerController
RDImageViewerController

Requirements

  • Runs on iOS 8.0 or later.

Installation

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

pod "RDImageViewerController"

Usage

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

Initialize RDImageViewerController with page data.

NSMutableArray <RDPageContentData *> *contentData = [NSMutableArray new];
for (NSInteger i = 0; i < kNumberOfImages; i++) {
    NSString *imageName = [NSString stringWithFormat:@"%ld.JPG", (long)i + 1];
    RDImageContentData *data = [[RDImageContentData alloc] initWithImageName:imageName];
    [contentData addObject:data];
}
RDImageViewerController *viewController = [[RDImageViewerController alloc] initWithContentData:contentData direction:self.directionSwitch.on ? RDPagingViewForwardDirectionLeft : RDPagingViewForwardDirectionRight];

You can show a custom view like this (See RDScrollViewPageContentData class).

NSMutableArray <RDPageContentData *> *contentData = [NSMutableArray new];
for (NSInteger i = 0; i < kNumberOfImages; i++) {
    RDScrollViewPageContentData *data = [[RDScrollViewPageContentData alloc] initWithString:[NSString stringWithFormat:@"%ld", (long)i + 1]];
    [contentData addObject:data];
}
RDImageViewerController *viewController = [[RDImageViewerController alloc] initWithContentData:contentData direction:self.directionSwitch.on ? RDPagingViewForwardDirectionLeft : RDPagingViewForwardDirectionRight];

To create own page, inherit the RDPageContentData class and implement RDPageContentDataDelegate methods.

Please check the sample code to know how to use.

The property of ‘landscapeMode’ is meaning zooming style in landscape.
If it is setted RDImageViewerControllerLandscapeModeAspectFit
RDImageViewerController

The other side it is setted RDImageViewerControllerLandscapeModeDisplayFit
RDImageViewerController

You can set the number of preloading images like this.

RDImageViewerController *viewController = ...
viewController.preloadCount = 2;

RDImageViewerController
RDImageViewerController

The view will be reused when scrolled.

Author

Akira Matsuda, [email protected]

License

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

Latest podspec

{
    "name": "RDImageViewerController",
    "version": "3.0.2",
    "summary": "Simple but powerful image viewer.",
    "homepage": "https://github.com/0x0c/RDImageViewerController",
    "license": "MIT",
    "authors": {
        "Akira Matsuda": "[email protected]"
    },
    "source": {
        "git": "https://github.com/0x0c/RDImageViewerController.git",
        "tag": "3.0.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*.{h,m}",
    "public_header_files": "Pod/Classes/**/*.h"
}

Pin It on Pinterest

Share This