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

Commit

Permalink
Merge branch 'feature/swift-4'
Browse files Browse the repository at this point in the history
  • Loading branch information
suricforever committed Oct 20, 2017
2 parents ae1ebeb + 2ff3333 commit 2cbf35d
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 549 deletions.
30 changes: 23 additions & 7 deletions MessageKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -461,16 +461,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = HarriesChen;
TargetAttributes = {
E5D671C41C59BD0C005C9598 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 0900;
};
E5DB76441C8FD040006B599B = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 0900;
};
};
};
Expand Down Expand Up @@ -602,14 +602,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 @@ -652,14 +658,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 @@ -704,7 +716,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -723,7 +736,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.harrieschen.MessageKit;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -737,7 +751,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.harrieschen.MessageKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -750,7 +765,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.harrieschen.MessageKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
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 = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
Expand Down Expand Up @@ -56,6 +57,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion MessageKit/BaseMessageCollectionViewCellDefaultSyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ open class BaseMessageCollectionViewCellDefaultSyle: BaseMessageCollectionViewCe
}()

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

Expand Down
7 changes: 4 additions & 3 deletions MessageKit/MessageViewController+Changes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ extension MessageViewController: MessageDataSourceDelegateProtocol {
let performInBackground = newContext != .firstLoad

self.isAutoLoadingEnabled = false
let perfomBatchUpdates: UpdateClosure = { modelUpdate in

let perfomBatchUpdates: UpdateClosure = { (changes, updateModelClosure) in
self.performBatchUpdates(
updateModelClosure: modelUpdate.1,
changes: modelUpdate.0,
updateModelClosure: updateModelClosure,
changes: changes,
context: newContext,
completion: { () -> Void in
self.isAutoLoadingEnabled = true
Expand Down
6 changes: 3 additions & 3 deletions MessageKit/TextBubbleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public final class TextBubbleView: UIView, MaximumLayoutWidthSpecificable, Backg
if self.textView.textColor != textColor {
self.textView.textColor = textColor
self.textView.linkTextAttributes = [
NSForegroundColorAttributeName: textColor,
NSUnderlineStyleAttributeName : NSUnderlineStyle.styleSingle.rawValue
NSAttributedStringKey.foregroundColor.rawValue: textColor,
NSAttributedStringKey.underlineStyle.rawValue : NSUnderlineStyle.styleSingle.rawValue
]
}
if self.bubbleImageView.image != bubbleImage { self.bubbleImageView.image = bubbleImage}
Expand Down Expand Up @@ -232,7 +232,7 @@ private final class TextBubbleLayoutModel {
return self.layoutContext.text.boundingRect(
with: CGSize(width: width, height: CGFloat.greatestFiniteMagnitude),
options: [.usesLineFragmentOrigin, .usesFontLeading],
attributes: [NSFontAttributeName: self.layoutContext.font], context: nil
attributes: [NSAttributedStringKey.font: self.layoutContext.font], context: nil
).size.bmaRound()
}
}
Expand Down
Binary file removed MessageKitDemo/MessageKit.framework/Assets.car
Binary file not shown.
Loading

0 comments on commit 2cbf35d

Please sign in to comment.