View Controller with Multiple sub views - xcode

I have a website page which I need to replicate in my app (as a reference for anyone that wants to help the url is http://www.sccgformulary.co.uk/gis.html) There is a title, some sub-headings, plenty of text in different sections and a few different tables. The colouring in the background isn't needed.
My question is how would this be implemented in Interface Builder (if it is even possible?) I don't know how to design the layout of a page which extends further than 1 screen. I've done it before programatically - is this the only way to design views which need a scrollview with multiple subviews? any help would be greatly appreciated!

What you are looking for is probably a simple UITableView with a custom UITableViewCell.
You might need some way of feeding data to your application via a web service. JSON is popular. but before you go ahead I suggest you read up on UITableView and look at some similar Apps to find out exactly what you want.

Related

Multiple Shells (views and view models) and routers for different type of users in Durandal

So I'm trying to build an app that has two different kind of users, namely customers and sellers. The app is designed in such a way that both of them will have different kind of navigation bars and access to different kind of pages via routes. As such, I'm trying to see what is the best way to achieve this? I'm thinking of either of the following solutions:
1. using compose binding or areas in my shell.html and by having a container and based on a certain condition, the correct specific view (partial view)will be injected and the default binding context will be a common shell.js. However, the nav bar and each navigation panel displayed is determined by the routes that have
nav:true
and both seller and customer will have different routes that are marked nav:true. Is there a way to work around this limitation if we use this approach?
2. using compose binding but having two different views and viewmodels that we bind to our shell.html and shell.js. In other words, there will be two routers. However, I've read a number of posts about having two routers and apparently having multiple main routers in an app is not suggested. Is there another way I should approach this?I was having thinking of having multiple SPAs but I figure that would not be efficient since this is a mobile app. Any help or suggestion is greatly appreciated!
You could simply develop two separate SPAs, but have them share much of the same codebase. With this approach, there's nothing special going on, other than your responsibility to modularize your code for reuse.
This approach would also eliminate the need to incorporate extensive logic throughout to curtail, trim, or augment the web app based on the user currently logged in.

How to best apply an MVC architecture in dojo mobile (custom controllers)?

I'm pretty new to Dojo and I'm wondering about some best practises for building a MVC application. I know there are modules like dojox/app, but it seems like these are made for more complex applications.
It seems like the best way to go is to make custom page-level controller objects with will handle all the page logic, but I'm not quite sure how to fit this piece in the puzzle. What is the proper way to switch between views and passing through parameters through them following a MVC archtiecture.
I have an overview page with list items, each with their own ID. I want to navigate to another page passing through the corresponding item ID so I can retrieve the details for this item externally. What would be the proper way of doing this?
I could call a method on the corresponding controller (Page1 Controller or Page2 Details controller) directly using a button and passing the listID parameter directly?
Another way of doing this could be by working with transition states and addling listeners in the page controller to forward to the correct page. Although I'm not quite sure how to pass parameters in this scenario..
... any better solutions?
Can anybody shed some light on this? It doesn't seem like there is much documentation/examples on this with the latest versions of dojo (1.9).
Thanks!
I will recommend dojox/app since you are already using dojo mobile.
It's very simple to get started and can be use for simple apps or very complex apps
Take a look at this resources:
https://github.com/csantanapr/dapp-examples/tree/master/dapp-request
https://github.com/csantanapr/dapp-boilerplate
http://dojotoolkit.org/documentation/tutorials/1.9/dojox_app/contactsList/

When to use more than one Sammy.js application?

As I'm learning about Sammy.js I read that you can have several Sammy.js applications in the same page, each bound to a different element (i.e. div). I would like to understand why would this be useful.
I read in another post that only forms inside a bound element will trigger the route change, I'm thinking this could be used to modularize your application. Is there another use case beside this? Could you provide an example of how to modularize your application in this way?
We implemented a component similar to Sammy in our Silverlight application some time ago. The similarity is in that both represent a kind of a simple browser that can be bound to a UI region. The approach gave us several benefits:
We had an extensible way to add new content implementations. I mean that we could add plugins to our app that contained new forms/views which the application core had no knowledge about.
We could easily implement composite views, e.g. dashboard that were able to show any view implemented in any module. Including themselves. (A-ha, we had created recursive dashboards that worked until the app hit the memory limit. Kind of Inception. :))
Sammy can be used to reach these goals as well.
However, you must understand that from all Sammy applications running on a page, only one can be bound to the browser location bar. Others will have their location visible only to javascript, or you'll need to render location bars for them on the page.

Populating a UiWebview control with data from a Kumulos API

I am currently really new to Xcode and the whole Iphone App development but reasonable proficient in Javascript/HTML/SQL.
I am looking at creating a new App which queries its data from a Kumulos database (Kumulos API's).
Before i head down the path, i just want to know if it was possible to query the database(i know how to do this), but more importantly load the returned data into a webview control.
Similar sort of idea as facebook app. I know they use a webview control.
Ive searched, but currently haven't found an answer on how do do this.
Can you suggest a better method?
Excuse my lack of coding examples.
The best way to do this is create objecive-C methods that are called by the javascript in your web view as per this guide:
Calling Objective-C from UIWebView
This way you could call an objective-C function that returns the data loaded from Kumulos, you can then do what you like in the javascript with the loaded data.

displaying web pages over web views in collection view using cocoa bindings

I tried sample example given at this link - Collection View Programming Guide
It is simple and it worked. Considering it as a reference I tried a simple application which will show a collection view of web views with some web page displayed over each web view.
The model class has two properties: NSString *pageName, and NSURL *pageURL.
I then followed each and every step written in tutorial above with required modifications but I was caught in the step -
How to bind web view to collection
view item?
In binding tab it shows three possibilities : Editable, Hidden, Tool tip but none of these is working.
Can anyone suggest me way to accomplish my requirement?
Thanks,
Miraaj
WebView does not expose bindings for the URL (one would think it would, but it doesn't). You'll need to make use of NSCollectionViewItem (create a custom subclass) and update your WebView's URL when its represented object is changed.
The quick start guide you referenced does not show how to use a custom collection view item (it shows a very basic case). You'll need to delve a little deeper into the documentation (and online examples) to achieve your goal.
I would offer one thought to consider regarding your overall goal: WebView is a "heavy" object, so keep your performance expectations realistic regarding creating many of these views.

Resources