Custom Alert (UIAlertView) with swift

前端 未结 5 1752
轻奢々
轻奢々 2020-11-28 09:16

How can i create a custom alert with Swift? I try translating a guide from Objective c but loads a full screen layout

for do it easy i can load a new layout with the

5条回答
  •  無奈伤痛
    2020-11-28 09:57

    Use https://github.com/shantaramk/Custom-Alert-View

    It is effortless to implement this. Follow the steps below:

    1. Drag down the AlertView folder in project directory

    2. Show AlertView Popup

    func showUpdateProfilePopup(_ message: String) {
        let alertView = AlertView(title: AlertMessage.success, message: message, okButtonText: LocalizedStrings.okay, cancelButtonText: "") { (_, button) in
                if button == .other {
                    self.navigationController?.popViewController(animated: true)
            }
        }
        alertView.show(animated: true)
    }
    
    
    

提交回复
热议问题