我想在项目中使用自定义图标创建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