Swift: Getting 'Snapshotting a view that has not been rendered..' error when trying to open a URL in safari from my app

前端 未结 8 1690
一整个雨季
一整个雨季 2020-12-28 12:48

One of the specifications of my app is that on tapping a tableView cell, the user will be redirected to the website associated with the cell. Here is the code:



        
8条回答
  •  没有蜡笔的小新
    2020-12-28 13:09

    Also using Objective-C, using the suggested [modeAlert.view layoutIfNeeded] reduced errors to one as above. Final error has been suppressed by changing last addAction from UIAlertActionStyleCancel to UIAlertActionStyleDefault as below. Not a great workaround to what appears to be a bug.

    [modeAlert addAction:[UIAlertAction
                      actionWithTitle:NSLocalizedString(@"Cancel", @"")
                      style:UIAlertActionStyleDefault
                      handler:nil ]];
    

提交回复
热议问题