has uitabbarcontroller changed in xcode 4 - uitabbarcontroller

I recently upgraded to xcode 4. My application utilizes tabbarcontroller. In old xcode 3.x, you were able to change the tabs to different types per this screenshot:
From what I gather in researching this issue, xcode 4 no longer offers this functionality. Am I missing something? From what I researched we are now suppose to delete/add tabs then change attributes to get the desired effect. So, to that end in xcode 4, I've added a new tab item and made the class a UINavigationController fully expecting the ability to toggle the "Shows Navigation Bar" with a checkbox. But, the "Navigation Controller" grouping never appears. What am I missing?
Thanks for your help.

I was surprised at first too and I was about to ask the same question. But, when you open the Object Library, in the bottom you can see a big star, "Tab Bar Item". Just drag that to the tab bar and you will notice a new item added to the tab bar controller.

Weird but works!
Just drag drop View Controller onto tabs!
Thanks

I played with xcode 4 a little bit more and discovered you can drag Navigation Controller from library onto your UITabBarController and it will create your tab item for you and set it up as a NavigationController. Pretty cool. Hopefully this will help others.

Related

iOS SwiftUI how to bring up extra actions like "Embed in VStack" when interacting with code?

I am looking at this SwiftUI tutorial and it suggests I can see extra actions upon Command-Clicking the SwiftUI elements in code. In my Xcode, this jumps me to the class definition.
I see there's an option in XCode 11.0 t change the Option key to show SwiftUI inspector, however, this still does not let me modify SwiftUI code elements using actions like "Embed in VStack"
How can I get both inspector and extra SwiftUI actions when interacting with SwiftUI Code (not the preview)?
Extra SwiftUI actions show when Canvas is opened (shortcut: Option-Command-Enter or ⌥+⌘+↵):
canvas is closed
canvas is opened
The accepted answer doesn't work for me on macOS 10.15.5 and Xcode 11.4.1.
The Good news is that you can get it via a shortcut of [Command][Shift][Left Click] on a SwiftUI element or by clicking Show Code Actions on the right click menu.
Instead of using the mouse, I recommend using the Xcode hotkey for bringing up code actions. Navigate to Preferences -> Key Bindings and search for Show Code Actions. You'll see the preset hotkey which you can then customize. My default key binding was Shift+Command+A. Just make sure you cursor is over the intended element when you press the hotkey.
You can change the command click behavior where you were looking under Xcode -> Preferences, Navigate tab.
Rather unintuitively, if you pick "Selects Code Structure", then command+click will bring up the SwiftUI menu options you're looking for (granted the canvas is open).
If you do this, you can still jump to definition via control+command+click
Conversely, if you'd prefer to continue to use command+click to jump to definition, you can instead use control+command+click to bring up the SwiftUI menu options.
Command clicking on a view will not work in Xcode 12.2 and 12.3 (under MacOS 10.15.5) if you have your preferences different than Xcode expects.
You have to change your Navigation preferences for Command-click on Code: to Selects Code Structure before the proper menu will appear when you command click on a View.
To change this. press command , to open your preferences and select the Navigation button. The option you need to change is in the first popup menu.

Xcode Main.storyboard shows weird view

not sure when storyboard convert views like this. I re-installed xcode. but no luck. Xcode version is 8.3.2 (8E2002). How do I get previous view.
thanks
Open storyboard and then go to Editor -> Canvas -> Show Bounds Rectangle and uncheck it.
It looks like the storyboard content is not getting properly rendered. You can try opening a smaller storyboard and see if the content is rendering properly to know whether it is specific to this larger storyboard.
If a smaller storyboard works, try to isolate the issue in your larger storyboard by temporarily removing scenes and reopening the storyboard. Sometimes these rendering issues can be caused by a particular scene configuration.
The report a bug banner button at the top-right may provide some logs giving clues to the issue. Feel free to send those to the Apple Bug Reporter

iOS Custom Tab Bar

I am looking to implement a custom Tab Bar in iOS where selected item is bigger size than the rest of the tabs and peeks out over the content similar to this screenshot.
Could someone point to a tutorial of how to accomplish this preferably in Swift?
I faced with this task several times. I found a lot of tutorials but I've never found one that gives the ability to create a center button that part of it is out of the tab bar.
At the end, I created an approach to have it done correctly. I implemented a simple example project with instructions how to do that. Please check my Custom Tabbar Center Button repo as an example.
One more benefit of it it's center button hides correctly with the tab bar when you use Hide Button Bar on Push property.
A UITabBar contains an array of UITabBarItems, which inherit from
UIBarItem. But unlike UIBarButtonItem that also inherits from
UIBarItem, there is no API to create a UITabBarItem with a customView.
So instead of trying to create a custom UITabBarItem, we’ll just
create a regular one and then put the custom UIButton on top of the
UITabBar
Not swift, but should be easily translated.
https://github.com/boctor/idev-recipes/tree/master/RaisedCenterTabBar
This one is Swift:
https://github.com/itsKaynine/SwiftRaisedTab
Source code for a similar question, using Swift 3:
https://stackoverflow.com/a/36016377/300897

XCode 6 Tab Bar tabs greyed out

Anytime I add a tab bar controller to XCode the tab bar is greyed out and I can't see any of the tabs in the storyboard. At runtime it displays fine. I can't figure out why it is happening.
Add an image to the Tab Bar Item and you will see the normal view of the tab bar on the specific View Controller where you changed it. When every single Tab Bar Item got an image you will also see the normal appearance in your Tab Bar Controller.
Setting an image for the Tab Bar Items and restarting xcode fixed it for me.
In the assets folder (or wherever your image is kept), set 'Render as' to Original image
It looks like this was a bug in the XCode UI. This has been fixed in later versions of XCode.

Tab Bar Controller Items Missing on Storyboard

I am not really sure what is happening with my xcode project. I am unable to edit the tab bar items in the story board. They are all greyed out as you can see below.
Could you please let me know what might be causing this?
Thank you.
Restarting my computer solved the problem. You can still see the icons and titles when you click and drag it.