Custom iOS Controller for multiple collections - iphone

I'm still fairly new to the iOS development scene, so I'm not totally sure where to look for open source controls, etc. The app I want to build will have multiple collections in it. I'd love to have a view where I can swipe up and down to browse between collections, and then swipe left and right to scroll though that particular collection -- all on one screen.
The app I've seen that basically resembles this is the "Popular" screen on the Mobli app for iOS.
I'd be grateful if anyone has seen something similar already built that I could base it on instead of trying to program a new view from scratch w/ my still limited knowledge.

The ScrollView sample project from apple does this, you might want to to take a look at it.
As for reusable components, those are few and far between. It's difficult to protect a XIB in an external library, and beginning developers tend to have trouble getting static libraries to work in their project anyway. Github is where I look for OSS code I can use.

Related

xCode, Swift: working with vs. working without storyboard

I'm new to programming apps, trying to realize a project for iOs using xCode and swift.
As far as I've learned most people seem to work with the storyboard feature, but I've come across people that suggest to deactivate the storyboard and work with code only.
I'd like to know your opinion on what method fits my needs best for the intended project. As I am just getting started, I'd like to stick with the appropriate method right away for I'm probably going to invest a lot of time.
This is about what the app is going to look like:
myApp Layout
Now this is what it' basically supposed to do:
The "settings"-button (blue area, top left) is going to take you to a different view to set preferences. The "search"-button (blue area, top right) is going to change the title into a search field.
You can browse through 3 categories. Each of them contains a couple of questions. Those are stored in a database and are supposed to be displayed list style within the red area. The order of the questions is going to depend on the users preferences.
Clicking any of the questions is going to take you to another view that displays the answer. When viewing the answer the "settings"-button (blue area, top left) is changing to a "go back"-button.
Now as far as I've learned the blue area might be realized with a navigation controller, navigation bar.
The white section works pretty much like a toolbar. However I've read it's close to impossible to move the standard toolbar from the bottom to the top.
I've seen tutorials of people realizing this type of layout with (to me) complex code but without using the storyboard. Am I wasting time on figuring out how to manipulate storyboard objects? Coming from coding and programming websites the project looks so unbelievably simple. Is a project like this in fact rather complex to do as an app?
In any big project you will have to use all approaches, it is all about experience. For example, I am using StoryBoards to make 95% of my UIViewControllers elements, using XIB for static screens like error messages, some loadings etc. and using code to append some gradient views, shadows etc. It is possible that in future I will be doing all in a different way. But if you are a beginner - better use Storyboard, it makes getting into all of it much easier, understanding UIKit and iOS development overall.

iOS Universal App without storyboard or xib file

I have a question about universal app. My app will not have storyboards or xib file. There is possibility to write universal iPhone/iPad application without it? I found some tutorial how to create universal app with storyboard, but i don't want (i can't) use this feature in my project.
If it is possible What should i do? If i have to made changes only in ViewControllers? I'm start to do this, i'm not changing old project so i can do anythng - what should i learn/what should i remember?
I'm targeting to iOS 5.
EDIT:
I have a screen information in resource file and my rootViewController or any other ViewController will be created in compile time, so i can't have xib file for that, i can't put button on xib with Interface Builder becouse i don't even know how many buttons i will have there. I don't know how many screens i've got till i hit run in my project.
Not only can you write any type of iOS app without Interface Builder, it is actually much more testable and pliable. Some auto layout tricks are difficult (not possible?) in IB style projects, as well.
There is an incredibly impressive library called Masonry that wraps the NSLayoutContraint syntax. This makes it quite pleasurable to subclass views while not having to use ugly VFL or incredibly verbose NSLayoutContraint syntax (not even going to address frame setting...blech!). IB style apps also promote bad software development practices and anti-patterns (just dumping everything in a view controller presentation-wise. No Separation of Concerns!). Also, it is more difficult to work on larger teams (IMHO even small teams) while utilizing Nibs, Xibs, and Storyboards due to merge issues.
On top of all of that, you gain a much deeper understanding of the classes you are working with (UIView, UIResponder, etc.) when writing code in this manner (once again IMHO). There is an interesting article outlining some of these issues in more detail: http://doing-it-wrong.mikeweller.com/2013/06/ios-app-architecture-and-tdd-1.html This is by no means the only article that discusses this problem. Also, this will help for your app delegate: creating a universal window-based iphone app without generated xib file
This is certainly possible, I have only used storyborads once in the many apps I have published. As for not using XIBs, I am not sure why you would want to do that. You can lay out your views at runtime in the init method, but I feel like that is just making things unduly hard on yourself. You can set a XIB up for the iPad and one for the iPhone so you can tailor the UI specifically to each device.
Perhaps if you go into a bit more detail about why you are imposing this requirement on yourself we can discuss if it si worth the effort to go down that road.
Good Luck.

What is a good way to implement a menu system for an iphone game?

