添加自定义图标SCAlertView

时间:2017-10-26 09:56:47

标签: ios iphone swift

我想在项目中使用自定义图标创建SCAlert。我搜索了Github页面并写下了该页面告诉我的内容。

let appearance = SCLAlertView.SCLAppearance(
    showCircularIcon: true
)
let alertView = SCLAlertView(appearance: appearance)
let alertViewIcon = UIImage(named: "IconImage") //Replace the IconImage text with the image name
alertView.showInfo("Custom icon", subTitle: "This is a nice alert with a custom icon you choose", circleIconImage: alertViewIcon)

我还导入了SCLAlertView。但是,当我这样做时,我会遇到很多错误,例如:

Expected declaration

Cannot use instance member 'appearance' within property initializer; property initializers run before 'self' is available

0 个答案:

没有答案