Swiftpack.co - roverdotcom/pet-focus as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by roverdotcom.
roverdotcom/pet-focus 0.0.2
An image view that automatically centers on dogs and cats.
⭐️ 4
🕓 4 years ago
iOS
.package(url: "https://github.com/roverdotcom/pet-focus.git", from: "0.0.2")

PetFocus

PetFocus is an image view that automatically centers images on any pets (dogs or cats) shown in the image. It's useful when cropping photos to squares or circles. Pets don't always cooperate when they're having their photos taken, so PetFocus helps show the best part of any photo, no matter how it actually turned out.

PetFocus is usable in projects deployed on iOS 10 and up, but will only perform pet-focused cropping on iOS 13. When running on versions older than iOS 13, PetFocus will fall back to the default cropping behavior.

Read more about the creation of PetFocus on the Rover Engineering blog.

Installing

Swift Package Manager

In Xcode 11, you can use the new Swift Package Manager integration to add PetFocus to your project. Select the menu item File > Swift Packages > Add Package Dependency… and enter in the PetFocus repository URL to add the package to your project:

https://github.com/roverdotcom/pet-focus.git

Carthage

If your project doesn't currently use Swift Package Manager, you can also use Carthage. If your project is already using Carthage, just add PetFocus to your Cartfile:

github "roverdotcom/pet-focus" == 0.0.2

CocoaPods

PetFocus can also be added via CocoaPods. Simply add the following to your Podfile:

pod 'PetFocus', :git => 'https://github.com/roverdotcom/pet-focus.git'

Usage

PetFocus provides PetFocusedImageView, a drop-in replacement for UIImageView. It can be used in exactly the same way as a UIImageView.

import PetFocus

class PetViewController: UIViewController {
    func viewDidLoad() {
        let imageView = PetFocusedImageView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
        addSubview(imageView)
        imageView.image = myDogImage
    }
}

License

PetFocus is available under the MIT License. See the LICENSE file for details.

GitHub

link
Stars: 4
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Test release 0.0.1
4 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics