Skip to content

Commit

Permalink
Update ChatExample to Xcode 9 & Swift 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
SD10 committed Sep 22, 2017
1 parent bf6890e commit e6c228c
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 69 deletions.
14 changes: 13 additions & 1 deletion Example/ChatExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = MessageKit;
TargetAttributes = {
882B5E321CF7D4B900B6E160 = {
Expand Down Expand Up @@ -554,14 +554,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -603,14 +609,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,6 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
Expand Down Expand Up @@ -70,6 +71,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -10,6 +10,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -30,6 +31,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- MessageKit (0.7.3)
- MessageKit (0.8.0)

DEPENDENCIES:
- MessageKit (from `../MessageKit.podspec`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: ../MessageKit.podspec

SPEC CHECKSUMS:
MessageKit: 99cd6b337d94b5e31a417614137939406e60d8ec
MessageKit: 66c54c68752d0f8a5aef18e6a884deca3580a7a6

PODFILE CHECKSUM: 9ac65b8dedf0e1b63fea245b089b6645c4e66309

Expand Down
16 changes: 8 additions & 8 deletions Example/Sources/ConversationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ConversationViewController: MessagesViewController {
self.slack()
})
}),
UIAlertAction(title: "iMessage", style: .default, handler: { action in
UIAlertAction(title: "iMessage", style: .default, handler: { _ in
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1, execute: {
self.iMessage()
})
Expand Down Expand Up @@ -103,7 +103,7 @@ class ConversationViewController: MessagesViewController {
$0.layer.borderColor = $0.titleColor(for: .disabled)?.cgColor
$0.backgroundColor = .white
}.onEnabled {
$0.backgroundColor = UIColor(colorLiteralRed: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
$0.backgroundColor = UIColor(red: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
$0.layer.borderColor = UIColor.clear.cgColor
}.onSelected {
// We use a transform becuase changing the size would cause the other views to relayout
Expand Down Expand Up @@ -140,7 +140,7 @@ class ConversationViewController: MessagesViewController {
messageInputBar.inputTextView.scrollIndicatorInsets = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0)
messageInputBar.setRightStackViewWidthConstant(to: 36, animated: true)
messageInputBar.setStackViewItems([messageInputBar.sendButton], forStack: .right, animated: true)
messageInputBar.sendButton.imageView?.backgroundColor = UIColor(colorLiteralRed: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
messageInputBar.sendButton.imageView?.backgroundColor = UIColor(red: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
messageInputBar.sendButton.contentEdgeInsets = UIEdgeInsets(top: 2, left: 2, bottom: 2, right: 2)
messageInputBar.sendButton.setSize(CGSize(width: 36, height: 36), animated: true)
messageInputBar.sendButton.image = #imageLiteral(resourceName: "ic_up")
Expand All @@ -167,7 +167,7 @@ class ConversationViewController: MessagesViewController {
$0.image = UIImage(named: named)?.withRenderingMode(.alwaysTemplate)
$0.setSize(CGSize(width: 30, height: 30), animated: true)
}.onSelected {
$0.tintColor = UIColor(colorLiteralRed: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
$0.tintColor = UIColor(red: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
}.onDeselected {
$0.tintColor = UIColor.lightGray
}.onTouchUpInside { _ in
Expand Down Expand Up @@ -262,19 +262,19 @@ extension ConversationViewController: MediaMessageLayoutDelegate {}

extension ConversationViewController: MessageCellDelegate {

func didTapAvatar<T: UIView>(in cell: MessageCollectionViewCell<T>) {
func didTapAvatar<T>(in cell: MessageCollectionViewCell<T>) {
print("Avatar tapped")
}

func didTapMessage<T: UIView>(in cell: MessageCollectionViewCell<T>) {
func didTapMessage<T>(in cell: MessageCollectionViewCell<T>) {
print("Message tapped")
}

func didTapTopLabel<T: UIView>(in cell: MessageCollectionViewCell<T>) {
func didTapTopLabel<T>(in cell: MessageCollectionViewCell<T>) {
print("Top label tapped")
}

func didTapBottomLabel<T: UIView>(in cell: MessageCollectionViewCell<T>) {
func didTapBottomLabel<T>(in cell: MessageCollectionViewCell<T>) {
print("Bottom label tapped")
}

Expand Down
2 changes: 0 additions & 2 deletions Example/Sources/MockMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import Foundation
import MessageKit
import CoreLocation



struct MockMessage: MessageType {

var messageId: String
Expand Down
Loading

0 comments on commit e6c228c

Please sign in to comment.