How to have a Splitview in a tab bar with storyboard? - ios6

I have seen IPad apps like the new Amazon app that have a split view as a tab in a tab bar. I have tried to make one like that by starting with a master-detail template and adding a tab bar and/or a tab bar controller to it, then I tried a Tabbed template and added a split view and/or a split view controller to it, I even tried one from scratch and still no luck. I know it can be done and approved by apple because I'm starting to see more of them on the app store.
Can any one help find a way to make a app like this with storyboards preferably?
this is a screenshot of what I would like to do

The problem is your using templates from apple and they have setup in app delegate file for what the root view controller should be. In both situations you present you change this. Using a master detail template you will have this in your app delegate
UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
MasterViewController *controller = (MasterViewController *)navigationController.topViewController;
controller.managedObjectContext = self.managedObjectContext;
and then you try to make the root view a tab bar controller and that's where you are getting errors. I just did a test and pretty much cleared everything in app delegate and changed masterviewcontroller in storybuilder to a regular tableviewcontroller class and everything loaded up. If it's not exactly what you need for a small application you are better off starting with a empty application for learning purposes and because it's better to know where everything is because you are the one that created it.

Related

Referencing Another App

What is the best way to reference another app in the visual query designer?
I am using the blog app and I created a second app to list the tags that are used in the main blog app. This way when the app goes to a detail page of a post, I can still have the tags listed on the website without the view changing automatically. I set up my blog tags app with a visual query that list all of the tags used in the main app. Everything was working fine in development.
The problem that I have run into is that when I move the app to a production site the AppId was different than the one I was currently using and development. Now, the tags app is showing an error and I am not able to get into the settings to change the app ID of the visual query to the proper one in order to get the information needed. Is there a better way that I should be handling this?
This sounds like the right way to do it - your main issues is getting into the admin-ui when the template you have shows an error.
I suggest that you quickly rename your current template (so it's not used till you fix the bug) and create an empty template with the original name. This way you can go to the normal settings.
Another option is to switch into dnn-edit-mode, and use the black-dnn buttons to get to app-admin.

AngularJS: Triangular three way binding -- Project Structure

I am currently working out an admin interface with a Live Preview and I am still not 100% on how to structure it properly.
My page basically consists out of two parts. The Admin Interface and the Live Preview. Obviously, the Admin Interface fills some variables with data and the Live Preview displays this.
Therefore, the Admin Interface needs to bind variables, that the Live Preview will bind for reading.
Furthermore, the Live Preview in the end (if possible) should be re-used as the final product that displays a set of information. All it does is display a single JSON file that is received from the server (when in product mode) and in case of the Live Preview it will need to update the data Live as its edited.
One more note: Both, the Live Preview and the Admin Interface consist of elements like directives again and parts of the Admin Interface need to be loaded dynamically by having a user add a page with a certain type of content.
After researching how modules are handled I came up with the following:
Live Preview is a Module
Admin Interface is a Module
My page includes both modules
Both of them should be connected to something central that provides the ability of editing the data (bound variables?) and reading the data so its updated live.
Ideally, this would be a service, so later on when loading the "Live Preview" as an actual product, can just use the same kind of service which in this case provides the information from our Database instead of a variable in its scope.
Is this a good approach? Is there a way to have a service that on the one hand side can be edited lively like in a two way binding so that my live preview can also pick it up? Is there something I can use instead of the services, like a controller? How should I go on about this?
You are doing everything right. I don't think that it is relevant as to whether the preview and admin panel are their own modules or contained within one. You will find people using module seperation in a wide variety of ways within their Angular apps.
What I think you said that is important and correct is to connect the preview and admin panel via a Service. Other methods of connecting these two (i.e. $rootScope) are costly and bad practice.
If you will be re-using live preview in many locations of your application I would wrap it in a directive.
You should feel confident in your approach, it's a good one.

Replay Edge animation on ui-view load in Angular Js

I'm building a project with angularJS. I use ui-router for views, and nested views.
So I have a index.html with just the header, the footer and a "general" ui-view where I load asychronously the Home-view, Contacts-view, About-view, etc.
On the "home" page and on the "about" page there are two different Adobe Edge animations.
They work like charm when I load them for the first time, but when I navigate through the website and then I come back to the home or the about page nothing appears.
I've tried loading the edge scripts in different ways
in the index.html head with the script tags
in a angular directive
in the controller
during the routing processes via the resolve option of ui-router
None of this strategies fixed the problem. The animations still play just once.
Finally I decided diving in the js code crafted automatically by Adobe Edge (I'm not a designer, I have no idea on how to create animation with Edge).
I found that Edge create an AdobeEdge object and bind it to the window... then call the animation throught an event handler in a jQuery anonymous function
(function($, Edge, compId){
....
$(window).ready(function() {
Edge.launchComposition(compId);
});
})(jQuery, AdobeEdge, "EDGE-123456");
On the official Adobe documentation (really bad!) there are some methods to call on the AdobeEdge object...
I tryied to insert in the home-controller the following line
$window.AdobeEdge.getComposition("EDGE-123456").getStage().play();
but doesn't work.
After a wasted whole day I'm frustrated, I hate who ho conceived Adobe Edge scripting and overall I need an help to fix it the right way (beofore implementing horrible workaround).
Thank you
Try using playAll(). I imagine this plays all the Symbol timelines at once (it's difficult to know for sure since the documentation is so vague), but I've found it works for my purposes.
$window.AdobeEdge.getComposition("EDGE-123456").getStage().playAll();

AngujarJS - ngRoute/ngView - stacked views

I'm new to Angular and it's my first time using the ng-view directive. I'm developing a Phonegap application and I noticed that, upon clicking many consecutive links which do a:
$location.path('/somePath') //this is illustrative - path depends on link clicked
the new loaded view is stacked. This means: I have to click the back-arrow in my android device N+1 times to leave the program, if I followed N links (or N calls to $location.path). Althought this behavior is not expected for me (I'm a n00b here), looks good in the base user experience I need for my app (is it related to the history stack?) - but also I have a "go to main menu" button, and I want that button "clearing such stack", rolling back to the first screen.
Why do I need it? Because I was navigating in my app back-and-forth (currently my "go to main menu" button does $location.path('/'), which STACKS again a main-menu view) and when I tried to close my application using the back-arrow button I had to hit that button an annoying amount of times.
So: how do I clear the stack when I click the main-menu button? (instead of doing $location.path('/'))
If you are building a phonegap app then I am assuming the actual URL doesn't matter to you? You may want to look at the ui-router module instead of ng-route as it focuses more on states than simple routes. You can easily move to/from states, with transitions if necessary, without changing the $location at all (avoiding your problem). Additionally, ui-router supports named views and nested views so you can split your templates up into smaller pieces if that fits your project.
Sorry not a direct answer to your question, but it sounds like ui-router is a better tool for what you are trying to do.
https://github.com/angular-ui/ui-router

Silverlight redirecting between project pages

I am having a my problem is I can not redirect my page in silverlight like most of people who are not familiar with this technology .
I design a login page first and if password is correct I want it to direct to MainPage.xaml
as you can see I tried methods which are commented already it did not work . I searched in this web page there are some posts about this problem but I could not solve please help me .
when i try that one;
Uri target = new Uri("MainPage",UriKind.Relative);
NavigationService.Navigate(target);
error message : Object reference not set to an instance of an object.
actually we found a solution with my friend ;
instead of directing a web page , when code goes into if block we are changing the content of page with {this.Content = new MainPage() ; } method and it is working .But System.Windows.Browser.HtmlPage.Window.Navigate(target) this one is directing us same login page or pages like www.---.com outside normal html pages .
Normally you need to use the NavigationService to do this:
NavigationService.Navigate(new Uri("/MainPage", UriKind.Relative));
The NavigationService is a property on the Page object so it will be available in the Login code-behind.
However, after you mentioned that you've "already done this" I realized the issue. Silverlight Navigation uses a Frame control. This Frame control lives in MainPage.xaml for the default project. So you're not navigating inside the frame, but you want to change the entire screen to a different one and do so without the Navigation services built into Silverlight.
I'd suggest you either (a) have the Login run as a page inside of the Frame on MainPage (you can load or unload the links on the top based on if the user is authenticated) or (b) don't use the Navigation for the remainder of the application and use a framework like Caliburn.Micro to handle all the Navigation between views.

Resources