We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91d1960 commit 330cbe6Copy full SHA for 330cbe6
1 file changed
JSONHelper/Pod Classes/JSONHelper.swift
@@ -88,25 +88,20 @@ infix operator <<< { associativity right precedence 150 }
88
89
// For optionals.
90
public func <<<<T>(inout property: T?, value: AnyObject?) -> T? {
91
+ var newValue: T?
92
93
if let unwrappedValue: AnyObject = value {
94
95
if let convertedValue = unwrappedValue as? T {
- property = convertedValue
96
+ newValue = convertedValue
97
} else if property is Int? && unwrappedValue is String {
98
99
if let intValue = "\(unwrappedValue)".toInt() {
- property = intValue as T
100
- } else {
101
- property = nil
+ newValue = intValue as T
102
}
103
104
105
106
107
108
109
-
+ property = newValue
110
return property
111
112
0 commit comments