{"id":17999022,"url":"https://github.com/sam-spencer/easier-cgrect","last_synced_at":"2025-04-04T07:12:27.182Z","repository":{"id":63920451,"uuid":"204572458","full_name":"Sam-Spencer/Easier-CGRect","owner":"Sam-Spencer","description":"Making CGRect play nice with data storage and calculations is annoying. Easier CGRect is a straightforward Swift extension that adds critically missing / boilerplate functionality to CGRect..","archived":false,"fork":false,"pushed_at":"2021-08-24T23:03:01.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T23:31:16.524Z","etag":null,"topics":["cgpoint","cgrect","cgsize","coregraphics"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sam-Spencer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"Sam-Spencer"}},"created_at":"2019-08-26T22:29:20.000Z","updated_at":"2021-08-24T23:03:04.000Z","dependencies_parsed_at":"2022-11-29T10:45:16.285Z","dependency_job_id":null,"html_url":"https://github.com/Sam-Spencer/Easier-CGRect","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sam-Spencer%2FEasier-CGRect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sam-Spencer%2FEasier-CGRect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sam-Spencer%2FEasier-CGRect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sam-Spencer%2FEasier-CGRect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sam-Spencer","download_url":"https://codeload.github.com/Sam-Spencer/Easier-CGRect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135161,"owners_count":20889421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cgpoint","cgrect","cgsize","coregraphics"],"created_at":"2024-10-29T22:09:45.357Z","updated_at":"2025-04-04T07:12:27.163Z","avatar_url":"https://github.com/Sam-Spencer.png","language":"Swift","funding_links":["https://github.com/sponsors/Sam-Spencer"],"categories":[],"sub_categories":[],"readme":"# Easier CGRect\nMaking `CGRect` play nice with data storage and calculations is annoying. That's fixed with a simple extension.\n\n## Installation\n\n 1. Drag the file into your Xcode project.\n 2. That's it.\n \n Or, you can use Swift Package Manager if your heart so desires.\n \n## Usage\n\nDirectly access `NSNumber` values for `CGRect` properties without needing to write repetitive boilerplate code that converts `origin` and `size` values.\n\n\n```swift\nlet bounds = CGRect.init(x: 10, y: 10, width: 100, height: 300)\n    \n// CGRect extension lets you retrieve an NSNumber for any x, y, width, or height value\nlet heightForCoreData: NSNumber = bounds.number(from: .height)\n    \n// CGSize extension lets you directly retrieve the number value as a calculated property\nlet heightFromCGSizeForCoreData: NSNumber = bounds.size.heightNumber\n```\n    \nDirectly access `Float` values for `CGRect` to quickly perform type-safe, value-guaranteed calculation. Again, without needing to write repetitive boilerplate code that converts `origin` and `size` values.\n\n```swift\nlet frame = CGRect.init(x: 10, y: 10, width: 100, height: 300)\n    \n// CGRect extension lets you retrieve an Float for any x, y, width, or height value\nlet xForCalculation: Float = bounds.float(from: .x)\n    \n// CGPoint extension lets you directly retrieve the float value as a calculated property\nlet xFromCGPointForCoreData: Float = bounds.origin.xFloat\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam-spencer%2Feasier-cgrect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsam-spencer%2Feasier-cgrect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam-spencer%2Feasier-cgrect/lists"}