Skip to content

apolo2/LTImageViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LTImageViewer

Requirements

iOS 6.0

Installation

####CocoaPods Coming soon.

####Manual Installation

Unzip example project and add files in LTImageViewer forder to your project

Add SDWebImage framework to your project

Usage

  • Import class:

    • '#import "LTImageViewerViewController.h"'
    • '#import "UIImageView+LTImageViewer.h"'
  • Then add protocol 'LTImageViewerDataSources, LTImageViewerDelegate' to your controller

  • Config your UIImageView with LTImageViewer:

[youImageView configWithViewerDataSources:dataSources delegate:delegate imageIndex:index];
  • Implement LTImageViewer DataSoucres in your controller:
- (NSInteger) numberOfImageInViewer 
{
    return [number of image in your controller];
}
//If you use web url for display image
- (NSURL*) imageURLAtIndex:(NSInteger)index 
{
    return [Web URL of image at index];
}
//Else use normal image
- (UIImage*) imageAtIndex:(NSInteger)index 
{
    return [your image at index];
}

//Top bar view and bottom bar view

- (UIView*) topBarViewForViewer:(LTImageViewerViewController *)viewer 
{
    //You can return your custom bar view
    //Return nil if you don't use bar view
    //Default return LTImageViewerBottomBarView

    return nil;
}

- (UIView*) bottomBarViewForViewer:(LTImageViewerViewController *)viewer 
{
    //You can return your custom bar view
    //Return nil if you don't use bar view
    //Default return LTImageViewerBottomBarView

    return nil;
}
  • Handle LTImageViewerDelegate for change:
- (void) imageViewer:(LTImageViewerViewController *)viewer didShowImageAtIndex:(NSInteger)index 
{
    //Your change code to update viewer status
}

Note

In this examle, SDWebImage was used to display image from an url. You can modify it by yourself using your own image cache manager such as AFNetworking...

Author

ThangLN, lethang255@gmail.com

Feel free to copy and modify this source code. Please let me know if you have any question!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published