Releases: Wasappli/WANetworkRouting
Releases · Wasappli/WANetworkRouting
Swift compatibility
- Added nullability to help swift compatibility
- Fixed an issue with route matching on
POST
request
V1 release
Fixed an issue with response descriptors and keypaths
Fixed an object parameter
Send the WAObjectRequest for authentication
Watch OS support
Added support for watch os
Fixed batch and updated pods
Pods
- Updated
AFNetworking
from3.0
to3.1
- Updated
WAMapping
from0.0.6
to0.0.7
Batch Manager
- Added
canEnqueue
behavior from response and error - Enqueue on
Offline
orTime out
error onNSURLErrorDomain
- Enqueue on http status code of
500
(server down) or503
(maintenance)
Added batch manager
- Added Batch manager
- Fixed an issue on route and
DELETE
: the object is no longer mapped as a request - Fixed an issue on request descriptors and routes with keypath. You can now write
meetings/:meeting.itemID/privatenotes/:itemID
- Added reachability on
WARequestManagerProtocol
andWAAFNetworkingRequestManager
:isReachable
- When you delete an object without using routes|request descriptors, the path is parsed to get the object ID to delete. It was not deleted before
- Fixed crashes when object requests have no success or failure blocks
- Fixed a crash when your request descriptor have no
shouldMapBlock
0.0.4
Fixed an issue with mapping progress with several response descriptors
Added support for `NSProgress`
This release brings the progress for download and mapping using NSProgress
!
[routingManager getObjectsAtPath:@"posts"
parameters:nil
progress:^(WAObjectRequest *objectRequest, NSProgress *uploadProgress, NSProgress *downloadProgress, NSProgress *mappingProgress) {
NSLog(@"downloadProgress: %f -> %@ — mappingProgress: %f -> %@", downloadProgress.fractionCompleted, downloadProgress.localizedDescription, mappingProgress.fractionCompleted, mappingProgress.localizedDescription);
}
success:^(WAObjectRequest *objectRequest, WAObjectResponse *response, NSArray *mappedObjects) {
}
failure:^(WAObjectRequest *objectRequest, WAObjectResponse *response, id<WANRErrorProtocol> error) {
}];
By adding support of NSProgress
, you can easily cancel the request. You have to call [downloadProgress cancel]
and/or [mappingProgress cancel]
depending on where you are on the task.
- Added a simple sample
- You no longer have to create
WAMapper
orWAReverseMapper
. Simply pass the store.
Was
WAMemoryStore *memoryStore = [[WAMemoryStore alloc] init];
// Create both a mapper and a reverse mapper
WAMapper *mapper = [WAMapper newMapperWithStore:memoryStore];
WAReverseMapper *reverseMapper = [WAReverseMapper new];
// Create the mapping manager
WAMappingManager *mappingManager = [WAMappingManager mappingManagerWithMapper:mapper
reverseMapper:reverseMapper];
is
WAMemoryStore *memoryStore = [[WAMemoryStore alloc] init];
// Create the mapping manager
WAMappingManager *mappingManager = [WAMappingManager mappingManagerWithStore:memoryStore];
- For registering default mapping blocks.
Was
// Add a default date formatter on mapper
id(^toDateMappingBlock)(id ) = ^id(id value) {
if ([value isKindOfClass:[NSString class]]) {
return [dateFormatter dateFromString:value];
}
return value;
};
[mapper addDefaultMappingBlock:toDateMappingBlock
forDestinationClass:[NSDate class]];
is
// Add a default date formatter on mapper
id(^toDateMappingBlock)(id ) = ^id(id value) {
if ([value isKindOfClass:[NSString class]]) {
return [dateFormatter dateFromString:value];
}
return value;
};
[mappingManager addDefaultMappingBlock:toDateMappingBlock
forDestinationClass:[NSDate class]];
0.0.2
- Fixed an import with missing .h on main header
- Do not ask the store to delete an object if
nil