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

[WIP] RC Xcode-11 workaround #2781

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

bobrenji
Copy link

@bobrenji bobrenji commented Nov 3, 2019

@RocketChat/ios

Please note this branch is still [WIP]. Please help me to review.

Issue 1: After successful login, app shows black screen
How to produce: Run on Xcode -11 [Fixed as a work around]

Issue 2: App always shows notification view on top of the screen. [Fixed as a work around]
Soln: NotificationViewController.shared.notificationViewIsHidden = true add as a work around. But not able to figure out what is the root cause.

Issue 3: SearchBar in SubscriptionsViewController shows navigation bar without background color.
once search view appears, navigation bar background color become transparent. [No solution yet]

…ile launch app

- Notification window is always open when app run using Blackberry SDK. It happen for only RC wrapped with BB SDK.
- we are not using video hence I removed jitsi support for a while. once I fix all other issues, I will put it back
// FIXME: if we present as window, window close must detected and oauthswift.cancel() must be called...
case .asPopover(let positioningRect, let positioningView, let preferredEdge, let behavior):
p.presentViewController(self, asPopoverRelativeTo: positioningRect, of: positioningView, preferredEdge: preferredEdge, behavior: behavior)
p.present(self, asPopoverRelativeTo: positioningRect, of: positioningView, preferredEdge: preferredEdge, behavior: behavior)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 144 characters (line_length)

