Closed ZebedeeTR closed 5 years ago
Not sure, but here's a sample project that you can use for reference:
My initial guess is that your view controller's Auto Layout constraints are doing something weird, maybe resulting in zero height.
The SwiftMessages view hierarchy is MaskingView > BaseView > CornerRoundingView > Your View
. I suggest that you inspect the view hierarchy to see if "Your View" is there. If it isn't, there may be a SwiftMessages problem. Another quick way to see if your view is there is to set destinationVC.preferredContentSize = CGSize(width: 0, height: 400)
, which adds an explicit 400pt height constraint to your view controller.
Let me know what you find.
Hi. Thanks for the help.
I couldn't figure out why my view's height comes from zero. I added the same View to your Test project, but it's okay there. :))
destinationVC.preferredContentSize = CGSize(width: 0, height: 400)
This code solves my problem.
I'm adding my project, if you want to examine it :)
I took a look at your project and there are a couple of things:
You can use preferredContentSize
to specify your height, but in my opinion, it is better if your view controller has sufficient Auto Layout constraints such that it has an intrinsic height.
Thanks for additional info.
Best regards.
Hello there, I am creating the destinationView from the xib file. I couldn't run SwiftMessagesSegue with programmatically. I didn't find out where I made a mistake.
I create destinationView like this
let destinationVC = AddNewServerVC(nibName: "AddNewServerVC", bundle: nil)
Then I try to show it as follows. I see only shadow.
let segue = VeryNiceSegue(identifier: nil, source: self, destination: destinationVC) segue.perform()
When I write this way, the view is displayed smoothly.
destinationVC.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext destinationVC.modalTransitionStyle = UIModalTransitionStyle.crossDissolve self.present(destinationVC, animated: true, completion: nil)
The VeryNiceSegue class is defined as in your instance.
What am I missing?