NamedPoint

0.1.0

Giving names to CGPoint values in CGRect
ollieatkinson/NamedPoint

What's New

0.1.0 - NamedPoint

2020-05-24T10:13:40Z

NamedPoint

A package to provide names for points in a frame.

public enum NamedPoint: String, Codable, Hashable {
    case topLeft,    topCenter,    topRight
    case middleLeft, middleCenter, middleRight
    case bottomLeft, bottomCenter, bottomRight
}

For example, just say .top(.left) or .topLeft and it will work on all platforms in all situations - we take care of the inconsistencies of for you.

let screen = CGRect(x: 0, y: 0, width: 3440, height: 1440)
let point = screen.point(at: .top(.right))

Quick Start

Include the dependency in your Package.swift file:

.package(url: "https://github.com/ollieatkinson/NamedPoint", .branch("master"))

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Jun 23 2023 07:50:17 GMT-0900 (Hawaii-Aleutian Daylight Time)