Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2202 from RocketChat/develop
Browse files Browse the repository at this point in the history
[RELEASE] Merge DEVELOP into MASTER
  • Loading branch information
rafaelks committed Sep 22, 2018
2 parents 5d0b02d + 23576a3 commit 64b4ae9
Show file tree
Hide file tree
Showing 123 changed files with 840 additions and 430 deletions.
19 changes: 13 additions & 6 deletions Podfile
Expand Up @@ -14,7 +14,7 @@ def ui_pods
end

def diff_pods
pod 'DifferenceKit'
pod 'DifferenceKit/Core'
end

def shared_pods
Expand Down Expand Up @@ -77,18 +77,25 @@ target 'Rocket.ChatTests' do
end

post_install do |installer|
swift4Targets = ['OAuthSwift', 'TagListView', 'SearchTextField', 'Nuke', 'Nuke-FLAnimatedImage-Plugin', 'DifferenceKit', 'SwipeCellKit']
swift3Targets = ['MobilePlayer', 'RCMarkdownParser']
swift42Targets = ['SwipeCellKit']
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.1'
config.build_settings['SWIFT_VERSION'] = '4.1'
if config.name == 'Debug'
config.build_settings['OTHER_SWIFT_FLAGS'] = ['$(inherited)', '-Onone']
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
else
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Owholemodule'
end
end
if swift4Targets.include? target.name
if swift3Targets.include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
config.build_settings['SWIFT_VERSION'] = '3.1'
end
end
if swift42Targets.include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
Expand Down
65 changes: 30 additions & 35 deletions Podfile.lock
Expand Up @@ -2,19 +2,14 @@ PODS:
- 1PasswordExtension (1.8.5)
- Crashlytics (3.10.7):
- Fabric (~> 1.7.11)
- DifferenceKit (0.5.3):
- DifferenceKit/Core (= 0.5.3)
- DifferenceKit/UIExtensions (= 0.5.3)
- DifferenceKit/Core (0.5.3)
- DifferenceKit/UIExtensions (0.5.3):
- DifferenceKit/Core
- Fabric (1.7.11)
- Firebase/Core (5.7.0):
- Firebase/Core (5.8.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 5.1.1)
- Firebase/CoreOnly (5.7.0):
- FirebaseCore (= 5.1.2)
- FirebaseAnalytics (5.1.1):
- FirebaseAnalytics (= 5.1.2)
- Firebase/CoreOnly (5.8.0):
- FirebaseCore (= 5.1.3)
- FirebaseAnalytics (5.1.2):
- FirebaseCore (~> 5.1)
- FirebaseInstanceID (~> 3.2)
- GoogleAppMeasurement (~> 5.1)
Expand All @@ -23,34 +18,34 @@ PODS:
- GoogleUtilities/Network (~> 5.2)
- "GoogleUtilities/NSData+zlib (~> 5.2)"
- nanopb (~> 0.3)
- FirebaseCore (5.1.2):
- FirebaseCore (5.1.3):
- GoogleUtilities/Logger (~> 5.2)
- FirebaseInstanceID (3.2.1):
- FirebaseCore (~> 5.1)
- GoogleUtilities/Environment (~> 5.2)
- FLAnimatedImage (1.0.12)
- FLEX (2.4.0)
- GoogleAppMeasurement (5.1.1):
- GoogleAppMeasurement (5.1.2):
- GoogleUtilities/AppDelegateSwizzler (~> 5.2.0)
- GoogleUtilities/MethodSwizzler (~> 5.2.0)
- GoogleUtilities/Network (~> 5.2)
- "GoogleUtilities/NSData+zlib (~> 5.2)"
- nanopb (~> 0.3)
- GoogleUtilities/AppDelegateSwizzler (5.2.2):
- GoogleUtilities/AppDelegateSwizzler (5.2.3):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (5.2.2)
- GoogleUtilities/Logger (5.2.2):
- GoogleUtilities/Environment (5.2.3)
- GoogleUtilities/Logger (5.2.3):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (5.2.2):
- GoogleUtilities/MethodSwizzler (5.2.3):
- GoogleUtilities/Logger
- GoogleUtilities/Network (5.2.2):
- GoogleUtilities/Network (5.2.3):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (5.2.2)"
- GoogleUtilities/Reachability (5.2.2):
- "GoogleUtilities/NSData+zlib (5.2.3)"
- GoogleUtilities/Reachability (5.2.3):
- GoogleUtilities/Logger
- MBProgressHUD (1.1.0)
- MobilePlayer (1.2.0)
Expand All @@ -66,24 +61,24 @@ PODS:
- OAuthSwift (1.2.2)
- RCMarkdownParser (3.0.6)
- ReachabilitySwift (4.2.1)
- Realm (3.7.6):
- Realm/Headers (= 3.7.6)
- Realm/Headers (3.7.6)
- RealmSwift (3.7.6):
- Realm (= 3.7.6)
- Realm (3.9.0):
- Realm/Headers (= 3.9.0)
- Realm/Headers (3.9.0)
- RealmSwift (3.9.0):
- Realm (= 3.9.0)
- semver (1.1.0)
- SimpleImageViewer (1.2.0):
- FLAnimatedImage
- SlackTextViewController (1.9.6)
- Starscream (2.1.1)
- SwiftLint (0.27.0)
- SwiftyJSON (4.1.0)
- SwipeCellKit (2.4.3)
- SwipeCellKit (2.5.0)

