5

I want to display the network traffic statistics in my iOS application. For that, I must detect the sent and received bytes and also the latency. I spent multiple hours on searching but I didn't find what I'm expecting.

What is the best way to do that? In Android there is the TrafficStats class that allows to get the sent and received bytes. What about iOS?

Ne AS
  • 1,490
  • 3
  • 26
  • 58
  • have you checked, http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring?answertab=votes#tab-top – Profstyle Sep 20 '16 at 15:23
  • Yes but I didn't really understand the logic. Can you explain me please? – Ne AS Sep 20 '16 at 15:24
  • Basically, the answer suggests monitoring the statistics on the network card relating to mobile data (WWAN). There's a Swift API library that lets you access the part that reports on data downloaded *since the device was last booted/restarted*. Also, because of the limitations of how large a number the variable type return can hold, the counter resets after slightly more than 4 GB. You can use that to calculate all the latency you need. – rassa45 Jul 07 '17 at 04:18

0 Answers0