dialogView.layer.cornerRadius

Hi all,
I’m in the quiz app and for whatever the animation on my dialogView just stopped working. I ran it in debug and it calls the method and parses the code, but the image still has square corners, not rounded. Any suggestions? Below is the code for that area in ResultViewController.swift

//
// ResultViewController.swift
// QuizApp
//
// Created by Mike Nelson on 1/17/20.
// Copyright © 2020 CIC Solutions. All rights reserved.
//

import UIKit

protocol ResultViewControllerProtocol {
func dialogDismissed()
}

class ResultViewController: UIViewController {

@IBOutlet weak var dimView: UIView!

@IBOutlet weak var dialogView: UIView!

@IBOutlet weak var titleLabel: UILabel!

@IBOutlet weak var feedbackLabel: UILabel!

@IBOutlet weak var dismissButton: UIButton!

var titleText = ""
var feedbackText = ""
var buttonText = ""

var delegate:ResultViewControllerProtocol?

override func viewDidLoad() {
    super.viewDidLoad()
    
    // Round the dialog box corners

    dialogView.layer.cornerRadius = 20

}
override func viewWillAppear(_ animated: Bool) {
    
    // Now that the elements have loaded set the text
    titleLabel.text = titleText
    feedbackLabel.text = feedbackText
    dismissButton.setTitle(buttonText, for: .normal)
    
    // Hide the ui elements
    dimView.alpha = 0
    titleLabel.alpha = 0
    feedbackLabel.alpha = 0
    
}

Make sure your IBOutlet is still connected.

You could delete the connection and reconnect it if needed.

Are you actually setting it in storyboard differently than the code?

1 Like

Thank you! for whatever reason the IBOutlet was no longer connected.

1 Like