Is there currently any API I can use in Swift which will allow me to export my app data to an Excel spreadsheet (.xlsx file)? I've been scouring the Internet and haven't been able to find such an API? Any suggestions for how to go about exporting data to Microsoft Excel?
Post
Replies
Boosts
Views
Activity
Here is my code below. I keep getting the error: "Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior". Everywhere online says this code will work. Thoughts on why it doesn't work? let alert = UIAlertController(title: "Alert: iCloud Disabled", message: "Go into Settings -> iCloud -> iCloud Drive and switch iCloud Drive to On.", preferredStyle: UIAlertControllerStyle.Alert) let OKAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (_)in self.networkAlertDisplayed = true self.performSegueWithIdentifier("unwindToController1", sender: self) }) alert.addAction(OKAction) self.presentViewController(alert, animated: true, completion: nil)What do I need to do to get this code working?
I use a MFMailComposeViewController in my apps to get feedback from customers via email. The problem I'm having is that every single email that I get sent from customers via my app has an empty email body. There is nothing on Stack Overflow or other sites regarding this issue and I can't figure out what the issue is here.
Email Title: App Question
Email Body:
发自我的 iPhone
Code I'm using:
func configuredMailComposeViewController() -> MFMailComposeViewController {
let mailComposerVC = MFMailComposeViewController()
mailComposerVC.mailComposeDelegate = self
var emailAddresses : [String] = []
emailAddresses.append("support@appwebsite.com")
mailComposerVC.setToRecipients(emailAddresses)
mailComposerVC.setSubject("App Question")
return mailComposerVC
}
func showSendMailErrorAlert() {
let sendMailErrorAlert = UIAlertController(title: "Could Not Send Email", message: "Your device could not send e-mail. Please check e-mail configuration and try again.", preferredStyle: UIAlertController.Style.alert)
self.present(sendMailErrorAlert, animated: true, completion: nil)
}
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?)
{
controller.dismiss(animated: true, completion: nil)
}