I wonder how I can check whether it's the first run of my ios app, in order to start with a specific view. I saw many ways to do with Objective-C, but not how to implement it in Xamarin.
“An ideal, and not too overwhelming, duration for a first run is about 30 minutes in total,” explains Sascha. “This also includes the time necessary for a proper warm up.” This ensures your muscles are ready for the run session. “Make sure you run slowly – too slow rather than too fast,” ensures the expert.
That kind of stress on the body is earned. To start with, a beginner needs at least two days, no more than three. A beginner can only start to think of themselves as becoming an intermediate runner after around six months of consistent training — sometimes even longer.
"The first mile is the hardest because it leads to a rapid increase in oxygen demand to your entire body," says Sadi Raza, MD, FACC, a board-certified cardiologist in Dallas, Texas.
I'm not familiar with Xamarin, but this sounds as easy as checking the existence of a custom entry, say LaunchedBefore
, in NSUserDefaults
at the app launch and writing it 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();
// Do stuff specific to the first launch here...
}
//...
}
I'm using "LaunchedBefore"
as opposed to "FirstLaunch"
since BoolForKey()
will return false
in case the key doesn't exist, so it's semantically better this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With