Questions tagged [viewcontroller]

viewcontroller is a design pattern which is a hybrid of the view and controller components of the MVC architecture

A viewcontroller responds to events by dispatching calls to a mapping table which matches views and controllers with each event target. It is implemented as an object in many frameworks, including:

2792 questions
3
votes
1 answer

Array of UIHostingController supporting different SwiftUI View types

I'm following https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit and I'm trying to append my page views to an array of UIHostingControllers and while everything works when I do: PageView(pages: [Text("hi"), Text("hello!")]) I get…
Iqbal W
  • 33
  • 4
3
votes
0 answers

How to make viewController ignore server.servlet.context-path

I have the following configuration for serving static content from Spring Boot. @Configuration public class WebConfig implements WebMvcConfigurer { @Value("${frontend.location}") private String frontendLocation; …
kswr
  • 57
  • 8
3
votes
3 answers

Table header view from .xib

I have a table in which I need to add a title view. I made it in an xib file to configure as I need, but I have problems connecting this view. Tell me what I'm doing wrong! class HeaderTableView: UITableViewHeaderFooterView { //I think in this class…
JiosDev
  • 324
  • 3
  • 11
3
votes
0 answers

Getting black screen animation when root controller change in iOS 13 and Xcode 11

I am changing rootviewcontroller of my uiwindow using below code. let tabbarVc: EPTabbarViewControllers = storyBoardIdentifiers.main.instantiateViewController(withIdentifier: "EPTabbarViewControllers") as! EPTabbarViewControllers let navControl =…
Drashti Javiya
  • 519
  • 1
  • 3
  • 14
3
votes
2 answers

how to present view controller from appdelegate or scenedelegate in swift5?

how to present view controller from appdelegate or scenedelegate in swift5 ? i tried this but didnt work : self.window = UIWindow(frame: UIScreen.main.bounds) let storyboard = UIStoryboard(name: "Main", bundle: nil) …
alina
  • 107
  • 8
3
votes
1 answer

How to use new Scene Delegate in Xcode

I'm trying to change a Label's text or show an alert when my iOS app becomes active from the background state. When I call a function in the ViewController class only the print() method works fine. But when I want to interact with the objects in…
anixrud
  • 184
  • 3
  • 11
3
votes
2 answers

Close a viewcontroller after a segue

What I want is to close a viewController after performing a segue so that the back button of the navigation controller on the new view doesn't go back to the view that I just closed, but it goes to the view that precedes it in the storyboard like it…
Poli97
  • 305
  • 4
  • 18
3
votes
1 answer

Passing Data Between View Controllers in Swift 4

I've got a login page on the main View Controller which passes a "verified" string to EslViewController, this, I can get to work, but it's now when I want to pass this "verified" to IP_ModuleViewController that I'm having issues with... the code at…
Taylor Styles
  • 139
  • 1
  • 13
3
votes
2 answers

Programmatically Pushing a ViewController

I'm trying to push a ViewController programmatically. Code: var plus = UIButton() plus.addTarget(self, action: #selector(plusPressed), for: .touchUpInside) @objc func plusPressed() { print("plus") let createJournalVC =…
Cal
  • 422
  • 6
  • 20
3
votes
1 answer

Make presented view controller to ignore and pass through touch events

edit: I want to make this view independent to be reusable. The question explains itself. I have searched, but didn't find any answers, even if the question seems to be common. I have two view controllers VC1 and VC2. My code is like:…
えるまる
  • 2,409
  • 3
  • 24
  • 44
3
votes
1 answer

ViewController Storyboard ID from a variable

How can I set in the Storyboard a ViewController Storyboard ID from a variable in a struct swift file? I don't want to write down the Storyboard ID of a VC from the Identity Inspector > Identity > StoryboardID hardcoded. I want it to be in a…
denis_lor
  • 6,212
  • 4
  • 31
  • 55
3
votes
0 answers

How to "preload" view controller without actually pushing it?

Background: I've got a free app that is ad-supported. The basic idea is that when the app is launched, ad content (HTML) is downloaded from the server in the background, and only if the download was successful, then the content is being…
Matthew Clark
  • 1,885
  • 21
  • 32
3
votes
1 answer

How much time an iOS app is guaranteed to stay in the background without being removed from the memory?

I have a Swift iOS app consisting of 3 view controllers – the initial one with a tableview, the second one with the chosen element and ability to create a new time session and the third one with the actual timer for the session (let’s call it the…
Andrei
  • 71
  • 1
  • 6
3
votes
1 answer

Files App View Controller?

In Pages, Numbers, and Keynote 3.3 for iOS, Apple has done away with its custom file manager and instead uses the a version of the iOS 11 Files App to allow the user to choose and save files within the applications, The Files-like document picker…
Jake Chasan
  • 6,290
  • 9
  • 44
  • 90
3
votes
6 answers

Dismiss second ViewController from the third ViewController

I am trying to dismiss VC b from VC c where VC c is a popover and has a button for sign out but it is not working. The structure of the flow is VC a ----presents modally----> VC b ----presents a popover----> VC c When the button in the popover is…