Closed jsedlacek closed 8 years ago
1.In view controller that SatisMeterview is shown we need to implement delegate service
#import <SatisMeter/SatisMeter.h>
@interface ViewController ()<SatisMeterCoreDelegate>
-(void)SatisMeterViewDidShow{
NSLog(@"%s",__func__);
//do whatever
}
-(void)SatisMeterViewDidDismiss{
NSLog(@"%s",__func__);
//do whatever
}
@esatp thanks for clarification. closing.
@jsedlacek are these working in the latest version 0.2.12
? And if so, could it be possible to add an example? Thanks!
@JaviLorbada let me check with the dev team, and get back to you.
Meanwhile, could you please let me know how you'd like to use these delegates?
Thanks
Meanwhile, could you please let me know how you'd like to use these delegates?
I would like to know when the SatisMeterView is shown by using SatisMeterViewDidShow
so that I can bring that view to the superview in the hierarchy.
Hi @JaviLorbada I have attached an example of how I use delegates
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let traitsDictionary = [
"name" : "James Bond",
"plan" : "Gold",
"createdAt" : "2015-11-01T00:00:00.000Z"
]
SatisMeter.sharedInstance()?.delegate = self
SatisMeter.sharedInstance().identifyUser(withUserId: "1", writeKey: "key", andTraitsDictionary: traitsDictionary)
}
}
extension ViewController: SatisMeterCoreDelegate {
func satisMeterViewDidShow() {
print("satisMeterViewDidShow")
}
func satisMeterViewDidDismiss() {
print("satisMeterViewDidDismiss")
}
}
Let's remove them from public API.