{"id":25195973,"url":"https://github.com/simplisticated/frame","last_synced_at":"2025-04-04T15:44:09.868Z","repository":{"id":56911648,"uuid":"115181961","full_name":"simplisticated/Frame","owner":"simplisticated","description":"Simplification of work with layout in iOS","archived":false,"fork":false,"pushed_at":"2020-03-03T12:30:37.000Z","size":345,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-03-15T06:22:21.014Z","etag":null,"topics":["bounds","cgrect","cgsize","frame","swift","uikit","uiview"],"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/simplisticated.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-23T08:23:12.000Z","updated_at":"2023-06-09T22:29:54.000Z","dependencies_parsed_at":"2022-08-20T20:20:36.352Z","dependency_job_id":null,"html_url":"https://github.com/simplisticated/Frame","commit_stats":null,"previous_names":["hellowizman/frame"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FFrame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FFrame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FFrame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FFrame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplisticated","download_url":"https://codeload.github.com/simplisticated/Frame/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208022,"owners_count":20901568,"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":["bounds","cgrect","cgsize","frame","swift","uikit","uiview"],"created_at":"2025-02-10T01:39:15.929Z","updated_at":"2025-04-04T15:44:09.843Z","avatar_url":"https://github.com/simplisticated.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" \u003e\n\t\u003cimg src=\"/Images/logo_2048_2048.png\" alt=\"Frame\" title=\"Frame\" width=\"300px\" height=\"300px\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://swift.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://cocoapods.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/cocoapods/v/Frame.svg\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://cocoapods.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/cocoapods/dt/Frame.svg\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://tldrlegal.com/license/mit-license\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n# Frame\n\nSimplifies work with layout in iOS. Provides set of tools for managing view's position, size and many other things.\n\n## How To Get Started\n\n- Copy content of `Source` folder to your project.\n\nor\n\n- Use `Frame` cocoapod\n\n## Requirements\n\n* iOS 9 and later\n* Xcode 9 and later\n* Swift 4\n\n## Usage\n\n### String\n\nHeight of string with attributes:\n\n```swift\nlet attributes: [NSAttributedStringKey : Any] = [\n    .font: UIFont.systemFont(ofSize: 36.0, weight: .thin),\n    .kern: 0.5\n]\n\nlet height = \"Some text\".frm.height(forWidth: 200, andAttributes: attributes)\n```\n\nWidth of string with attributes:\n\n```swift\nlet width = \"Some text\".frm.width(forHeight: 200, andAttributes: attributes)\n```\n\nSize that fits:\n\n```swift\nlet constraintSize = CGSize(width: 200, height: CGFloat.greatestFiniteMagnitude)\nlet sizeThatFits = \"Some text\".frm.sizeThatFits(constraintSize, withAttributes: attributes)\n```\n\n### NSAttributedString\n\nHeight of attributed string:\n\n```swift\nlet attributes: [NSAttributedStringKey : Any] = [\n    .font: UIFont.systemFont(ofSize: 36.0, weight: .thin),\n    .kern: 0.5\n]\n\nlet attributedString = NSAttributedString(string: \"Some text\", attributes: attributes)\nlet height = attributedString.frm.height(forWidth: 200)\n```\n\nWidth of attributed string:\n\n```swift\nlet width = attributedString.frm.width(forHeight: 200)\n```\n\nSize that fits:\n\n```swift\nlet constraintSize = CGSize(width: 200, height: CGFloat.greatestFiniteMagnitude)\nlet sizeThatFits = attributedString.frm.sizeThatFits(constraintSize)\n```\n\n### UILabel\n\nLabel's height to fit attributed text:\n\n```swift\nlet attributes: [NSAttributedStringKey : Any] = [\n    .font: UIFont.systemFont(ofSize: 36.0, weight: .thin),\n    .kern: 0.5\n]\n\nlet attributedString = NSAttributedString(string: \"Some text\", attributes: attributes)\nlet label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 0))\nlet height = label.frm.height(forAttributedText: attributedString)\n```\n\n### CGRect\n\nInset:\n\n```swift\nlet sourceFrame = CGRect(x: 20, y: 20, width: 500, height: 350)\nlet resultFrame = sourceFrame.frm.inset(top: 10, left: 10, bottom: 10, right: 10) // (30, 30, 480, 330)\n```\n\nOffset:\n\n```swift\nlet sourceFrame = CGRect(x: 20, y: 20, width: 500, height: 350)\nlet resultFrame = sourceFrame.frm.offset(top: 10, left: 10, bottom: 10, right: 10) // (10, 10, 520, 370)\n```\n\n## License\n\n`Frame` is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fframe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplisticated%2Fframe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fframe/lists"}