Relax MessageModelProtocol and MessageViewModelProtocol requirements.
MessageModelProtocol should not require setter for status property. MessageViewModelProtocol should not require messageModel property. Both are convenience shortcuts for DemoChatApp and should be removed since they are not used by ChattoAdditions framework.
This commit is contained in:
parent
7df96b0122
commit
da05cb2a09
|
|
@ -35,7 +35,7 @@ public protocol MessageModelProtocol: ChatItemProtocol {
|
|||
var senderId: String { get }
|
||||
var isIncoming: Bool { get }
|
||||
var date: NSDate { get }
|
||||
var status: MessageStatus { get set }
|
||||
var status: MessageStatus { get }
|
||||
}
|
||||
|
||||
public protocol DecoratedMessageModelProtocol: MessageModelProtocol {
|
||||
|
|
@ -64,12 +64,7 @@ public extension DecoratedMessageModelProtocol {
|
|||
}
|
||||
|
||||
var status: MessageStatus {
|
||||
get {
|
||||
return self.messageModel.status
|
||||
}
|
||||
set {
|
||||
self.messageModel.status = newValue
|
||||
}
|
||||
return self.messageModel.status
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ public protocol MessageViewModelProtocol: class { // why class? https://gist.git
|
|||
var showsFailedIcon: Bool { get }
|
||||
var date: String { get }
|
||||
var status: MessageViewModelStatus { get }
|
||||
var messageModel: MessageModelProtocol { get }
|
||||
}
|
||||
|
||||
public protocol DecoratedMessageViewModelProtocol: MessageViewModelProtocol {
|
||||
|
|
@ -79,10 +78,6 @@ extension DecoratedMessageViewModelProtocol {
|
|||
public var showsFailedIcon: Bool {
|
||||
return self.messageViewModel.showsFailedIcon
|
||||
}
|
||||
|
||||
public var messageModel: MessageModelProtocol {
|
||||
return self.messageViewModel.messageModel
|
||||
}
|
||||
}
|
||||
|
||||
public class MessageViewModel: MessageViewModelProtocol {
|
||||
|
|
|
|||
|
|
@ -29,12 +29,15 @@ public protocol PhotoMessageModelProtocol: DecoratedMessageModelProtocol {
|
|||
var imageSize: CGSize { get }
|
||||
}
|
||||
|
||||
public class PhotoMessageModel: PhotoMessageModelProtocol {
|
||||
public let messageModel: MessageModelProtocol
|
||||
public let image: UIImage // fixme: URL
|
||||
public class PhotoMessageModel<MessageModelT: MessageModelProtocol>: PhotoMessageModelProtocol {
|
||||
public var messageModel: MessageModelProtocol {
|
||||
return self._messageModel
|
||||
}
|
||||
public let _messageModel: MessageModelT // Can't make messasgeModel: MessageModelT: https://gist.github.com/diegosanchezr/5a66c7af862e1117b556
|
||||
public let image: UIImage
|
||||
public let imageSize: CGSize
|
||||
public init(messageModel: MessageModelProtocol, imageSize: CGSize, image: UIImage) {
|
||||
self.messageModel = messageModel
|
||||
public init(messageModel: MessageModelT, imageSize: CGSize, image: UIImage) {
|
||||
self._messageModel = messageModel
|
||||
self.imageSize = imageSize
|
||||
self.image = image
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,11 @@ public extension PhotoMessageViewModelProtocol {
|
|||
func wasHidden() {}
|
||||
}
|
||||
|
||||
public class PhotoMessageViewModel: PhotoMessageViewModelProtocol {
|
||||
public var photoMessage: PhotoMessageModelProtocol
|
||||
public class PhotoMessageViewModel<PhotoMessageModelT: PhotoMessageModelProtocol>: PhotoMessageViewModelProtocol {
|
||||
public var photoMessage: PhotoMessageModelProtocol {
|
||||
return self._photoMessage
|
||||
}
|
||||
public let _photoMessage: PhotoMessageModelT // Can't make photoMessage: PhotoMessageModelT: https://gist.github.com/diegosanchezr/5a66c7af862e1117b556
|
||||
public var transferStatus: Observable<TransferStatus> = Observable(.Idle)
|
||||
public var transferProgress: Observable<Double> = Observable(0)
|
||||
public var transferDirection: Observable<TransferDirection> = Observable(.Download)
|
||||
|
|
@ -65,8 +68,8 @@ public class PhotoMessageViewModel: PhotoMessageViewModelProtocol {
|
|||
return self.messageViewModel.showsFailedIcon || self.transferStatus.value == .Failed
|
||||
}
|
||||
|
||||
public init(photoMessage: PhotoMessageModelProtocol, messageViewModel: MessageViewModelProtocol) {
|
||||
self.photoMessage = photoMessage
|
||||
public init(photoMessage: PhotoMessageModelT, messageViewModel: MessageViewModelProtocol) {
|
||||
self._photoMessage = photoMessage
|
||||
self.image = Observable(photoMessage.image)
|
||||
self.messageViewModel = messageViewModel
|
||||
}
|
||||
|
|
@ -80,18 +83,18 @@ public class PhotoMessageViewModel: PhotoMessageViewModelProtocol {
|
|||
}
|
||||
}
|
||||
|
||||
public class PhotoMessageViewModelDefaultBuilder<ModelT: PhotoMessageModelProtocol>: ViewModelBuilderProtocol {
|
||||
public class PhotoMessageViewModelDefaultBuilder<PhotoMessageModelT: PhotoMessageModelProtocol>: ViewModelBuilderProtocol {
|
||||
public init() { }
|
||||
|
||||
let messageViewModelBuilder = MessageViewModelDefaultBuilder()
|
||||
|
||||
public func createViewModel(model: ModelT) -> PhotoMessageViewModel {
|
||||
public func createViewModel(model: PhotoMessageModelT) -> PhotoMessageViewModel<PhotoMessageModelT> {
|
||||
let messageViewModel = self.messageViewModelBuilder.createMessageViewModel(model)
|
||||
let photoMessageViewModel = PhotoMessageViewModel(photoMessage: model, messageViewModel: messageViewModel)
|
||||
return photoMessageViewModel
|
||||
}
|
||||
|
||||
public func canCreateViewModel(fromModel model: Any) -> Bool {
|
||||
return model is ModelT
|
||||
return model is PhotoMessageModelT
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,11 +28,14 @@ public protocol TextMessageModelProtocol: DecoratedMessageModelProtocol {
|
|||
var text: String { get }
|
||||
}
|
||||
|
||||
public class TextMessageModel: TextMessageModelProtocol {
|
||||
public let messageModel: MessageModelProtocol
|
||||
public class TextMessageModel<MessageModelT: MessageModelProtocol>: TextMessageModelProtocol {
|
||||
public var messageModel: MessageModelProtocol {
|
||||
return self._messageModel
|
||||
}
|
||||
public let _messageModel: MessageModelT // Can't make messasgeModel: MessageModelT: https://gist.github.com/diegosanchezr/5a66c7af862e1117b556
|
||||
public let text: String
|
||||
public init(messageModel: MessageModelProtocol, text: String) {
|
||||
self.messageModel = messageModel
|
||||
public init(messageModel: MessageModelT, text: String) {
|
||||
self._messageModel = messageModel
|
||||
self.text = text
|
||||
}
|
||||
// This should be covered by DecoratedMessageModelProtocol, but compiler crashes without this (Xcode 7.1)
|
||||
|
|
|
|||
|
|
@ -28,29 +28,31 @@ public protocol TextMessageViewModelProtocol: DecoratedMessageViewModelProtocol
|
|||
var text: String { get }
|
||||
}
|
||||
|
||||
public class TextMessageViewModel: TextMessageViewModelProtocol {
|
||||
public let text: String
|
||||
public class TextMessageViewModel<TextMessageModelT: TextMessageModelProtocol>: TextMessageViewModelProtocol {
|
||||
public var text: String {
|
||||
return self.textMessage.text
|
||||
}
|
||||
public let textMessage: TextMessageModelT
|
||||
public let messageViewModel: MessageViewModelProtocol
|
||||
|
||||
public init(text: String, messageViewModel: MessageViewModelProtocol) {
|
||||
self.text = text
|
||||
public init(textMessage: TextMessageModelT, messageViewModel: MessageViewModelProtocol) {
|
||||
self.textMessage = textMessage
|
||||
self.messageViewModel = messageViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public class TextMessageViewModelDefaultBuilder<ModelT: TextMessageModelProtocol>: ViewModelBuilderProtocol {
|
||||
public class TextMessageViewModelDefaultBuilder<TextMessageModelT: TextMessageModelProtocol>: ViewModelBuilderProtocol {
|
||||
public init() { }
|
||||
|
||||
let messageViewModelBuilder = MessageViewModelDefaultBuilder()
|
||||
|
||||
public func createViewModel(model: ModelT) -> TextMessageViewModel {
|
||||
let messageViewModel = self.messageViewModelBuilder.createMessageViewModel(model)
|
||||
let textMessageViewModel = TextMessageViewModel(text: model.text, messageViewModel: messageViewModel)
|
||||
public func createViewModel(textMessage: TextMessageModelT) -> TextMessageViewModel<TextMessageModelT> {
|
||||
let messageViewModel = self.messageViewModelBuilder.createMessageViewModel(textMessage)
|
||||
let textMessageViewModel = TextMessageViewModel(textMessage: textMessage, messageViewModel: messageViewModel)
|
||||
return textMessageViewModel
|
||||
|
||||
}
|
||||
|
||||
public func canCreateViewModel(fromModel model: Any) -> Bool {
|
||||
return model is ModelT
|
||||
return model is TextMessageModelT
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ import Chatto
|
|||
class BaseMessagePresenterTests: XCTestCase {
|
||||
|
||||
// BaseMessagePresenter is generic, let's use the photo one for instance
|
||||
var presenter: PhotoMessagePresenter<PhotoMessageViewModelDefaultBuilder<PhotoMessageModel>, PhotoMessageTestHandler>!
|
||||
var presenter: PhotoMessagePresenter<PhotoMessageViewModelDefaultBuilder<PhotoMessageModel<MessageModel>>, PhotoMessageTestHandler>!
|
||||
let decorationAttributes = ChatItemDecorationAttributes(bottomMargin: 0, showsTail: false)
|
||||
var interactionHandler: PhotoMessageTestHandler!
|
||||
override func setUp() {
|
||||
let viewModelBuilder = PhotoMessageViewModelDefaultBuilder<PhotoMessageModel>()
|
||||
let viewModelBuilder = PhotoMessageViewModelDefaultBuilder<PhotoMessageModel<MessageModel>>()
|
||||
let sizingCell = PhotoMessageCollectionViewCell.sizingCell()
|
||||
let photoStyle = PhotoMessageCollectionViewCellDefaultStyle()
|
||||
let baseStyle = BaseMessageCollectionViewCellDefaultSyle()
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class PhotoMessagePresenterBuilderTests: XCTestCase {
|
|||
func testThat_CreatesPresenter() {
|
||||
let messageModel = MessageModel(uid: "uid", senderId: "senderId", type: "photo-message", isIncoming: true, date: NSDate(), status: .Success)
|
||||
let photoMessageModel = PhotoMessageModel(messageModel: messageModel, imageSize: CGSize(width: 30, height: 30), image: UIImage())
|
||||
let builder = PhotoMessagePresenterBuilder(viewModelBuilder: PhotoMessageViewModelDefaultBuilder<PhotoMessageModel>(), interactionHandler: PhotoMessageTestHandler())
|
||||
let builder = PhotoMessagePresenterBuilder(viewModelBuilder: PhotoMessageViewModelDefaultBuilder<PhotoMessageModel<MessageModel>>(), interactionHandler: PhotoMessageTestHandler())
|
||||
XCTAssertNotNil(builder.createPresenterWithChatItem(photoMessageModel))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ import XCTest
|
|||
|
||||
class PhotoMessagePresenterTests: XCTestCase, UICollectionViewDataSource {
|
||||
|
||||
var presenter: PhotoMessagePresenter<PhotoMessageViewModelDefaultBuilder<PhotoMessageModel>, PhotoMessageTestHandler>!
|
||||
var presenter: PhotoMessagePresenter<PhotoMessageViewModelDefaultBuilder<PhotoMessageModel<MessageModel>>, PhotoMessageTestHandler>!
|
||||
let decorationAttributes = ChatItemDecorationAttributes(bottomMargin: 0, showsTail: false)
|
||||
let testImage = UIImage()
|
||||
override func setUp() {
|
||||
let viewModelBuilder = PhotoMessageViewModelDefaultBuilder<PhotoMessageModel>()
|
||||
let viewModelBuilder = PhotoMessageViewModelDefaultBuilder<PhotoMessageModel<MessageModel>>()
|
||||
let sizingCell = PhotoMessageCollectionViewCell.sizingCell()
|
||||
let photoStyle = PhotoMessageCollectionViewCellDefaultStyle()
|
||||
let baseStyle = BaseMessageCollectionViewCellDefaultSyle()
|
||||
|
|
@ -57,7 +57,7 @@ class PhotoMessagePresenterTests: XCTestCase, UICollectionViewDataSource {
|
|||
|
||||
func testThat_RegistersAndDequeuesCells() {
|
||||
let collectionView = UICollectionView(frame: CGRect.zero, collectionViewLayout: UICollectionViewFlowLayout())
|
||||
PhotoMessagePresenter<PhotoMessageViewModelDefaultBuilder<PhotoMessageModel>, PhotoMessageTestHandler>.registerCells(collectionView)
|
||||
PhotoMessagePresenter<PhotoMessageViewModelDefaultBuilder<PhotoMessageModel<MessageModel>>, PhotoMessageTestHandler>.registerCells(collectionView)
|
||||
collectionView.dataSource = self
|
||||
collectionView.reloadData()
|
||||
XCTAssertNotNil(self.presenter.dequeueCell(collectionView: collectionView, indexPath: NSIndexPath(forItem: 0, inSection: 0)))
|
||||
|
|
@ -76,7 +76,7 @@ class PhotoMessagePresenterTests: XCTestCase, UICollectionViewDataSource {
|
|||
}
|
||||
|
||||
class PhotoMessageTestHandler: BaseMessageInteractionHandlerProtocol {
|
||||
typealias ViewModelT = PhotoMessageViewModel
|
||||
typealias ViewModelT = PhotoMessageViewModel<PhotoMessageModel<MessageModel>>
|
||||
|
||||
var didHandleTapOnFailIcon = false
|
||||
func userDidTapOnFailIcon(viewModel viewModel: ViewModelT) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class TextMessagePresenterBuilderTests: XCTestCase {
|
|||
func testThat_CreatesPresenter() {
|
||||
let messageModel = MessageModel(uid: "uid", senderId: "senderId", type: "text-message", isIncoming: true, date: NSDate(), status: .Success)
|
||||
let textMessageModel = TextMessageModel(messageModel: messageModel, text: "Some text")
|
||||
let builder = TextMessagePresenterBuilder(viewModelBuilder: TextMessageViewModelDefaultBuilder<TextMessageModel>(), interactionHandler: TextMessageTestHandler())
|
||||
let builder = TextMessagePresenterBuilder(viewModelBuilder: TextMessageViewModelDefaultBuilder<TextMessageModel<MessageModel>>(), interactionHandler: TextMessageTestHandler())
|
||||
XCTAssertNotNil(builder.createPresenterWithChatItem(textMessageModel))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ import Chatto
|
|||
|
||||
class TextMessagePresenterTests: XCTestCase, UICollectionViewDataSource {
|
||||
|
||||
var presenter: TextMessagePresenter<TextMessageViewModelDefaultBuilder<TextMessageModel>, TextMessageTestHandler>!
|
||||
var presenter: TextMessagePresenter<TextMessageViewModelDefaultBuilder<TextMessageModel<MessageModel>>, TextMessageTestHandler>!
|
||||
let decorationAttributes = ChatItemDecorationAttributes(bottomMargin: 0, showsTail: false)
|
||||
override func setUp() {
|
||||
let viewModelBuilder = TextMessageViewModelDefaultBuilder<TextMessageModel>()
|
||||
let viewModelBuilder = TextMessageViewModelDefaultBuilder<TextMessageModel<MessageModel>>()
|
||||
let sizingCell = TextMessageCollectionViewCell.sizingCell()
|
||||
let textStyle = TextMessageCollectionViewCellDefaultStyle()
|
||||
let baseStyle = BaseMessageCollectionViewCellDefaultSyle()
|
||||
|
|
@ -43,7 +43,7 @@ class TextMessagePresenterTests: XCTestCase, UICollectionViewDataSource {
|
|||
func testThat_RegistersAndDequeuesCells() {
|
||||
|
||||
let collectionView = UICollectionView(frame: CGRect.zero, collectionViewLayout: UICollectionViewFlowLayout())
|
||||
TextMessagePresenter<TextMessageViewModelDefaultBuilder<TextMessageModel>, TextMessageTestHandler>.registerCells(collectionView)
|
||||
TextMessagePresenter<TextMessageViewModelDefaultBuilder<TextMessageModel<MessageModel>>, TextMessageTestHandler>.registerCells(collectionView)
|
||||
collectionView.dataSource = self
|
||||
collectionView.reloadData()
|
||||
XCTAssertNotNil(self.presenter.dequeueCell(collectionView: collectionView, indexPath: NSIndexPath(forItem: 0, inSection: 0)))
|
||||
|
|
@ -87,7 +87,7 @@ class TextMessagePresenterTests: XCTestCase, UICollectionViewDataSource {
|
|||
}
|
||||
|
||||
class TextMessageTestHandler: BaseMessageInteractionHandlerProtocol {
|
||||
typealias ViewModelT = TextMessageViewModel
|
||||
typealias ViewModelT = TextMessageViewModel<TextMessageModel<MessageModel>>
|
||||
|
||||
func userDidTapOnFailIcon(viewModel viewModel: ViewModelT) {
|
||||
|
||||
|
|
|
|||
|
|
@ -8,24 +8,29 @@
|
|||
|
||||
/* Begin PBXBuildFile section */
|
||||
1CB21D193EF017E5E1C63755 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 623390018DA74FF277EE2626 /* Pods.framework */; };
|
||||
C30C6EBB1BDE9BDC00D4C879 /* FakeMessageFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = C30C6EBA1BDE9BDC00D4C879 /* FakeMessageFactory.swift */; };
|
||||
C31E291A1BF38F8A00EF5B2F /* FakeMessageSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = C31E29191BF38F8A00EF5B2F /* FakeMessageSender.swift */; };
|
||||
C31E291C1BF39DE600EF5B2F /* FakePhotoMessageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C31E291B1BF39DE600EF5B2F /* FakePhotoMessageViewModel.swift */; };
|
||||
C326C9AE1BF6424900EC4607 /* UserActionHandlers.swift in Sources */ = {isa = PBXBuildFile; fileRef = C326C9AD1BF6424900EC4607 /* UserActionHandlers.swift */; };
|
||||
C33FBFA91BDE441C008E3545 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FBFA81BDE441C008E3545 /* AppDelegate.swift */; };
|
||||
C33FBFAB1BDE441C008E3545 /* DemoChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FBFAA1BDE441C008E3545 /* DemoChatViewController.swift */; };
|
||||
C33FBFAE1BDE441C008E3545 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C33FBFAC1BDE441C008E3545 /* Main.storyboard */; };
|
||||
C33FBFB01BDE441C008E3545 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C33FBFAF1BDE441C008E3545 /* Assets.xcassets */; };
|
||||
C33FBFB31BDE441C008E3545 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C33FBFB11BDE441C008E3545 /* LaunchScreen.storyboard */; };
|
||||
C33FBFC91BDE441C008E3545 /* ChattoAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FBFC81BDE441C008E3545 /* ChattoAppUITests.swift */; };
|
||||
C35A6F4D1BF807C10085CA19 /* SlidingDatasSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C35A6F4C1BF807C10085CA19 /* SlidingDatasSource.swift */; };
|
||||
C35A6F4F1BF807EC0085CA19 /* SlidingDataSourceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C35A6F4E1BF807EC0085CA19 /* SlidingDataSourceTests.swift */; };
|
||||
C35A6F511BF8089C0085CA19 /* FakeDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C35A6F501BF8089C0085CA19 /* FakeDataSource.swift */; };
|
||||
C396D98F1BF8C64900F10439 /* ConversationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C396D98E1BF8C64900F10439 /* ConversationsViewController.swift */; };
|
||||
C3B0D35B1BF3C55E006CF725 /* SendingStatusPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B0D35A1BF3C55E006CF725 /* SendingStatusPresenter.swift */; };
|
||||
C3B0D35D1BF3C627006CF725 /* SendingStatusCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B0D35C1BF3C627006CF725 /* SendingStatusCollectionViewCell.swift */; };
|
||||
C3B0D35F1BF3C63C006CF725 /* SendingStatusCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3B0D35E1BF3C63C006CF725 /* SendingStatusCollectionViewCell.xib */; };
|
||||
C3B0D3611BF3C928006CF725 /* ChatItemsDemoDecorator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B0D3601BF3C928006CF725 /* ChatItemsDemoDecorator.swift */; };
|
||||
C3F91DB61C75EF9E00D461D2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DA01C75EF9E00D461D2 /* AppDelegate.swift */; };
|
||||
C3F91DB71C75EF9E00D461D2 /* ChatItemsDemoDecorator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DA11C75EF9E00D461D2 /* ChatItemsDemoDecorator.swift */; };
|
||||
C3F91DB81C75EF9E00D461D2 /* ConversationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DA21C75EF9E00D461D2 /* ConversationsViewController.swift */; };
|
||||
C3F91DBC1C75EF9E00D461D2 /* DemoChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DA81C75EF9E00D461D2 /* DemoChatViewController.swift */; };
|
||||
C3F91DBD1C75EF9E00D461D2 /* FakeDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DA91C75EF9E00D461D2 /* FakeDataSource.swift */; };
|
||||
C3F91DBE1C75EF9E00D461D2 /* FakeMessageFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DAA1C75EF9E00D461D2 /* FakeMessageFactory.swift */; };
|
||||
C3F91DBF1C75EF9E00D461D2 /* FakeMessageSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DAB1C75EF9E00D461D2 /* FakeMessageSender.swift */; };
|
||||
C3F91DC01C75EF9E00D461D2 /* DemoPhotoMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DAD1C75EF9E00D461D2 /* DemoPhotoMessageHandler.swift */; };
|
||||
C3F91DC11C75EF9E00D461D2 /* DemoPhotoMessageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DAE1C75EF9E00D461D2 /* DemoPhotoMessageModel.swift */; };
|
||||
C3F91DC21C75EF9E00D461D2 /* DemoPhotoMessageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DAF1C75EF9E00D461D2 /* DemoPhotoMessageViewModel.swift */; };
|
||||
C3F91DC31C75EF9E00D461D2 /* SlidingDatasSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DB01C75EF9E00D461D2 /* SlidingDatasSource.swift */; };
|
||||
C3F91DC41C75EF9E00D461D2 /* DemoTextMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DB21C75EF9E00D461D2 /* DemoTextMessageHandler.swift */; };
|
||||
C3F91DC51C75EF9E00D461D2 /* DemoTextMessageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DB31C75EF9E00D461D2 /* DemoTextMessageModel.swift */; };
|
||||
C3F91DC61C75EF9E00D461D2 /* DemoTextMessageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DB41C75EF9E00D461D2 /* DemoTextMessageViewModel.swift */; };
|
||||
C3F91DC71C75EF9E00D461D2 /* BaseMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DB51C75EF9E00D461D2 /* BaseMessageHandler.swift */; };
|
||||
C3F91DCC1C75EFE300D461D2 /* SendingStatusCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DC91C75EFE300D461D2 /* SendingStatusCollectionViewCell.swift */; };
|
||||
C3F91DCD1C75EFE300D461D2 /* SendingStatusCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3F91DCA1C75EFE300D461D2 /* SendingStatusCollectionViewCell.xib */; };
|
||||
C3F91DCE1C75EFE300D461D2 /* SendingStatusPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F91DCB1C75EFE300D461D2 /* SendingStatusPresenter.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
|
@ -62,13 +67,7 @@
|
|||
623390018DA74FF277EE2626 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
BC1B7FD95E9FA5D84A5E756D /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
C103E6161174A5DF650D22E6 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
|
||||
C30C6EBA1BDE9BDC00D4C879 /* FakeMessageFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FakeMessageFactory.swift; path = Source/FakeMessageFactory.swift; sourceTree = "<group>"; };
|
||||
C31E29191BF38F8A00EF5B2F /* FakeMessageSender.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FakeMessageSender.swift; sourceTree = "<group>"; };
|
||||
C31E291B1BF39DE600EF5B2F /* FakePhotoMessageViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FakePhotoMessageViewModel.swift; sourceTree = "<group>"; };
|
||||
C326C9AD1BF6424900EC4607 /* UserActionHandlers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserActionHandlers.swift; sourceTree = "<group>"; };
|
||||
C33FBFA51BDE441C008E3545 /* ChattoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ChattoApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C33FBFA81BDE441C008E3545 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
C33FBFAA1BDE441C008E3545 /* DemoChatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoChatViewController.swift; sourceTree = "<group>"; };
|
||||
C33FBFAD1BDE441C008E3545 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
C33FBFAF1BDE441C008E3545 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
C33FBFB21BDE441C008E3545 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
|
|
@ -78,14 +77,25 @@
|
|||
C33FBFC41BDE441C008E3545 /* ChattoAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ChattoAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C33FBFC81BDE441C008E3545 /* ChattoAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChattoAppUITests.swift; sourceTree = "<group>"; };
|
||||
C33FBFCA1BDE441C008E3545 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
C35A6F4C1BF807C10085CA19 /* SlidingDatasSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SlidingDatasSource.swift; sourceTree = "<group>"; };
|
||||
C35A6F4E1BF807EC0085CA19 /* SlidingDataSourceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SlidingDataSourceTests.swift; sourceTree = "<group>"; };
|
||||
C35A6F501BF8089C0085CA19 /* FakeDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FakeDataSource.swift; sourceTree = "<group>"; };
|
||||
C396D98E1BF8C64900F10439 /* ConversationsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConversationsViewController.swift; sourceTree = "<group>"; };
|
||||
C3B0D35A1BF3C55E006CF725 /* SendingStatusPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendingStatusPresenter.swift; sourceTree = "<group>"; };
|
||||
C3B0D35C1BF3C627006CF725 /* SendingStatusCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendingStatusCollectionViewCell.swift; sourceTree = "<group>"; };
|
||||
C3B0D35E1BF3C63C006CF725 /* SendingStatusCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SendingStatusCollectionViewCell.xib; sourceTree = "<group>"; };
|
||||
C3B0D3601BF3C928006CF725 /* ChatItemsDemoDecorator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatItemsDemoDecorator.swift; sourceTree = "<group>"; };
|
||||
C3F91DA01C75EF9E00D461D2 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
C3F91DA11C75EF9E00D461D2 /* ChatItemsDemoDecorator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatItemsDemoDecorator.swift; sourceTree = "<group>"; };
|
||||
C3F91DA21C75EF9E00D461D2 /* ConversationsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConversationsViewController.swift; sourceTree = "<group>"; };
|
||||
C3F91DA81C75EF9E00D461D2 /* DemoChatViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoChatViewController.swift; sourceTree = "<group>"; };
|
||||
C3F91DA91C75EF9E00D461D2 /* FakeDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FakeDataSource.swift; sourceTree = "<group>"; };
|
||||
C3F91DAA1C75EF9E00D461D2 /* FakeMessageFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FakeMessageFactory.swift; sourceTree = "<group>"; };
|
||||
C3F91DAB1C75EF9E00D461D2 /* FakeMessageSender.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FakeMessageSender.swift; sourceTree = "<group>"; };
|
||||
C3F91DAD1C75EF9E00D461D2 /* DemoPhotoMessageHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoPhotoMessageHandler.swift; sourceTree = "<group>"; };
|
||||
C3F91DAE1C75EF9E00D461D2 /* DemoPhotoMessageModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoPhotoMessageModel.swift; sourceTree = "<group>"; };
|
||||
C3F91DAF1C75EF9E00D461D2 /* DemoPhotoMessageViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoPhotoMessageViewModel.swift; sourceTree = "<group>"; };
|
||||
C3F91DB01C75EF9E00D461D2 /* SlidingDatasSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SlidingDatasSource.swift; sourceTree = "<group>"; };
|
||||
C3F91DB21C75EF9E00D461D2 /* DemoTextMessageHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoTextMessageHandler.swift; sourceTree = "<group>"; };
|
||||
C3F91DB31C75EF9E00D461D2 /* DemoTextMessageModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoTextMessageModel.swift; sourceTree = "<group>"; };
|
||||
C3F91DB41C75EF9E00D461D2 /* DemoTextMessageViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoTextMessageViewModel.swift; sourceTree = "<group>"; };
|
||||
C3F91DB51C75EF9E00D461D2 /* BaseMessageHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseMessageHandler.swift; sourceTree = "<group>"; };
|
||||
C3F91DC91C75EFE300D461D2 /* SendingStatusCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendingStatusCollectionViewCell.swift; sourceTree = "<group>"; };
|
||||
C3F91DCA1C75EFE300D461D2 /* SendingStatusCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SendingStatusCollectionViewCell.xib; sourceTree = "<group>"; };
|
||||
C3F91DCB1C75EFE300D461D2 /* SendingStatusPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendingStatusPresenter.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
|
@ -131,23 +141,6 @@
|
|||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C30C6EBD1BDE9BE200D4C879 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C3B0D3601BF3C928006CF725 /* ChatItemsDemoDecorator.swift */,
|
||||
C396D98E1BF8C64900F10439 /* ConversationsViewController.swift */,
|
||||
C33FBFAA1BDE441C008E3545 /* DemoChatViewController.swift */,
|
||||
C30C6EBA1BDE9BDC00D4C879 /* FakeMessageFactory.swift */,
|
||||
C35A6F501BF8089C0085CA19 /* FakeDataSource.swift */,
|
||||
C31E29191BF38F8A00EF5B2F /* FakeMessageSender.swift */,
|
||||
C31E291B1BF39DE600EF5B2F /* FakePhotoMessageViewModel.swift */,
|
||||
C35A6F4C1BF807C10085CA19 /* SlidingDatasSource.swift */,
|
||||
C326C9AD1BF6424900EC4607 /* UserActionHandlers.swift */,
|
||||
C3B0D3581BF3C54F006CF725 /* Custom items */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C33FBF9C1BDE441C008E3545 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
|
@ -173,8 +166,7 @@
|
|||
C33FBFA71BDE441C008E3545 /* ChattoApp */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C30C6EBD1BDE9BE200D4C879 /* Source */,
|
||||
C33FBFA81BDE441C008E3545 /* AppDelegate.swift */,
|
||||
C3F91D9F1C75EF9E00D461D2 /* Source */,
|
||||
C33FBFAC1BDE441C008E3545 /* Main.storyboard */,
|
||||
C33FBFAF1BDE441C008E3545 /* Assets.xcassets */,
|
||||
C33FBFB11BDE441C008E3545 /* LaunchScreen.storyboard */,
|
||||
|
|
@ -201,21 +193,51 @@
|
|||
path = ChattoAppUITests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C3B0D3581BF3C54F006CF725 /* Custom items */ = {
|
||||
C3F91D9F1C75EF9E00D461D2 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C3B0D3591BF3C54F006CF725 /* Sending status */,
|
||||
C3F91DA01C75EF9E00D461D2 /* AppDelegate.swift */,
|
||||
C3F91DA11C75EF9E00D461D2 /* ChatItemsDemoDecorator.swift */,
|
||||
C3F91DA21C75EF9E00D461D2 /* ConversationsViewController.swift */,
|
||||
C3F91DA81C75EF9E00D461D2 /* DemoChatViewController.swift */,
|
||||
C3F91DA91C75EF9E00D461D2 /* FakeDataSource.swift */,
|
||||
C3F91DAA1C75EF9E00D461D2 /* FakeMessageFactory.swift */,
|
||||
C3F91DAB1C75EF9E00D461D2 /* FakeMessageSender.swift */,
|
||||
C3F91DB01C75EF9E00D461D2 /* SlidingDatasSource.swift */,
|
||||
C3F91DB51C75EF9E00D461D2 /* BaseMessageHandler.swift */,
|
||||
C3F91DAC1C75EF9E00D461D2 /* Photo Messages */,
|
||||
C3F91DC81C75EFE300D461D2 /* Sending status */,
|
||||
C3F91DB11C75EF9E00D461D2 /* Text Messages */,
|
||||
);
|
||||
name = "Custom items";
|
||||
path = "Source/Custom items";
|
||||
path = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C3B0D3591BF3C54F006CF725 /* Sending status */ = {
|
||||
C3F91DAC1C75EF9E00D461D2 /* Photo Messages */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C3B0D35A1BF3C55E006CF725 /* SendingStatusPresenter.swift */,
|
||||
C3B0D35C1BF3C627006CF725 /* SendingStatusCollectionViewCell.swift */,
|
||||
C3B0D35E1BF3C63C006CF725 /* SendingStatusCollectionViewCell.xib */,
|
||||
C3F91DAD1C75EF9E00D461D2 /* DemoPhotoMessageHandler.swift */,
|
||||
C3F91DAE1C75EF9E00D461D2 /* DemoPhotoMessageModel.swift */,
|
||||
C3F91DAF1C75EF9E00D461D2 /* DemoPhotoMessageViewModel.swift */,
|
||||
);
|
||||
path = "Photo Messages";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C3F91DB11C75EF9E00D461D2 /* Text Messages */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C3F91DB21C75EF9E00D461D2 /* DemoTextMessageHandler.swift */,
|
||||
C3F91DB31C75EF9E00D461D2 /* DemoTextMessageModel.swift */,
|
||||
C3F91DB41C75EF9E00D461D2 /* DemoTextMessageViewModel.swift */,
|
||||
);
|
||||
path = "Text Messages";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C3F91DC81C75EFE300D461D2 /* Sending status */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C3F91DC91C75EFE300D461D2 /* SendingStatusCollectionViewCell.swift */,
|
||||
C3F91DCA1C75EFE300D461D2 /* SendingStatusCollectionViewCell.xib */,
|
||||
C3F91DCB1C75EFE300D461D2 /* SendingStatusPresenter.swift */,
|
||||
);
|
||||
path = "Sending status";
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -329,8 +351,8 @@
|
|||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C3B0D35F1BF3C63C006CF725 /* SendingStatusCollectionViewCell.xib in Resources */,
|
||||
C33FBFB31BDE441C008E3545 /* LaunchScreen.storyboard in Resources */,
|
||||
C3F91DCD1C75EFE300D461D2 /* SendingStatusCollectionViewCell.xib in Resources */,
|
||||
C33FBFB01BDE441C008E3545 /* Assets.xcassets in Resources */,
|
||||
C33FBFAE1BDE441C008E3545 /* Main.storyboard in Resources */,
|
||||
);
|
||||
|
|
@ -418,18 +440,23 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C31E291C1BF39DE600EF5B2F /* FakePhotoMessageViewModel.swift in Sources */,
|
||||
C3B0D3611BF3C928006CF725 /* ChatItemsDemoDecorator.swift in Sources */,
|
||||
C33FBFAB1BDE441C008E3545 /* DemoChatViewController.swift in Sources */,
|
||||
C396D98F1BF8C64900F10439 /* ConversationsViewController.swift in Sources */,
|
||||
C3B0D35B1BF3C55E006CF725 /* SendingStatusPresenter.swift in Sources */,
|
||||
C3B0D35D1BF3C627006CF725 /* SendingStatusCollectionViewCell.swift in Sources */,
|
||||
C30C6EBB1BDE9BDC00D4C879 /* FakeMessageFactory.swift in Sources */,
|
||||
C31E291A1BF38F8A00EF5B2F /* FakeMessageSender.swift in Sources */,
|
||||
C35A6F511BF8089C0085CA19 /* FakeDataSource.swift in Sources */,
|
||||
C35A6F4D1BF807C10085CA19 /* SlidingDatasSource.swift in Sources */,
|
||||
C33FBFA91BDE441C008E3545 /* AppDelegate.swift in Sources */,
|
||||
C326C9AE1BF6424900EC4607 /* UserActionHandlers.swift in Sources */,
|
||||
C3F91DBF1C75EF9E00D461D2 /* FakeMessageSender.swift in Sources */,
|
||||
C3F91DB81C75EF9E00D461D2 /* ConversationsViewController.swift in Sources */,
|
||||
C3F91DC41C75EF9E00D461D2 /* DemoTextMessageHandler.swift in Sources */,
|
||||
C3F91DC31C75EF9E00D461D2 /* SlidingDatasSource.swift in Sources */,
|
||||
C3F91DC71C75EF9E00D461D2 /* BaseMessageHandler.swift in Sources */,
|
||||
C3F91DC61C75EF9E00D461D2 /* DemoTextMessageViewModel.swift in Sources */,
|
||||
C3F91DC01C75EF9E00D461D2 /* DemoPhotoMessageHandler.swift in Sources */,
|
||||
C3F91DBC1C75EF9E00D461D2 /* DemoChatViewController.swift in Sources */,
|
||||
C3F91DBD1C75EF9E00D461D2 /* FakeDataSource.swift in Sources */,
|
||||
C3F91DB61C75EF9E00D461D2 /* AppDelegate.swift in Sources */,
|
||||
C3F91DCE1C75EFE300D461D2 /* SendingStatusPresenter.swift in Sources */,
|
||||
C3F91DC51C75EF9E00D461D2 /* DemoTextMessageModel.swift in Sources */,
|
||||
C3F91DCC1C75EFE300D461D2 /* SendingStatusCollectionViewCell.swift in Sources */,
|
||||
C3F91DB71C75EF9E00D461D2 /* ChatItemsDemoDecorator.swift in Sources */,
|
||||
C3F91DC11C75EF9E00D461D2 /* DemoPhotoMessageModel.swift in Sources */,
|
||||
C3F91DC21C75EF9E00D461D2 /* DemoPhotoMessageViewModel.swift in Sources */,
|
||||
C3F91DBE1C75EF9E00D461D2 /* FakeMessageFactory.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Badoo Trading Limited.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import Chatto
|
||||
import ChattoAdditions
|
||||
|
||||
public protocol DemoMessageViewModelProtocol {
|
||||
var messageModel: DemoMessageModelProtocol { get }
|
||||
}
|
||||
|
||||
class BaseMessageHandler {
|
||||
|
||||
private let messageSender: FakeMessageSender
|
||||
init (messageSender: FakeMessageSender) {
|
||||
self.messageSender = messageSender
|
||||
}
|
||||
func userDidTapOnFailIcon(viewModel viewModel: DemoMessageViewModelProtocol) {
|
||||
print("userDidTapOnFailIcon")
|
||||
self.messageSender.sendMessage(viewModel.messageModel)
|
||||
}
|
||||
|
||||
func userDidTapOnBubble(viewModel viewModel: DemoMessageViewModelProtocol) {
|
||||
print("userDidTapOnBubble")
|
||||
|
||||
}
|
||||
|
||||
func userDidLongPressOnBubble(viewModel viewModel: DemoMessageViewModelProtocol) {
|
||||
print("userDidLongPressOnBubble")
|
||||
}
|
||||
}
|
||||
|
|
@ -69,16 +69,16 @@ class DemoChatViewController: BaseChatViewController {
|
|||
|
||||
override func createPresenterBuilders() -> [ChatItemType: [ChatItemPresenterBuilderProtocol]] {
|
||||
return [
|
||||
TextMessageModel.chatItemType: [
|
||||
DemoTextMessageModel.chatItemType: [
|
||||
TextMessagePresenterBuilder(
|
||||
viewModelBuilder: TextMessageViewModelDefaultBuilder<TextMessageModel>(),
|
||||
interactionHandler: TextMessageHandler(baseHandler: self.baseMessageHandler)
|
||||
viewModelBuilder: DemoTextMessageViewModelBuilder(),
|
||||
interactionHandler: DemoTextMessageHandler(baseHandler: self.baseMessageHandler)
|
||||
)
|
||||
],
|
||||
PhotoMessageModel.chatItemType: [
|
||||
DemoPhotoMessageModel.chatItemType: [
|
||||
PhotoMessagePresenterBuilder(
|
||||
viewModelBuilder: FakePhotoMessageViewModelBuilder(),
|
||||
interactionHandler: PhotoMessageHandler(baseHandler: self.baseMessageHandler)
|
||||
viewModelBuilder: DemoPhotoMessageViewModelBuilder(),
|
||||
interactionHandler: DemoPhotoMessageHandler(baseHandler: self.baseMessageHandler)
|
||||
)
|
||||
],
|
||||
SendingStatusModel.chatItemType: [SendingStatusPresenterBuilder()]
|
||||
|
|
@ -33,9 +33,9 @@ extension Array {
|
|||
}
|
||||
}
|
||||
|
||||
func createTextMessageModel(uid: String, text: String, isIncoming: Bool) -> TextMessageModel {
|
||||
let messageModel = createMessageModel(uid, isIncoming: isIncoming, type: TextMessageModel.chatItemType)
|
||||
let textMessageModel = TextMessageModel(messageModel: messageModel, text: text)
|
||||
func createTextMessageModel(uid: String, text: String, isIncoming: Bool) -> DemoTextMessageModel {
|
||||
let messageModel = createMessageModel(uid, isIncoming: isIncoming, type: TextMessageModel<MessageModel>.chatItemType)
|
||||
let textMessageModel = DemoTextMessageModel(messageModel: messageModel, text: text)
|
||||
return textMessageModel
|
||||
}
|
||||
|
||||
|
|
@ -46,9 +46,9 @@ func createMessageModel(uid: String, isIncoming: Bool, type: String) -> MessageM
|
|||
return messageModel
|
||||
}
|
||||
|
||||
func createPhotoMessageModel(uid: String, image: UIImage, size: CGSize, isIncoming: Bool) -> PhotoMessageModel {
|
||||
let messageModel = createMessageModel(uid, isIncoming: isIncoming, type: PhotoMessageModel.chatItemType)
|
||||
let photoMessageModel = PhotoMessageModel(messageModel: messageModel, imageSize:size, image: image)
|
||||
func createPhotoMessageModel(uid: String, image: UIImage, size: CGSize, isIncoming: Bool) -> DemoPhotoMessageModel {
|
||||
let messageModel = createMessageModel(uid, isIncoming: isIncoming, type: PhotoMessageModel<MessageModel>.chatItemType)
|
||||
let photoMessageModel = DemoPhotoMessageModel(messageModel: messageModel, imageSize:size, image: image)
|
||||
return photoMessageModel
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ class FakeMessageFactory {
|
|||
}
|
||||
}
|
||||
|
||||
class func createTextMessageModel(uid: String, isIncoming: Bool) -> TextMessageModel {
|
||||
class func createTextMessageModel(uid: String, isIncoming: Bool) -> DemoTextMessageModel {
|
||||
let incomingText: String = isIncoming ? "incoming" : "outgoing"
|
||||
let maxText = self.demoTexts.randomItem()
|
||||
let length: Int = 10 + Int(arc4random_uniform(300))
|
||||
|
|
@ -78,7 +78,7 @@ class FakeMessageFactory {
|
|||
return ChattoApp.createTextMessageModel(uid, text: text, isIncoming: isIncoming)
|
||||
}
|
||||
|
||||
class func createPhotoMessageModel(uid: String, isIncoming: Bool) -> PhotoMessageModel {
|
||||
class func createPhotoMessageModel(uid: String, isIncoming: Bool) -> DemoPhotoMessageModel {
|
||||
var imageSize = CGSize.zero
|
||||
switch arc4random_uniform(100) % 3 {
|
||||
case 0:
|
||||
|
|
|
|||
|
|
@ -26,21 +26,25 @@ import Foundation
|
|||
import Chatto
|
||||
import ChattoAdditions
|
||||
|
||||
public protocol DemoMessageModelProtocol: MessageModelProtocol {
|
||||
var status: MessageStatus { get set }
|
||||
}
|
||||
|
||||
public class FakeMessageSender {
|
||||
|
||||
public var onMessageChanged: ((message: MessageModelProtocol) -> Void)?
|
||||
public var onMessageChanged: ((message: DemoMessageModelProtocol) -> Void)?
|
||||
|
||||
public func sendMessages(messages: [MessageModelProtocol]) {
|
||||
public func sendMessages(messages: [DemoMessageModelProtocol]) {
|
||||
for message in messages {
|
||||
self.fakeMessageStatus(message)
|
||||
}
|
||||
}
|
||||
|
||||
public func sendMessage(message: MessageModelProtocol) {
|
||||
public func sendMessage(message: DemoMessageModelProtocol) {
|
||||
self.fakeMessageStatus(message)
|
||||
}
|
||||
|
||||
private func fakeMessageStatus(message: MessageModelProtocol) {
|
||||
private func fakeMessageStatus(message: DemoMessageModelProtocol) {
|
||||
switch message.status {
|
||||
case .Success:
|
||||
break
|
||||
|
|
@ -65,14 +69,14 @@ public class FakeMessageSender {
|
|||
}
|
||||
}
|
||||
|
||||
private func updateMessage(message: MessageModelProtocol, status: MessageStatus) {
|
||||
private func updateMessage(message: DemoMessageModelProtocol, status: MessageStatus) {
|
||||
if message.status != status {
|
||||
message.status = status
|
||||
self.notifyMessageChanged(message)
|
||||
}
|
||||
}
|
||||
|
||||
private func notifyMessageChanged(message: MessageModelProtocol) {
|
||||
private func notifyMessageChanged(message: DemoMessageModelProtocol) {
|
||||
self.onMessageChanged?(message: message)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Badoo Trading Limited.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import ChattoAdditions
|
||||
|
||||
class DemoPhotoMessageHandler: BaseMessageInteractionHandlerProtocol {
|
||||
private let baseHandler: BaseMessageHandler
|
||||
init (baseHandler: BaseMessageHandler) {
|
||||
self.baseHandler = baseHandler
|
||||
}
|
||||
|
||||
func userDidTapOnFailIcon(viewModel viewModel: DemoPhotoMessageViewModel) {
|
||||
self.baseHandler.userDidTapOnFailIcon(viewModel: viewModel)
|
||||
}
|
||||
|
||||
func userDidTapOnBubble(viewModel viewModel: DemoPhotoMessageViewModel) {
|
||||
self.baseHandler.userDidTapOnBubble(viewModel: viewModel)
|
||||
}
|
||||
|
||||
func userDidLongPressOnBubble(viewModel viewModel: DemoPhotoMessageViewModel) {
|
||||
self.baseHandler.userDidLongPressOnBubble(viewModel: viewModel)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Badoo Trading Limited.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import ChattoAdditions
|
||||
|
||||
public class DemoPhotoMessageModel: PhotoMessageModel<MessageModel>, DemoMessageModelProtocol {
|
||||
public override init(messageModel: MessageModel, imageSize: CGSize, image: UIImage) {
|
||||
super.init(messageModel: messageModel, imageSize: imageSize, image: image)
|
||||
}
|
||||
|
||||
public var status: MessageStatus {
|
||||
get {
|
||||
return self._messageModel.status
|
||||
}
|
||||
set {
|
||||
self._messageModel.status = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,10 +25,10 @@
|
|||
import Foundation
|
||||
import ChattoAdditions
|
||||
|
||||
class FakePhotoMessageViewModel: PhotoMessageViewModel {
|
||||
class DemoPhotoMessageViewModel: PhotoMessageViewModel<DemoPhotoMessageModel> {
|
||||
|
||||
let fakeImage: UIImage
|
||||
override init(photoMessage: PhotoMessageModelProtocol, messageViewModel: MessageViewModelProtocol) {
|
||||
override init(photoMessage: DemoPhotoMessageModel, messageViewModel: MessageViewModelProtocol) {
|
||||
self.fakeImage = photoMessage.image
|
||||
super.init(photoMessage: photoMessage, messageViewModel: messageViewModel)
|
||||
if photoMessage.isIncoming {
|
||||
|
|
@ -65,17 +65,23 @@ class FakePhotoMessageViewModel: PhotoMessageViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
public class FakePhotoMessageViewModelBuilder: ViewModelBuilderProtocol {
|
||||
extension DemoPhotoMessageViewModel: DemoMessageViewModelProtocol {
|
||||
var messageModel: DemoMessageModelProtocol {
|
||||
return self._photoMessage
|
||||
}
|
||||
}
|
||||
|
||||
class DemoPhotoMessageViewModelBuilder: ViewModelBuilderProtocol {
|
||||
|
||||
let messageViewModelBuilder = MessageViewModelDefaultBuilder()
|
||||
|
||||
public func createViewModel(model: PhotoMessageModel) -> PhotoMessageViewModel {
|
||||
func createViewModel(model: DemoPhotoMessageModel) -> DemoPhotoMessageViewModel {
|
||||
let messageViewModel = self.messageViewModelBuilder.createMessageViewModel(model)
|
||||
let photoMessageViewModel = FakePhotoMessageViewModel(photoMessage: model, messageViewModel: messageViewModel)
|
||||
let photoMessageViewModel = DemoPhotoMessageViewModel(photoMessage: model, messageViewModel: messageViewModel)
|
||||
return photoMessageViewModel
|
||||
}
|
||||
|
||||
public func canCreateViewModel(fromModel model: Any) -> Bool {
|
||||
return model is PhotoMessageModel
|
||||
func canCreateViewModel(fromModel model: Any) -> Bool {
|
||||
return model is DemoPhotoMessageModel
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Badoo Trading Limited.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import ChattoAdditions
|
||||
|
||||
class DemoTextMessageHandler: BaseMessageInteractionHandlerProtocol {
|
||||
private let baseHandler: BaseMessageHandler
|
||||
init (baseHandler: BaseMessageHandler) {
|
||||
self.baseHandler = baseHandler
|
||||
}
|
||||
func userDidTapOnFailIcon(viewModel viewModel: DemoTextMessageViewModel) {
|
||||
self.baseHandler.userDidTapOnFailIcon(viewModel: viewModel)
|
||||
}
|
||||
|
||||
func userDidTapOnBubble(viewModel viewModel: DemoTextMessageViewModel) {
|
||||
self.baseHandler.userDidTapOnBubble(viewModel: viewModel)
|
||||
}
|
||||
|
||||
func userDidLongPressOnBubble(viewModel viewModel: DemoTextMessageViewModel) {
|
||||
self.baseHandler.userDidLongPressOnBubble(viewModel: viewModel)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Badoo Trading Limited.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import ChattoAdditions
|
||||
|
||||
public class DemoTextMessageModel: TextMessageModel<MessageModel>, DemoMessageModelProtocol {
|
||||
public override init(messageModel: MessageModel, text: String) {
|
||||
super.init(messageModel: messageModel, text: text)
|
||||
}
|
||||
|
||||
public var status: MessageStatus {
|
||||
get {
|
||||
return self._messageModel.status
|
||||
}
|
||||
set {
|
||||
self._messageModel.status = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Badoo Trading Limited.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import ChattoAdditions
|
||||
|
||||
public class DemoTextMessageViewModel: TextMessageViewModel<DemoTextMessageModel>, DemoMessageViewModelProtocol {
|
||||
|
||||
public override init(textMessage: DemoTextMessageModel, messageViewModel: MessageViewModelProtocol) {
|
||||
super.init(textMessage: textMessage, messageViewModel: messageViewModel)
|
||||
}
|
||||
|
||||
public var messageModel: DemoMessageModelProtocol {
|
||||
return self.textMessage
|
||||
}
|
||||
}
|
||||
|
||||
public class DemoTextMessageViewModelBuilder: ViewModelBuilderProtocol {
|
||||
public init() { }
|
||||
|
||||
let messageViewModelBuilder = MessageViewModelDefaultBuilder()
|
||||
|
||||
public func createViewModel(textMessage: DemoTextMessageModel) -> DemoTextMessageViewModel {
|
||||
let messageViewModel = self.messageViewModelBuilder.createMessageViewModel(textMessage)
|
||||
let textMessageViewModel = DemoTextMessageViewModel(textMessage: textMessage, messageViewModel: messageViewModel)
|
||||
return textMessageViewModel
|
||||
}
|
||||
|
||||
public func canCreateViewModel(fromModel model: Any) -> Bool {
|
||||
return model is DemoTextMessageModel
|
||||
}
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Badoo Trading Limited.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import Chatto
|
||||
import ChattoAdditions
|
||||
|
||||
class TextMessageHandler: BaseMessageInteractionHandlerProtocol {
|
||||
private let baseHandler: BaseMessageHandler
|
||||
init (baseHandler: BaseMessageHandler) {
|
||||
self.baseHandler = baseHandler
|
||||
}
|
||||
func userDidTapOnFailIcon(viewModel viewModel: TextMessageViewModel) {
|
||||
self.baseHandler.userDidTapOnFailIcon(viewModel: viewModel)
|
||||
}
|
||||
|
||||
func userDidTapOnBubble(viewModel viewModel: TextMessageViewModel) {
|
||||
self.baseHandler.userDidTapOnBubble(viewModel: viewModel)
|
||||
}
|
||||
|
||||
func userDidLongPressOnBubble(viewModel viewModel: TextMessageViewModel) {
|
||||
self.baseHandler.userDidLongPressOnBubble(viewModel: viewModel)
|
||||
}
|
||||
}
|
||||
|
||||
class PhotoMessageHandler: BaseMessageInteractionHandlerProtocol {
|
||||
private let baseHandler: BaseMessageHandler
|
||||
init (baseHandler: BaseMessageHandler) {
|
||||
self.baseHandler = baseHandler
|
||||
}
|
||||
|
||||
func userDidTapOnFailIcon(viewModel viewModel: PhotoMessageViewModel) {
|
||||
self.baseHandler.userDidTapOnFailIcon(viewModel: viewModel)
|
||||
}
|
||||
|
||||
func userDidTapOnBubble(viewModel viewModel: PhotoMessageViewModel) {
|
||||
self.baseHandler.userDidTapOnBubble(viewModel: viewModel)
|
||||
}
|
||||
|
||||
func userDidLongPressOnBubble(viewModel viewModel: PhotoMessageViewModel) {
|
||||
self.baseHandler.userDidLongPressOnBubble(viewModel: viewModel)
|
||||
}
|
||||
}
|
||||
|
||||
class BaseMessageHandler {
|
||||
|
||||
private let messageSender: FakeMessageSender
|
||||
init (messageSender: FakeMessageSender) {
|
||||
self.messageSender = messageSender
|
||||
}
|
||||
func userDidTapOnFailIcon(viewModel viewModel: MessageViewModelProtocol) {
|
||||
NSLog("userDidTapOnFailIcon")
|
||||
self.messageSender.sendMessage(viewModel.messageModel)
|
||||
}
|
||||
|
||||
func userDidTapOnBubble(viewModel viewModel: MessageViewModelProtocol) {
|
||||
NSLog("userDidTapOnBubble")
|
||||
|
||||
}
|
||||
|
||||
func userDidLongPressOnBubble(viewModel viewModel: MessageViewModelProtocol) {
|
||||
NSLog("userDidLongPressOnBubble")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue