Skip to main content

IPProvider

public class IPProvider: NSObject

The IPProvider class is designed to provide a mechanism for fetching and caching the user's IP address from a remote API. This class ensures that the IP address is regularly updated in the background, and it provides a simple interface for obtaining the current IP address from the cache.

By default, the IP address cache time interval is 10 minutes, after which the IP address is automatically refreshed from the API.

Properties

public static let shared = IPProvider()

The shared instance of the IPProvider class follows the Singleton pattern. This instance is used to access the functionality of the class.

Method Summary

TypeMethodDescription
StringgetIPAddress()Returns the current IP address from the cache.