How to resize UITabBarController content view in iOS7? - uitabbarcontroller

Has anyone been able to resize the content view for an iOS 7 UITabBarController? In previous versions it consisted of two views. A UITabBar and a UITransitionView. The transition view was the content view. However as of iOS 7 SDK the UITransitionView is fullscreen and setting its size does nothing.
I need to resize the content view as I want to display an ad above the UITabBar.

I managed to reach the actual content view on iOS 7 (inside the UIViewControllerWrapper) via this
UIView *viewToResize = [[transitionView.subviews[0] subviews] objectAtIndex:0];
WHen you then resize that view, you should obtain the same effect as resizing the UITransitionView.

Related

dynamically update color scheme of many available + refresh views in swiftui

How can I refresh a SwiftUI View dynamically while showing the user a list of color schemes to choose from? eg the user sees a list with 5 different themes each with its own button+UILabel, then presses one of them and the View refreshes with the UI elements refreshing to using that color scheme selected.
How can I force the View to redraw using the new color scheme?
Is there a way to define such Color scheme via an extension to swiftUI Color, so that I can continue to use eg a .foregroundColor(Color.primary) and yet the color actually used, to be in the dynamically chosen current theme, ie. use the Color.primary for the currently selected theme?
Thank you

SwiftUI small widget is not opening the iOS app on tap

In my widget, I place a header view.
var header: some View {
ZStack {
Link(destination: url) {
Rectangle().fill(Color("WidgetBackground")).frame(height: 36)
Text("Header")
}
}
}
This is a simple text on a colored background.
The url is the urlscheme for my app.
When I tap on the label or on header view, it opens my app on medium and large size widgets.
But on the small size widgets, it didnt open the app, but it flickers and reload the widget.
I also see the flicker happen in medium and large size widgets when I tap on empty spaces other than elements.
I have no clue , why this flicker happens.
Based on documentation, interacting on widget should open the app, without any extra effort.
Am I missing something ?
I don’t know why the app doesn’t open (an iOS bug, I guess), but your deeplink won’t work because Link isn’t available in the “small” widget size. You need to set the .widgetURL() modifier on your view instead.

UIViewRepresentable not sizing correctly in ScrollView

I followed Apple's guide on using UIPageViewController with SwiftUI. Their guide works fine. However I ran into an issue, where if I have my PageView inside a ScrollView - the height of the PageView is no longer respected and I have to set the frame manually. Not ideal, as the content inside PageView is dynamic and thus, heights will vary.
This seems to be an issue with ScrollView; as I have another view - UIViewRepresentable - that is a simple wrapper around WKWebView - with the same issue.
Is there a way to have these views size themselves, inside a SwiftUI ScrollView?
If I place these views outside of a ScrollView and into a simple VStack for example, they size themselves correctly.

How to adjust UIView height according to the Collection View Content Height in swift 3?

I have a problem of adjusting the UIView height in my project. I illustrated the project.
Let me explain about my project image.Each Orange UIView has trailing, leading , top and bottom constraints and vertical spacing to each UIView. But, I add "Height" to each UIView because if I don't add, it gives error and add the "Height" warning.
In UIView2, I add 3 Container Views. Each Container Views has 3 View Controllers. (Data 1 View, Data 2 View, Data 3 View)
I embed Collection View inside in each views.
The problem is that in Data 3 View has many collection View cell data. So, the height of Orange UIView should be increase according to the collection view content.
Currently, I just add fixed height constant (height:800) if users click on the Data 3 segmented control button. But, I don't want to set fixed height like this.
I've been trying to solve this problem since last week. I could not solve this till now.
Can anyone help me explain in step by step please? Because I have no idea of what should I do.
Since UITableView or UICollectionView inherit from UIScrollView they basically do not have an intrinsicContentSize.
You have two ways to make the same height as the content size (the space that you can scroll):
You can subclass the collection view and override intrinsicContentSize method to return the contentSize and the sizeThatFits: method as well
Create a height constraint in the interface and set it as equal to the content size of the collection view.

when I Using Three20 to Launch another UITabBarController in a TTLauncherView ,Original UITabBarController Tabbar Can't disappear

when I launch another UITabBarController in a LaunchView, the TTLauncherView is in the page in the original UITabBarController, the Dest Controller is another UITabBarController, but the Original UITabBarController's TabBar can't disappear.
So, in the UI, I have two TabBars, the Original TabBar in the Bottom, the second Dest Controller View display in the screen except the bottom tabbar.
This is not what I want. How to solve this problem to hide the Original TabBar and let the second Dest Controller to display Full Screen?
In the first Controller, I launch second controller by LauncherView button.
You need to hide the tab bar view when pushing the new controller using
controller.hidesBottomBarWhenPushed = YES;
Take a look on this tutorial from three20 wiki, it explains on how to hide the tab bar when pushing another controller.
http://three20.info/article/2010-11-10-Hiding-The-iphone-Tab-Bar-With-TTNavigator