Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Commit 2cbf35d

Browse files
committed
Merge branch 'feature/swift-4'
2 parents ae1ebeb + 2ff3333 commit 2cbf35d

File tree

18 files changed

+68
-549
lines changed

18 files changed

+68
-549
lines changed

MessageKit.xcodeproj/project.pbxproj

+23-7
Original file line numberDiff line numberDiff line change
@@ -461,16 +461,16 @@
461461
isa = PBXProject;
462462
attributes = {
463463
LastSwiftUpdateCheck = 0720;
464-
LastUpgradeCheck = 0800;
464+
LastUpgradeCheck = 0900;
465465
ORGANIZATIONNAME = HarriesChen;
466466
TargetAttributes = {
467467
E5D671C41C59BD0C005C9598 = {
468468
CreatedOnToolsVersion = 7.2;
469-
LastSwiftMigration = 0800;
469+
LastSwiftMigration = 0900;
470470
};
471471
E5DB76441C8FD040006B599B = {
472472
CreatedOnToolsVersion = 7.2.1;
473-
LastSwiftMigration = 0800;
473+
LastSwiftMigration = 0900;
474474
};
475475
};
476476
};
@@ -602,14 +602,20 @@
602602
CLANG_CXX_LIBRARY = "libc++";
603603
CLANG_ENABLE_MODULES = YES;
604604
CLANG_ENABLE_OBJC_ARC = YES;
605+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
605606
CLANG_WARN_BOOL_CONVERSION = YES;
607+
CLANG_WARN_COMMA = YES;
606608
CLANG_WARN_CONSTANT_CONVERSION = YES;
607609
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
608610
CLANG_WARN_EMPTY_BODY = YES;
609611
CLANG_WARN_ENUM_CONVERSION = YES;
610612
CLANG_WARN_INFINITE_RECURSION = YES;
611613
CLANG_WARN_INT_CONVERSION = YES;
614+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
615+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
612616
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
617+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
618+
CLANG_WARN_STRICT_PROTOTYPES = YES;
613619
CLANG_WARN_SUSPICIOUS_MOVE = YES;
614620
CLANG_WARN_UNREACHABLE_CODE = YES;
615621
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -652,14 +658,20 @@
652658
CLANG_CXX_LIBRARY = "libc++";
653659
CLANG_ENABLE_MODULES = YES;
654660
CLANG_ENABLE_OBJC_ARC = YES;
661+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
655662
CLANG_WARN_BOOL_CONVERSION = YES;
663+
CLANG_WARN_COMMA = YES;
656664
CLANG_WARN_CONSTANT_CONVERSION = YES;
657665
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
658666
CLANG_WARN_EMPTY_BODY = YES;
659667
CLANG_WARN_ENUM_CONVERSION = YES;
660668
CLANG_WARN_INFINITE_RECURSION = YES;
661669
CLANG_WARN_INT_CONVERSION = YES;
670+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
671+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
662672
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
673+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
674+
CLANG_WARN_STRICT_PROTOTYPES = YES;
663675
CLANG_WARN_SUSPICIOUS_MOVE = YES;
664676
CLANG_WARN_UNREACHABLE_CODE = YES;
665677
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -704,7 +716,8 @@
704716
PRODUCT_NAME = "$(TARGET_NAME)";
705717
SKIP_INSTALL = YES;
706718
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
707-
SWIFT_VERSION = 3.0;
719+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
720+
SWIFT_VERSION = 4.0;
708721
};
709722
name = Debug;
710723
};
@@ -723,7 +736,8 @@
723736
PRODUCT_BUNDLE_IDENTIFIER = com.harrieschen.MessageKit;
724737
PRODUCT_NAME = "$(TARGET_NAME)";
725738
SKIP_INSTALL = YES;
726-
SWIFT_VERSION = 3.0;
739+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
740+
SWIFT_VERSION = 4.0;
727741
};
728742
name = Release;
729743
};
@@ -737,7 +751,8 @@
737751
PRODUCT_BUNDLE_IDENTIFIER = com.harrieschen.MessageKitTests;
738752
PRODUCT_NAME = "$(TARGET_NAME)";
739753
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
740-
SWIFT_VERSION = 3.0;
754+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
755+
SWIFT_VERSION = 4.0;
741756
};
742757
name = Debug;
743758
};
@@ -750,7 +765,8 @@
750765
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
751766
PRODUCT_BUNDLE_IDENTIFIER = com.harrieschen.MessageKitTests;
752767
PRODUCT_NAME = "$(TARGET_NAME)";
753-
SWIFT_VERSION = 3.0;
768+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
769+
SWIFT_VERSION = 4.0;
754770
};
755771
name = Release;
756772
};

MessageKit.xcodeproj/xcshareddata/xcschemes/MessageKit.xcscheme

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES"
3031
codeCoverageEnabled = "YES">
3132
<Testables>
@@ -56,6 +57,7 @@
5657
buildConfiguration = "Debug"
5758
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5859
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60+
language = ""
5961
launchStyle = "0"
6062
useCustomWorkingDirectory = "NO"
6163
ignoresPersistentStateOnLaunch = "NO"

MessageKit/BaseMessageCollectionViewCellDefaultSyle.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ open class BaseMessageCollectionViewCellDefaultSyle: BaseMessageCollectionViewCe
4545
}()
4646

4747
open func attributedStringForDate(_ date: String) -> NSAttributedString {
48-
let attributes = [NSFontAttributeName : self.dateFont]
48+
let attributes = [NSAttributedStringKey.font : self.dateFont]
4949
return NSAttributedString(string: date, attributes: attributes)
5050
}
5151

MessageKit/MessageViewController+Changes.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ extension MessageViewController: MessageDataSourceDelegateProtocol {
7575
let performInBackground = newContext != .firstLoad
7676

7777
self.isAutoLoadingEnabled = false
78-
let perfomBatchUpdates: UpdateClosure = { modelUpdate in
78+
79+
let perfomBatchUpdates: UpdateClosure = { (changes, updateModelClosure) in
7980
self.performBatchUpdates(
80-
updateModelClosure: modelUpdate.1,
81-
changes: modelUpdate.0,
81+
updateModelClosure: updateModelClosure,
82+
changes: changes,
8283
context: newContext,
8384
completion: { () -> Void in
8485
self.isAutoLoadingEnabled = true

MessageKit/TextBubbleView.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ public final class TextBubbleView: UIView, MaximumLayoutWidthSpecificable, Backg
130130
if self.textView.textColor != textColor {
131131
self.textView.textColor = textColor
132132
self.textView.linkTextAttributes = [
133-
NSForegroundColorAttributeName: textColor,
134-
NSUnderlineStyleAttributeName : NSUnderlineStyle.styleSingle.rawValue
133+
NSAttributedStringKey.foregroundColor.rawValue: textColor,
134+
NSAttributedStringKey.underlineStyle.rawValue : NSUnderlineStyle.styleSingle.rawValue
135135
]
136136
}
137137
if self.bubbleImageView.image != bubbleImage { self.bubbleImageView.image = bubbleImage}
@@ -232,7 +232,7 @@ private final class TextBubbleLayoutModel {
232232
return self.layoutContext.text.boundingRect(
233233
with: CGSize(width: width, height: CGFloat.greatestFiniteMagnitude),
234234
options: [.usesLineFragmentOrigin, .usesFontLeading],
235-
attributes: [NSFontAttributeName: self.layoutContext.font], context: nil
235+
attributes: [NSAttributedStringKey.font: self.layoutContext.font], context: nil
236236
).size.bmaRound()
237237
}
238238
}
-246 KB
Binary file not shown.

0 commit comments

Comments
 (0)