SkillAgentSearch skills...

NamedPoint

Giving names to CGPoint values in CGRect

Install / Use

/learn @ollieatkinson/NamedPoint
About this skill

Quality Score

0/100

Supported Platforms

Universal

Tags

README

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

Related Skills

View on GitHub
GitHub Stars9
CategoryDevelopment
Updated4y ago
Forks0

Languages

Swift

Security Score

55/100

Audited on Nov 9, 2021

No findings