Search code examples
ioswebappstore-approval

Loading a web in a simple iOS application


I am new to iOS development. I am trying to build a simple iOS application to display statistical results from my team's websites. This web is currently on my node.js server.

I believe there is a way to simply load the websites using UIWebView.

1) However, I want to make sure if this is the proper way to build an application and if it is okay with the Apple's AppStore policy.

2) I also want to know the advantages of using the RESTful API and native code over just simply loaded with a view.


Solution

  • This web is currently on my node.js server.

    As long as it is hosted somewhere, it is very easy to load the website on a UIWebView or actually WKWebView as Apple will suggest you to here

    Important Starting in iOS 8.0 and OS X 10.10, use WKWebView to add web content to your app. Do not use UIWebView or WebView.

    You may want to check specifically against the type of content you will be loading on the web view but other than that it is a totally valid way of doing it.

    2) I also want to know the advantages of using the RESTful API and native code over just simply loaded with a view.

    This opens a big old can of worms and I don’t think it is objective enough to be answered here. I will entertain a general difference however - if you are consuming a RESTful api to show content, you can use the native interfaces which are already available on the iOS sdk and may seem familiar to the users. You are also only relying for the underlying data on the backend so performance is generally snappier. That being said people still use hybrid platforms to create apps and that is still a thing. So overall, there are many pros and cons of either way.