Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gajjartejas/swipeable-zoomable-imageview
An example of swipeable and pinch to zoom or double tap to zoom using UIScrollview and UIPageviewController
https://github.com/gajjartejas/swipeable-zoomable-imageview
Last synced: about 2 months ago
JSON representation
An example of swipeable and pinch to zoom or double tap to zoom using UIScrollview and UIPageviewController
- Host: GitHub
- URL: https://github.com/gajjartejas/swipeable-zoomable-imageview
- Owner: gajjartejas
- Created: 2016-10-08T17:06:22.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-24T18:25:35.000Z (over 4 years ago)
- Last Synced: 2024-10-11T10:21:39.317Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 3.55 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[](http://www.instagram.com/gajjartejas)
[](http://www.twitter.com/gajjartejas)
[](http://www.reddit.com/u/gajjartejas)## Swipeable-Zoomable-ImageView-Example
An example of Swipeable and pinch to zoom or double tap to zoom using UIScrollview and UIPageviewController## Usage
Copy following files to your existing project:1. SZImageView.storyboard
2. ImageScrollView.swift
3. ImageViewController.swift
4. ImageContentViewController.swift
5. ImagePageViewController.swiftadd following code to your viewcontroller
``` swift
@IBAction func showImagesAction(sender: AnyObject) {let imageViewController = UIStoryboard(name:"SZImageView",bundle:nil).instantiateViewControllerWithIdentifier("ImageViewController") as! ImageViewController
//Add your local images
imageViewController.images = ["image1","image2"]
let navigationController = UINavigationController.init(rootViewController: imageViewController)
self.presentViewController(navigationController, animated: true) {
}
}
```
## ImageViewController### Properties
``` swift
//An array contain images
var images = [AnyObject]()//UIPageControl displayed in botton
@IBOutlet weak var pageControl: UIPageControl!//ContainerView of UIPageController
@IBOutlet weak var containerView: UIView!
```
### Delegates
``` swift
//ImageViewControllerDelegate
//Called when the number of pages is updated.
func imageViewController(imageViewController: ImageViewController,
imagePageViewController: ImagePageViewController,
didUpdatePageCount count: Int)//Called when the current index is updated.
func imageViewController(imageViewController: ImageViewController,
imagePageViewController: ImagePageViewController,
didUpdatePageIndex index: Int)
```## ImagePageViewController
### Actions
**NOTE: To access this action use the imageViewController.imagePageViewController properties**
``` swift
// Scrolls to the view controller at the given index. Automatically calculates the direction.
func scrollToViewController(index newIndex: Int)//Scrolls to the next view controller.
func scrollToNextViewController()
```
## Possible features/TODO
- Landscape orientation support
- Remote Image Integration
- swift 3.0 support
- ~~Show image at index~~
- ~~Possible Delegates~~
- Documentations inside code
- List of contents inside readme## Sources/Tutorial used
- [Tutorial-appcoda](http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/)
- [ImageScrollView-Github](https://github.com/huynguyencong/ImageScrollView)