An extension to SnapshotTesting which allows you to create HEIC images

Overview

πŸ—œ SnapshotTestingHEIC

Swift 5.2 Build Status

An extension to SnapshotTesting which allows you to create HEIC images. The benefit of using HEIC instead of PNG is that it can store as much as image quality as PNG, but with a smaller file size. You can verify this by looking at SnapshotTestingHEICTests.

Usage

Once installed, no additional configuration is required. You can import the SnapshotTestingHEIC module, call SnapshotTesting following their usage guide and simply provide our imageHEIC strategy as below.

import XCTest
import SnapshotTesting
import SnapshotTestingHEIC

class MyViewControllerTests: XCTestCase {
  func testMyViewController() {
    let vc = MyViewController()
    assertSnapshot(matching: vc, as: .imageHEIC)
  }
}

Installation

Xcode 11

⚠️ Warning: By default, Xcode will try to add the SnapshotTestingHEIC package to your project's main application/framework target. Please ensure that SnapshotTestingHEIC is added to a test target instead, as documented in the last step, below.

  1. From the File menu, navigate through Swift Packages and select Add Package Dependency….
  2. Enter package repository URL: https://github.com/alexey1312/SnapshotTestingHEIC
  3. Confirm the version and let Xcode resolve the package
  4. On the final dialog, update SnapshotTestingHEIC's Add to Target column to a test target that will contain snapshot tests (if you have more than one test target, you can later add SnapshotTestingHEIC to them by manually linking the library in its build phase)

Swift Package Manager

If you want to use SnapshotTestingHEIC in any other project that uses Swift Package Manager, add the package as a dependency in Package.swift:

dependencies: [
  .package(name: "SnapshotTestingStitch", url: "https://github.com/alexey1312/SnapshotTestingHEIC.git", from: "1.0.0"),
]

Next, add SnapshotTestingHEIC as a dependency of your test target:

targets: [
  .target(
    name: "MyApp"
  ),
  
  .testTarget(
    name: "MyAppTests", 
    dependencies: [
      .target(name: "MyApp"),
      .product(name: "SnapshotTestingHEIC", package: "SnapshotTestingHEIC"),
    ]
  ),
]

Other

We do not currently support distribution through CocoaPods or Carthage.

License

This library is released under the MIT license. See LICENSE for details.

You might also like...
Cordova-plugin-saveimage - This plugin helps you save images

cordova-plugin-saveimage This plugin helps you save images on iOS/Android Instal

TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage
TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage

TextDrawer TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage. About Annotating Images TextDrawer is the easiest way

Zoomable - A container that allows you to zoom in and out of an image using only SwiftUI

Zoomable It is a container that allows you to zoom in and out of an image using