DEPENDENCIES:
- 1PasswordExtension
- Crashlytics
- DifferenceKit
- DifferenceKit/Core
- Fabric
- Firebase/Core
- FLEX (~> 2.0)
Expand Down Expand Up @@ -160,14 +155,14 @@ SPEC CHECKSUMS:
Crashlytics: ccaac42660eb9351b9960c0d66106b0bcf99f4fa
DifferenceKit: 2037137305c55a39ff729baa72697efa30b1052d
Fabric: f233c9492b3bbc1f04e3882986740f7988a58edb
Firebase: 734a4f92957aa6c40e7ae3fda3d9359e1890aa87
FirebaseAnalytics: 993577e91157feb40945abedd6ab346d8a4b6ac8
FirebaseCore: 3a97432acb324b439fbed338e642f9cbb516a63d
Firebase: 25812f43e7a53b11ae2f0a5f4c6d12faeb1f7cd7
FirebaseAnalytics: df15839e9c6ca6bd14d2e8ab6b0c672e6c49097e
FirebaseCore: 27bd80e5bfaaf9552a1f5cacb4c7e8bb925bab22
FirebaseInstanceID: ea5af6920d0a4a29b40459d055bebe4a6c1333c4
FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
FLEX: bd1a39e55b56bb413b6f1b34b3c10a0dc44ef079
GoogleAppMeasurement: f7507b39b70ad0bd80b3d81518b2f43868974307
GoogleUtilities: 06b66f9567769a7958db20a92f0128b2843e49d5
GoogleAppMeasurement: fc4a4c3fe0144db9313cbf443ffe62e6b1d6268c
GoogleUtilities: 6f681e27050c5e130325e89fa0316dfca826f954
MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
MobilePlayer: 069b13482499f14c25b6ce53f63a91e17975b073
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
Expand All @@ -176,16 +171,16 @@ SPEC CHECKSUMS:
OAuthSwift: 27b34fe80b76b67cd8f45571e0be2432bc9f6de1
RCMarkdownParser: 518b616a4f48bb02247243544d4fd55c048288a4
ReachabilitySwift: 35720ffea59c1c76d15f885be77fd33e33985427
Realm: 9eaecad54712d6246d08ba34c10f354e4715d7d3
RealmSwift: 1fe08b4ebaeeaacf17f9ba0343f7b25c9fc31fa6
Realm: 3d36f208bf3aff8335dc3298742140182bde4edb
RealmSwift: aa4d11917bfcfaa3ed51f219102a487ecd895447
semver: 11ae3bc4a6036efbc86b5863ef5fa32c065c8bbd
SimpleImageViewer: 6ed0d2acf7c166a5b4e795bccc7b9ea1b225ff9b
SlackTextViewController: b854e62c1c156336bc4fd409c6ca79b5773e8f9d
Starscream: 142bd8ef24592d985daee9fa48c936070b85b15f
SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073
SwiftyJSON: c29297daf073d2aa016295d5809cdd68045c39b3
SwipeCellKit: cee9906e6d3a36e22ad1a852fba7f8fa0839d113
SwipeCellKit: d8f2617538ce3021cb0a11d1b93856a06a2f2e20

