Questions tagged [uiviewcontroller]
The UIViewController class manages the views in iOS apps and mediates the interaction between an app's views, its underlying model objects, and the overall workflow.
16,208
questions
0
votes
1
answer
27
views
Present a UIViewController with active background
There is a view controller (B), which presents as a half-screen modal with a custom presentation style and animation. I present this on a button tap on the main view controller (A), and dismiss with a ...
0
votes
0
answers
31
views
how to solve the problem of overlapping views?
In my application there is a function showing animation:
func showAnimation() {
let animatedViewController = AnimationViewController(name: "")
animatedViewController....
0
votes
1
answer
28
views
Update Label Text with Timer Values
I know there are a lot of answers out there about similar issues, but it seems all of them are don't fit to my problem. And I am new to Swift and my head is burning about all this stuff.
The task is ...
0
votes
0
answers
17
views
Segue from ViewController to TabBarController
I am a newbie to Swift and I try to perform the simplest task to imagine: Establish a segue from normal ViewController to TabBarController.
I've already given the segue an Identifier ( "intoGame&...
0
votes
1
answer
14
views
Card Slide Gallery in UIViewController
Is there a way to implement a card sliding gallery in a UIViewController? The gallery is not supposed to have images but buttons. I'm thinking the app "Bumble" for example when it comes to ...
0
votes
0
answers
26
views
UIPresentationController multiple sizes or detents
I am working on trying to implement a presentation controller that essentially mimics the behavior of the UISheetPresentationController. I am doing this because I want to add a third detent and also I ...
0
votes
0
answers
24
views
How to set the image for a button located within a UICollectionView's Cell which is triple embedded?
I am on the main view controller which is one of five, embedded in a UITabBarController.
In the main view controller there is a table view with several rows, each of the rows has a view controller ...
0
votes
1
answer
32
views
How to modally present a ViewController from SceneDelegate?
I have an OnboardingViewController which available to access from app's settings in a modal style.
When a user opens the app first time I want to show him the OnboardingVC in the same modal style (...
0
votes
1
answer
30
views
Initialize viewControllers from its types
I have a list of view controller types. I want to initialize the corresponding types out of it.
struct TabbedViewControllers {
static var viewControllers: [UIViewController.Type] {
return [...
2
votes
1
answer
32
views
`isMovingToParentViewController`/`isMovingToParent` incorrectly true
In my view controller, I am checking for isMovingToParent inside viewWillAppear so that I can execute some logic only when the view controller is first displayed and not when a later view controller ...
1
vote
2
answers
26
views
NSUnknownKeyException for a UIButton. Correctly added referencing outlets and corresponding function
I am facing an NSUnknownKeyException for a back button present on a Storyboard, i.e. FastGazeExtension. I have correctly connected the back button to the UIButton outlet property in the controller, i....
0
votes
1
answer
26
views
bg color of view controller status bar area in UIViewControllerRepresentable
I am using a UIViewControllerRepresentable for a view controller that can accomplish things I can't do in SwiftUI. I am trying to get the status bar area appear the same color as the dark blue, but it ...
0
votes
0
answers
10
views
UINavigationBar overlaps with status bar after presented VC with prefersStatusBarHidden as true
Presenting a VC(1) on Root VC(0) with prefersStatusBarHidden as true.
After that dismissing the presented vc(1) and pushing another vc on root vc(2) with prefersStatusBarHidden as false. ...
0
votes
0
answers
29
views
PresentViewController show sometime black screen
When I do :
ImagePicker = UIImagePickerController.Create;
ImagePicker.setModalPresentationStyle(UIModalPresentationCurrentContext);
SharedApplication.keyWindow.rootViewController.presentViewController(...
0
votes
0
answers
24
views
How to dismiss or remove SKScene after transitioning to a UIViewController
In my game when the player dies they transition to a Game Over screen which is a SKScene. Here the player can restart the level(works fine as its just a transition back to the GameScene) and I also ...
0
votes
0
answers
32
views
How to make UISheetPresentationController prefersGrabberVisible follow light/dark mode?
In setting UISheetPresentationController's prefersGrabberVisible to true, our app successfully displays the grabber handle at the top of modal view controllers.
However, the grabber is always in the ...
-1
votes
0
answers
21
views
How to set default modalPresentationStyle for all ViewController in app. Or set default value for custom from xib
I want to create customAlertController. But how can I set default presentation style in class in order not to always change it when create controller
0
votes
1
answer
20
views
Changing UINavigationController Frame in Swift
How can I change the frame of a UINavigationController? I am trying to build a view to verify a users phone number, and want to present it as a pop up view (not full sheet) and also be able to push ...
0
votes
0
answers
27
views
UIPresentationController with interactive presenting view
I looked at this question, but it does not help: Interacting with presenting view and UIPresentationController
I am trying to implement a sheet presentation controller, similar to the ...
0
votes
2
answers
37
views
Missing transition from first view controller to second view controller using navigation controller
I want to create a navigation hierarchy where I want to go to a SecondViewController from FirstViewController using a NavigationController. The FirstViewController contains a button B that I intend to ...
0
votes
0
answers
25
views
iOS: How to remove UIViewController shadow changes as another UIViewController is being pushed/popped
I have two UIViewController objects with a white background color. When I push page A over page B through a UINavigationController, I notice that iOS is adding a shadow on page B during page ...
0
votes
1
answer
23
views
Navigation to ViewController via Push Segue opens screen then immediately closes it
I have a SearchViewController that contains a UITableView that presents articles.
When pressing on an article, a navigation with segue command is called and the user is moved to the ...
0
votes
0
answers
46
views
Prevent presenting view controller from changing size in background
The current default behavior on presenting view controller modally is that the presenting view controller decreases size in background which shows the application window behind it with default window ...
0
votes
0
answers
41
views
Crashlytics : Fatal Exception: NSInternalInconsistencyException
I got an error in Crashlytics. The message is about fatal exception inconsistency.
Fatal Exception: NSInternalInconsistencyException
Modifications to the layout engine must not be performed from a ...
1
vote
1
answer
66
views
How to refresh ViewController?
Swift noob here. I have a simple app that has a main page which is a ViewController, relevant code below:
import SwiftUI
class GameViewController: UIViewController {
...
func ...
0
votes
2
answers
49
views
How to push UIViewController overCurrentContext using UINavigationController
I have a UIViewController that contains a UITabBar. I want to push a new UIViewController that covers the current context (so during the animation it shows the new UIViewController covering the ...
0
votes
0
answers
31
views
Custom view in place of the scope bar below a search bar
For example, in the system Mail app, when the user taps on the search bar, a scope bar appears beneath it.
As I want to provide more search options, may I know how I can have two scope bars, one on ...
1
vote
0
answers
57
views
Ignore Bottom safe area in UIViewController presented from SwiftUI
I have a UIViewController that I am presenting from a SwiftUI view, previously when presenting from UIKit, I wasn't having this issue. The content at the bottom is being cut off for some reason, how ...
0
votes
0
answers
17
views
UIViewController gets initialized twice with SwiftUI as rootController
When initializing rootController through SwiftUI it initializes the view twice
let swiftUIView = CustomViewController().environmentObject(webServiceController)
let ...
0
votes
1
answer
30
views
Swift: Update Layout and Content of ViewController when dismissing presented ViewController
I have a UIView which displays some information such as a user's Name and more, including a list of objects that all get pulled from my database. This works fine.
However, I now have a ViewController ...
-2
votes
1
answer
31
views
Converting prototype cells in a storyboard to .xib
I have a prototype cell in a Storyboard. Is there any quick and easy method for me to extract that to its own .xib file so that I do not need to create .xib from scratch? Thanks.
0
votes
1
answer
32
views
How to enable SideMenu to work with ViewController functions | Swift/Xcode
I'm using a pod called "SideMenu" which creates a menu using a tableView. The menu is embedded in my ViewController, but it doesn't have access to the ViewController's functions. When I tap ...
0
votes
0
answers
9
views
Call snapshotViewAfterScreenUpdates from viewDidLoad will block viewDidAppear called
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
UIView* view = [self.view snapshotViewAfterScreenUpdates:YES];
NSLog(@"%@",view);
}
- (void)...
0
votes
1
answer
36
views
Event called in UIViewController when return from a dialog?
Does exist an event in UIViewController called when you return from a dialog?
I'm asking for notification permission doing this:
let center = UNUserNotificationCenter.current()
center....
-1
votes
1
answer
40
views
How to modally present a navigation controller in Swift?
I am trying to present a navigation controller modally,the thing is my navigation bar is not showing any baritems... any ideas? This is my code. If I add a backgroud color to the navigation bar it ...
0
votes
0
answers
25
views
IB Outlet is Nil in some situation only. SWIFT - iOS [duplicate]
i have pop up viewController which has a textField, label and button to get input from user at requited time presented using ModelPresentation and capturing values using closures.
it works fine in ...
0
votes
0
answers
29
views
UIScrollView for ViewController horizontally and vertically
My code tutorial works for scrolling horizontally with ScrollView.
I would like to make it with ViewControllers (instead of views) from my Storyboard.
And I would like to add a vertical ScrollView (To ...
0
votes
1
answer
33
views
Container view width decreases after adding safe area constraints
I have a ViewController and a container view testcontrollerViewController inside of it. I noticed that after I'm adding constraints to that container view in the storyboard (all the edges match the ...
0
votes
1
answer
26
views
Presenting a ViewController based on previous selected TableView Cell (Programmatically, no Storyboard)
As shown in the image, in the ViewController1 is a UiTableView. Both Cells present a new ViewController which is the same in both cases. ViewController2. The presented ViewController2 now presents two ...
0
votes
1
answer
144
views
UIViewControllerRepresentable instantiates view controllers over and over
I'm new to development on iOS. So, I made a ViewController with Storyboard and am showing it in SwiftUI View on a button click.
Representable:
import UIKit
import SwiftUI
struct StartTraining: ...
0
votes
0
answers
17
views
Swift: NavigationController show nil when open from tapped push notif
At first i try to present viewController and show nothing. Then, i print the navigation controller and return nil. So i expect that's the reason why viewController is not presenting.
This error happen ...
0
votes
0
answers
84
views
Alternate of ViewController in SwiftUI project
What is the counterpart of ViewController class in a project with interface of type SwiftUI?
I am following this documentation to initialize adLoader from Google AdMob in a SwiftUI project. All ...
0
votes
0
answers
34
views
Tab bar and navigation bar color
Since upgrading to Xcode Version 13.2.1 (13C100), I've been having display issues with some of my view controllers. They look to all have the same properties, but some display with the correct colours ...
1
vote
0
answers
433
views
WebKit assertion "Error" after dismissing ViewController
So I have a XIB file with some views and a WKWebView.
This file is linked to a UIViewController class.
Everything works fine, all the functionalities work. However, upon dismissing the ViewController ...
0
votes
2
answers
23
views
how do I get a variable in scoop in swift so I can pass it data?
how do I get my serialnumberLabel in scoop of the itemsviewController when its in a different file and where would I put it because I'm new to swift I know very little please help
1
vote
0
answers
29
views
Swift 5: Unbalanced calls to begin/end appearance transitions for xxViewController when i try dismiss views
i have two errors "Unbalanced calls to begin/end appearance transitions for DonesViewController"(its my last viewcontroller) and the same error fot BottomSheetViewController, when i try to ...
0
votes
0
answers
37
views
Swift/UIKit: Is there any way to present a view outside of the UIViewController/navigationController hierarchy?
I would like to present a custom, banner-style view at the top of my UIKit application that persists for a certain amount of time, and then animates off of the screen. Is there any way to present this ...
0
votes
0
answers
32
views
Inset contents underneath sheet presented with medium detent
iOS 15 added UISheetPresentationController which allows you to implement a half-height sheet by setting sheetPresentationController's detents to [.medium()]. You can then set the ...
0
votes
0
answers
25
views
Swift 5 - Trying to dismiss all viewcontrollers with navigations and modal presents
im trying to dismiss all viewcontrollers after a few seconds.
I found some solutions for this, but doesnt work for me.
I have 6 view controllers, A, B, C are navigations controllers, and D, E , F use ...
0
votes
2
answers
56
views
I am trying to create a custom UITabBar, but there is a memory leak caused when I present one of the tabBar's view controllers
I am trying to create a custom tabBarController, but it seems like there is a memory leak caused by presenting the different view controllers. I can see the memory usage climb when I toggle between ...