MessageInputBar Overhall -> Top UIStackView, Autocomplete and Attachment managers#244
MessageInputBar Overhall -> Top UIStackView, Autocomplete and Attachment managers#244nathantannar4 wants to merge 4 commits into
Conversation
|
Ouch, It also looks like #155 made it in here and its not approved |
|
Its not as bad as it looks 😝 a lot of the extra lines were from breaking things apart |
|
|
||
| fileprivate var targetedCell:UICollectionViewCell? | ||
| fileprivate var targetedFrame = CGRect.zero | ||
| @objc func menuControllerWillShow(aNotification:Notification) { |
| // each type has its own random | ||
| public extension Bool { | ||
| /// SwiftRandom extension | ||
| public static func random() -> Bool { |
There was a problem hiding this comment.
We would have to include the LICENSE for this project and a link to it if we're going to use it to this extent
|
Removed AttachmentManager and AutocompleteManager to make this less of a major change |
cwalo
left a comment
There was a problem hiding this comment.
Just a couple of questions.
|
|
||
|
|
||
| switch message.data { | ||
| case .text, .attributedText: |
| makeButton(named: "ic_library").onTextViewDidChange { button, textView in | ||
| button.isEnabled = textView.text.isEmpty | ||
| makeButton(named: "ic_library").onSelected { | ||
| $0.tintColor = UIColor(red: 15/255, green: 135/255, blue: 255/255, alpha: 1.0) |
There was a problem hiding this comment.
How do we feel about pulling colors into their own Styles file or something?
There was a problem hiding this comment.
This is the Example
| let imagePicker = UIImagePickerController() | ||
| imagePicker.delegate = self | ||
| imagePicker.sourceType = .photoLibrary | ||
| self?.present(imagePicker, animated: true, completion: nil) |
There was a problem hiding this comment.
I recall instances where the ImagePickerController gets deallocated after it's dismissed because there's no strong reference to it outside of the block. Have you seen that? Speaking from hazy memory when adding a UIAlertAction that presents UIImagePickerController.
|
@nathantannar4 I'm going to close this for now. We'll discuss this how to move forward on this next meeting. Nonetheless, I appreciate the time you've put into this 👍 |
This is a large overhaul to the
MessageInputBarthat adds many new features and customization possibilities thanks to a newUIStackViewaddition which is anchored on top of the previous left/right stack views andInputTextView.To keep separation between the
MessageInputBarand the Autocomplete/Attachment functionality their properties and methods are held in their own manager objects which also makes it easy for users to change to add functionality to the managers (AttachmentManagerandAutocompleteManager).In addition there was a fair bit of clean up by moving some lines of code into their own methods and creating a new
InputStackViewandSeparatorLineclass in an attempt to keep the number of lines of code in the MessageInputBar reasonable.Opening this up to everyone! Feel free to tear it apart! Lets try and make this as good as it can be!