Skip to content

ollieatkinson/NamedPoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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"))

About

Giving names to CGPoint values in CGRect

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages