Skip to content

IODevBlue/ZoomableSwiftImageView

Repository files navigation

ZoomableSwiftImageView

A customizable and lightweight SwiftUI image viewer with smooth zooming, panning and double-tap-to-zoom functionality.

GitHub release (latest by date) Repository Size License GitHub Repository stars GitHub watchers

Table of content

Requirements

  • iOS 13.0+
  • macOS 11.0+
  • Xcode 11+

Uses

Image Galleries: Display images where users can zoom in and out on images for a detailed view.

Features

  • Zooming Capabilities

    Pinch to zoom in and out of the displayed image allowing for detailed inspection of the image content.

    Zooming

  • Double Tap to Zoom

    Double Tap to Zoom

  • Panning Functionality with Snapback

    Drag the image to pan around. The snapback feature ensures the image remains within defined boundaries when you release it.

    Panning with Snapback

Installation

Current Version: 1.0.0

There are several ways to install this library.

  1. Using Swift Package Manager (SPM):
  1. CocoaPods:
  • Add the following line to your Podfile:
pod 'ZoomableSwiftImageView', '~> 1.0.0'
  • Then run:
pod install
  1. Carthage:
  • Add the following line to your Cartfile:
github "IODevBlue/ZoomableSwiftImageView" ~> 1.0.0
  • Then run:
carthage update --platform iOS
  • Follow the instructions to link the framework to your project.
  1. Manually: Download the project zip file.
  • Navigate to the Sources folder and copy the ZoomableSwiftImageView subfolder into your Xcode project.
  • Alternatively, ZoomableSwiftImageView is a single source file. You can just copy the ZoomableSwiftImageView.swift file to your Xcode project.

If you do make major or minor improvements to the source code, consider making a pull request or an issue to make a contribution. Check the Contributing for more information.

Usage

Import ZoomableSwiftImageView and then create an instance by providing an Image:

import SwiftUI
import ZoomableSwiftImageView

struct ContentView: View {
    var body: some View {
        ZoomableSwiftImageView(image: Image("your_image_name"))
    }
}

Applications using ZoomableSwiftImageView

If your application uses ZoomableSwiftImageView and you'd love to showcase, send an email containing:

  • An app icon
  • A link to download your application.
  • A related Github repository.

Contributions

Contributors are welcome!

NOTE: This repository is split into two branches:

All developing implementations and proposed changes are pushed to the development branch and finalized updates are pushed to the main branch.

Check the Contributing for more information.

Changelog

  • 1.0.0
    • Initial release

More version history can be gotten from the Change log file.

License

    Copyright 2024 IO DevBlue

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

About

A customizable and lightweight SwiftUI image viewer with smooth zooming, panning and double-tap-to-zoom functionality.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Languages