diff --git a/Chatto/Chatto.xcodeproj/project.pbxproj b/Chatto/Chatto.xcodeproj/project.pbxproj index 1eed845..ea3c9b6 100644 --- a/Chatto/Chatto.xcodeproj/project.pbxproj +++ b/Chatto/Chatto.xcodeproj/project.pbxproj @@ -420,6 +420,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -461,6 +462,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; diff --git a/ChattoAdditions/ChattoAdditions.xcodeproj/project.pbxproj b/ChattoAdditions/ChattoAdditions.xcodeproj/project.pbxproj index c08c759..1e7cd62 100644 --- a/ChattoAdditions/ChattoAdditions.xcodeproj/project.pbxproj +++ b/ChattoAdditions/ChattoAdditions.xcodeproj/project.pbxproj @@ -699,6 +699,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -740,6 +741,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; diff --git a/ChattoAdditions/Source/Chat Items/BaseMessage/BaseMessagePresenter.swift b/ChattoAdditions/Source/Chat Items/BaseMessage/BaseMessagePresenter.swift index 1595e69..c988dc7 100644 --- a/ChattoAdditions/Source/Chat Items/BaseMessage/BaseMessagePresenter.swift +++ b/ChattoAdditions/Source/Chat Items/BaseMessage/BaseMessagePresenter.swift @@ -180,7 +180,7 @@ public class BaseMessagePresenter Void)? @objc func bubbleTapped(tapGestureRecognizer: UITapGestureRecognizer) { diff --git a/ChattoAdditions/Source/Input/ChatInputBar.swift b/ChattoAdditions/Source/Input/ChatInputBar.swift index 299d572..b005200 100644 --- a/ChattoAdditions/Source/Input/ChatInputBar.swift +++ b/ChattoAdditions/Source/Input/ChatInputBar.swift @@ -57,7 +57,7 @@ public class ChatInputBar: ReusableXibView { @IBOutlet var tabBarContainerHeightConstraint: NSLayoutConstraint! class public func loadNib() -> ChatInputBar { - let view = NSBundle(forClass: self).loadNibNamed(self.nibName(), owner: nil, options: nil).first as! ChatInputBar + let view = NSBundle(forClass: self).loadNibNamed(self.nibName(), owner: nil, options: nil)!.first as! ChatInputBar view.translatesAutoresizingMaskIntoConstraints = false view.frame = CGRect.zero return view diff --git a/ChattoAdditions/Source/Input/ReusableXibView.swift b/ChattoAdditions/Source/Input/ReusableXibView.swift index c48fba5..6b5329f 100644 --- a/ChattoAdditions/Source/Input/ReusableXibView.swift +++ b/ChattoAdditions/Source/Input/ReusableXibView.swift @@ -39,7 +39,7 @@ import UIKit } let bundle = NSBundle(forClass: self.dynamicType) - if let loadedView = bundle.loadNibNamed(self.dynamicType.nibName(), owner: nil, options: nil).first as! UIView? { + if let loadedView = bundle.loadNibNamed(self.dynamicType.nibName(), owner: nil, options: nil)?.first as? UIView { loadedView.frame = frame loadedView.autoresizingMask = autoresizingMask loadedView.translatesAutoresizingMaskIntoConstraints = translatesAutoresizingMaskIntoConstraints diff --git a/ChattoAdditions/Tests/Chat Items/PhotoMessages/PhotoMessagePresenterTests.swift b/ChattoAdditions/Tests/Chat Items/PhotoMessages/PhotoMessagePresenterTests.swift index d8158e3..a0ee4fd 100644 --- a/ChattoAdditions/Tests/Chat Items/PhotoMessages/PhotoMessagePresenterTests.swift +++ b/ChattoAdditions/Tests/Chat Items/PhotoMessages/PhotoMessagePresenterTests.swift @@ -82,7 +82,7 @@ class PhotoMessageTestHandler: BaseMessageInteractionHandlerProtocol { func userDidTapOnFailIcon(viewModel viewModel: ViewModelT, failIconView: UIView) { self.didHandleTapOnFailIcon = true } - + var didHandleTapOnAvatar = false func userDidTapOnAvatar(viewModel viewModel: ViewModelT) { self.didHandleTapOnAvatar = true diff --git a/ChattoAdditions/Tests/Chat Items/TextMessages/TextMessagePresenterTests.swift b/ChattoAdditions/Tests/Chat Items/TextMessages/TextMessagePresenterTests.swift index 7aca220..2622d9d 100644 --- a/ChattoAdditions/Tests/Chat Items/TextMessages/TextMessagePresenterTests.swift +++ b/ChattoAdditions/Tests/Chat Items/TextMessages/TextMessagePresenterTests.swift @@ -92,9 +92,9 @@ class TextMessageTestHandler: BaseMessageInteractionHandlerProtocol { func userDidTapOnFailIcon(viewModel viewModel: ViewModelT, failIconView: UIView) { } - + func userDidTapOnAvatar(viewModel viewModel: ViewModelT) { - + } func userDidTapOnBubble(viewModel viewModel: ViewModelT) { diff --git a/ChattoApp/ChattoApp.xcodeproj/project.pbxproj b/ChattoApp/ChattoApp.xcodeproj/project.pbxproj index aeeecad..e07856f 100644 --- a/ChattoApp/ChattoApp.xcodeproj/project.pbxproj +++ b/ChattoApp/ChattoApp.xcodeproj/project.pbxproj @@ -578,6 +578,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -616,6 +617,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; diff --git a/ChattoApp/ChattoApp/Info.plist b/ChattoApp/ChattoApp/Info.plist index 5da0369..9e12b6d 100644 --- a/ChattoApp/ChattoApp/Info.plist +++ b/ChattoApp/ChattoApp/Info.plist @@ -22,6 +22,10 @@ 1 LSRequiresIPhoneOS + NSCameraUsageDescription + NSCameraUsageDescription + NSPhotoLibraryUsageDescription + NSPhotoLibraryUsageDescription UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/ChattoApp/ChattoApp/Source/BaseMessageHandler.swift b/ChattoApp/ChattoApp/Source/BaseMessageHandler.swift index f1756d3..b4c169e 100644 --- a/ChattoApp/ChattoApp/Source/BaseMessageHandler.swift +++ b/ChattoApp/ChattoApp/Source/BaseMessageHandler.swift @@ -44,7 +44,7 @@ class BaseMessageHandler { func userDidTapOnAvatar(viewModel viewModel: MessageViewModelProtocol) { print("userDidTapOnAvatar") } - + func userDidTapOnBubble(viewModel viewModel: DemoMessageViewModelProtocol) { print("userDidTapOnBubble") } diff --git a/ChattoApp/ChattoApp/Source/DemoChatViewController.swift b/ChattoApp/ChattoApp/Source/DemoChatViewController.swift index 23a8d56..783c8a5 100644 --- a/ChattoApp/ChattoApp/Source/DemoChatViewController.swift +++ b/ChattoApp/ChattoApp/Source/DemoChatViewController.swift @@ -65,19 +65,19 @@ class DemoChatViewController: BaseChatViewController { } override func createPresenterBuilders() -> [ChatItemType: [ChatItemPresenterBuilderProtocol]] { - + let textMessagePresenter = TextMessagePresenterBuilder( viewModelBuilder: DemoTextMessageViewModelBuilder(), interactionHandler: DemoTextMessageHandler(baseHandler: self.baseMessageHandler) ) textMessagePresenter.baseMessageStyle = BaseMessageCollectionViewCellAvatarStyle() - + let photoMessagePresenter = PhotoMessagePresenterBuilder( viewModelBuilder: DemoPhotoMessageViewModelBuilder(), interactionHandler: DemoPhotoMessageHandler(baseHandler: self.baseMessageHandler) ) photoMessagePresenter.baseCellStyle = BaseMessageCollectionViewCellAvatarStyle() - + return [ DemoTextMessageModel.chatItemType: [ textMessagePresenter diff --git a/ChattoApp/ChattoApp/Source/Photo Messages/DemoPhotoMessageHandler.swift b/ChattoApp/ChattoApp/Source/Photo Messages/DemoPhotoMessageHandler.swift index 3a5d343..d59be1a 100644 --- a/ChattoApp/ChattoApp/Source/Photo Messages/DemoPhotoMessageHandler.swift +++ b/ChattoApp/ChattoApp/Source/Photo Messages/DemoPhotoMessageHandler.swift @@ -34,7 +34,7 @@ class DemoPhotoMessageHandler: BaseMessageInteractionHandlerProtocol { func userDidTapOnFailIcon(viewModel viewModel: DemoPhotoMessageViewModel, failIconView: UIView) { self.baseHandler.userDidTapOnFailIcon(viewModel: viewModel) } - + func userDidTapOnAvatar(viewModel viewModel: DemoPhotoMessageViewModel) { self.baseHandler.userDidTapOnAvatar(viewModel: viewModel) } diff --git a/ChattoApp/ChattoApp/Source/Text Messages/DemoTextMessageHandler.swift b/ChattoApp/ChattoApp/Source/Text Messages/DemoTextMessageHandler.swift index e121047..9a7467b 100644 --- a/ChattoApp/ChattoApp/Source/Text Messages/DemoTextMessageHandler.swift +++ b/ChattoApp/ChattoApp/Source/Text Messages/DemoTextMessageHandler.swift @@ -30,10 +30,11 @@ class DemoTextMessageHandler: BaseMessageInteractionHandlerProtocol { init (baseHandler: BaseMessageHandler) { self.baseHandler = baseHandler } + func userDidTapOnFailIcon(viewModel viewModel: DemoTextMessageViewModel, failIconView: UIView) { self.baseHandler.userDidTapOnFailIcon(viewModel: viewModel) } - + func userDidTapOnAvatar(viewModel viewModel: DemoTextMessageViewModel) { self.baseHandler.userDidTapOnAvatar(viewModel: viewModel) } diff --git a/ChattoApp/Pods/Pods.xcodeproj/project.pbxproj b/ChattoApp/Pods/Pods.xcodeproj/project.pbxproj index 6dc8c57..b45d59b 100644 --- a/ChattoApp/Pods/Pods.xcodeproj/project.pbxproj +++ b/ChattoApp/Pods/Pods.xcodeproj/project.pbxproj @@ -1081,6 +1081,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_VERSION = 2.3; SYMROOT = "${SRCROOT}/../build"; }; name = Debug; @@ -1151,6 +1152,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_VERSION = 2.3; SYMROOT = "${SRCROOT}/../build"; VALIDATE_PRODUCT = YES; };