All Projects → GitHawkApp → Messageviewcontroller

GitHawkApp / Messageviewcontroller

Licence: mit
A SlackTextViewController replacement written in Swift for the iPhone X.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Messageviewcontroller

STTextView
📝 STTextView is a light-weight library that adds a placeholder to the UITextView.
Stars: ✭ 36 (-97.84%)
Mutual labels:  uikit, uitextview
Flamesui
A css-based web components.
Stars: ✭ 133 (-92.03%)
Mutual labels:  uikit
Distancepicker
Custom UIKit control to select a distance with a pan gesture, written in Swift
Stars: ✭ 118 (-92.93%)
Mutual labels:  uikit
Components
MobileUI was created thinking of making your hybrid application faster and smaller since you only install what you are really going to use for UI.
Stars: ✭ 125 (-92.51%)
Mutual labels:  uikit
Downloadbutton
Customizable App Store style download button
Stars: ✭ 1,532 (-8.15%)
Mutual labels:  uikit
Pbtreeview
An UITreeView implementation from UITableView that Apple missed in its UIKit framework. And it is in pure Swift.
Stars: ✭ 128 (-92.33%)
Mutual labels:  uikit
Vue Notus
Vue Notus: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 108 (-93.53%)
Mutual labels:  uikit
Uikitswiftdsl
Swift DSL for UIKit
Stars: ✭ 134 (-91.97%)
Mutual labels:  uikit
Combine Mvvm
Sample project with Combine & UIKit framework, MVVM architecture
Stars: ✭ 132 (-92.09%)
Mutual labels:  uikit
Uiimageheic
UIImage category that adds familiar HEIC encoding.
Stars: ✭ 125 (-92.51%)
Mutual labels:  uikit
Ios.blog.swiftui search bar in navigation bar
🔍 SwiftUI search bar in the navigation bar.
Stars: ✭ 124 (-92.57%)
Mutual labels:  uikit
Gskstretchyheaderview
A generic stretchy header for UITableView and UICollectionView
Stars: ✭ 1,624 (-2.64%)
Mutual labels:  uikit
Multiplatform Compose
A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.
Stars: ✭ 126 (-92.45%)
Mutual labels:  uikit
Movieflex ios
iOS application for Movie / Actor information with clean / intuitive UI and MVVM architecture.
Stars: ✭ 119 (-92.87%)
Mutual labels:  uikit
Paper Kit 2 Angular
Free Bootstrap 4 UI Kit for Angular 2+
Stars: ✭ 133 (-92.03%)
Mutual labels:  uikit
React Virgin
The react-native UI Kit you've been looking for.
Stars: ✭ 1,523 (-8.69%)
Mutual labels:  uikit
Awesome Tca
Awesome list for The Composable Architecture
Stars: ✭ 124 (-92.57%)
Mutual labels:  uikit
Kgnautolayout
Making AutoLayout Easy
Stars: ✭ 127 (-92.39%)
Mutual labels:  uikit
Bartinter
Dynamically changes status bar style depending on content behind it
Stars: ✭ 1,687 (+1.14%)
Mutual labels:  uikit
Overlap
Tiny iOS library to achieve overlap visual effect
Stars: ✭ 133 (-92.03%)
Mutual labels:  uikit

Installation

Just add MessageViewController to your Podfile and install. Done!

pod 'MessageViewController'

Setup

You must subclass MessageViewController.

import MessageViewController

class ViewController: MessageViewController {
  // ...
}

Finish setup using a UIScrollView. Remember this can also be a UITableView or UICollectionView.

func viewDidLoad() {
  super.viewDidLoad()
  setup(scrollView: scrollView)
}

Customizations

You can customize any part of the UI that you want!

// Border between the text view and the scroll view
borderColor = .lightGray

// Change the appearance of the text view and its content
messageView.inset = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16)
messageView.textView.placeholderText = "New message..."
messageView.textView.placeholderTextColor = .lightGray
messageView.font = .systemFont(ofSize: 17)

// Setup the button using text or an icon
messageView.set(buttonTitle: "Send", for: .normal)
messageView.addButton(target: self, action: #selector(onButton))
messageView.buttonTint = .blue

// Set custom attributes for an autocompleted string
let tintColor = .blue
messageAutocompleteController.autocompleteTextAttributes = ["@": [.font: UIFont.preferredFont(forTextStyle: .body), .foregroundColor: tintColor, .backgroundColor: tintColor.withAlphaComponent(0.1)]]

Autocomplete

The base view controller uses a MessageAutocompleteController control to handle text autocompletion.

This control uses a plain UITableView to display its autocomplete. Add a dataSource and delegate to display and handle interactions.

let tableView = messageAutocompleteController.tableView
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
tableView.dataSource = self
tableView.delegate = self

Then register for autocomplete prefixes you want to respond to and set a delegate to handle when a prefix is found.

messageAutocompleteController.register(prefix: "@")
messageAutocompleteController.delegate = self

Your delegate needs to implement just one method.

func didFind(controller: MessageAutocompleteController, prefix: String, word: String) {
  // filter your data
  controller.show(true)
}

Note: You can perform asyncronous autocomplete searches. Just be sure to call messageAutocompleteController.show() when finished.

Acknowledgements

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].