TextToolBar

public final class TextToolBar : UIView
extension TextToolBar: UITextViewDelegate
extension TextToolBar: UICollectionViewDataSource

Undocumented

  • Undocumented

    Declaration

    Swift

    public static let safeAreaBottom: CGFloat
  • Undocumented

    Declaration

    Swift

    public static let textContainerHeight: CGFloat
  • Undocumented

    Declaration

    Swift

    public static let textContainerMaxHeight: CGFloat
  • Undocumented

    Declaration

    Swift

    public static let avatarWidth: CGFloat
  • Undocumented

    Declaration

    Swift

    public static let replyContainerHeight: CGFloat
  • Undocumented

    Declaration

    Swift

    public static let imagesCollectionHeight: CGFloat
  • Undocumented

    Declaration

    Swift

    public static let openGraphPreviewContainerHeight: CGFloat
  • Returns an instance of TextToolBar.

    Declaration

    Swift

    public static func make() -> TextToolBar

Text View Container

  • Declaration

    Swift

    public private(set) lazy var avatarView: AvatarView { get set }
  • An UITextView. You have to use the text property to change the value of the text view.

    Declaration

    Swift

    public private(set) lazy var textView: UITextView { get set }
  • The default text view attributes.

    Declaration

    Swift

    public var textViewTextAttributes: [NSAttributedString.Key : Any]
  • A placeholder label. You have to use the placeholderText property to change the value of the placeholder label.

    Declaration

    Swift

    public private(set) lazy var placeholderLabel: UILabel { get set }
  • A send button.

    Declaration

    Swift

    public private(set) lazy var sendButton: UIButton { get set }
  • An UIActivityIndicatorView.

    Declaration

    Swift

    public private(set) lazy var activityIndicatorView: UIActivityIndicatorView { get set }
  • The text of the text view.

    Declaration

    Swift

    public var text: String { get set }
  • An option to show the avatar.

    Declaration

    Swift

    public var showAvatar: Bool { get set }
  • The send button title by default.

    Declaration

    Swift

    public var sendTitle: String
  • The cancel title of the send button by default.

    Declaration

    Swift

    public var cancelTitle: String
  • The placeholder text.

    Declaration

    Swift

    public var placeholderText: String { get set }

Reply Container

  • A reply text.

    Declaration

    Swift

    public var replyText: String? { get set }

Open Graph Container

  • Enables the detector of links in the text.

    Declaration

    Swift

    public var linksDetectorEnabled: Bool
  • The color of underline that founded link in the text.

    Declaration

    Swift

    public var linksHighlightColor: UIColor
  • The Open Graph data of the founded link in the text.

    Declaration

    Swift

    public internal(set) var openGraphData: OGResponse? { get }

Images Collection View

  • Picked images.

    Declaration

    Swift

    public var images: [UIImage]
  • Add the TextToolBar to a view container. Use this method to add TextToolBar to the view hierarchy and you no need to do any other layout actions.

    Declaration

    Swift

    public func addToSuperview(_ view: UIView,
                               placeholderText: String = "Leave a message",
                               sendButtonAction: UIControl.Action? = nil)

    Parameters

    view

    the superview.

    placeholderText

    the placeholder text.

    sendButtonAction

    the send button action.

  • Check if the content is valid: text is not empty or at least one image was added.

    Declaration

    Swift

    public var isValidContent: Bool { get }
  • Reset states of all child views and clear all added/generated data.

    Declaration

    Swift

    public func reset()
  • Toggle isUserInteractionEnabled states for all child views.

    Declaration

    Swift

    public var isEnabled: Bool { get set }
  • Update the placeholder and send button visibility.

    Declaration

    Swift

    public func updatePlaceholder()
  • Add an Activity to the flat feed.

    Declaration

    Swift

    public func addActivity(to flatFeed: FlatFeed, completion: @escaping ActivityCompletion<Activity>)
  • Undocumented

    Declaration

    Swift

    func updateOpenGraph(_ dataDetectorURLItems: [DataDetectorURLItem])
  • Undocumented

    Declaration

    Swift

    func underlineLinks(with dataDetectorURLItems: [DataDetectorURLItem])
  • Undocumented

    Declaration

    Swift

    func updateOpenGraphPreview()
  • Upload images and get URL’s.

    Declaration

    Swift

    public func uploadImages(imagePrefixFileName: String = "image",
                             _ completion: @escaping (_ imageURLs: [URL]?, _ error: Error?) -> Void)

Text View Height

  • Update the height of the text view for a big text length.

    Declaration

    Swift

    func updateTextHeightIfNeeded()

Text View Delegate

Keyboard Events

  • Undocumented

    Declaration

    Swift

    @objc
    func keyboardUpdated(_ notification: NSNotification)

Images Collection View

  • Enables the image picking with a given view controller. The view controller will be used to present UIImagePickerController.

    Declaration

    Swift

    public func enableImagePicking(with viewController: UIViewController)
  • Undocumented

    Declaration

    Swift

    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
  • Undocumented

    Declaration

    Swift

    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell