Skip to content

Changed for Swift 3 compliance#50

Open
Qandelor wants to merge 2 commits intoturowicz:masterfrom
Qandelor:Adaptations/Swift3
Open

Changed for Swift 3 compliance#50
Qandelor wants to merge 2 commits intoturowicz:masterfrom
Qandelor:Adaptations/Swift3

Conversation

@Qandelor
Copy link
Copy Markdown

Have not done a lot of checks but is mostly syntaxic changes.

Comment thread src/Serializable.swift
- returns: The class as an NSDictionary.
*/
public func toDictionary() -> NSDictionary {
open func toDictionary() -> NSDictionary {
Copy link
Copy Markdown

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 17 (cyclomatic_complexity)

Comment thread src/Serializable.swift
}
else if let propValue:UInt32 = propValue as? UInt32 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt32), forKey: propName!)
}
Copy link
Copy Markdown

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)

Comment thread src/Serializable.swift
}
else if let propValue:UInt16 = propValue as? UInt16 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt16), forKey: propName!)
}
Copy link
Copy Markdown

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)

Comment thread src/Serializable.swift
}
else if let propValue:UInt8 = propValue as? UInt8 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt8), forKey: propName!)
}
Copy link
Copy Markdown

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)

Comment thread src/Serializable.swift
}
else if let propValue:Int64 = propValue as? Int64 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as Int64), forKey: propName!)
}
Copy link
Copy Markdown

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)

Comment thread src/Serializable.swift
var dictionary = [String: AnyObject]()
open class Serializable: NSObject {
fileprivate class SortedDictionary : NSMutableDictionary {
var _dictionary = [String: AnyObject]()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable Name Violation: Variable name should only contain alphanumeric characters: '_dictionary' (variable_name)

Comment thread src/Serializable.swift
- returns: The class as a JSON string.
*/
public func toJsonString(prettyPrinted: Bool = false) -> String? {
open func toJsonString(_ prettyPrinted : Bool = false) -> String? {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type. (colon)

Comment thread src/Serializable.swift
- returns: The class as JSON, wrapped in NSData.
*/
public func toJson(prettyPrinted: Bool = false) -> NSData? {
open func toJson(_ prettyPrinted : Bool = false) -> Data? {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type. (colon)

Comment thread src/Serializable.swift
else if let propValue:UInt32 = propValue as? UInt32 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt32), forKey: propName!)
}
else if let propValue:UInt64 = propValue as? UInt64 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type. (colon)

Comment thread src/Serializable.swift
else if let propValue:UInt16 = propValue as? UInt16 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt16), forKey: propName!)
}
else if let propValue:UInt32 = propValue as? UInt32 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type. (colon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants