{"id":25195940,"url":"https://github.com/simplisticated/laconic","last_synced_at":"2025-12-12T06:18:32.124Z","repository":{"id":56919587,"uuid":"45689170","full_name":"simplisticated/Laconic","owner":"simplisticated","description":"Short and clear expressions in Swift.","archived":false,"fork":false,"pushed_at":"2017-10-31T21:39:23.000Z","size":102,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T17:04:11.189Z","etag":null,"topics":["expression","operator","swift"],"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":"2015-11-06T15:14:40.000Z","updated_at":"2021-12-23T11:07:35.000Z","dependencies_parsed_at":"2022-08-21T04:50:29.488Z","dependency_job_id":null,"html_url":"https://github.com/simplisticated/Laconic","commit_stats":null,"previous_names":["igormatyushkin014/laconic","russo-programmisto/laconic"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FLaconic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FLaconic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FLaconic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FLaconic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplisticated","download_url":"https://codeload.github.com/simplisticated/Laconic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253112073,"owners_count":21856069,"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":["expression","operator","swift"],"created_at":"2025-02-10T01:39:10.866Z","updated_at":"2025-12-12T06:18:32.068Z","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/Laconic/blob/master/Logo/logo-1024-300.png\" alt=\"Laconic\" title=\"Laconic\"\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-4.0-orange.svg?style=flat\"\u003e\u003c/a\u003e\n\u003ca href=\"https://cocoapods.org\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/v/Laconic.svg?maxAge=2592000\"\u003e\u003c/a\u003e\n\u003ca href=\"https://cocoapods.org\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/dt/Laconic.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# Laconic\n\nShort and clear expressions in Swift.\n\n## How To Get Started\n\n- Copy content of `Laconic` folder to your project.\n\nor\n\n- Use `Laconic` cocoapod\n\n## Requirements\n\n* iOS 9 and later\n* Xcode 9 and later\n\n## Usage\n\n### Square roots\n\n```swift\n/*\n * Square root of 2nd degree.\n */\n\nlet someNumber = 4\nlet squareRoot = √someNumber                  // 2\n\n/*\n * Square root of 8th degree.\n */\n \nlet anotherSquareRoot = √√√65536              // 4\n\n/*\n * Square root of 16th degree.\n */\n\nlet oneMoreSquareRoot = √√√√(124500 + 3500)   // 2.085454039791327\n\n```\n\n### Equality\n\n```swift\n/*\n * You can use ≤ operator instead of \u003c=, and ≥ instead of \u003e=\n */\n\nlet eightIsMoreOrEqualToHalf = 8 ≥ 0.5            // true\n\nlet oneIsMoreOrEqualToSeven = 1 ≥ 7               // false\n\nlet twentyFourIsLessOrEqualToNinety = 24 ≤ 90     // true\n```\n\n### Sum\n\n```swift\n/*\n * Example of sum of several numbers.\n */\n\nlet numbers = [\n    8,\n    241,\n    382,\n    90\n]\n\nlet sumOfNumbers = ∑numbers            // 721\n\n/*\n * Also, you can get sum of strings.\n */\n\nlet sumOfStrings = ∑[\"a\", \"b\", \"c\"]    // abc\n\n/*\n * If you use ∑ operator with array of UIView objects,\n * you will get another UIView,\n * which is a superview for those elements in array.\n * In other words, each view in array will be added to container as a subview\n * and finally the container will be returned as a result of operation.\n */\n\nlet view1 = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 20.0, height: 20.0))\nview1.backgroundColor = .greenColor()\n\nlet view2 = UIView(frame: CGRect(x: 20.0, y: 0.0, width: 20.0, height: 20.0))\nview2.backgroundColor = .blueColor()\n\nlet container = ∑[view1, view2]\n```\n\n### Views\n\n```swift\nlet view1 = UIView()\nlet label1 = UILabel()\nlet containerView = UIView() // Will be used as superview for view1\n\n/*\n * Set {0, 0, 200, 200} frame for view1.\n */\n\nview1 --\u003e CGRect(x: 0, y: 0, width: 200, height: 200)\n\n/*\n * Also, it's possible to set frame by this command.\n */\n\nview1 --\u003e (0, 0, 200, 200)\n\n/*\n * Set green background color for view1.\n */\n\nview1 --\u003e .greenColor()\n\n/*\n * Add view1 to containerView as a subview.\n */\n\nview1 --\u003e containerView\n\n/*\n * All those operations can be done in one line of code.\n */\n\nview1 --\u003e (0, 0, 200, 200) --\u003e .greenColor() --\u003e containerView\n\n/*\n * Assume we want to set container's background color to blue.\n */\n\nview1 --\u003e (0, 0, 200, 200) --\u003e .greenColor() --\u003e (containerView --\u003e .blueColor())\n\n/*\n * Set label's text to \"Hello\" and add this label to view1.\n */\n\nlabel1 --\u003e \"Hello\" --\u003e view1.bounds --\u003e view1\n\n/*\n * Set label's text, font, text alignment, frame and finally add to view1.\n */\n\nlabel1 --\u003e \"Hello\" --\u003e UIFont.systemFontOfSize(20.0) --\u003e .Center --\u003e view1.bounds --\u003e view1\n```\n\nHere is the full list of supported operators for manipulating views:\n\n```swift\n/*\n * Set background color for UIView object.\n */\n\nlet view1 = UIView()\nview1 --\u003e .greenColor()\n\n/*\n * Set frame for UIView object.\n */\n\nview1 --\u003e CGRect(x: 0, y: 0, width: 200, height: 200)\n\n/*\n * Set frame for UIView object.\n */\n\nview1 --\u003e (0, 0, 200, 200)\n\n/*\n * Set top left coordinate for UIView object.\n */\n\nview1 --\u003e CGPoint(x: 20, y: 20)\n\n\n/*\n * Set size for UIView object.\n */\n\nview1 --\u003e CGSize(width: 200, height: 200)\n\n\n/*\n * Add UIView object as subview to another UIView object.\n */\n\nview1 --\u003e containerView\n\n/*\n * Set text for UILabel object.\n */\n\nlet label1 = UILabel()\nlabel1 --\u003e \"Hello\"\n\n/*\n * Set attributed text for UILabel object.\n */\n\nlet textAttributes: [String : AnyObject] = [\n    NSFontAttributeName: UIFont.systemFontOfSize(20.0),\n    NSForegroundColorAttributeName: UIColor.blackColor(),\n    NSKernAttributeName: 0.5\n]\n\nlet attributedText = NSAttributedString(string: \"Hello\", attributes: textAttributes)\n\nlabel1 --\u003e attributedText\n\n/*\n * Set font for UILabel object.\n */\n\nlabel1 --\u003e UIFont.systemFontOfSize(20.0)\n\n\n/*\n * Set text alignment for UILabel object.\n */\n\nlabel1 --\u003e .Center\n\n/*\n * Set text for UITextView object.\n */\n\nlet textView1 = UITextView()\ntextView1 --\u003e \"Hello\"\n\n/*\n * Set attributed text for UITextView object.\n */\n\ntextView1 --\u003e attributedText\n\n/*\n * Set font for UITextView object.\n */\n\ntextView1 --\u003e UIFont.systemFontOfSize(20.0)\n\n/*\n * Set text alignment for UITextView object.\n */\n\ntextView1 --\u003e .Center\n\n/*\n * Set title for UIButton object.\n */\n\nlet button1 = UIButton()\nbutton1 --\u003e \"Hello\"\n\n/*\n * Set attributed title for UIButton object.\n */\n\nbutton1 --\u003e attributedText\n\n/*\n * Set image to UIImageView object.\n */\n\nlet image = UIImage(named: \"image_name\")\n\nlet imageView1 = UIImageView()\nimageView1 --\u003e image\n\n/*\n * Set title for UINavigationItem object.\n */\n\nlet navigationItem1 = UINavigationItem()\nnavigationItem1 --\u003e \"Hello\"\n\n\n/*\n * Remove view from superview.\n */\n\nview1--\u003e\n```\n\n## License\n\n`Laconic` 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%2Flaconic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplisticated%2Flaconic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Flaconic/lists"}