I'm working on a project and I've been asked to add a fairly detailed and nested menu system overtop pre-existing gameplay. I'm new to iphone programming in general, but have experience with other C languages on different platforms. I'm looking for an example of a good clean menu system architecture.
So far, I've gotten a little used to how the xib files interact with the code, but I still have a ways to go it seems. I have two UIViewControllers; lets call them UIViewControllerA and UIViewControllerB. I started with UIViewControllerA (the game's main view controller) and want to add UIViewControllerB as a menu to lay on top the game window. The only way I've found to get UIViewControllerB to render is to use it as a data member of UIViewControllerA and add it as a subview to UIViewControllerA.
This seems like a very unclean way to organize this system and introduces some bugs. IE - when I have UIViewControllerB showing, the touch events fall through to UIViewControllerA which I do not want.
Sorry this is long, but I'll get to the point. Does anyone have a good suggestion on how to create a clean and robust menu system? I feel as though I am way off the mark. I don't think I have enough experience to come up with a good system on this platform.
Thanks in advance!
EDIT:
I feel as perhaps I didn't specify that I'm seeking help for technical programming design rather than visual design. I'm seeking for a way to implement a state-machine type architecture for an iphone platform.
Check out this link - https://github.com/relikd/OGActionChooser
It's a nice-looking replacement for a UIActionSheet or UIAlertView - this could easily be customized to present a modal menu system.
A really easy way to have a clean menu page, simply take a picture of hardwood floor (or off the web) and add buttons. I would show an example but I need 10 points...
Take the pic, onto PS (photoshop) and add a box or square, add shadow and some cool special effects, upload it to xcode, but the buttons in the box.

How to make iPhone app "skinnable"?

I was asked by a client to make a "skinnable" app and I don't really know what that means.
I googled like crazy and I didn't found a clear answer or an example.
If anyone has a clue about this, any tip would be appreciated.
Thanks.
Generally this means the app will allow the user to choose different looks for the UI, each of which will have a different color scheme, feel, etc.
What I actually did with my project. I decided to use multiple storyboards to give me greater control over the entire UI and UX of each theme. I programmatically link them all together via a master storyboard that links them all together. That's what I did, and it works very very well. Performance is great, while still maintaining high level of fine grain control over each theme. You can even keep your Header and Implementation files the same for individual view controllers, just so as you keep the names the same on the storyboard.
So for instance, one of my apps that I'm working on called Jam-mout (A music player) has multiple high quality themes. (Image attached). Each theme has it's own storyboard.
For iPhone apps, where the majority of the GUI design is provided by the operating system, you could do it by setting custom Navigation bar background images, custom button graphics, and different fonts/sizes/weights and whitespace. Make sure you're working with a designer who's familiar with the iPhone GUI (if you're not working closely with a designer this is going to be a nightmare).
I recently put together an app for a client who wanted a heavily customised GUI: http://itunes.apple.com/us/app/gogoparis/id428497937?mt=8. A 'skinnable' app would have several sets like this, so the user could choose between several different overall styles. (I hope your client has an enormous design budget!)
my post here should help you get started:
What is the recommended method of styling an iOS app?
if you need live theme changes, each theme in this example could post notifications when the user selects another theme (or skin) - then you can update either the theme instance itself.
alternatively, you can create identifiers for themes which are mapped (NSCFDictionary) to a central theme factory. an example identifier for a specific view for use with the theme factory could be a string MONImageSelectorTableCellThemeIdentifier.
an example manager/factory which handles all theme loading and vends references to themes:
#interface MONThemeManager : NSObject
//...
- (MONTheme *)themeForCurrentlySelectedSkinForViewWithIdentifier:(NSString *)identifier;
//...
#end
beyond that, it's hard to answer your question in more detail without knowing your requirements. the implementation of skinning an app can range from very simple to very very complex. good luck.
Already some good answer here, but I'd add that if you use a ui toolkit such as Three20
you can skin everything using CSS as you might for web pages.
I do realise this is an old post, but I thought I'd share my penny on the matter:)
To make any Cocoa app skinnable you need you think of 3 aspects of the app:
1) Uniformity: By this I mean that on all windows, views (including buttons, text inputs etc...) you want to have a 'standard' that will apply throughout the app. This is the first thing you need to look at. Although iOS and OS X alike already have 'themes' as to put it i.e. Apples default way of shading and laying things out, you can override these (refer to the individual view / window etc... documentation.
2) Performance: With skinning etc... performance is always an issue when it comes to writing your own drawRect etc... methods. The code apple have in place for the 'default' is already optimised, so you need to keep a close eye on the performance of the app whilst you are doing this. Good examples are: Do I use an image with a gradient, or do I use NSGradient? Both of which have performance issues when it comes to rendering them, but it's a question of which is the better of the two
3) userDefaults: This is generally the area where you'd be getting your 'skin settings' pulled from. userDefaults is basically where you store all of the information which you generally set in a preference pane.
If I were you I'd look into the class reference of it:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/
Furthermore, here's a nifty example of using userDefaults:
http://mobile.tutsplus.com/tutorials/iphone/nsuserdefaults_iphone-sdk/
Hope this helps!

navigate in iPhone app without programming

is it possible please to build small application with interface builder without coding, just to make sure that my interfaces are well organised ?
For the navigation interface, no. You need to programmatically push views into the navigation stack.
Interface Builder is a layout tool for individual screens. Connecting them in a navigation flow happens in code.
I second #fluchtpunkt's comment that you might want to look at publishing your content as an iBook rather than a native app. Or you could look at one of the html-to-native-app solutions like PhoneGap or Appcellerator. I've never worked with either of them, but theoretically if you have any HTML ability at all, they flatten out the learning curve of simple app building very significantly.
If you just want to test your interface you should probably use a mockup tool. I have good experience with blueprint. Or try something like interface (http://www.lesscode.co.nz/interface). Here you can create a GUI prototype and export it to XCode (maybe you can run the app at the simulator with navigation after this operation…) but i don’t know because i haven’t any experience this tool!