How to call initWith… in swift

后端 未结 4 722
忘掉有多难
忘掉有多难 2021-01-25 07:52

I have a an objective-c class (RDAlertView) which create an Alert (UIAlertView for ios < 8 and UIAlertController for ios >=8 )

Here is the code in Object

4条回答
  •  北海茫月
    2021-01-25 08:24

    These methods are treated like constructors. You can call them like this:

    var alert = RDAlertView("notification", message:"message", completion:nil, cancelButtonTitle:"Cancel", otherButtonTitles:nil)
    alert.show()
    

    Caveat: written without an IDE, careful of syntax errors / typos

提交回复
热议问题