From b4308dcd7b6eac38998ea0061a17e093e7ad1a98 Mon Sep 17 00:00:00 2001 From: Anton Schukin Date: Wed, 11 May 2016 10:43:48 +0100 Subject: [PATCH 1/2] Make BaseMessagePresenter.decorationAttributes public --- .../Source/Chat Items/BaseMessage/BaseMessagePresenter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChattoAdditions/Source/Chat Items/BaseMessage/BaseMessagePresenter.swift b/ChattoAdditions/Source/Chat Items/BaseMessage/BaseMessagePresenter.swift index 6c4fd8e..eb9ad5c 100644 --- a/ChattoAdditions/Source/Chat Items/BaseMessage/BaseMessagePresenter.swift +++ b/ChattoAdditions/Source/Chat Items/BaseMessage/BaseMessagePresenter.swift @@ -92,7 +92,7 @@ public class BaseMessagePresenter Void)?) { cell.performBatchUpdates({ () -> Void in self.messageViewModel.showsTail = decorationAttributes.showsTail From d84a9805a487a66a34f9ae3411c2f8c3e3206a13 Mon Sep 17 00:00:00 2001 From: Anton Schukin Date: Wed, 11 May 2016 10:49:07 +0100 Subject: [PATCH 2/2] Allow PhotoBubbleView to be subclassed --- .../PhotoMessages/Views/PhotoBubbleView.swift | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ChattoAdditions/Source/Chat Items/PhotoMessages/Views/PhotoBubbleView.swift b/ChattoAdditions/Source/Chat Items/PhotoMessages/Views/PhotoBubbleView.swift index 040227b..7a56057 100644 --- a/ChattoAdditions/Source/Chat Items/PhotoMessages/Views/PhotoBubbleView.swift +++ b/ChattoAdditions/Source/Chat Items/PhotoMessages/Views/PhotoBubbleView.swift @@ -35,13 +35,13 @@ public protocol PhotoBubbleViewStyleProtocol { func overlayColor(viewModel viewModel: PhotoMessageViewModelProtocol) -> UIColor? } -public final class PhotoBubbleView: UIView, MaximumLayoutWidthSpecificable, BackgroundSizingQueryable { +public class PhotoBubbleView: UIView, MaximumLayoutWidthSpecificable, BackgroundSizingQueryable { public var viewContext: ViewContext = .Normal public var animationDuration: CFTimeInterval = 0.33 public var preferredMaxLayoutWidth: CGFloat = 0 - override init(frame: CGRect) { + public override init(frame: CGRect) { super.init(frame: frame) self.commonInit() } @@ -58,7 +58,7 @@ public final class PhotoBubbleView: UIView, MaximumLayoutWidthSpecificable, Back self.addSubview(self.progressIndicatorView) } - private lazy var imageView: UIImageView = { + public private(set) lazy var imageView: UIImageView = { let imageView = UIImageView() imageView.autoresizingMask = .None imageView.clipsToBounds = true @@ -76,9 +76,7 @@ public final class PhotoBubbleView: UIView, MaximumLayoutWidthSpecificable, Back return view }() - - - private var progressIndicatorView: CircleProgressIndicatorView = { + public private(set) var progressIndicatorView: CircleProgressIndicatorView = { let progressView = CircleProgressIndicatorView(size: CGSize(width: 33, height: 33)) return progressView }() @@ -89,7 +87,6 @@ public final class PhotoBubbleView: UIView, MaximumLayoutWidthSpecificable, Back return imageView }() - public var photoMessageViewModel: PhotoMessageViewModelProtocol! { didSet { self.updateViews() @@ -122,7 +119,7 @@ public final class PhotoBubbleView: UIView, MaximumLayoutWidthSpecificable, Back } } - private func updateViews() { + public func updateViews() { if self.viewContext == .Sizing { return } if isUpdating { return } guard let _ = self.photoMessageViewModel, _ = self.photoMessageStyle else { return }