link your app with ImageCoordinateSpace.framework from Carthage/Build/iOS folder
Unit tests
To run included unit tests install dependencies via Carthage:
carthage bootstrap
Run tests:
xcodebuild test -scheme ImageCoordinateSpace -destination 'platform=iOS Simulator,name=iPhone 11 Pro'
See them pass at lightning speed:
Test Suite 'All tests' passed at 2017-12-13 08:07:14.826.
Executed 36 tests, with 0 failures (0 unexpected) in 0.013 (0.023) seconds
** TEST SUCCEEDED **
Image Coordinate Space
UICoordinateSpace
forUIImageView
imageUsage
Convert
CGPoint
from image coordinates to view coordinates:Convert
CGPoint
from view coordinates to image coordinates:Similar conversions are available for
CGRect
:and from view coordinates to image coordinates:
Examples
Add positioned image overlay
Open included Xcode Example project to see Xcode Playground: Example/Visual.playground
Converting image face detection regions to view touch points
Other uses from popular Stackoverflow questions:
Documentation
HeaderDoc is included, see UIImageView+UICoordinateSpace.swift
Installation
CocoaPods
pod 'ImageCoordinateSpace'
pod install
Carthage
add to your Cartfile:
github "paulz/ImageCoordinateSpace"
run
carthage update
link your app with
ImageCoordinateSpace.framework
fromCarthage/Build/iOS
folderUnit tests
To run included unit tests install dependencies via Carthage:
Run tests:
See them pass at lightning speed:
Author
Paul Zabelin, https://github.com/paulz
License
ImageCoordinateSpace is available under the MIT license. See the LICENSE file for more info.