{"id":25195952,"url":"https://github.com/simplisticated/sirius","last_synced_at":"2025-04-04T15:44:06.805Z","repository":{"id":62455553,"uuid":"58260970","full_name":"simplisticated/Sirius","owner":"simplisticated","description":"View at Swift from another world.","archived":false,"fork":false,"pushed_at":"2016-09-23T18:10:57.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-10T01:39:10.261Z","etag":null,"topics":[],"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":"2016-05-07T10:23:48.000Z","updated_at":"2023-04-16T02:46:12.000Z","dependencies_parsed_at":"2022-11-02T00:16:40.714Z","dependency_job_id":null,"html_url":"https://github.com/simplisticated/Sirius","commit_stats":null,"previous_names":["igormatyushkin014/sirius"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FSirius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FSirius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FSirius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FSirius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplisticated","download_url":"https://codeload.github.com/simplisticated/Sirius/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":[],"created_at":"2025-02-10T01:39:11.981Z","updated_at":"2025-04-04T15:44:06.784Z","avatar_url":"https://github.com/simplisticated.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" \u003e\n  \u003cimg src=\"https://github.com/igormatyushkin014/Sirius/blob/master/Logo/logo-1024-300.png\" alt=\"Sirius\" title=\"Sirius\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://swift.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat\"\u003e\u003c/a\u003e\n\u003ca href=\"https://cocoapods.org\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/v/Sirius.svg?maxAge=2592000\"\u003e\u003c/a\u003e\n\u003ca href=\"https://cocoapods.org\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/dt/Sirius.svg?maxAge=2592000\"\u003e\u003c/a\u003e\n\u003ca href=\"https://tldrlegal.com/license/mit-license\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# At a Glance\n\nSwift is still a brand new language, which, very often, does not relieve the developer from writing a lot of boilerplate code. The main goal of `Sirius` framework is to simplify work with fundamental things in modern programming: the objects. Framework includes set of extensions for Swift's native types and protocols, which makes programming easier and allows to save many lines of code.\n\n##How To Get Started\n\n- Copy content of `Sirius` folder to your project.\n\nor\n\n- Use `Sirius` cocoapod\n\n## Requirements\n\n* iOS 9.0 and later\n* Xcode 8 and later\n\n**Note**: For Swift 2.x use `Sirius v1.0`. For Swift 3.0 use `Sirius v3.0`.\n\n## Usage\n\n### Manipulation with objects\n\n```swift\nlet object = SomeClass()\n\nobject.use { (object) in\n    // Do several operations with object...\n}\n\nobject.useAs(NSString.self) { (object) in\n    // Do something with object casted to NSString type...\n}\n```\n\nBoth methods `use` and `useAs` support chain calls, so it's possible to write something like this:\n\n```swift\nobject.use { (object) in\n    // Do several operations with object...\n}.useAs(NSString.self) { (object) in\n    // Do something with object casted to NSString type...\n}.useAs(NSNumber.self) { (object) in\n    // Do something with object casted to NSNumber type...\n}\n```\n\nSince two methods above return receiver's instance, you can use them with initializer like this:\n\n```swift\nlet view = UIView().use { (object) in\n    object --\u003e .blueColor()\n    object.clipsToBounds = true\n}\n```\n\nThis approach makes code more demonstrative and clear.\n\n### Class name\n\n```swift\nlet classNameIncludingNamespace = SomeClass.className(includeNamespace: true) // \"com.domain.appName.SomeClass\"\nlet classNameWithoutNamespace = SomeClass.className(includeNamespace: false) // \"SomeClass\"\n```\n\n### Real-life examples\n\nUsually, when you want to set up view's layer, for example - make corners rounded, you write a code like this:\n\n```swift\nview.layer.backgroundColor = UIColor.whiteColor().CGColor\nview.layer.borderColor = UIColor.blackColor().CGColor\nview.layer.borderWidth = 1.0\nview.layer.cornerRadius = view.bounds.size.width / 2.0\nview.layer.masksToBounds = true\n```\n\nWith `Sirius` you can forget about `view.` input on each line:\n\n```swift\nview.layer.use { (layer) in\n    layer.backgroundColor = UIColor.whiteColor().CGColor\n    layer.borderColor = UIColor.blackColor().CGColor\n    layer.borderWidth = 1.0\n    layer.cornerRadius = view.bounds.size.width / 2.0\n    layer.masksToBounds = true\n}\n```\n\nThe same you can do on initialization of the view:\n\n```swift\nlet view = UIView().use { (view) in\n    view.frame = CGRect(x: 0.0, y: 0.0, width: 200.0, height: 200.0)\n    \n    view.layer.use({ (layer) in\n        layer.backgroundColor = UIColor.whiteColor().CGColor\n        layer.borderColor = UIColor.blackColor().CGColor\n        layer.borderWidth = 1.0\n        layer.cornerRadius = view.bounds.size.width / 2.0\n        layer.masksToBounds = true\n    })\n}\n```\n\n## License\n\n`Sirius` is available under the MIT license. See the `LICENSE` file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fsirius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplisticated%2Fsirius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fsirius/lists"}