ios - How to hide admob adverts using Swift? -
i adding in-app purchase game built on swift. not know objc much allow lone swift, learning experience me. have added in app purchases , adverts, trying confirm purchase, , remove admob ads.
here current view controller: http://pastebin.com/t5kvvn6h
i trying utilize check if purchase complete:
if nsuserdefaults.standarduserdefaults().boolforkey("noads") { }
what wondering is, set in viewdidload
, right? ok, part need help with, set within hide ads. read can use:
admobbannerview.removefromsuperview()
have on thought how work in syntax or how create instances. help appreciated!
// remove ads if nsuserdefaults.standarduserdefaults().boolforkey("noads") { adbannerview().removefromsuperview() gadbannerview().removefromsuperview() admobbannerview.removefromsuperview() <--- gives me error: utilize of unresolved identifer admobbannerview }
admobbannerview beingness referenced in viewcontroller. newb.
looking @ code, admobbannerview exists within createbanner func. if trying reference anywhere else in code, such within viewdidload, not going work - unless create instance variable, _iadview , others.
ios objective-c swift
No comments:
Post a Comment