Skip to content

Commit

Permalink
Fix some Xcode 9 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
irace committed Jan 5, 2018
1 parent 6389e66 commit b5e8332
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public protocol BaseMessageInteractionHandlerProtocol {

open class BaseMessagePresenter<BubbleViewT, ViewModelBuilderT, InteractionHandlerT>: BaseChatItemPresenter<BaseMessageCollectionViewCell<BubbleViewT>> where
ViewModelBuilderT: ViewModelBuilderProtocol,
ViewModelBuilderT.ViewModelT: MessageViewModelProtocol,
InteractionHandlerT: BaseMessageInteractionHandlerProtocol,
InteractionHandlerT.ViewModelT == ViewModelBuilderT.ViewModelT,
BubbleViewT: UIView,
Expand Down
6 changes: 3 additions & 3 deletions ChattoAdditions/Source/Input/ChatInputBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ extension ChatInputBar: UITextViewDelegate {
public func textView(_ textView: UITextView, shouldChangeTextIn nsRange: NSRange, replacementText text: String) -> Bool {
let range = self.textView.text.bma_rangeFromNSRange(nsRange)
if let maxCharactersCount = self.maxCharactersCount {
let currentCount = textView.text.characters.count
let rangeLength = textView.text.substring(with: range).characters.count
let nextCount = currentCount - rangeLength + text.characters.count
let currentCount = textView.text.count
let rangeLength = textView.text[range].count
let nextCount = currentCount - rangeLength + text.count
return UInt(nextCount) <= maxCharactersCount
}
return true
Expand Down
2 changes: 1 addition & 1 deletion ChattoAdditions/Source/Input/ReusableXibView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import UIKit
for constraint in constraints {
let firstItem = constraint.firstItem === self ? loadedView : constraint.firstItem
let secondItem = constraint.secondItem === self ? loadedView : constraint.secondItem
loadedView.addConstraint(NSLayoutConstraint(item: firstItem, attribute: constraint.firstAttribute, relatedBy: constraint.relation, toItem: secondItem, attribute: constraint.secondAttribute, multiplier: constraint.multiplier, constant: constraint.constant))
loadedView.addConstraint(NSLayoutConstraint(item: firstItem as Any, attribute: constraint.firstAttribute, relatedBy: constraint.relation, toItem: secondItem, attribute: constraint.secondAttribute, multiplier: constraint.multiplier, constant: constraint.constant))
}
return loadedView
} else {
Expand Down

0 comments on commit b5e8332

Please sign in to comment.