In this post, we will see how to resolve Swift – Function needs to be executed twice before singleton property changes Question: I have a Singleton class AuthManager that is used to manage AWS Amplify authentication in an app I’m ...

In this post, we will see how to resolve iOS 16: title of UINavigationBar disappears Question: In my app, I used UIViewController as a bottom sheet. BottomSheet consists of NavigationBar(title and close button) and ScrollView(for contentView). Until iOS 16, I ...

Question: I have a tab bar application, with many views. Is there a way to know if a particular UIViewController is currently visible from within the UIViewController? (looking for a property) Best Answer: The view’s window property is non-nil if ...

Question: I’m new to iOS and Objective-C and the whole MVC paradigm and I’m stuck with the following: I have a view that acts as a data entry form and I want to give the user the option to select ...

Question: I have a view controller that manages my entire view. Inside this view, I would like to create another four views which each have some button selector functions. I was wondering if it would be possible/smart for me to ...

Question: I’d like to ask about naming the Swift extension function. I have an extension file for a UIViewController and created a function called showAlert in the file. I thought the name showAlert might (or might not) be used as ...

Question: I have a BaseViewController connected to it’s .xib and want to subclass it with SubViewController in my storyboard to add more views. I already have do similar setup with UIView but it doesn’t work for UIViewcontroller. With no particular ...

Question: I am working on an app that has users drag objects to target locations. Everything thus far is programmatically created, aka no storyboard. My issue is that for the draggable objects, the colored circles on the right, when dragged ...

Question: import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { // var array = self.generateRandomNumbers(size: 1000) // lazy var array = generateRandomNumbers(size: 1000) // print(array) } Answer: Well, the basic answer is the concept of understanding. var array = generateRandomNumbers(size: 1000) ...