ios - How to tell if it's your first run? -
i wonder how can check whether it's first run of ios app, in order start specific view. saw many ways objective-c, not how implement in xamarin.
i'm not familiar xamarin, sounds easy checking existence of custom entry, launchedbefore, in nsuserdefaults @ app launch , writing if not found.
something like
public override void finishedlaunching (uiapplication application) { var defaults = nsuserdefaults.standarduserdefaults; const string key = "launchedbeforekey"; if (!defaults.boolforkey(key)) { // first launch user.setbool(true, key); defaults.synchronize(); // stuff specific first launch here... } //... } i'm using "launchedbefore" opposed "firstlaunch" since boolforkey() return false in case key doesn't exist, it's semantically better way.
Comments
Post a Comment