PODFILE CHECKSUM: 6702db159e15966472657eea05905247ba9622d9
PODFILE CHECKSUM: 6b8602cb3bfdb2d5969e91f6f161923d47884c5c

COCOAPODS: 1.5.3
8 changes: 3 additions & 5 deletions Rocket.Chat.ShareExtension/Base/SENavigationController.swift
Expand Up @@ -11,9 +11,7 @@ import MobileCoreServices

final class SENavigationController: UINavigationController {
func loadContent(_ store: SEStore) -> SEAction? {
let itemProviders = (extensionContext?.inputItems.first as? NSExtensionItem)?.attachments?.compactMap {
$0 as? NSItemProvider
} ?? []
let itemProviders = (extensionContext?.inputItems.first as? NSExtensionItem)?.attachments ?? []

parseItemProviders(store, itemProviders)
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
Expand All @@ -40,15 +38,15 @@ final class SENavigationController: UINavigationController {

view.transform = CGAffineTransform(translationX: 0, y: view.frame.size.height)

UIView.animate(withDuration: 0.25, delay: 0, options: UIViewAnimationOptions(rawValue: 7 << 16), animations: { [weak self] in
UIView.animate(withDuration: 0.25, delay: 0, options: UIView.AnimationOptions(rawValue: 7 << 16), animations: { [weak self] in
self?.view.transform = CGAffineTransform.identity
}, completion: nil)

store.subscribe(self)
}

private func completeRequest() {
UIView.animate(withDuration: 0.20, delay: 0, options: UIViewAnimationOptions(rawValue: 7 << 16), animations: { [weak self] in
UIView.animate(withDuration: 0.20, delay: 0, options: UIView.AnimationOptions(rawValue: 7 << 16), animations: { [weak self] in
self?.view.transform = CGAffineTransform(translationX: 0, y: self?.view.frame.height ?? 0)
}, completion: { [weak self] _ in
self?.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
Expand Down
16 changes: 8 additions & 8 deletions Rocket.Chat.ShareExtension/Base/SEViewController.swift
Expand Up @@ -16,7 +16,7 @@ enum SEError: Error {
class SEViewController: UIViewController, SEStoreSubscriber {

lazy var activityIndicator: UIActivityIndicatorView = {
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.whiteLarge)
let activityIndicator = UIActivityIndicatorView(style: .whiteLarge)
activityIndicator.frame = CGRect(x: 0, y: 0, width: 80, height: 80)
activityIndicator.layer.cornerRadius = 10
activityIndicator.backgroundColor = UIColor.black.withAlphaComponent(0.5)
Expand Down Expand Up @@ -67,7 +67,7 @@ class SEViewController: UIViewController, SEStoreSubscriber {
NotificationCenter.default.addObserver(
self,
selector: #selector(onKeyboardFrameWillChange(_:)),
name: NSNotification.Name.UIKeyboardWillChangeFrame,
name: UIResponder.keyboardWillChangeFrameNotification,
object: nil
)

Expand All @@ -77,15 +77,15 @@ class SEViewController: UIViewController, SEStoreSubscriber {
func stopAvoidingKeyboard() {
NotificationCenter.default.removeObserver(
self,
name: NSNotification.Name.UIKeyboardWillChangeFrame,
name: UIResponder.keyboardWillChangeFrameNotification,
object: nil
)
}

@objc func onKeyboardFrameWillChange(_ notification: Notification) {
guard
let userInfo = notification.userInfo,
let keyboardFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue
let keyboardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue
else {
return
}
Expand All @@ -94,10 +94,10 @@ class SEViewController: UIViewController, SEStoreSubscriber {
let safeAreaFrame = view.safeAreaLayoutGuide.layoutFrame.insetBy(dx: 0, dy: -additionalSafeAreaInsets.bottom)
let intersection = safeAreaFrame.intersection(keyboardFrameInView)

let animationDuration: TimeInterval = (notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0
let animationCurveRawNSN = notification.userInfo?[UIKeyboardAnimationCurveUserInfoKey] as? NSNumber
let animationCurveRaw = animationCurveRawNSN?.uintValue ?? UIViewAnimationOptions.curveEaseInOut.rawValue
let animationCurve = UIViewAnimationOptions(rawValue: animationCurveRaw)
let animationDuration: TimeInterval = (notification.userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0
let animationCurveRawNSN = notification.userInfo?[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber
let animationCurveRaw = animationCurveRawNSN?.uintValue ?? UIView.AnimationOptions.curveEaseInOut.rawValue
let animationCurve = UIView.AnimationOptions(rawValue: animationCurveRaw)

UIView.animate(withDuration: animationDuration, delay: 0, options: animationCurve, animations: {
let keyboardDisappeared = keyboardFrameInView == .zero
Expand Down
Expand Up @@ -34,7 +34,7 @@ class SEComposeFileCell: UICollectionViewCell, SECell {
let textField = UITextField(
frame: CGRect(x: 20, y: 0, width: tableView.bounds.width - 16, height: cellModel.nameHeight)
)
NotificationCenter.default.addObserver(self, selector: #selector(nameDidChange(_:)), name: .UITextFieldTextDidChange, object: textField)
NotificationCenter.default.addObserver(self, selector: #selector(nameDidChange(_:)), name: UITextField.textDidChangeNotification, object: textField)
return textField
}()

Expand All @@ -43,7 +43,7 @@ class SEComposeFileCell: UICollectionViewCell, SECell {
frame: CGRect(x: 16, y: 0, width: tableView.bounds.width - 16, height: cellModel.descriptionHeight)
)
textView.font = nameTextField.font
NotificationCenter.default.addObserver(self, selector: #selector(descriptionDidChange(_:)), name: .UITextViewTextDidChange, object: textView)
NotificationCenter.default.addObserver(self, selector: #selector(descriptionDidChange(_:)), name: UITextView.textDidChangeNotification, object: textView)
return textView
}()

Expand Down
Expand Up @@ -29,7 +29,7 @@ open class KMPlaceholderTextView: UITextView {
private struct Constants {
static let defaultiOSPlaceholderColor = UIColor(red: 0.0, green: 0.0, blue: 0.0980392, alpha: 0.22)
}
open let placeholderLabel: UILabel = UILabel()
public let placeholderLabel: UILabel = UILabel()

private var placeholderLabelConstraints = [NSLayoutConstraint]()

Expand Down Expand Up @@ -97,7 +97,7 @@ open class KMPlaceholderTextView: UITextView {
private func commonInit() {
NotificationCenter.default.addObserver(self,
selector: #selector(textDidChange),
name: NSNotification.Name.UITextViewTextDidChange,
name: UITextView.textDidChangeNotification,
object: nil)

placeholderLabel.font = font
Expand Down Expand Up @@ -145,7 +145,7 @@ open class KMPlaceholderTextView: UITextView {

deinit {
NotificationCenter.default.removeObserver(self,
name: NSNotification.Name.UITextViewTextDidChange,
name: UITextView.textDidChangeNotification,
object: nil)
}

Expand Down
2 changes: 1 addition & 1 deletion Rocket.Chat.ShareExtension/Helpers/VideoInfo.swift
Expand Up @@ -27,7 +27,7 @@ struct VideoInfo {
let generator = AVAssetImageGenerator(asset: asset)
generator.appliesPreferredTrackTransform = true

guard let cgImage = try? generator.copyCGImage(at: CMTimeMake(0, 1), actualTime: nil) else {
guard let cgImage = try? generator.copyCGImage(at: CMTimeMake(value: 0, timescale: 1), actualTime: nil) else {
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions Rocket.Chat.ShareExtension/Info.plist
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>3.1.0</string>
<string>3.1.1</string>
<key>CFBundleVersion</key>
<string>210</string>
<string>214</string>
<key>ITSEncryptionExportComplianceCode</key>
<string></string>
<key>NSExtension</key>
Expand Down
Expand Up @@ -69,7 +69,7 @@ extension NSItemProvider {

image = image.resizeWith(width: 1024) ?? image

if let data = UIImageJPEGRepresentation(image, 0.9) {
if let data = image.jpegData(compressionQuality: 0.9) {
let file = SEFile(name: name, description: "", mimetype: "image/jpeg", data: data, fileUrl: item as? URL)
let content = store.state.content + [SEContent(type: .file(file))]
DispatchQueue.main.async {
Expand Down

0 comments on commit 64b4ae9

Please sign in to comment.