Skip to content

MessageInputBar Overhall -> Top UIStackView, Autocomplete and Attachment managers#244

Closed
nathantannar4 wants to merge 4 commits into
v0.10.0from
feature/messageInputBarV2
Closed

MessageInputBar Overhall -> Top UIStackView, Autocomplete and Attachment managers#244
nathantannar4 wants to merge 4 commits into
v0.10.0from
feature/messageInputBarV2

Conversation

@nathantannar4

Copy link
Copy Markdown
Member

This is a large overhaul to the MessageInputBar that adds many new features and customization possibilities thanks to a new UIStackView addition which is anchored on top of the previous left/right stack views and InputTextView.

To keep separation between the MessageInputBar and 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 (AttachmentManager and AutocompleteManager).

In addition there was a fair bit of clean up by moving some lines of code into their own methods and creating a new InputStackView and SeparatorLine class 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!

@SD10

SD10 commented Oct 7, 2017

Copy link
Copy Markdown
Member

Ouch, +2500 additions and 25 files modified. Starting at ~500 lines PRs get difficult. I wish we could've broken this up into multiple PRs and done it slowly.

It also looks like #155 made it in here and its not approved

@nathantannar4

Copy link
Copy Markdown
Member Author

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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is not approved yet :/

Comment thread Example/Sources/Random.swift Outdated
// each type has its own random
public extension Bool {
/// SwiftRandom extension
public static func random() -> Bool {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@nathantannar4

Copy link
Copy Markdown
Member Author

Removed AttachmentManager and AutocompleteManager to make this less of a major change

@cwalo cwalo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of questions.



switch message.data {
case .text, .attributedText:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs .emoji case, no?

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we feel about pulling colors into their own Styles file or something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the Example

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Derp... carry on.

let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = .photoLibrary
self?.present(imagePicker, animated: true, completion: nil)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SD10 SD10 changed the base branch from v0.9.0 to v0.10.0 October 10, 2017 00:59
@SD10

SD10 commented Oct 17, 2017

Copy link
Copy Markdown
Member

@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 👍

@SD10 SD10 closed this Oct 17, 2017
@nathantannar4 nathantannar4 deleted the feature/messageInputBarV2 branch October 23, 2017 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants