• Stars
    star
    1,449
  • Rank 31,207 (Top 0.7 %)
  • Language
    Swift
  • Created almost 11 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An easy to use Image Viewer that is inspired by Facebook

ImageViewer.swift

An easy to use Image Viewer that is inspired by Facebook

Version Deployment status License Platform

Screenshot-dark-modeScreenshot-light-mode Screenshot-auto-rotate

Supports

  • From iOS 10
  • Swift versions
    • Swift 4.0
    • Swift 4.2
    • Swift 5.0

Installation

CocoaPods

Using cocoapods

pod 'ImageViewer.swift', '~> 3.0'

If you need remote image fetching:

pod 'ImageViewer.swift', '~> 3.0'
pod 'ImageViewer.swift/Fetcher', '~> 3.0'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate Alamofire into your Xcode project using Carthage, specify it in your Cartfile:

github "michaelhenry/ImageViewer.swift" ~> 3.2

How to use it

The simplest way to to use this is by using the imageView.setupImageViewer()

imageView.setupImageViewer()

Example:

import ImageViewer_swift

let imageView = UIImageView()
imageView.image = UIImage(named: 'cat1')
...
imageView.setupImageViewer()

Or you might load it from a URL

imageView.setupImageViewer(url: URL(string: "https://example.com/image.jpg")!)

Or you might load it with an array of images [UIImage]

let images = [
    UIImage(named: "cat1"),
    UIImage(named: "cat1"),
    UIImage(named: "cat1")
]
imageView.setupImageViewer(images: images)

Or you might load it with an array of URL [URL]

let urls = [
    URL(string: "https://example.com/your-image-1.jpg")!,
    URL(string: "https://example.com/your-image-2.jpg")!,
    URL(string: "https://example.com/your-image-3.jpg")!
]
imageView.setupImageViewer(urls: urls)

How to change the layout or options that are available

You can check this file ImageViewerOption.swift to see what are the available options that will fit to your needs.

public enum ImageViewerOption {
    case theme(ImageViewerTheme)
    case closeIcon(UIImage)
    case rightNavItemTitle(String, onTap: ((Int) -> Void)?)
    case rightNavItemIcon(UIImage, onTap: ((Int) -> Void)?)
}

You could also check the Demo Project for more information.

Easy peasy :)

Please let me know if you have any questions.

Cheers, Michael Henry Pantaleon

Twitter: @michaelhenry119

Linked in: ken119

http://www.iamkel.net

Dependency

License

MIT

Copyright (c) 2013 Michael Henry Pantaleon (http://www.iamkel.net). All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

FlipBoardNavigationController

This is a new navigation controller inspired by Flipboard.
Objective-C
846
star
2

MHYahooParallaxView

Parallax implementation inspired by Yahoo Weather and News Digest :)
Objective-C
661
star
3

MHNatGeoViewControllerTransition

A new 3D Effect ViewController transition inspired by NatGeo (City Guides by National Geographic)
Objective-C
642
star
4

NewsMagazineApp

Simple way to inform you. An OpenSource news magazine app.
Objective-C
342
star
5

KeyboardAvoider

The missing interactive keyboard in SwiftUI for iOS
Swift
126
star
6

MHWebViewController

An Instagram inspired Web View Controller.
Swift
74
star
7

RxRetroSwift

A Reactive way inspired by the simplicity of Retrofit when creating REST API Calls.
Swift
68
star
8

deploy-to-cocoapods-github-action

Github action for deploying to Cocoapods.org
JavaScript
38
star
9

Localizr

Localizr is a Tool that handles and automates the generation of localization files for IOS and Android so there will be only one source of truth for all of your localization strings.
Python
35
star
10

MHProgressView

A simple progressview indicator that looks like the progressview in Instagram.
Objective-C
27
star
11

MHPinterestLayout

customized dynamic cell - Pinterest layout with custom header
Swift
24
star
12

Localizr.swift

Simplified and automated Localization process library in IOS. Please check https://github.com/michaelhenry/Localizr for more info.
Swift
19
star
13

AttributedString.swift

Swifty NSAttributed String.
Swift
18
star
14

Rates

A currency rate converter App.
Swift
14
star
15

Prettier.swift

Prettier.io wrapper for swift. An opinionated code formatter.
JavaScript
10
star
16

swifty-code-coverage

A github action for generating code coverage report for your ios/macos/spm project.
Shell
6
star
17

AutoBot

DSL for creating UITestCases for iOS Development.
Swift
4
star
18

XConfigs

๐Ÿ› Configs, a quick, simple and stylish solution for your remote and dev configurations.
Swift
4
star
19

fastlane-match-certificates-boilerplate

A boilerplate git repository for your .mobileprovision and .cert files when using fastlane match
Shell
4
star
20

create-report

A Github action for creating generic run report (using Markdown, HTML or JUnit).
Swift
3
star
21

MPFlipViewController

A custom container view controller following the iOS 5 containment API that navigates between child view controllers via touch gestures and page-flip animations
Objective-C
3
star
22

envject

A command-line tool for injecting environment variables or secrets to any file that has to be compiled. (like for example in iOS, with string obfuscation support).
Go
3
star
23

go-gin-lambda

A very easy way to deploy your go-gin application to aws lambda.
Go
3
star
24

SimpleXMLParser

Swift
2
star
25

boto

For the latest version of boto, see https://github.com/boto/boto3 -- Python interface to Amazon Web Services
Python
1
star
26

SwiftUIKit

A collection of UIKIt control for SwiftUI.
Swift
1
star
27

DjangoDocker

Docker recipe for Django on GUNICORN and NGINX
Shell
1
star
28

SwiftAutoCoder

A simple automated nscoding implementation in swift
Swift
1
star
29

MHEmailController

Override the Send Button of the MFMailComposeViewController then Add Captcha Verification Before sending it
Objective-C
1
star
30

omise

A simple and opinionated key value store using single table design pattern in go
Go
1
star
31

michaelhenry

1
star
32

SwiftCommonUtils

Just utils.
Swift
1
star
33

.files

1
star
34

App

Swift
1
star
35

AutoBotServer

the server that accepts and generates actions for UI test cases.
Python
1
star
36

IOSMacroFunctionHelperList

A collection of some helpful macro functions that can be reuse for IOS development.
Objective-C
1
star
37

IOS_GHActions

My Personal GH Actions for IOS Development
1
star
38

MHSocialNetworkingSharerHelper

This is just a helper for integrating custom social sharing capabilities (not just using the default IOS sharing sheet form).
Objective-C
1
star