{"id":1589,"url":"https://github.com/GitHawkApp/MessageViewController","last_synced_at":"2025-08-02T04:31:47.269Z","repository":{"id":52238954,"uuid":"116085251","full_name":"GitHawkApp/MessageViewController","owner":"GitHawkApp","description":"A SlackTextViewController replacement written in Swift for the iPhone X.","archived":false,"fork":false,"pushed_at":"2019-09-25T20:40:15.000Z","size":490,"stargazers_count":1676,"open_issues_count":24,"forks_count":93,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-11-24T20:48:11.987Z","etag":null,"topics":["githawk","ios","swift","uikit","uitextview"],"latest_commit_sha":null,"homepage":"http://githawk.com","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/GitHawkApp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-01-03T03:11:50.000Z","updated_at":"2024-10-12T12:26:00.000Z","dependencies_parsed_at":"2022-08-26T05:50:43.061Z","dependency_job_id":null,"html_url":"https://github.com/GitHawkApp/MessageViewController","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/GitHawkApp%2FMessageViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHawkApp%2FMessageViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHawkApp%2FMessageViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHawkApp%2FMessageViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitHawkApp","download_url":"https://codeload.github.com/GitHawkApp/MessageViewController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228438976,"owners_count":17920017,"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":["githawk","ios","swift","uikit","uitextview"],"created_at":"2024-01-05T20:15:50.608Z","updated_at":"2024-12-06T08:31:14.429Z","avatar_url":"https://github.com/GitHawkApp.png","language":"Swift","funding_links":[],"categories":["Messaging","Swift","Content"],"sub_categories":["Video","Other free courses","Messages"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/animation.gif\" /\u003e\n\u003c/p\u003e\n\n## Installation\n\nJust add `MessageViewController` to your Podfile and install. Done!\n\n```ruby\npod 'MessageViewController'\n```\n\n## Setup\n\nYou must subclass `MessageViewController`.\n\n```swift\nimport MessageViewController\n\nclass ViewController: MessageViewController {\n  // ...\n}\n```\n\nFinish setup using a `UIScrollView`. Remember this can also be a `UITableView` or `UICollectionView`.\n\n```swift\nfunc viewDidLoad() {\n  super.viewDidLoad()\n  setup(scrollView: scrollView)\n}\n```\n\n## Customizations\n\nYou can customize any part of the UI that you want!\n\n```swift\n// Border between the text view and the scroll view\nborderColor = .lightGray\n\n// Change the appearance of the text view and its content\nmessageView.inset = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16)\nmessageView.textView.placeholderText = \"New message...\"\nmessageView.textView.placeholderTextColor = .lightGray\nmessageView.font = .systemFont(ofSize: 17)\n\n// Setup the button using text or an icon\nmessageView.set(buttonTitle: \"Send\", for: .normal)\nmessageView.addButton(target: self, action: #selector(onButton))\nmessageView.buttonTint = .blue\n\n// Set custom attributes for an autocompleted string\nlet tintColor = .blue\nmessageAutocompleteController.autocompleteTextAttributes = [\"@\": [.font: UIFont.preferredFont(forTextStyle: .body), .foregroundColor: tintColor, .backgroundColor: tintColor.withAlphaComponent(0.1)]]\n```\n\n## Autocomplete\n\nThe base view controller uses a `MessageAutocompleteController` control to handle text autocompletion.\n\nThis control uses a plain `UITableView` to display its autocomplete. Add a `dataSource` and `delegate` to display and handle interactions.\n\n```swift\nlet tableView = messageAutocompleteController.tableView\ntableView.register(UITableViewCell.self, forCellReuseIdentifier: \"cell\")\ntableView.dataSource = self\ntableView.delegate = self\n```\n\nThen register for autocomplete prefixes you want to respond to and set a `delegate` to handle when a prefix is found.\n\n```swift\nmessageAutocompleteController.register(prefix: \"@\")\nmessageAutocompleteController.delegate = self\n```\n\nYour delegate needs to implement just one method.\n\n```swift\nfunc didFind(controller: MessageAutocompleteController, prefix: String, word: String) {\n  // filter your data\n  controller.show(true)\n}\n```\n\n\u003e **Note:** You can perform asyncronous autocomplete searches. Just be sure to call `messageAutocompleteController.show()` when finished.\n\n## Acknowledgements\n\n- Heavy inspiration from [SlackTextViewController](https://github.com/slackhq/SlackTextViewController)\n- Created with ❤️ by [Ryan Nystrom](https://twitter.com/_ryannystrom)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGitHawkApp%2FMessageViewController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGitHawkApp%2FMessageViewController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGitHawkApp%2FMessageViewController/lists"}