You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-2
Original file line number
Diff line number
Diff line change
@@ -54,12 +54,12 @@ import AlamofireJsonToObjects
54
54
## Sample code
55
55
56
56
```
57
-
class WeatherResponse: EVObject {
57
+
class WeatherResponse: EVNetworkingObject {
58
58
var location: String?
59
59
var three_day_forecast: [Forecast] = [Forecast]()
60
60
}
61
61
62
-
class Forecast: EVObject {
62
+
class Forecast: EVNetworkingObject {
63
63
var day: String?
64
64
var temperature: NSNumber?
65
65
var conditions: String?
@@ -105,6 +105,10 @@ The code above will pass the folowing json to the objects:
105
105
## Advanced object mapping
106
106
AlamofireJsonToObjects is based on [EVReflection](https://github.com/evermeer/EVReflection) and you can use all [EVReflection](https://github.com/evermeer/EVReflection) features like property mapping, converters, validators and key kleanup. See [EVReflection](https://github.com/evermeer/EVReflection) for more information.
107
107
108
+
## Handling HTTP status >= 300
109
+
When a network call returns a [HTTP error status](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) (300 or highter) then this will be added to the evReflectionStatuses as a custom error. see the unit test testErrorResponse as a sample. In order to make this work, you do have to set EVNetworkingObject as your bass class and not EVObject. You then also have to be aware that if you override the initValidation or the propertyMapping function, that you also have to call the super for that function.
110
+
111
+
108
112
## License
109
113
110
114
AlamofireJsonToObjects is available under the MIT 3 license. See the LICENSE file for more info.
0 commit comments