Categories
Mastering Development

How to fix: Application tried to present a nil modal view controller on target

A newbie here looking for HELP! I’ve been trying to fix this for 2 weeks now. I tried using the simulator and real phone, I still get the same error. ERROR: Thread 1: Exception: Application tried to present a nil modal view controller on target Here’s the complete ViewController. Please see the codes below. import […]

Categories
Mastering Development

Function Calls Between GameScene and GameViewController using SKSprit

So I writing a program in swift, and am having trouble understanding the proper communication between GameScene and GameViewController: Basically I have ‘savefiles’ which are plists, when loaded using a function "self.loadFromPlist(fileName: )" are loaded by clearing the previous array of nodes, and drawings a set of SKShapeNodes based on attributes from the dictionary elements […]

Categories
Mastering Development

modalPresentationStyle not updating the data

The below code can show the ratings screen using modal or i can push it. if i use modal i can see the animation effect and not in pushed controller method, the animation are defined in a view class separately, but in case of pushed i can see the ratings gets updated instantly but not […]

Categories
Mastering Development

Present view controller and allow user to swipe back

Currently, I’m presenting a new view controller like this: let mainStoryboard = UIStoryboard(name: "Main", bundle: Bundle.main) if let viewController = mainStoryboard.instantiateViewController(withIdentifier: "MyViewController") as? MyViewController { // Present fullscreen viewController.modalPresentationStyle = .fullScreen self.present(viewController, animated: true, completion: nil) } However, this doesn’t let me swipe from the left to go back to the previous controller. How can […]

Categories
Mastering Development

Unable to Change UILabel.text from another View Controller, UILabel gets nil value

I’m a newbie programmer and trying to create a Single View weather application. My goal is editing dateLbl1 created in WeeklyWeatherViewController from HomeViewController. I wrote my code like this : let WeeklyWeatherView = WeeklyWeatherViewController() … WeeklyWeatherView.dateLbl1.text = nextDayShort[0].uppercased() But the label gets "nil" value. Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value […]

Categories
Mastering Development

Cannot figure out why URL value is nil when trying to download image to Firebase

I am creating a basic profile function on my application that works with Firebase. I had no issues until I began to attempt adding an image function to my profile. Essentially, on the sign-up screen I want my users to be able to upload an image to be used as their profile picture. On the […]

Categories
Mastering Development

Can not show the image after edited in Image View in Xcode 10.2

when I try to show an image after edited (crop) to Image View, I get the error: errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 “query cancelled” UserInfo={NSLocalizedDescription=query cancelled} How can I solve it? Thank you. This is my code import UIKit import CoreImage import CoreGraphics class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { @IBOutlet weak var […]

Categories
Mastering Development

Grabbing result from a picker view for use in other view controller

Hello fellow programmers, I am having some trouble figuring out passing data between view controllers. my initial view controller(SelectCarViewController) consists of two pickers(year and make/model) I have a Label that displays the year once selected and a label that displays the make/model once selected. Once the two are filled in an invisible button(search parts) will […]

Categories
Mastering Development

Constraining UITableViewCell to right edge of UITableView

For some reason, when I try to put the shadows on my Cell using the following, it isn’t going the full width of the cell: cell.layer.shadowPath = UIBezierPath(roundedRect:cell.bounds, cornerRadius:cell.contentView.layer.cornerRadius).cgPath Does anyone know how to fix this? Granted, my ending intention is to give it spacing on both the left and right sides, but I feel […]

Categories
Mastering Development

Shared text iPhone and iPad

I need to share text on iphone and ipad, my code works for iphone but does not work for ipad. I am using a static function to call from trailingSwipeActionsConfigurationForRowAt options of my tableView static func dialogCompartir(titulo: String, descripcion: String, view: UIViewController, url: String) -> Void { // Set the link to share. if let […]