NavigationView inside UIHostingController inside UITabBarController (SwiftUI inside objective C) adds gray bottom area - objective-c

I have an app in Objectice C
I started to add some SwiftUI views
Everything works great but when I add a NavigationView inside the SwiftUI view automatically adds a gray space at the bottom that I cannot remove.
Other tabs that are in objective c dont have this space.
If I remove the NavigationView, then the view automatically covers all the screen.
any idea what could it be ?
I tried with frame and safearea but no luck

Related

Animate view and set button backgroundimage conflict

I am making a type of drawer animation for iOS where a button tap in one of my views will expand that view over the other views from the bottom up. All is well, except when I want to change the button image after animation. The animation completes but then returns the view to its original position when setting the button image.
Things I have tried:
Using CGAffineTransformMakeTranslation instead of setCenter; this works perfectly, except I want to also add a panGestureRecognizer to interact with the drawer, present, and dismiss it. The transform doesn't seem to play well with this interaction
Adding the buttons programmatically thinking maybe AutoLayout is fussing with this
UIView beginAnimations as well as UIView animateWithDuration and completion block
Setting breakpoints and verifying that the movement of the view is reflected in the frame of the button before the image is changed; button frame is not still in original position, but has supposedly relocated with the view
It shouldn't matter, but my project is using TabBarController. I made a simpler version of what I'm trying to do with just the one view controller and had the same issue. The green view extends beyond the frame of the view controller's view so that when it moves up it reveals what is off-screen.
example: http://i.imgur.com/tRou0Js.png?1

Swipe to see options in iPad

How can I implement swipe to see more options? There are lot of libraries that I could readily use, but they all are designed for iPhone apps. In iPad you have a lot of space, and I want to stack the buttons vertically instead of horizontally.
Is there any library for this? If not, how should I go about building this as a custom cell?
I tried building a custom UITableViewCell class which adds a UIScrollView, but it's not the same as showing the buttons beneath the cell.
Based on your inputs I have created a simple custom cell with basic functionality of swipe to see utility buttons and of course buttons stacked vertically.
What I did was, add a UIView beneath the cell's content view and positioned at right. Now depending on the number of buttons provided each button's height is adjusted accordingly. And delegates are provided for button clicks.
Swipe gestures are added. On swiping left it will animate and shift the cell's content view to reveal the button view. On swiping right it will reset the cell to original position.
You can customise it from here onwards as you wish :)
I have uploaded them over here : https://github.com/srikanth-vm/GSSwipeableCell

How do I fix empty 44px space in iOS7 view with ViewDeckController?

I am in the process of transitioning an app to iOS7. All of the views throughout the app have a 44px empty space at the bottom that appears to be for a bottom toolbar or something, but I am not trying to display a bottom toolbar. This space also exists on views that do have a bottom toolbar and the toolbar just shows directly above it.
The red space shown is actually a view behind the black view. No matter what size I set the frame of the black view to, the red space is always shown. I am also hiding the status bar in plist, so don't know if this is an artifact from that or if it has something to do with navigation bar as they are both normally 44px in height.
I have looked at the transitioning guide and haven't found anything that's worked. Any ideas to what could be causing this and how to fix?
UPDATE:
I have tried setting edgesForExtendedLayout = UIRectEdgeAll and extendedLayoutIncludesOpaqueBars = YES (also tried NO) with no effect. When I look at the subviews of the navigation controller it shows a UIToolBar as hidden, but shows it contains a frame in the exact area the view refuses to resize to even with autolayout constraints.
UPDATE 2:
This is actually a problem with ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets it's center view bounds.
I believe it has to do with the UINavigationBar. Try toggling the following options in Storyboard and see if it solves the problem. Namely, the 'Extend Edges' options:
These options can also be set in code with the edgesForExtendedLayout and extendedLayoutIncludesOpaqueBars properties on UIViewController.
If you are transitioning to iOS 7, you should be using an Auto Layout constraint to anchor to the Bottom Layout guide. Control drag from your view to the Bottom Layout guide and choose Vertical Space from the popup menu.
Using frames in iOS 7 is harder and is the way of the past.
Auto Layout is hard to grasp at first, but it is very powerful once you get the feel.
This is actually a problem with third party library ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets centerViewBounds for IIViewDeckControllerIntegrated. I was able to figure it out after changing to IIViewDeckControllerContained and seeing the view sized correctly.
In IIViewDeckController.m, just return self.referenceBounds for iOS7 like it does for IIViewDeckControllerContained.

Can't seem to achieve the same effect on my slide menu as Any.Do

I am trying to create the same type of slide-up/pull-up menu (from the bottom) as the Any.do iPhone app, but not having any success.
The issue I am running into is the app was built with storyboards so I am thinking I might have to scratch that idea and use just code.
Any ideas?
There is no need to get rid of your storyboard to recreate this, that's what IBOutlets are for. Any way, it looks like this was made by creating a UIScrollView that takes up the entire screen. Then add a UITableView to the upper section of the scroll view. Mind you in order for this to work, you'll need to disable scrolling on the scroll view in the background.
From there you can programmatically add the other elements to the scroll view to be rendered off screen, since there are only three they can probably just be buttons. And finally, since scrolling is disabled on the background scroll view you can add an image with a UISwipeGestureRecognizer at the bottom of the screen to manually change the scroll view's content offset property.

Putting a toolbar directly under a navigation controller without hiding the content underneath the toolbar

I am trying to put a toolbar directly beneath a navigation bar but I need the toolbar to not hide the content from the view directly beneath it. My quick solution was to set the navigation controller's native toolbar to visible, which works and properly resizes the view beneath it so that it doesn't let anything hide behind it, BUT the default toolbar shows at the bottom of the screen.
I need it to be at the top, just under the nav bar. I figure the easy solution would be to change the frame of the default toolbar (which I don't know how to do) OR to position a new instance of the toolbar onto the view (which works but it hides the content beneath it) but have it resize the views below.
Please see the following image that I found to see what I'm trying to do. (note how the tableview's first row starts UNDER the tab bar)
Thanks!!!
You are confusing two things. The NavigationController toolbar property IS the bottom bar, any toolbar that you add to a view has nothing to do with the nav controller but is a property of that view.
If you have your own toolbar at the top of a view you need to move the rest of the view content down or set that toolbar to translucent if thats what your looking for.
Again the nav controller toolbar is always the bottom bar, the toolbar you drop in IB is just a toolbar for that view that you can put anywhere.
I don't believe you can change the frame of the default toolbar. You will need to create your own instance of a toolbar, position it at the bottom of the navigation bar and resize your tableView to fit below.
We can't see how you have your views set up but if you are starting with a view that is subclassed as UITableViewController you will have trouble doing that. What you want is to start with a UIViewController as your master controller, add a tableview and toolbar as subviews. Then position and size them as appropriate.
If you are hiding and showing the toolbar you will create a method to move it up under the navigation controller and again resize the tableview.