Previewing SwiftUI toolbars on macOS - xcode

Is there any way to preview the toolbar for a macOS SwiftUI app? I can't figure out how to structure my preview to get it to display the toolbar items in a view. It does the right thing when actually running, but not in preview.
I’ve tried putting my preview in a NavigationStack and even in a NavigationSplitView (which is what the app does). I’ve tried specifying .previewDevice(PreviewDevice(rawValue: "Mac")) as well. It won’t even show the toolbar in the live preview (where it runs outside of Xcode).

Related

Where did tabbed controller views go in storyboard?

Forgive but I haven't coded in about a year or two, so I haven't been following the latest update in Xcode.
Anyways, I decided to go back and brush up on some skills and I noticed right off the bat that a lot has changed.
I created a new project using the tabbed view controller set up, usually it shows in storyboard immediately upon creating the project. Now there is nothing there. Where did it go and how do I bring it back?
I attached a screenshot so you can see the simulator running the tabbed apps but not showing in storyboard.
enter image description here
You opened the LaunchScreen.storyboard. This layout appears on the screen for a few moments while the app is launching.
https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app
https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/launch-screen
The storyboard that you are looking for is Main.storyboard
Notice, that there is no Main.storyboard if you start with SwiftUI
There are no specialized app templates any more. But there is still a tab view controller object in the storyboard editor's library, so just drag it into the canvas and use it. It gives you same two-child tab view controller as before.

Xamarin.Forms UWP Application doesn't work on XBOX as native

I have tried my UWP app on XBOX one which is built using xamarin.forms and it works generally fine but by default mouse mode is active. I changed it using
RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
on UWP level in app.xaml.cs and it disabled mouse pointer but problem is that using game pad, i am not able to select items on the UI. I can navigate through textbox and buttons but not Toolbar (Commandbar in uwp), ListView, Masterdetail, Tabs etc.
I created a blank native UWP application and added a commandbar with AppBarButtons and NavigationView with NavigationViewItems. It perfectly works, I am able to navigate between menu items and commanbaritems using mouse pad.
Why this is not working for Xamarin.Forms? is xamarin.forms not actually native for UWP?
Xamarin.Forms MasterDetailPage was written before NavigationView existed and it doesn't use it at all (and especially not with NavigationViewItems, that would limit the flexibility, i don't think it will ever be used).
As SplitView has some focus bug that I can confirm it doesn't come as a surprise that it doesn't work with XBox as expected. However UWP doesn't grant that the app will work properly when you disable the mouse mode with native controls, that's why it is enabled by default. There are properties like XYFocusLeft that must be set if the app is not working properly. You probably need to make custom renderer to expose those properties and set them right. That's pretty much of work to do but it is up to you to decide...

Xcode: How to show Preview in separate window instead of showing in Assistant editor?

When I'm making edits in storyboard I know how to show the preview in the assistant editor (as shown in the below screen shot).
How to show the preview in a separate window, so that I'll be able to drag it to my the screen attached to my computer?
UPDATE: Adding few more images to clarify what is the "Storyboard Preview":
In XCode 7 I managed to do this by selecting File -> New window, then adding a preview-part teh same way you illustrate above. I then drag it to my secondary screen resize everything to give a good preview of the screen sizes I want.

Cannot view images in Xcode

I seems to be unable to view images in Xcode. I am not talking about when running an app, nor do I mean UIImageViews (that works) or other views with images set (also works) in Interface Builder, I am simply talking about viewing images by clicking on them in the project navigator (in the left pane) and expecting them to show up on the middle/right (just like when editing code).
Has anyone had this problem as well?
The problem is fullscreen mode. If you exit the fullscreen the images is previewed as expected.
Check this menu and be sure you select Preview :

ipad storyboard in xcode cannot drag button

I'm running xcode 4.5.2 to write an iOS app for both iphone & ipad ("universal" app).
I'm able to use the iphone storyboard to drag & drop buttons, labels, etc onto it. In fact I have functioning code on the iphone side.
However, since the beginning, I have not been able to drag & drop anything onto the ipad storyboard. When I try to do so the buttons, labels, etc just "bounce off".
Is there a way to reset the iPad storyboard so that I can get a clean start? It potentially could be that I had mistakenly (this is my very first iOS app) dragged a view or view controller onto the ipad story board. I tried deleting it but the whole ipad storyboard disappears after that.
It is probably something very simple but I'm very new to this. Thanks.
You can only drag & drop items into a view if you are in the most "zoomed-in" way of viewing it. Try pressing the "=" in the bottom right corner when you bring up your iPad storyboard (this will toggle between the most zoomed-in and the most previous zoom out). Once it zooms you in all the way, try dropping something onto your view again.
EDIT: Per Xcode 8 Release Notes, Interface Builder should now allow editing at all zoom levels.

Resources