Hello iOS folk,
Early February, I met Olivier (creator of OHHTTPStubs [1]) at dotSwift conference in
Paris. We had a nice discussion about mocking libraries using dynamic features like obj-c
Swizzling [2].
In Swift, runtime introspecting is very limited (some MirrorType - but really meant for
IDE). In fact, to achieve dynamic mocking you have to use Obj-C/Swift bridging. For
mocking object like NSURLSession (inheriting from NSObject) using the bridge is just fine.
Therefore, keeping the HTTP stub layer an Obj-C lib fits the needs (so far). Further
improvement could be done via wrapping.
Following Olivier suggestion to join the effort in maintening OHHTTPStubs librarie [3], we
deprecated AeroGearHttpStubs today [4], let’s work together on improving http mocking
experience. Stay tune for more PR.
++
Corinne
[1]
https://github.com/AliSoftware/OHHTTPStubs
[2]
http://corinnekrych.blogspot.fr/2014/07/http-stubs-lets-go-swift-swizzlin...
[3]
https://github.com/aerogear/aerogear-ios-httpstub/issues/15
[4]
https://github.com/aerogear/aerogear-ios-httpstub