Is a ViewController okay to use for making a loaderView? - ios

I'm making a loader for my app, and can't figure out how to do it. I have no experience with using .xib. Can I just make it in storyboard as a viewcontroller with a view, or is that considered bad practice?

Related

Does it make sense use Storyboard and SceneDelegate together?

Does it make sense to use Application Scene Manifest without SwiftUI? Anyway view controller is added from storyboard ti window already.
I have seen this in an example code, and I am worried it is pointless.

Best approach for 1 screen contains 2 view controller

I want to learn parent - child concepts in iOS. I found a some app in app store and I liked the their design. They have 3 button in same view controller when the user taps a button below view changes and calls their view controllers. Like a TabBar.
I tried to create 3 xib files. When the user taps the buttons they are awaking from nib and I added them to my containerView subview. It works. But I couldn't send a data between them because there is no prepare for segue method to so i couldn't prepared them.
I tried to create 3 viewController in Storyboard and I use them with the Storyboard ID. It works. But still can't transfer data between them.
I didn't understand what is the best approach for solve this problem ? I researched on the web about Custom Segues and Parent - Child concepts but I couldn't find anything.
What is the best approach for make a container like in the image ?
Thank you.
I am not sure if there is something like a best approach, at least in general term. It really depends on your specific demands and other logic of your app.
Both creating XIB files and creating ViewControllers in Storyboard together with their ID is ok. Here it is more about your preferred way. I would say that today you will probably see more using Storyboard than XIB files.
In terms of data transition. There are several ways, if it is not some very heavy logic then delegates can do it pretty well and easy.

Best practise in creating an uiview and presenting them in iOs

Is it a good practise to creates views in xcode and hide them and when required show them?
I am asking that because I prefer to create views visually and not in code.
If the view is to complex(a lot of subviews) should I create a new view controller to it?
I know there isn't a specify question here but I really need a clarification on this matter.
Regards
One of my first iOS applications had a tab bar and views that the user could switch between. Originally it was done by hiding and showing the right views depending on what the user pressed on the tab bar. This ended up being a complex disaster.
I then rewrote the app so that each tab bar view had its own UIViewController with its own set of views. That turned out to be so much easier to manage. (I also changed from using Interface Builder to straight code for creating the views, but that's beside the point and you can continue to use IB if you want.)
As for me, I prefer folowing practice:
Usually, a use storyboards,where views are placed, but if a view is complex, I create a separate XIB file, arrange all subviews there, and then in storyboard drag an UIView subclass and connect my XIB view with it.It helps to avoid mess in storyboard.
As for hiding views, I also don't recommend such practice as it can become very complex to understand your code and all those views are allocated when XIB is loaded, so the mobile developing rule "do as lazy as u can" is not met. We should try to spend as less memory as it's possible.
UIView is the best way to create iOS app, esp. if you want to reuse the code.
For example if you have same view to present in iPad n iPhone then using UIView can result in lots of similar code in View-controller
In another case if your view might need to have multiple table view it can be quite complex to handle each with delegates in ViewController. But separate view will solve this problem.
I have made my 1st open source code after learning how to use View
https://github.com/bishalg/BGRadioList
which I had learned from
http://www.raywenderlich.com/1768/uiview-tutorial-for-ios-how-to-make-a-custom-uiview-in-ios-5-a-5-star-rating-view
About the hiding view - I have used lots of hide and show view codes in my apps but believe me at one point it will become complex and unmanageable if you have lots of views.

How do I transition from a UIView to a UITableViewController using an IBAction in xcode?

I built my app as a single view application and then later added another view with an .xib. I get how to do that. But what I need to do now is add another view, but this is a UITableViewController that uses storyboards. I am adding IAP from a tutorial I used that uses a MasterViewController and automatically loads the first view, but I didn't make my app that way.
If anyone can explain how I can make it so when you click a button (IBAction) on my original view, I can transition to the UITableViewController that use storyboards that has the table for my IAP, that would be awesome. Is this even possible? If there's another way I'm cool with that too! BTW I am very new to this so please explain in simple terms if possible. So if anyone ca help it would be greatly appreciated.
Put a button on the first form, hold down CTRL and drag the mouse and point to the other form and it will create a segue. You can set the type (push, modal, etc.)
Watch the WWDC session from 2011 introducing Storyboards. Worthwhile.

Do I need multiple view controllers for the iPhone & iPad storyboards?

I'm still relatively unfamiliar with all the new features of iOS 5, and what I can do in Xcode now. So, a good explanation would be appreciated.
I'm designed a single-view application and I have both an iPhone and iPad storyboard. I chose 'Single View Application' when I first started, so Xcode created a ViewController for me. Both storyboards list this view controller as their own.
Back in iOS 4 the way that I linked button actions to my view controller was to Right-Click on the button on the nib, pick the action that I wanted, then drag it over into the view controller's '.h' file, which auto-created a method/property for me.
I am confused about how to accomplish this now, since I have multiple storyboards but only one view controller. Do I need to have multiple links for each button; one for the button on the iPhone and one for the iPad? Or is there a better way to accomplish what I am trying to do now?
You do it the same way you did it in iOS4. But obviously you never built an universal app there ;-)
It's totally okay to have a single UIViewController class for two different nib files.
And if you use storyboards it's fine to use different storyboards and a single viewController too.
You can even use the same viewController for different scenes inside a single storyboard.
The connections to the viewController are saved in the nib or storyboard. So you can't overwrite them while designing the other user interface.
Open the iPhone storyboard, make your connections to actions and outlets. Then open the iPad storyboard and make totally independent connections.
In response to the first reply, I was under the impression that a view controller could only support two scenes in a storyboard layout. I say that because I found this thread.

Resources