ios - How to organize the API Url's in Objective-C -
i trying organize api url's in single file, doing created header file , added following lines
#define login_url @"http://192.168.100.100/api/login" #define signup_url @"http://192.168.100.100/api/signup" #define products_url @"http://192.168.100.100/api/products" #define employee_url @"http://192.168.100.100/api/employee" #define get_products_url @"http://192.168.100.100/api/getproducts" #define clients_url @"http://192.168.100.100/api/clients"
here base url
http://192.168.100.100/
keep on changing, have find , replace ip address. there better ways organize api url's?
hey may organise api url's using following code
#define site_url(url) @"http://192.168.100.100/api" url #define login_url site_url("/login") #define signup_url site_url("/signup") #define products_url site_url("/products") #define employee_url site_url("/employee") #define get_products_url site_url("/getproducts") #define clients_url site_url("/clients")
Comments
Post a Comment