A low-maintenance, simple framework for a snapshot testing, which takes into account a snapshot difference factor (must have if you're using CI).
A low-maintenance, simple framework for a snapshot testing, which takes into account a snapshot difference factor (must have if you're using CI).

CornSnapshotTesting A low-maintenance, simple framework for a snapshot testing, which takes into account a snapshot difference factor (must have if yo

Agrume - πŸ‹ An iOS image viewer written in Swift with support for multiple images.
Agrume - πŸ‹ An iOS image viewer written in Swift with support for multiple images.

Agrume An iOS image viewer written in Swift with support for multiple images. Requirements Swift 5.0 iOS 9.0+ Xcode 10.2+ Installation Use Swift Packa

APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS.
APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS.

APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS. It's built on top of a modified version of libpng wit

A lightweight generic cache for iOS written in Swift with extra love for images.
A lightweight generic cache for iOS written in Swift with extra love for images.

Haneke is a lightweight generic cache for iOS and tvOS written in Swift 4. It's designed to be super-simple to use. Here's how you would initalize a J

Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web
Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web

Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web. It provides you a chance to use a pure-Swift way to work

Image viewer (or Lightbox) with support for local and remote videos and images
Image viewer (or Lightbox) with support for local and remote videos and images

Table of Contents Features Focus Browse Rotation Zoom tvOS Setup Installation License Author Features Focus Select an image to enter into lightbox mod

Comments
  • Add macOS Support

    Add macOS Support

    Would you ever consider adding macOS support? Would be good to reuse as much of the logic as possible as there are a bunch of similarities between the NSImage and UIImage interfaces used for this extension.

    opened by Sherlouk 3
  • Fix minimum platform version to match swift-snapshot-testing package

    Fix minimum platform version to match swift-snapshot-testing package

    Sorry to miss this, not sure why my Xcode didn't report it. But swift-snapshot-testing also increases the minimum platform versions (see here). I changed the Package.swift to match their requirements

    opened by antranapp 0
  • Fix naming of swift-snapshot-testing package

    Fix naming of swift-snapshot-testing package

    Fix issue caused by recent release of swift-snapshot-testing which changed its package name: https://github.com/pointfreeco/swift-snapshot-testing/releases/tag/1.10.0

    opened by antranapp 0
  • Support for perceptualPrecision parameter

    Support for perceptualPrecision parameter

    In the latest version (1.10.0) of snapshot testing framework a new parameter has been introduced: perceptualPrecision. Are there any plans to support it?

    opened by sschizas 2
Releases(1.2.1)
  • 1.2.1(Sep 25, 2022)

    What's Changed

    • Fix minimum platform version to match swift-snapshot-testing package by @antranapp in https://github.com/alexey1312/SnapshotTestingHEIC/pull/4

    Full Changelog: https://github.com/alexey1312/SnapshotTestingHEIC/compare/1.2.0...1.2.1

    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Sep 23, 2022)

    What's Changed

    • Fix naming of swift-snapshot-testing package by @antranapp in https://github.com/alexey1312/SnapshotTestingHEIC/pull/3

    New Contributors

    • @antranapp made their first contribution in https://github.com/alexey1312/SnapshotTestingHEIC/pull/3

    Full Changelog: https://github.com/alexey1312/SnapshotTestingHEIC/compare/1.1.0...1.2.0

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Apr 3, 2022)

Owner
Aleksei Kakoulin
Aleksei Kakoulin
Convert HEIC images to JPEG format on the Mac

heic2jpeg Convert HEIC images to JPEG format on the Mac A basic tool to convert Apple's obnoxious HEIC format images (as the default photo format for

Fazal Majid 2 Mar 1, 2022
iOS Swift class to create circular or rounded avatar images

SwiftyAvatar iOS Swift 3.0 UIimage class Create awesome circular avatar images! IBInspectable attributes accessible from the identity inspector. Round

Dimitrios Kalaitzidis 183 Dec 17, 2022
IconsMaker - Create your app icon with SwiftUI and generate PNG images in all needed sizes

IconsMaker - Create your app icon with SwiftUI and generate PNG images in all needed sizes

Jonathan Gander 14 Oct 20, 2022
FlaneurImagePicker is an iOS image picker that allows users to pick images from different sources (ex: user's library, user's camera, Instagram...). It's highly customizable.

FlaneurImagePicker is a highly customizable iOS image picker that allows users to pick images from different sources (ex: device's library, device's c

FlaneurApp 17 Feb 2, 2020
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.

I've built out the Swift version of this library! Screenshots Description ABMediaView can display images, videos, as well as now GIFs and Audio! It su

Andrew Boryk 80 Dec 20, 2022
SwiftColorArt is a demo application that includes Swift files with all classes and extension necessary to create a font color schema matching to an image

SwiftColorArt SwiftColorArt is a demo application that includes Swift files with all classes and extension necessary to create a font color schema mat

Jan Gregor Triebel 264 Jan 4, 2023
STDevRxExt contains some extension functions for RxSwift and RxCocoa which makes our live easy.

STDevRxExt Example To run the Example.playground, clone the repo, and run pod install from the Example directory first. Requirements iOS 9.0+ tvOS 9.0

STDev 6 Mar 26, 2021
ThreeDCardView - Library that you can see images with a 3D card 🌌

?? ThreeDCardView Usage First you have to import 'ThreeDCardView' import 'ThreeDCardView' Create ThreeDCardView and set the frame let threeDCardView:T

Fomagran 4 Jul 9, 2022