Trying to access the environment object created inside scene delegate by another scenedelegate function

I have created an environment object in my scendelegate and want to also use it in another function that resides inside my scenedelegate. The code looks as follows: SceneDelegate.swift class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? //@EnvironmentObject var data: DataFetcher var data = DataFetcher() func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) […]

By TJ D Alessandro
Categorised as environmentobject, ios, swiftui, xcode12 Tagged , , ,

HTTP DELETE Works From Browser But Not From Postman or IOS App

When attempting an http request to my rest api, I continually get a 401 error when using the following code. I don not get this error making any other type of request. I have provided the function that makes the request below. func deleteEvent(id: Int){ eventUrl.append(String(id)) let request = NSMutableURLRequest(url: NSURL(string: eventUrl)! as URL) request.httpMethod […]

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us