{"id":2571,"url":"https://github.com/1amageek/Toolbar","last_synced_at":"2025-08-03T00:32:05.743Z","repository":{"id":56924390,"uuid":"88851916","full_name":"1amageek/Toolbar","owner":"1amageek","description":"Awesome autolayout Toolbar. Toolbar is a library for iOS. You can easily create chat InputBar.","archived":false,"fork":false,"pushed_at":"2021-01-14T08:42:42.000Z","size":4469,"stargazers_count":455,"open_issues_count":8,"forks_count":32,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-11-24T16:42:51.998Z","etag":null,"topics":["autolayout","inputbar","ios","swift","toolbar"],"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/1amageek.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-04-20T10:12:47.000Z","updated_at":"2024-10-17T01:30:00.000Z","dependencies_parsed_at":"2022-08-21T05:20:45.646Z","dependency_job_id":null,"html_url":"https://github.com/1amageek/Toolbar","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1amageek%2FToolbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1amageek%2FToolbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1amageek%2FToolbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1amageek%2FToolbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1amageek","download_url":"https://codeload.github.com/1amageek/Toolbar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510736,"owners_count":17931759,"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":["autolayout","inputbar","ios","swift","toolbar"],"created_at":"2024-01-05T20:16:17.201Z","updated_at":"2024-12-06T18:30:35.237Z","avatar_url":"https://github.com/1amageek.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Keyboard","Other free courses"],"readme":"# Toolbar\n\n\u003cimg src=\"https://github.com/1amageek/Toolbar/blob/master/Toolbar.png\" width=\"640px\"\u003e\n\n [![Version](http://img.shields.io/cocoapods/v/Toolbar.svg)](http://cocoapods.org/?q=Toolbar)\n [![Platform](http://img.shields.io/cocoapods/p/Toolbar.svg)](http://cocoapods.org/?q=Toolbar)\n [![Downloads](https://img.shields.io/cocoapods/dt/Toolbar.svg?label=Total%20Downloads\u0026colorB=28B9FE)](https://cocoapods.org/pods/Toolbar)\n\nThis toolbar is made with Autolayout.\nIt works more interactively than UIToolbar.\n\n\u003cimg src=\"https://github.com/1amageek/pls_donate/blob/master/kyash.jpg\" width=\"200px\"\u003e\n\nPlease Donate\n\n\u003cimg src=\"https://github.com/1amageek/Toolbar/blob/master/Toolbar.gif\" width=\"320px\"\u003e\n\n _Slow Animations Debug mode_\n \nIf you want a Toolbar that works with the keyboard, please see here.\nhttps://github.com/1amageek/OnTheKeyboard\n\n## Installation\n\n__[CocoaPods](https://github.com/cocoapods/cocoapods)__\n\n- Inset `pod 'Toolbar'` to your Podfile.\n- Run `pod install`\n\n## Usage\n\nHeight and Width of the Toolbar are determined automatically.\nDo not set frame.\n\nInitialization.\n```\nlet toolbar: Toolbar = Toolbar()\n```\n\n``` swift\n\nlet toolbar: Toolbar = Toolbar()\n\nlazy var camera: ToolbarItem = {\n    let item: ToolbarItem = ToolbarItem(image: #imageLiteral(resourceName: \"camera\"), target: nil, action: nil)\n    return item\n}()\n\nlazy var microphone: ToolbarItem = {\n    let item: ToolbarItem = ToolbarItem(image: #imageLiteral(resourceName: \"microphone\"), target: nil, action: nil)\n    return item\n}()\n\nlazy var picture: ToolbarItem = {\n    let item: ToolbarItem = ToolbarItem(image: #imageLiteral(resourceName: \"picture\"), target: nil, action: nil)\n    return item\n}()\n\nvar toolbarBottomConstraint: NSLayoutConstraint?\n\noverride func loadView() {\n    super.loadView()\n    self.view.addSubview(toolbar)\n    self.toolbarBottomConstraint = self.toolbar.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: 0)\n    self.toolbarBottomConstraint?.isActive = true\n}\n\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    self.toolbar.maximumHeight = 100\n    self.toolbar.setItems([self.camera, self.picture, self.microphone], animated: false)\n}\n\n```\n\n### Hide items\n``` Swift\nfunc hideItems() {\n    self.camera.setHidden(false, animated: true)\n    self.microphone.setHidden(false, animated: true)\n    self.picture.setHidden(false, animated: true)\n}\n```\n\n### Stretchable TextView\n\nYou can control the height by setting `maximumHeight`.\n\n``` Swift\n// ViewController\n\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    self.toolbar.maximumHeight = 100\n    let textView: UITextView = UITextView(frame: .zero)\n    textView.delegate = self\n    textView.font = UIFont.systemFont(ofSize: 14)\n    self.toolbar.setItems([textView], animated: false)\n}\n\n// UITextViewDelegate\nfunc textViewDidChange(_ textView: UITextView) {\n    let size: CGSize = textView.sizeThatFits(textView.bounds.size)\n    if let constraint: NSLayoutConstraint = self.constraint {\n        textView.removeConstraint(constraint)\n    }\n    self.constraint = textView.heightAnchor.constraint(equalToConstant: size.height)\n    self.constraint?.priority = UILayoutPriorityDefaultHigh\n    self.constraint?.isActive = true\n}\n\nvar constraint: NSLayoutConstraint?\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1amageek%2FToolbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1amageek%2FToolbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1amageek%2FToolbar/lists"}