Can't get it working in my app - no errors, just no modal display either
jakeatwork opened this issue · comments
Jake Levine commented
Ran the pod install and it's in my project fine, but with this block of code on a button and the import FlourishUI
, nothing is happening. I do register a button click on print, but this is very basic setup...
@IBAction func showModalButtonTapped(sender: UIButton) {
print("This button actually works")
let title = "TESTING PLEASE"
let body = "This is the body copy."
Modal(title: title, body: body, status: .Success).show()
}
Any ideas? There are no errors, just no modal displaying. Am I missing something?
Thanks.
Clayton (McIlrath) Unicorn commented
That all looks fine. My only hunch is that it's an issue with how you're calling the View Controller. Are you using a segue or display modally?
Here's my own implementation in a working product. Also triggered from an IBAction and it works correctly.
@IBAction func saveForm(sender: AnyObject)
{
// Save the entry to the local database
let entry = RemoteEntry(title: titleInput.text!, body: bodyInput.text, mood: feelingButton.tag)
entry.create() { success, message, error in
// Reset and clear the form if it saved
if success
{
Modal(title: "Saved Entry", body: "Your entry has been saved to iCloud", status: .Success).show()
self.resetTitle()
self.feelingButton.setTitle("select", forState: .Normal)
self.feelingButton.setTitleColor(AppHelper.colors.cta, forState: .Normal)
self.bodyInput.text = nil
self.hideKeyboard()
}
else
{
Modal(title: "iCloud Error", body: message, status: .Error).show()
}
}
}