On another note, if you want this to work on cellphone networks as well as wifi, could you create a local VPN server (I think this is possible with swift), connect to it via the iOS tun API and then use the proxy on its local VPN address?
When I want to intercept iOS traffic, I connect to a VPN with proxy settings to a mitmproxy instance running on the VPN subnet.