Skip to main content

Posts

Showing posts with the label HTML

Displaying HTML content stored in a folder within an iOS app

Through this journey of getting to know "how to build apps for the iPhone with Swift", I have encountered a fair share of problems. You can have a read of my previous posts on Getting started with iOS programming Serving HTML content in an iOS app Discovering Core Data migrations And  how to deal with Core Data migrations  to get an idea of the sort of problems I have faced. In this post, I am going to share about a rather simple issue that I encountered very early when I started building my app. The app I am building is an HTML5 app, actually no; A more accurate statement for this would be that it is a hybrid app, as the logic is almost equally distributed between native code and HTML5 code. Problem The problem I had was that when I would add a folder to my iOS app with web content and tried to refer to it using let path = NSBundle.mainBundle().pathForResource("index", ofType: "html", inDirectory:"webContent") It simply wouldn...