How to create new View Controller in a standard way (Not overlapped view controller) - viewcontroller

I have a button (Button 1) and when I press it, I want to jump to my other View Controller (red) as "full-screen". But every time it shows me the new View Controller (red) as an overlapping view (with a space at the top). How can I show the new View Controller as a "full-screen" View Controller?
If I didn't follow any rules I am sorry. I hope for your help. Thank you very much.
Best regards
MacBook Pro: macOs Catalina 10.15.4
Xcode: Version 11.4
Now my new view controller (red) is with space at the top when I reach it from the button

Select the second View Controller(Red). In its attribute inspector, there is an option called Presentation which is initially automatic selected. Make it Fullscreen.

Related

How do I get a crossfade transition with resize on macos using storyboard & NSTabViewController?

On a brand new MACOS application project (swift, storyboards), using the latest available version of xCode (8.3) I can't get a crossfade transition with a NSTabViewController that I add to my story board. The window is not resizing as well.
What am I doing wrong ?
I start by adding a new window controller, I remove its content view controller that I replace by a tabviewcontroller.
The tabview controller comes with two tabs wired to two view controllers. I resize one of them to make it bigger and put random buttons on both of them to be able to check wether the full view is visible or not at runtime.
Everything is left with default settings, as well as the "crossfade" transition of the tabviewcontroller.
But when running the application, tabs change abruptly, and the window doesn't resize to display the new tab.
My goal is to build a preference panel on my storyboard ans I just fail on the first steps.
For crossfade animation to work, you need to connect delegate outlet of the tab view to the tab view controller.
It does not seem smooth resize is supported by the standard tab view, though.

How to add initial view to Storyboard file?

I started an "Empty Application" template, this means that I had to add my own storyboard file. Problem is, it is completely blank, and I can't figure out how to get the first view on there, so I can start designing my interface.
Anyone know how to get that first view on there?
When you create a new Storyboard file, all you need to do is click/drag the UIViewController object from your right hand side of tools into your Storyboard and then you're all set to begin work on your new Storyboard.
Just in case you can not start from scratch :
Select your View Controller
Open the Attribute inspector (right pan by default)
Go to View Controller section
Select Is Initial View Controller checkmark of the Initial Scene option
In the latest version of Xcode (12.2), this is how you can add initial view to story board
Click on + Icon,
search "View Controller", Drag and drop View Controller.
Go to Edit->Show Library then drag and drop a type of View Controller that you need.

Toolbar at the bottom not showing

I used the xcode4 xib file to design the following UI:
View
Table View
Toolbar
Bar Button Item
Segmented Control
Bar Button Item
Segmented Control
On the design sheet, both Table View and Toolbar show up; but when I run the app in simulator, the toolbar is not showing up.
I tried to make the table view invisible (as a test) and to bring the toolbar to the front. Still the toolbar does not show.
Do you have any idea what I might be doing wrong, and what I should try next? Do I need to do init for the toolbar in the .m file?
Thanks much!
Lu
Have you set the the toolbarHidden property of your UINavigationControllerto NO ? You have to explicitly do this to show the toolbar as it is defaulty set to YES. If this isn't the issue, we need to see some code, especially your toolbar initialization and etc.

persistent view controller

Im building an iphone radio application and I want to have the controls, play, pause, stop, etc. in a tool bar (a custom view controller) at the bottom of the application. I want to keep this there throughout all the views so you can control the audio while navigating through the other parts of the application (multiple view/table controllers).
Is there a way to create a view that stays in place like a tab bar?
The idea here would be to check the view position with respect to ur window (UIWindow present in the application delegate). Lets say u call this view PL now each time any view is pushed on the window, you have to check the position of this view PL if this view is not the last view in the stack make it the last view, This can also be done by checking in viewWillDisappear.
Hope this give u an idead of what to do.
Thanks,
Madhup

Easy custom UITableView drawing

All,
I found the code in Matt Gallagher site ( http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html ) for this really neat design for a Table View... Im very new to Cocoa and Im having a hard time figuring out how to wire the darn thing in IB...
I loved the design and wanted to use something similar in a more complex structure... Nav Bar / Tab Bar with a few other views / TableView for the data in the first view... I found lots of tutorials to do that and got it working... When I tried to use that design in my project, things went crazy... in My MainWindow.xib I cant have a UIView where the arrow is pointing...
the nib looks like this:
Tab Bar Controller
Tab Bar
Nav Controller
Navigation Bar
Table View Controller
Table View
---->>>> (UIView for the backgroundImage )
Navigation Item
Tab Bar Item
UIView Controller
Tab Bar item
Window
can anyone guide me in the right direction??
Thanks !!!
It sounds like you're not having issues with the table view as much as the construction of the hierarchy around the table.
Instructions for creating the hierarchy would be as follows. I think you've diverged at around step 9:
Start with new copy of the default iPhone "View" template
Throw away the view controller class.
Open the MainWindow.xib and delete the view controller there too.
Find the controllers in the
Interface Builder library palette (they're
the yellow spheres at the top of the "Cocoa Touch" library in "Objects" mode whose icons contain
other objects).
Drag the tab view controller into
your MainWindow.xib file at the top
level.
Expand the tab view (triangle next to its name in the list view of the xib)
Drag a navigation controller into your expanded tab view (if this works, it should appear as one of the tabs along with the two view controllers that are there by default)
Expand the navigation controller
Drag a view controller (not a table view controller) into the navigation controller. It should appear as the content of the navigation controller.
Select the view controller (single click).
Press Command-4 (or select "Identity Inspector" from the "Tools" menu).
In the "Class Identity" popup menu, select EasyCustomTableController (this assumes that the current xib file is part of an Xcode project and this Xcode project already has EasyCustomTableController added to it).
Add a UIImageView to the view controller's view (this is your background image)
Add a UITableView to the view controller's view (this is your table). Add this view so it is after (and hence on top of) your image view.
There should be a tableView outlet on the view controller. Connect this to the table view.
Connect the app delegate's viewController to the tab bar controller (back in Xcode you can optionally change the type of this property to UITabViewController)
Should work.
The trick is that UITableViewController can't be used if you want the view to contain more than just a table. For this reason, you must use UIViewController and recreate the functionality that the UITableViewController adds. See here for how this is done:
http://cocoawithlove.com/2009/03/recreating-uitableviewcontroller-to.html
Thank you Matt (kind of cool that you answered)!!
I really appreciate the help... I've been messing around with it and got it to work using a UIViewController in another view (being created from the tableview)... Once I had the UITableViewController in the navigation I dropped the imageview & used a gray color; it looks great!! The initial screen has the rows big enough that scrolling is not an issue... I will go back and try to change that now...
I do have to say that IB is by far the most challenging step in app development for a newbie coming into Cocoa Touch !!! Yikes!