Xcode iPhone: New Project Template, Combine? - iphone

This question is simple... you have a choice of which Template you'd like to use when creating a new iPhone application in Xcode.
What if I choose a View-Based, but I need a Navigation-Based application too? Can you combine the various templates within a project? I mean, is it just a matter of creating a new .xib file and dragging on the various UI components?

The navigation based template is also view based. Look at the code, the navigation based template contains a rootViewController which loads its view from a xib file.
You cannot combine templates automatically you'll have to do it yourself.

You can always create custom templates as you want. You just need to pick a template from Xcode then you can modify it as you want and just place it on a proper location.
Read my this blog post for a better understanding - http://www.makebetterthings.com/blogs/iphone/how-to-create-xcode-project-templates/

Related

UIPageViewController/TextKit Multipage flow in SWIFT

Has anyone had any luck creating a multiple page view of document (one, NSTextStorage, one NSLayoutManager, and multiple NSTextContainers) in Swift. I'm having a lot of trouble finding example code not in objective C.
Basically, I'm trying to recreate the "Advanced Text Layouts and Effects with Text Kit" demo from WWDC 2013, but the whole thing is in Objective C and there is no sample code to be found. The post below seems to be having luck; but I'm having no luck translating...
UIPageViewController/TextKit Reflowing Text on paging
http://rshankar.com/quotes-app-simple-page-based-application-in-swift/
This uses the Page Based Application project template for a out-of-the-box working example, then customize for the model you want to use.
It use this same technique in my app by changing the root controller to what ever viewController I want it to be, coping the three files into my app, and all the magic is done for me.

why there is no "Use Core Data" check box with Tabbed Application template

I need a tabbed application with core data persistence. when i create a new project with Tabbed Application template, i can not find the "Use Core Data" check box. Is it okey to manually add a core data to a project created with Tabbed Application template?
It's not there because there is no standard way to implement core data view controllers in an tabbed application like there is in a table based app.
Yes it is okay to add Core Data to every project you create. You can use a core-data enabled template for reference.
Yes, you can add it yourself. Or you can the empty template and add the tab bar controller yourself.

Iphone sdk - How to setup a 'template'

I've been working on a Cook Book App and I've been making each page individually which takes a really long time to do, I asked a question similar to this and it was brought to my attention that you can setup a way to automate the design process so all you need to do is input your data.
Can someone please explain in as much detail as possible how you setup your xcode files/code to automate such a process
So for example I would just enter the page text and it would automatically put my standard background picture in and add a scroll view and appropriate buttons etc.
Thanks
You could make one master view that contains all the controls that you need: standard background picture, scroll view, appropriate buttons, etc, and make any subsequent views that you create inherit from this view, so that they all contain those controls.
You could also use just one view and work with multiple instances of it, one instance per page. Just make sure to have a Text property on it, or a constructor that takes in your text string, so that you could set it to a different text on each page.
Xcode project templates and file templates are pretty easy to make, with a few caveats.
Check the answers to these questions:
Add new templates in Xcode
Change templates in XCode
Also take a gander at these handy tutorials:
Custom Xcode Templates
Xcode: How to customize the existing project templates
It sounds to me like your putting your data into your views (pages). That's a big design error. You need to employ the Model-View-Controller design pattern and separate your data from your views. That will make it easy to create one view (template) that you can reload with data to display each individual recipe.
The first thing to do is to separate your data from the view. You need to have the recipes stored in an array, dictionary, Core Data etc and then wrap that data in a dedicated object. The second thing to do is to create a dedicated view to display all the recipes. As the user moves from recipe to recipe the app will simply remove and add information to the same view as needed.
I would recommend Cocoa Recipes for Mac OS X: The Vermont Recipes, Second Edition because it addresses these issues and it uses a recipe type app as its example. It's for Cocoa but the basic principles apply to iPhone apps as well.

How can you have a page with a button that change views that is not a table view? (iPhone Developing)

I asked a similar question and someone gave me a tutorial link. But, the link made me use a table view and it looks bad with all the lines and stuff. So how do I just make a view with a button and background and stuff (Please write steps in 1.2.3.. format and it would be nice if you attached the code needed too.)???
It's really difficult to fit that kind of project into a comment field, and, in any case, the best way to learn is to get your hands dirty.
Take a look at the Utility sample project that is built into Xcode. Create a new project in Xcode, and under the iPhone Application templates, select Utility Application. This template project uses a button to switch between two views.

iPhone: Is there a pre-made UISettingsView?

On startup, if the user hasn't done any setting of NSUserDefaults, I want my main view to do a flipside view that brings up the same stuff that shows up in the Settings app.
Is there an API for instantiating the same controller that Settings uses, or will I have to reimplement a table view and controller myself?
This website hosts the 'MySettings' API which is a nice toolkit that encapsulates various Settings features (switches, choices, etc) all in a declarative (plist-based) API.
You have to code the ui elements yourself if you wish to make the perferences available within your app. The utility template in xcode gives you a starting point by making a flipview available.
Check out Craig Hockenberry's Generic Table Views, which make it really easy to set up a Settings-like table view.