Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Cross-platform UI Development with Xamarin.Forms

You're reading from  Cross-platform UI Development with Xamarin.Forms

Product type Book
Published in Aug 2015
Publisher
ISBN-13 9781784391195
Pages 330 pages
Edition 1st Edition
Languages
Author (1):
Paul Johnson Paul Johnson
Profile icon Paul Johnson

Table of Contents (22) Chapters

Cross-platform UI Development with Xamarin.Forms
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
1. In the Beginning… 2. Let's Get the Party Started 3. Making It Look Pretty and Logging In 4. Making Your Application Portable 5. Data, Generics, and Making Sense of Information 6. A View to a Kill 7. Connect Me to Your Other Services 8. What a Bind! 9. Addressing the Issue 10. This is the World Calling… 11. A Portable Settings Class 12. Xamarin Forms Labs 13. Social Media into the Mix 14. Bringing It All Together Index

Setting up iOS


iOS is very simple to set up and listens for events. The basis for the majority of code is based on the freely available Reachability.cs class from Xamarin (https://github.com/xamarin/monotouch-samples/blob/master/ReachabilitySample/reachability.cs).

This class contains just about everything required to check your connection. In AppDelegate.cs, a small amount of code is needed to get the ConnectionChanged event:

// set up notifications
var settings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType, null);
UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);

// produce notification
MessageEvents.Change += (object s, UIChangedEventArgs ea) =>
{
  if (ea.ModuleName == "Notification")
  {
    var notification = new UILocalNotification
    {
      FireDate = DateTime.Now,
      AlertAction = "Connection changed",
      AlertBody = ea.Info,
    };
    UIApplication.SharedApplication...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}