diff --git a/MessageKit.xcodeproj/project.pbxproj b/MessageKit.xcodeproj/project.pbxproj index 0149ace..5421c06 100644 --- a/MessageKit.xcodeproj/project.pbxproj +++ b/MessageKit.xcodeproj/project.pbxproj @@ -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; }; }; }; @@ -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; @@ -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; @@ -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; }; @@ -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; }; @@ -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; }; @@ -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; }; diff --git a/MessageKit.xcodeproj/xcshareddata/xcschemes/MessageKit.xcscheme b/MessageKit.xcodeproj/xcshareddata/xcschemes/MessageKit.xcscheme index 339a970..123cd5c 100644 --- a/MessageKit.xcodeproj/xcshareddata/xcschemes/MessageKit.xcscheme +++ b/MessageKit.xcodeproj/xcshareddata/xcschemes/MessageKit.xcscheme @@ -1,6 +1,6 @@ @@ -56,6 +57,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/MessageKit/BaseMessageCollectionViewCellDefaultSyle.swift b/MessageKit/BaseMessageCollectionViewCellDefaultSyle.swift index c292cec..aff2e47 100644 --- a/MessageKit/BaseMessageCollectionViewCellDefaultSyle.swift +++ b/MessageKit/BaseMessageCollectionViewCellDefaultSyle.swift @@ -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) } diff --git a/MessageKit/MessageViewController+Changes.swift b/MessageKit/MessageViewController+Changes.swift index 83f3f58..d99088b 100644 --- a/MessageKit/MessageViewController+Changes.swift +++ b/MessageKit/MessageViewController+Changes.swift @@ -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 diff --git a/MessageKit/TextBubbleView.swift b/MessageKit/TextBubbleView.swift index ebc4b63..8a33d57 100644 --- a/MessageKit/TextBubbleView.swift +++ b/MessageKit/TextBubbleView.swift @@ -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} @@ -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() } } diff --git a/MessageKitDemo/MessageKit.framework/Assets.car b/MessageKitDemo/MessageKit.framework/Assets.car deleted file mode 100644 index dd8bca3..0000000 Binary files a/MessageKitDemo/MessageKit.framework/Assets.car and /dev/null differ diff --git a/MessageKitDemo/MessageKit.framework/Headers/MessageKit-Swift.h b/MessageKitDemo/MessageKit.framework/Headers/MessageKit-Swift.h deleted file mode 100644 index 39a8d3d..0000000 --- a/MessageKitDemo/MessageKit.framework/Headers/MessageKit-Swift.h +++ /dev/null @@ -1,291 +0,0 @@ -// Generated by Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38) -#pragma clang diagnostic push - -#if defined(__has_include) && __has_include() -# include -#endif - -#pragma clang diagnostic ignored "-Wauto-import" -#include -#include -#include -#include - -#if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if defined(__has_include) && __has_include() -# include -# elif !defined(__cplusplus) || __cplusplus < 201103L -typedef uint_least16_t char16_t; -typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); -#endif - -#if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) -#endif -#if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class -#endif -#if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif -#endif - -#if defined(__has_attribute) && __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) -#else -# define SWIFT_RUNTIME_NAME(X) -#endif -#if defined(__has_attribute) && __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) -#else -# define SWIFT_COMPILE_NAME(X) -#endif -#if defined(__has_attribute) && __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) -#else -# define SWIFT_METHOD_FAMILY(X) -#endif -#if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA -#endif -#if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA -#endif -#if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA -#endif -#if !defined(SWIFT_CLASS) -# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif -#endif - -#if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#endif - -#if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) -#endif - -#if !defined(OBJC_DESIGNATED_INITIALIZER) -# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif -#endif -#if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type -# if defined(__has_feature) && __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) -# endif -#endif -#if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) -#endif -#if defined(__has_feature) && __has_feature(modules) -@import Foundation; -@import UIKit; -@import CoreFoundation; -@import CoreGraphics; -@import ObjectiveC; -#endif - -#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" -#pragma clang diagnostic ignored "-Wduplicate-method-arg" - -@interface NSBundle (SWIFT_EXTENSION(MessageKit)) -@end - -@class NSCoder; - -SWIFT_CLASS("_TtC10MessageKit16CustomBubbleView") -@interface CustomBubbleView : UIView -@property (nonatomic) CFTimeInterval animationDuration; -@property (nonatomic) CGFloat preferredMaxLayoutWidth; -- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; -- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER; -@property (nonatomic) BOOL selected; -@property (nonatomic, readonly) BOOL isUpdating; -- (void)performBatchUpdates:(void (^ _Nonnull)(void))updateClosure animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion; -- (CGSize)sizeThatFits:(CGSize)size; -- (void)layoutSubviews; -@property (nonatomic, readonly) BOOL canCalculateSizeInBackground; -@end - - -SWIFT_CLASS("_TtC10MessageKit14FileBubbleView") -@interface FileBubbleView : UIView -@property (nonatomic) CFTimeInterval animationDuration; -@property (nonatomic) CGFloat preferredMaxLayoutWidth; -@property (nonatomic) CGFloat fileWidth; -@property (nonatomic) CGFloat fileHeight; -@property (nonatomic) CGSize fileBubbleViewSize; -@property (nonatomic) CGSize fileIconSize; -- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; -- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER; -@property (nonatomic) BOOL selected; -@property (nonatomic, readonly) BOOL isUpdating; -- (void)performBatchUpdates:(void (^ _Nonnull)(void))updateClosure animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion; -- (CGSize)sizeThatFits:(CGSize)size; -- (void)layoutSubviews; -@property (nonatomic, readonly) BOOL canCalculateSizeInBackground; -@end - -@class UICollectionViewLayoutAttributes; - -SWIFT_CLASS("_TtC10MessageKit27MessageCollectionViewLayout") -@interface MessageCollectionViewLayout : UICollectionViewLayout -- (void)invalidateLayout; -- (void)prepareLayout; -@property (nonatomic, readonly) CGSize collectionViewContentSize; -- (NSArray * _Nullable)layoutAttributesForElementsInRect:(CGRect)rect; -- (UICollectionViewLayoutAttributes * _Nullable)layoutAttributesForItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath; -- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds; -- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; -- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER; -@end - -@class UICollectionView; -@class NSLayoutConstraint; - -SWIFT_CLASS("_TtC10MessageKit21MessageViewController") -@interface MessageViewController : UIViewController -@property (nonatomic, readonly, strong) UICollectionView * _Null_unspecified collectionView; -@property (nonatomic, strong) NSLayoutConstraint * _Null_unspecified inputContainerBottomConstraint; -@property (nonatomic) BOOL isFirstLayout; -- (UIView * _Nonnull)createInputView; -- (void)viewDidLoad; -- (void)viewDidAppear:(BOOL)animated; -- (void)didReceiveMemoryWarning; -- (void)viewDidLayoutSubviews; -- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER; -- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER; -@end - -@protocol UIViewControllerTransitionCoordinator; - -@interface MessageViewController (SWIFT_EXTENSION(MessageKit)) -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id _Nonnull)coordinator; -@end - - -@interface MessageViewController (SWIFT_EXTENSION(MessageKit)) -- (BOOL)isScrolledAtBottom; -- (BOOL)isScrolledAtTop; -- (BOOL)isCloseToBottom; -- (BOOL)isCloseToTop; -- (void)scrollToBottomWithAnimated:(BOOL)animated; -- (CGRect)visibleRect; -@end - -@class UICollectionViewCell; - -@interface MessageViewController (SWIFT_EXTENSION(MessageKit)) -- (NSInteger)collectionView:(UICollectionView * _Nonnull)collectionView numberOfItemsInSection:(NSInteger)section; -- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView * _Nonnull)collectionView; -- (UICollectionViewCell * _Nonnull)collectionView:(UICollectionView * _Nonnull)collectionView cellForItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath; -- (void)collectionView:(UICollectionView * _Nonnull)collectionView didEndDisplayingCell:(UICollectionViewCell * _Nonnull)cell forItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath; -- (void)collectionView:(UICollectionView * _Nonnull)collectionView willDisplayCell:(UICollectionViewCell * _Nonnull)cell forItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath; -- (BOOL)collectionView:(UICollectionView * _Nonnull)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath; -- (void)collectionView:(UICollectionView * _Nonnull)collectionView performAction:(SEL _Nonnull)action forItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath withSender:(id _Nullable)sender; -- (BOOL)collectionView:(UICollectionView * _Nonnull)collectionView canPerformAction:(SEL _Nonnull)action forItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath withSender:(id _Nullable)sender; -@end - - -@interface MessageViewController (SWIFT_EXTENSION(MessageKit)) -- (void)enqueueMessageCountReductionIfNeeded; -@property (nonatomic, readonly) double focusPosition; -@end - - -SWIFT_CLASS("_TtC10MessageKit15PhotoBubbleView") -@interface PhotoBubbleView : UIView -@property (nonatomic) CFTimeInterval animationDuration; -@property (nonatomic) CGFloat preferredMaxLayoutWidth; -- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; -- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER; -@property (nonatomic, readonly) BOOL isUpdating; -- (void)performBatchUpdates:(void (^ _Nonnull)(void))updateClosure animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion; -- (CGSize)sizeThatFits:(CGSize)size; -- (void)layoutSubviews; -@property (nonatomic, readonly) BOOL canCalculateSizeInBackground; -@end - - -SWIFT_CLASS("_TtC10MessageKit14TextBubbleView") -@interface TextBubbleView : UIView -@property (nonatomic) CGFloat preferredMaxLayoutWidth; -@property (nonatomic) CFTimeInterval animationDuration; -@property (nonatomic) BOOL selected; -- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; -- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER; -@property (nonatomic, readonly) BOOL isUpdating; -- (void)performBatchUpdates:(void (^ _Nonnull)(void))updateClosure animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion; -- (CGSize)sizeThatFits:(CGSize)size; -- (void)layoutSubviews; -@property (nonatomic, strong) NSCache * _Null_unspecified layoutCache; -@property (nonatomic, readonly) BOOL canCalculateSizeInBackground; -@end - - -@interface UIColor (SWIFT_EXTENSION(MessageKit)) -+ (UIColor * _Nonnull)bma_colorWithRgb:(NSInteger)rgb; -- (UIColor * _Nonnull)bma_blendWithColor:(UIColor * _Nonnull)color; -@end - - -@interface UIImage (SWIFT_EXTENSION(MessageKit)) -@end - - -@interface UIImage (SWIFT_EXTENSION(MessageKit)) -@end - - -@interface UIImage (SWIFT_EXTENSION(MessageKit)) -- (UIImage * _Nonnull)bma_tintWithColor:(UIColor * _Nonnull)color; -- (UIImage * _Nonnull)bma_blendWithColor:(UIColor * _Nonnull)color; -+ (UIImage * _Nonnull)bma_imageWithColor:(UIColor * _Nonnull)color size:(CGSize)size; -@end - - -@interface UIImageView (SWIFT_EXTENSION(MessageKit)) -@end - - -@interface UIView (SWIFT_EXTENSION(MessageKit)) -@end - - -@interface UIView (SWIFT_EXTENSION(MessageKit)) -@property (nonatomic) CGRect bma_rect; -@end - -#pragma clang diagnostic pop diff --git a/MessageKitDemo/MessageKit.framework/Headers/MessageKit.h b/MessageKitDemo/MessageKit.framework/Headers/MessageKit.h deleted file mode 100644 index 33e942c..0000000 --- a/MessageKitDemo/MessageKit.framework/Headers/MessageKit.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// MessageKit.h -// MessageKit -// -// Created by ChenHao on 1/28/16. -// Copyright © 2016 HarriesChen. All rights reserved. -// - -#import - -//! Project version number for MessageKit. -FOUNDATION_EXPORT double MessageKitVersionNumber; - -//! Project version string for MessageKit. -FOUNDATION_EXPORT const unsigned char MessageKitVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import diff --git a/MessageKitDemo/MessageKit.framework/Info.plist b/MessageKitDemo/MessageKit.framework/Info.plist deleted file mode 100644 index ab09856..0000000 Binary files a/MessageKitDemo/MessageKit.framework/Info.plist and /dev/null differ diff --git a/MessageKitDemo/MessageKit.framework/MessageKit b/MessageKitDemo/MessageKit.framework/MessageKit deleted file mode 100755 index b16139d..0000000 Binary files a/MessageKitDemo/MessageKit.framework/MessageKit and /dev/null differ diff --git a/MessageKitDemo/MessageKit.framework/Modules/MessageKit.swiftmodule/x86_64.swiftdoc b/MessageKitDemo/MessageKit.framework/Modules/MessageKit.swiftmodule/x86_64.swiftdoc deleted file mode 100644 index ccc8935..0000000 Binary files a/MessageKitDemo/MessageKit.framework/Modules/MessageKit.swiftmodule/x86_64.swiftdoc and /dev/null differ diff --git a/MessageKitDemo/MessageKit.framework/Modules/MessageKit.swiftmodule/x86_64.swiftmodule b/MessageKitDemo/MessageKit.framework/Modules/MessageKit.swiftmodule/x86_64.swiftmodule deleted file mode 100644 index b2ddba0..0000000 Binary files a/MessageKitDemo/MessageKit.framework/Modules/MessageKit.swiftmodule/x86_64.swiftmodule and /dev/null differ diff --git a/MessageKitDemo/MessageKit.framework/Modules/module.modulemap b/MessageKitDemo/MessageKit.framework/Modules/module.modulemap deleted file mode 100644 index 287579e..0000000 --- a/MessageKitDemo/MessageKit.framework/Modules/module.modulemap +++ /dev/null @@ -1,10 +0,0 @@ -framework module MessageKit { - umbrella header "MessageKit.h" - - export * - module * { export * } -} - -module MessageKit.Swift { - header "MessageKit-Swift.h" -} diff --git a/MessageKitDemo/MessageKit.framework/_CodeSignature/CodeResources b/MessageKitDemo/MessageKit.framework/_CodeSignature/CodeResources deleted file mode 100644 index 822969a..0000000 --- a/MessageKitDemo/MessageKit.framework/_CodeSignature/CodeResources +++ /dev/null @@ -1,201 +0,0 @@ - - - - - files - - Assets.car - - /Wd4uIWhxMxh7o79n/SWWUFIvhg= - - Headers/MessageKit-Swift.h - - +r7lnWomQnQXSAshferLmntfDAQ= - - Headers/MessageKit.h - - X9ItVkcT15kcNg/MxuVvZvOW+Do= - - Info.plist - - T19NzxnVf7RP11VOvFWSKD3ccao= - - Modules/MessageKit.swiftmodule/x86_64.swiftdoc - - dAFkX9BBD9CyjmdjPt61mLNy2Y0= - - Modules/MessageKit.swiftmodule/x86_64.swiftmodule - - r0AdunTYCdolbJPmhcPsXF13Wvk= - - Modules/module.modulemap - - IFnBo7ya+ILNf9rUVmJQF/MB3L8= - - - files2 - - Assets.car - - hash - - /Wd4uIWhxMxh7o79n/SWWUFIvhg= - - hash2 - - cbLBsTJH/HQFIFAM79yBQZtzPeZKzzKAz/smY2mRawk= - - - Headers/MessageKit-Swift.h - - hash - - +r7lnWomQnQXSAshferLmntfDAQ= - - hash2 - - nZbYJRMrCvJiklxYIH4iyTe0kDxaQqFS4uhNK6JSovU= - - - Headers/MessageKit.h - - hash - - X9ItVkcT15kcNg/MxuVvZvOW+Do= - - hash2 - - fEMKTGBFO9j7E0PvShIt3RDy+v4KyPBuHkXz82kbacg= - - - Modules/MessageKit.swiftmodule/x86_64.swiftdoc - - hash - - dAFkX9BBD9CyjmdjPt61mLNy2Y0= - - hash2 - - OxPDZtV0VAWfsyiKy3URYJpsZgqcQ285AWykW1NKa88= - - - Modules/MessageKit.swiftmodule/x86_64.swiftmodule - - hash - - r0AdunTYCdolbJPmhcPsXF13Wvk= - - hash2 - - CplzwRz1LFK0q18oHet+frz9xVKtcVWKwv7YX/6PwLw= - - - Modules/module.modulemap - - hash - - IFnBo7ya+ILNf9rUVmJQF/MB3L8= - - hash2 - - ZShTsFTvcSxpXYqoCuK6/bDmYmzwx7mfvwGgwe03GDg= - - - - rules - - ^ - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^ - - weight - 20 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/MessageKitDemo/MessageKitDemo.xcodeproj/project.pbxproj b/MessageKitDemo/MessageKitDemo.xcodeproj/project.pbxproj index db37b54..1c5dd6c 100644 --- a/MessageKitDemo/MessageKitDemo.xcodeproj/project.pbxproj +++ b/MessageKitDemo/MessageKitDemo.xcodeproj/project.pbxproj @@ -7,8 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 86A830CF1D8E927800A69D85 /* MessageKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86A830CE1D8E927800A69D85 /* MessageKit.framework */; }; - 86A830D01D8E927800A69D85 /* MessageKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 86A830CE1D8E927800A69D85 /* MessageKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + AC0979B31F97001500F5CB9F /* MessageKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC0979B41F97001500F5CB9F /* MessageKit.framework */; }; E5259E5B1C7DB06E00C503FF /* FPSLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5259E5A1C7DB06E00C503FF /* FPSLabel.swift */; }; E5D672011C59BE77005C9598 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5D672001C59BE77005C9598 /* AppDelegate.swift */; }; E5D672031C59BE77005C9598 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5D672021C59BE77005C9598 /* ViewController.swift */; }; @@ -24,7 +23,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 86A830D01D8E927800A69D85 /* MessageKit.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,7 +30,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 86A830CE1D8E927800A69D85 /* MessageKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = MessageKit.framework; sourceTree = ""; }; + AC0979B41F97001500F5CB9F /* MessageKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = MessageKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E5259E5A1C7DB06E00C503FF /* FPSLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FPSLabel.swift; sourceTree = ""; }; E5D671FD1C59BE77005C9598 /* MessageKitDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MessageKitDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; E5D672001C59BE77005C9598 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -48,19 +46,27 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 86A830CF1D8E927800A69D85 /* MessageKit.framework in Frameworks */, + AC0979B31F97001500F5CB9F /* MessageKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + AC0979B21F97001500F5CB9F /* Frameworks */ = { + isa = PBXGroup; + children = ( + AC0979B41F97001500F5CB9F /* MessageKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; E5D671F41C59BE77005C9598 = { isa = PBXGroup; children = ( - 86A830CE1D8E927800A69D85 /* MessageKit.framework */, E5D671FF1C59BE77005C9598 /* MessageKitDemo */, E5D671FE1C59BE77005C9598 /* Products */, + AC0979B21F97001500F5CB9F /* Frameworks */, ); sourceTree = ""; }; @@ -115,12 +121,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = HarriesChen; TargetAttributes = { E5D671FC1C59BE77005C9598 = { CreatedOnToolsVersion = 7.2; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -212,14 +218,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; @@ -259,14 +271,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; @@ -304,7 +322,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.harrieschen.MessageKitDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -321,7 +340,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.harrieschen.MessageKitDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/MessageKitDemo/MessageKitDemo/FPSLabel.swift b/MessageKitDemo/MessageKitDemo/FPSLabel.swift index ce57abe..0ce2ff2 100644 --- a/MessageKitDemo/MessageKitDemo/FPSLabel.swift +++ b/MessageKitDemo/MessageKitDemo/FPSLabel.swift @@ -25,7 +25,7 @@ class FPSLabel: UILabel { fatalError("init(coder:) has not been implemented") } - func tick(_ link: CADisplayLink) { + @objc func tick(_ link: CADisplayLink) { if lastTime == 0 { lastTime = link.timestamp return diff --git a/MessageKitDemo/MessageKitDemo/ViewController.swift b/MessageKitDemo/MessageKitDemo/ViewController.swift index 1de523c..67500cd 100644 --- a/MessageKitDemo/MessageKitDemo/ViewController.swift +++ b/MessageKitDemo/MessageKitDemo/ViewController.swift @@ -275,7 +275,7 @@ class ViewController: MessageViewController { super.didReceiveMemoryWarning() } - func addNewMessage() { + @objc func addNewMessage() { for _ in 1...1000 { sendNewMessage(randomModel()) @@ -283,7 +283,7 @@ class ViewController: MessageViewController { } - func addNewMessages() { + @objc func addNewMessages() { var array = self.messageDataSource!.messageItems for _ in 0...300 { diff --git a/MessageKitTests/MessageKitTests.swift b/MessageKitTests/MessageKitTests.swift index e35872c..cbf46fd 100644 --- a/MessageKitTests/MessageKitTests.swift +++ b/MessageKitTests/MessageKitTests.swift @@ -27,8 +27,7 @@ class MessageKitTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { - // Put the code you want to measure the time of here. + self.measure // Put the code you want to measure the time of here. } }