UIApplication.shared.open(url, options: [:], completionHandler: nil)
return
}
UIApplication.shared.open(successURL, options: [:], completionHandler: nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 131 characters (line_length)

let msg = error?.localizedDescription.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)
let urlString = "\(self.callbackUrlScheme)?error=\(msg ?? "UNKNOWN")"
let url = URL(string: urlString)!
UIApplication.shared.open(url, options: [:], completionHandler: nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 128 characters (line_length)

completionHandler: { callback, error in
guard error == nil, let successURL = callback else {
let msg = error?.localizedDescription.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)
let urlString = "\(self.callbackUrlScheme)?error=\(msg ?? "UNKNOWN")"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 129 characters (line_length)

callbackURLScheme: callbackUrlScheme,
completionHandler: { callback, error in
guard error == nil, let successURL = callback else {
let msg = error?.localizedDescription.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 159 characters (line_length)

@@ -136,6 +154,9 @@ extension OAuthSwiftError: CustomNSError {

case .tokenExpired(let e): return ["error": e as Any]
case .requestError(let e, let request): return ["error": e, "request": request]
case .authorizationPending(let e, let request): return ["error": e, "request": request]
case .slowDown(let e, let request): return ["error": e, "request": request]
case .accessDenied(let e, let request): return ["error": e, "request": request]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'e' (identifier_name)

@@ -136,6 +154,9 @@ extension OAuthSwiftError: CustomNSError {

case .tokenExpired(let e): return ["error": e as Any]
case .requestError(let e, let request): return ["error": e, "request": request]
case .authorizationPending(let e, let request): return ["error": e, "request": request]
case .slowDown(let e, let request): return ["error": e, "request": request]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'e' (identifier_name)

@@ -136,6 +154,9 @@ extension OAuthSwiftError: CustomNSError {

case .tokenExpired(let e): return ["error": e as Any]
case .requestError(let e, let request): return ["error": e, "request": request]
case .authorizationPending(let e, let request): return ["error": e, "request": request]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'e' (identifier_name)

}
}

public var underlyingError: Error? {
switch self {
case .tokenExpired(let e): return e
case .requestError(let e, _): return e
case .authorizationPending(let e, _): return e
case .slowDown(let e, _): return e
case .accessDenied(let e, _): return e

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'e' (identifier_name)

}
}

public var underlyingError: Error? {
switch self {
case .tokenExpired(let e): return e
case .requestError(let e, _): return e
case .authorizationPending(let e, _): return e
case .slowDown(let e, _): return e

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'e' (identifier_name)

@@ -633,7 +633,7 @@ extension MessagesViewController {
return .zero
}

override func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 160 characters (line_length)

} else {
(UIApplication.shared.value(forKey: "statusBarWindow") as? UIWindow)?.alpha = newValue || isDeviceWithNotch ? 1 : 0
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

statusBar.alpha = newValue || isDeviceWithNotch ? 1 : 0
window?.addSubview(statusBar)
} else {
(UIApplication.shared.value(forKey: "statusBarWindow") as? UIWindow)?.alpha = newValue || isDeviceWithNotch ? 1 : 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 133 characters (line_length)

@@ -40,7 +40,17 @@ final class NotificationViewController: TopTransparentViewController {
set {
visibleConstraint?.isActive = !newValue
hiddenConstraint?.isActive = newValue
(UIApplication.shared.value(forKey: "statusBarWindow") as? UIWindow)?.alpha = newValue || isDeviceWithNotch ? 1 : 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

actionsContainerView.center = CGPoint(x: targetCenter, y: actionsContainerView.center.y)
swipeable.actionsView?.visibleWidth = abs(actionsContainerView.frame.minX)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

#if canImport(Combine)
if let backgroundColor = options.backgroundColor {
self.backgroundColor = backgroundColor
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)

@@ -111,7 +111,25 @@ class SwipeActionsView: UIView {

clipsToBounds = true
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = options.backgroundColor ?? #colorLiteral(red: 0.862745098, green: 0.862745098, blue: 0.862745098, alpha: 1)


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)

@@ -111,7 +111,25 @@ class SwipeActionsView: UIView {

clipsToBounds = true
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = options.backgroundColor ?? #colorLiteral(red: 0.862745098, green: 0.862745098, blue: 0.862745098, alpha: 1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

} else if let encodedString_ = self.rawString.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed) {
if rawString.range(of: "%[0-9A-Fa-f]{2}", options: .regularExpression, range: nil, locale: nil) != nil {
return Foundation.URL(string: rawString)
} else if let encodedString_ = rawString.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should only contain alphanumeric characters: 'encodedString_' (identifier_name)

@@ -923,17 +842,15 @@ extension JSON {
extension JSON {

public var null: NSNull? {
set {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused Setter Value Violation: Setter value is not used. (unused_setter_value)

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

if self.type == .dictionary {
if let o = self.rawDictionary[key] {
if type == .dictionary {
if let o = rawDictionary[key] {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'o' (identifier_name)

var unwrappedDic = dictionary
for (k, v) in dictionary {
unwrappedDic[k] = unwrap(v)
var d = dictionary

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'd' (identifier_name)

@@ -35,7 +35,7 @@ class SwipeActionButton: UIButton {
}

override var intrinsicContentSize: CGSize {
return CGSize(width: UIViewNoIntrinsicMetric, height: contentEdgeInsets.top + alignmentRect.height + contentEdgeInsets.bottom)
return CGSize(width: UIView.noIntrinsicMetric, height: contentEdgeInsets.top + alignmentRect.height + contentEdgeInsets.bottom)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 135 characters (line_length)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 151 characters (line_length)

@@ -353,7 +351,7 @@ public extension ComposerView {
/**
Called when the content size of the text view changes and adjusts the composer height constraint.
*/
public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Block Based KVO Violation: Prefer the new block based KVO API with keypaths when using Swift 3.2 or later. (block_based_kvo)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 151 characters (line_length)

@@ -133,7 +133,7 @@ public class ReplyView: UIView {
clipsToBounds = true
isHidden = true

NotificationCenter.default.addObserver(forName: .UIContentSizeCategoryDidChange, object: nil, queue: nil, using: { [weak self] _ in
NotificationCenter.default.addObserver(forName: UIContentSizeCategory.didChangeNotification, object: nil, queue: nil, using: { [weak self] _ in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discarded Notification Center Observer Violation: When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
Line Length Violation: Line should be 120 characters or less: currently 151 characters (line_length)

failure()
}
} != nil
// return oauthSwift.authorize(withCallbackURL: callbackUrl, scope: scope, state: state, success: { _, _, _ in }, failure: { _ in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 137 characters (line_length)

switch result {
case .success(_, _, _): break
// self.showTokenAlert(name: serviceParameters["name"], credential: credential)
case .failure(_):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty Enum Arguments Violation: Arguments can be omitted when matching enums with associated types if they are not used. (empty_enum_arguments)

}) != nil
return oauthSwift.authorize(withCallbackURL: callbackUrl, scope: scope, state: state) { result in
switch result {
case .success(_, _, _): break

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty Enum Arguments Violation: Arguments can be omitted when matching enums with associated types if they are not used. (empty_enum_arguments)

} else {
return value(forKey: "_searchField") as? UITextField
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

if self.type == .dictionary {
if let o = self.rawDictionary[key] {
if type == .dictionary {
if let o = rawDictionary[key] {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'o' (identifier_name)

var unwrappedDic = dictionary
for (k, v) in dictionary {
unwrappedDic[k] = unwrap(v)
var d = dictionary

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'd' (identifier_name)

@@ -35,7 +35,7 @@ class SwipeActionButton: UIButton {
}

override var intrinsicContentSize: CGSize {
return CGSize(width: UIViewNoIntrinsicMetric, height: contentEdgeInsets.top + alignmentRect.height + contentEdgeInsets.bottom)
return CGSize(width: UIView.noIntrinsicMetric, height: contentEdgeInsets.top + alignmentRect.height + contentEdgeInsets.bottom)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 135 characters (line_length)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 151 characters (line_length)

@@ -353,7 +351,7 @@ public extension ComposerView {
/**
Called when the content size of the text view changes and adjusts the composer height constraint.
*/
public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Block Based KVO Violation: Prefer the new block based KVO API with keypaths when using Swift 3.2 or later. (block_based_kvo)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 151 characters (line_length)

@@ -133,7 +133,7 @@ public class ReplyView: UIView {
clipsToBounds = true
isHidden = true

NotificationCenter.default.addObserver(forName: .UIContentSizeCategoryDidChange, object: nil, queue: nil, using: { [weak self] _ in
NotificationCenter.default.addObserver(forName: UIContentSizeCategory.didChangeNotification, object: nil, queue: nil, using: { [weak self] _ in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discarded Notification Center Observer Violation: When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
Line Length Violation: Line should be 120 characters or less: currently 151 characters (line_length)

failure()
}
} != nil
// return oauthSwift.authorize(withCallbackURL: callbackUrl, scope: scope, state: state, success: { _, _, _ in }, failure: { _ in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 137 characters (line_length)

switch result {
case .success(_, _, _): break
// self.showTokenAlert(name: serviceParameters["name"], credential: credential)
case .failure(_):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty Enum Arguments Violation: Arguments can be omitted when matching enums with associated types if they are not used. (empty_enum_arguments)

}) != nil
return oauthSwift.authorize(withCallbackURL: callbackUrl, scope: scope, state: state) { result in
switch result {
case .success(_, _, _): break

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty Enum Arguments Violation: Arguments can be omitted when matching enums with associated types if they are not used. (empty_enum_arguments)

} else {
return value(forKey: "_searchField") as? UITextField
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

@@ -158,7 +158,7 @@ extension ThreadsViewController {
return .zero
}

override func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 160 characters (line_length)

@@ -101,14 +101,14 @@ public class HintsView: UITableView {
Shared initialization procedures.
*/
private func commonInit() {
NotificationCenter.default.addObserver(forName: .UIContentSizeCategoryDidChange, object: nil, queue: nil, using: { [weak self] _ in
NotificationCenter.default.addObserver(forName: UserDefaults.didChangeNotification, object: nil, queue: nil, using: { [weak self] _ in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discarded Notification Center Observer Violation: When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
Line Length Violation: Line should be 120 characters or less: currently 142 characters (line_length)

@@ -83,7 +83,7 @@ public class EditingView: UIView, ComposerLocalizable {
clipsToBounds = true
isHidden = true

NotificationCenter.default.addObserver(forName: .UIContentSizeCategoryDidChange, object: nil, queue: nil, using: { [weak self] _ in
NotificationCenter.default.addObserver(forName: UIContentSizeCategory.didChangeNotification, object: nil, queue: nil, using: { [weak self] _ in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discarded Notification Center Observer Violation: When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. (discarded_notification_center_observer)
Line Length Violation: Line should be 120 characters or less: currently 151 characters (line_length)

@@ -93,7 +94,8 @@ internal func dynamicBridgeCast<T>(fromObjectiveC x: Any) -> T {
}
}

internal func dynamicBridgeCast<T>(fromSwift x: T) -> Any {
/// :nodoc:
public func dynamicBridgeCast<T>(fromSwift x: T) -> Any {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name)

@@ -83,7 +83,8 @@ extension Object {

// MARK: CustomObjectiveCBridgeable

internal func dynamicBridgeCast<T>(fromObjectiveC x: Any) -> T {
/// :nodoc:
public func dynamicBridgeCast<T>(fromObjectiveC x: Any) -> T {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name)

@@ -387,11 +569,56 @@ public final class Realm {
:nodoc:
*/
@discardableResult
public func dynamicCreate(_ typeName: String, value: Any = [:], update: Bool = false) -> DynamicObject {
if update && schema[typeName]?.primaryKeyProperty == nil {
@available(*, deprecated, message: "Pass .error, .modified or .all rather than a boolean. .error is equivalent to false and .all is equivalent to true.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 157 characters (line_length)

return unsafeDowncast(RLMCreateObjectInRealmWithValue(rlmRealm, typeName, value, update), to: T.self)
let typeName = (type as Object.Type).className()
return unsafeDowncast(RLMCreateObjectInRealmWithValue(rlmRealm, typeName, value,
RLMUpdatePolicy(rawValue: UInt(update.rawValue))!), to: type)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 123 characters (line_length)

let typeName = (type as Object.Type).className()
if update && schema[typeName]?.primaryKeyProperty == nil {
throwRealmException("'\(typeName)' does not have a primary key and can not be updated")
@available(*, deprecated, message: "Pass .error, .modified or .all rather than a boolean. .error is equivalent to false and .all is equivalent to true.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 157 characters (line_length)

@@ -297,7 +422,27 @@ public final class Realm {
- parameter objects: A sequence which contains objects to be added to the Realm.
- parameter update: If `true`, objects that are already in the Realm will be updated instead of added anew.
*/
public func add<S: Sequence>(_ objects: S, update: Bool = false) where S.Iterator.Element: Object {
@available(*, deprecated, message: "Pass .error, .modified or .all rather than a boolean. .error is equivalent to false and .all is equivalent to true.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 157 characters (line_length)


- parameter object: The object to be added to this Realm.
- parameter update: If `true`, the Realm will try to find an existing copy of the object (with the same primary
key), and update it. Otherwise, the object will be added.
*/
public func add(_ object: Object, update: Bool = false) {
if update && object.objectSchema.primaryKeyProperty == nil {
@available(*, deprecated, message: "Pass .error, .modified or .all rather than a boolean. .error is equivalent to false and .all is equivalent to true.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 157 characters (line_length)

callback: @escaping (Realm?, Swift.Error?) -> Void) {
RLMRealm.asyncOpen(with: configuration.rlmConfiguration, callbackQueue: callbackQueue) { rlmRealm, error in
callback: @escaping (Realm?, Swift.Error?) -> Void) -> AsyncOpenTask {
return AsyncOpenTask(rlmTask: RLMRealm.asyncOpen(with: configuration.rlmConfiguration, callbackQueue: callbackQueue) { rlmRealm, error in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 145 characters (line_length)

@@ -18,6 +18,7 @@

import Foundation
import Realm
import Realm.Private

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate Imports Violation: Imports should be unique. (duplicate_imports)

@@ -456,6 +475,11 @@ public class ObjectUtil: NSObject {
// Ignored lazy property.
return false
}
if object is RLMObject {
// Implicitly ignore lazy properties on RLMObject subclasses
// FIXME: should align RLMObject/Object behavior in 4.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo Violation: FIXMEs should be resolved (should align RLMObject/Object ...). (todo)

let C = isConnectionOnTrafficFlagSet ? "C" : "-"
let D = isConnectionOnDemandFlagSet ? "D" : "-"
let l = isLocalAddressFlagSet ? "l" : "-"
let d = isDirectFlagSet ? "d" : "-"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'd' (identifier_name)

let i = isInterventionRequiredFlagSet ? "i" : "-"
let C = isConnectionOnTrafficFlagSet ? "C" : "-"
let D = isConnectionOnDemandFlagSet ? "D" : "-"
let l = isLocalAddressFlagSet ? "l" : "-"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'l' (identifier_name)

@@ -313,4 +348,59 @@ extension SCNetworkReachabilityFlags {
var isConnectionRequiredAndTransientFlagSet: Bool {
return intersection([.connectionRequired, .transientConnection]) == [.connectionRequired, .transientConnection]
}

var description: String {
let W = isOnWWANFlagSet ? "W" : "-"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'W' (identifier_name)

var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil)
context.info = UnsafeMutableRawPointer(Unmanaged<Reachability>.passUnretained(self).toOpaque())
let weakifiedReachability = ReachabilityWeakifier(reachability: self)
let opaqueWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.passUnretained(weakifiedReachability).toOpaque()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 123 characters (line_length)


self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue)
self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 123 characters (line_length)

guard let ref = SCNetworkReachabilityCreateWithName(nil, hostname) else {
throw ReachabilityError.failedToCreateWithHostname(hostname, SCError())
}
self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 123 characters (line_length)

@@ -391,3 +391,4 @@ open class RCMarkdownParser: RCBaseParser {
return "\(char)"
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)

if #available(iOS 13.0, *) {

} else {
/// The presenting view controllers view doesn't get removed from the window as its currently transistioning and presenting a view controller

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 153 characters (line_length)

@@ -51,3 +51,4 @@ open class RCBaseParser {
}

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)

@@ -144,3 +144,4 @@ public extension NSAttributedString {
}

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)

}
}

public var underlyingError: Error? {
switch self {
case .tokenExpired(let e): return e
case .requestError(let e, _): return e
case .authorizationPending(let e, _): return e

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'e' (identifier_name)

case requestError(error: Error, request: URLRequest)
/// The provided token is expired, retrieve new token by using the refresh token
case tokenExpired(error: Error?)
/// If the user has not either allowed or denied the request yet, the authorization server will return the authorization_pending error.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 139 characters (line_length)

open func makeRequest(_ urlString: String, method: OAuthSwiftHTTPRequest.Method, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil) -> OAuthSwiftHTTPRequest? {
guard let url = URL(string: urlString) else {
return nil
open func makeRequest(_ url: URLConvertible, method: OAuthSwiftHTTPRequest.Method, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil) -> OAuthSwiftHTTPRequest? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 210 characters (line_length)

}

@discardableResult
open func request(_ urlString: String, method: OAuthSwiftHTTPRequest.Method, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, checkTokenExpiration: Bool = true, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
open func request(_ url: URLConvertible, method: OAuthSwiftHTTPRequest.Method, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, checkTokenExpiration: Bool = true, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 315 characters (line_length)

open func patch(_ urlString: String, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
return self.request(urlString, method: .PATCH, parameters: parameters, headers: headers, success: success, failure: failure)
open func patch(_ url: URLConvertible, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {
return self.request(url, method: .PATCH, parameters: parameters, headers: headers, completionHandler: completion)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 121 characters (line_length)

}

@discardableResult
open func patch(_ urlString: String, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
return self.request(urlString, method: .PATCH, parameters: parameters, headers: headers, success: success, failure: failure)
open func patch(_ url: URLConvertible, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 221 characters (line_length)

open func delete(_ urlString: String, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
return self.request(urlString, method: .DELETE, parameters: parameters, headers: headers, success: success, failure: failure)
open func delete(_ url: URLConvertible, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {
return self.request(url, method: .DELETE, parameters: parameters, headers: headers, completionHandler: completion)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 122 characters (line_length)

}

@discardableResult
open func delete(_ urlString: String, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
return self.request(urlString, method: .DELETE, parameters: parameters, headers: headers, success: success, failure: failure)
open func delete(_ url: URLConvertible, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 222 characters (line_length)

open func put(_ urlString: String, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
return self.request(urlString, method: .PUT, parameters: parameters, headers: headers, body: body, success: success, failure: failure)
open func put(_ url: URLConvertible, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {
return self.request(url, method: .PUT, parameters: parameters, headers: headers, body: body, completionHandler: completion)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 131 characters (line_length)

}

@discardableResult
open func put(_ urlString: String, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
return self.request(urlString, method: .PUT, parameters: parameters, headers: headers, body: body, success: success, failure: failure)
open func put(_ url: URLConvertible, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 238 characters (line_length)

open func post(_ urlString: String, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
return self.request(urlString, method: .POST, parameters: parameters, headers: headers, body: body, success: success, failure: failure)
open func post(_ url: URLConvertible, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {
return self.request(url, method: .POST, parameters: parameters, headers: headers, body: body, completionHandler: completion)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 132 characters (line_length)

}

@discardableResult
open func post(_ urlString: String, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, success: OAuthSwiftHTTPRequest.SuccessHandler?, failure: OAuthSwiftHTTPRequest.FailureHandler?) -> OAuthSwiftRequestHandle? {
return self.request(urlString, method: .POST, parameters: parameters, headers: headers, body: body, success: success, failure: failure)
open func post(_ url: URLConvertible, parameters: OAuthSwift.Parameters = [:], headers: OAuthSwift.Headers? = nil, body: Data? = nil, completionHandler completion: OAuthSwiftHTTPRequest.CompletionHandler?) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 239 characters (line_length)

}, failure: failure)
default:
failure(error)
_ = self.renewAccessToken(withRefreshToken: self.client.credential.oauthRefreshToken, headers: renewHeaders ?? headers, completionHandler: renewCompletionHandler)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 182 characters (line_length)

}

// Reauthorize the request again, this time with a brand new access token ready to be used.
_ = self.startAuthorizedRequest(url, method: method, parameters: parameters, headers: headers, body: body, onTokenRenewal: onTokenRenewal, completionHandler: completion)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 197 characters (line_length)

// If provided, fire the onRenewal closure
if let renewalCallBack = onTokenRenewal {
renewalCallBack(credential)
open func startAuthorizedRequest(_ url: URLConvertible, method: OAuthSwiftHTTPRequest.Method, parameters: OAuthSwift.Parameters, headers: OAuthSwift.Headers? = nil, renewHeaders: OAuthSwift.Headers? = nil, body: Data? = nil, onTokenRenewal: TokenRenewedHandler? = nil, completionHandler completion: @escaping OAuthSwiftHTTPRequest.CompletionHandler) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 383 characters (line_length)

// Request new access token by disabling check on current token expiration. This is safe because the implementation wants the user to retrieve a new token.
return self.client.request(accessTokenUrl, method: .POST, parameters: parameters, headers: finalHeaders, checkTokenExpiration: false, success: successHandler, failure: failure)
return self.client.request(accessTokenUrl, method: .POST, parameters: parameters, headers: finalHeaders, checkTokenExpiration: false, completionHandler: completionHandler)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 183 characters (line_length)

return nil
}

if self.contentType == "multipart/form-data" {
// Request new access token by disabling check on current token expiration. This is safe because the implementation wants the user to retrieve a new token.
return self.client.postMultiPartRequest(accessTokenUrl, method: .POST, parameters: parameters, headers: headers, checkTokenExpiration: false, success: successHandler, failure: failure)
return self.client.postMultiPartRequest(accessTokenUrl, method: .POST, parameters: parameters, headers: headers, checkTokenExpiration: false, completionHandler: completionHandler)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 191 characters (line_length)

return
}
guard let accessToken = responseParameters["access_token"] as? String else {
let message = NSLocalizedString("Could not get Access Token", comment: "Due to an error in the OAuth2 process, we couldn't get a valid token.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 163 characters (line_length)

}

fileprivate func requestOAuthAccessToken(withParameters parameters: OAuthSwift.Parameters, headers: OAuthSwift.Headers? = nil, success: @escaping TokenSuccessHandler, failure: FailureHandler?) -> OAuthSwiftRequestHandle? {
let successHandler: OAuthSwiftHTTPRequest.SuccessHandler = { [weak self] response in
fileprivate func requestOAuthAccessToken(withParameters parameters: OAuthSwift.Parameters, headers: OAuthSwift.Headers? = nil, completionHandler completion: @escaping TokenCompletionHandler) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cyclomatic Complexity Violation: Function should have complexity 10 or less: currently complexity equals 12 (cyclomatic_complexity)
Line Length Violation: Line should be 120 characters or less: currently 224 characters (line_length)

}

@discardableResult
open func renewAccessToken(withRefreshToken refreshToken: String, parameters: OAuthSwift.Parameters? = nil, headers: OAuthSwift.Headers? = nil, success: @escaping TokenSuccessHandler, failure: FailureHandler?) -> OAuthSwiftRequestHandle? {
open func renewAccessToken(withRefreshToken refreshToken: String, parameters: OAuthSwift.Parameters? = nil, headers: OAuthSwift.Headers? = nil, completionHandler completion: @escaping TokenCompletionHandler) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 241 characters (line_length)

}

open func postOAuthAccessTokenWithRequestToken(byCode code: String, callbackURL: URL?, headers: OAuthSwift.Headers? = nil, success: @escaping TokenSuccessHandler, failure: FailureHandler?) -> OAuthSwiftRequestHandle? {
open func postOAuthAccessTokenWithRequestToken(byCode code: String, callbackURL: URL?, headers: OAuthSwift.Headers? = nil, completionHandler completion: @escaping TokenCompletionHandler) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 220 characters (line_length)

@@ -140,7 +145,8 @@ open class OAuth2Swift: OAuthSwift {
var queryString: String? = ""
queryString = queryString?.urlQueryByAppending(parameter: "client_id", value: self.consumerKey, encodeError)
if let callbackURL = callbackURL {
queryString = queryString?.urlQueryByAppending(parameter: "redirect_uri", value: self.encodeCallbackURL ? callbackURL.absoluteString.urlEncoded : callbackURL.absoluteString, encode: self.encodeCallbackURLQuery, encodeError)
let value = self.encodeCallbackURL ? callbackURL.string.urlEncoded : callbackURL.string
queryString = queryString?.urlQueryByAppending(parameter: "redirect_uri", value: value, encode: self.encodeCallbackURLQuery, encodeError)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 149 characters (line_length)

} else {
failure?(OAuthSwiftError.encodingError(urlString: urlString))
completion(.failure(.encodingError(urlString: credential.oauthToken))) //TODO specific error

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo Violation: TODOs should be resolved (specific error). (todo)

this.client.credential.oauthVerifier = oauth_verifier.safeStringByRemovingPercentEncoding
} else {
if !this.allowMissingOAuthVerifier {
completion(.failure(.configurationError(message: "Missing oauth_verifier. Maybe use allowMissingOAuthVerifier=true")))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 150 characters (line_length)

return
if let token = responseParameters["oauth_token"], !token.isEmpty {
this.client.credential.oauthToken = token.safeStringByRemovingPercentEncoding
if let oauth_verifier = responseParameters["oauth_verifier"] {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier Name Violation: Variable name should only contain alphanumeric characters: 'oauth_verifier' (identifier_name)

if let token = responseParameters["token"] {
responseParameters["oauth_token"] = token
}
open func authorize(withCallbackURL url: URLConvertible, headers: OAuthSwift.Headers? = nil, completionHandler completion: @escaping TokenCompletionHandler) -> OAuthSwiftRequestHandle? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cyclomatic Complexity Violation: Function should have complexity 10 or less: currently complexity equals 13 (cyclomatic_complexity)
Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 42 lines (function_body_length)
Line Length Violation: Line should be 120 characters or less: currently 190 characters (line_length)

var consumerKey: String
var consumerSecret: String
var requestTokenUrl: String
var authorizeUrl: String
var accessTokenUrl: String

// MARK: init
public init(consumerKey: String, consumerSecret: String, requestTokenUrl: String, authorizeUrl: String, accessTokenUrl: String) {
public init(consumerKey: String, consumerSecret: String, requestTokenUrl: URLConvertible, authorizeUrl: URLConvertible, accessTokenUrl: URLConvertible) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 157 characters (line_length)

return true
}
}
if let body = self.userInfo["Response-Body"] as? String,
let bodyData = body.data(using: OAuthSwiftDataEncoding),
let json = try? JSONSerialization.jsonObject(with: bodyData, options: []),
let jsonDic = json as? [String: AnyObject] {
if let error = jsonDic["error"] as? String, error == "invalid_token" || error == "\"invalid_token\"" {
if let error = jsonDic["error"] as? String, error == "invalid_token" || error == "expired_token" || error == "\"invalid_token\"" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 146 characters (line_length)

return false
}
if self.code == 401 {
if let reponseHeaders = self.userInfo["Response-Headers"] as? [String: String],
let authenticateHeader = reponseHeaders["WWW-Authenticate"] ?? reponseHeaders["Www-Authenticate"] {
let headerDictionary = authenticateHeader.headerDictionary
if let error = headerDictionary["error"], error == "invalid_token" || error == "\"invalid_token\"" {
if let error = headerDictionary["error"], error == "invalid_token" || error == "expired_token" || error == "\"invalid_token\"" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 132 characters (line_length)

# target.build_configurations.each do |config|
# config.build_settings['SWIFT_VERSION'] = '3.1'
# end
# end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/CommentIndentation: Incorrect indentation detected (column 0 instead of 4).

@@ -72,7 +72,8 @@ target 'Rocket.ChatTests' do
end

post_install do |installer|
swift42Targets = ['RCMarkdownParser', 'MobilePlayer']
# swift3Targets = ['MobilePlayer', 'RCMarkdownParser']
swift42Targets = ['SwipeCellKit', 'MobilePlayer', 'RCMarkdownParser']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming/VariableName: Use snake_case for variable names.
Style/WordArray: Use %w or %W for an array of words.

@@ -72,7 +72,8 @@ target 'Rocket.ChatTests' do
end

post_install do |installer|
swift42Targets = ['RCMarkdownParser', 'MobilePlayer']
# swift3Targets = ['MobilePlayer', 'RCMarkdownParser']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/CommentIndentation: Incorrect indentation detected (column 0 instead of 2).

ui_pods

# Text Processing
pod 'RCMarkdownParser', :git => 'https://github.com/RocketChat/RCMarkdownParser.git'
pod "RCMarkdownParser"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@reetp
Copy link

reetp commented Nov 3, 2019

Please note this branch is still [WIP]. Please help me to review.

Please note this:
https://rocket.chat/2019/10/11/moving-mobile-apps-to-react/

The iOS swift native app is being deprecated. Unless someone wants to take on maintenance themselves there will be no more development here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants