Hybrid iOS App
This is a sample how to connect an iOS app and server-side web pages. For this sample a news aggregator is built. To keep it simple the backend is using Yahoo Pipes, which aggregates different news web pages. It's requesting RSS feeds and also scraping HTML by some online news returning JSON.
git clone firstname.lastname@example.org:appsunited/ios-hybrid.git
Up and Running
- Copy all files in
/Serverto your web server.
WebViewController.mline 52 change the path
[self loadPageWithURL:@"http://newsmate"];where you have stored the
- Run iOS Simulator.
- Add another UIViewController in front of loaded news snippets. A list or table to select different news sources. This also should be an UIWebView requesting a list with topics and/or online news papers.
- Refactor the
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequestmethod, also create required classes. Review architecture issues.
- Implement the Observer design pattern and find an approach to listen, observe or notify - also called Broadcaster/Listener, Publish/Subscribe or Notifications.
- Cross platform code
- Rapid development
- Instant updates
- Bad Performance - 3x slower, JS Engine Nitro isn't supported in UIWebView
- Presentation and layout issues
- JS Execution time is limited (10s on iOS)
- Native user experience - effects and animations
- Mobile Safari has better caching and asynchronous multithreading
- UIWebView Bridge - PhoneGap, trigger.io
- Gaming - Spaceport, ImpactJS, CocoonJS
JS to Objective-C
- Native Code is ~3x faster than JS (ranges in 2x-9x)
- MBP vs. iPhone is a factor of 10.
- The performance between Chrome 8 and Chrome 29 is a flatline. If the web feels faster, that is probably because you’re running a faster computer, but it has nothing to do with improvements to Chrome.
Google about JS