Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Introduction to iOS… 9
Craig Dunn

Xamarin

@conceptdev
On the menu?
File New App
How it works
iOS 9
Configuration
UI design
C# code
File > New
iPad Multitasking
-‐ Adaptive layout
-‐ Size classes
-‐ Configuration:
+ LaunchScreen.storyboard
+ support all iPad
orient...
How it works
Xamarin’s Unique Approach
iOS C# UI

Windows C# UI
Android C# UI
Shared C# Code
github.com/xamarinhq/app-‐acquaint
Under the Hood Bonnet
Native UI
Storyboards & XIBs
User Interface code (﴾C#)﴿
UIKit, MapKit,
CoreLocation
…
Shared C# Code...
System.Net
Choose the Mono managed or the native iOS
network stack for WebClient & HttpClient
*
*
Application Transport Security
-‐ HTTPS “just works”
-‐ HTTP exceptions
-‐ HTTP opt-‐out
Native Performance
Xamarin.iOS does full Ahead Of Time (﴾AOT)﴿ compilation
with LLVM to produce an ARM binary for Apple’s ...
Shine with iOS 9
iOS 9
-‐ UIStackView & Localization
-‐ Core Spotlight
-‐ NSUserActivity / Handoff
-‐ Universal linking
-‐ 3D Touch
+ Quick...
UIStackView
UIStackView
Horizontal & vertical orientation
Leading and Trailing
(﴾not Left and Right)﴿
UIStackView & Localization
Localization Configuration
<key>CFBundleLocalizations</key>
<array>
<string>de</string>
<string>es</string>
<string>ja</st...
Localized Content
Localized Content
Localization
Core Spotlight
Core Spotlight (﴾Search)﴿
public override void Index (Task t)
{

var attributeSet = new CSSearchableItemAttributeSet (UTTy...
Responding to Search
public override bool ContinueUserActivity (UIApplication application,

NSUserActivity userActivity, 
...
NSUserActivity / Handoff
NSUserActivity / Handoff
Creating NSUserActivity for Handoff
<key>NSUserActivityTypes</key>
<array>
<string>my.custom.identifier.add</string>
<stri...
Creating NSUserActivity for Handoff
var activity = new NSUserActivity ("my.custom.identifier.add")(;

activity.EligibleFor...
Responding to NSUserActivity
public override bool ContinueUserActivity (UIApplication application,

NSUserActivity userAct...
Universal Links
Deep link into your app
Great for search, mail-‐outs
https://evolve.xamarin.com/session/56f441a3de91c6253c...
Set up Universal Links
https://evolve.xamarin.com/apple-‐app-‐site-‐association
{
"applinks": {
"apps": [],
"details": [
{...
Responding to Universal Links
public override bool ContinueUserActivity (UIApplication application,

NSUserActivity userAc...
3D Touch Quick Actions
Info.plist
Responding to Quick Actions
public UIApplicationShortcutItem LaunchedShortcutItem { get; set; }

public override void OnAc...
Xamarin.Forms too!
Evolve app:
-‐ Core Spotlight
-‐ NSUserActivity
-‐ Universal Linking
-‐ 3D Touch
Quick Actions
EVOLVE A...
VISUAL STUDIO
one more thing…
Visual Studio on Windows Storyboards
Visual Studio on Windows iOS Simulator
Visual Studio on Windows USB Remoting
Sample Code
github.com/conceptdev/xamarin-‐ios-‐samples > Traveller (﴾iOS)﴿
github.com/conceptdev/xamarin-‐ios-‐samples > ...
Craig Dunn

Xamarin

@conceptdev
THANK YOU!
Introduction to iOS 9 (Xamarin Evolve 2016)
Nächste SlideShare
Wird geladen in …5
×

Introduction to iOS 9 (Xamarin Evolve 2016)

873 Aufrufe

Veröffentlicht am

Slides for my talk on getting started with iOS and adding iOS 9-specific features to your native iOS and Xamarin.Forms apps.

Veröffentlicht in: Mobil
  • Login to see the comments

  • Gehören Sie zu den Ersten, denen das gefällt!

Introduction to iOS 9 (Xamarin Evolve 2016)

  1. 1. Introduction to iOS… 9 Craig Dunn
 Xamarin
 @conceptdev
  2. 2. On the menu? File New App How it works iOS 9 Configuration UI design C# code
  3. 3. File > New
  4. 4. iPad Multitasking -‐ Adaptive layout -‐ Size classes -‐ Configuration: + LaunchScreen.storyboard + support all iPad orientation options
  5. 5. How it works
  6. 6. Xamarin’s Unique Approach iOS C# UI Windows C# UI Android C# UI Shared C# Code github.com/xamarinhq/app-‐acquaint
  7. 7. Under the Hood Bonnet Native UI Storyboards & XIBs User Interface code (﴾C#)﴿ UIKit, MapKit, CoreLocation … Shared C# Code • Business Logic • Database • Web services • File operations custom bindings Mono (﴾.NET Framework)﴿ • System.Net CocoaPods Objective-‐C NSUrlSession SQLite iOS iOS C# UI Windows C# UI Android C# UI Shared C# Code Xamarin
  8. 8. System.Net Choose the Mono managed or the native iOS network stack for WebClient & HttpClient * *
  9. 9. Application Transport Security -‐ HTTPS “just works” -‐ HTTP exceptions -‐ HTTP opt-‐out
  10. 10. Native Performance Xamarin.iOS does full Ahead Of Time (﴾AOT)﴿ compilation with LLVM to produce an ARM binary for Apple’s App Store.
  11. 11. Shine with iOS 9
  12. 12. iOS 9 -‐ UIStackView & Localization -‐ Core Spotlight -‐ NSUserActivity / Handoff -‐ Universal linking -‐ 3D Touch + Quick Actions
  13. 13. UIStackView
  14. 14. UIStackView Horizontal & vertical orientation Leading and Trailing (﴾not Left and Right)﴿
  15. 15. UIStackView & Localization
  16. 16. Localization Configuration <key>CFBundleLocalizations</key> <array> <string>de</string> <string>es</string> <string>ja</string> <string>he</string> <string>ar</string> </array> <key>CFBundleDevelopmentRegion</key> <string>en</string> Info.plist
  17. 17. Localized Content
  18. 18. Localized Content
  19. 19. Localization
  20. 20. Core Spotlight
  21. 21. Core Spotlight (﴾Search)﴿ public override void Index (Task t) {
 var attributeSet = new CSSearchableItemAttributeSet (UTType.Text);
 attributeSet.Title = t.Name;
 attributeSet.ContentDescription = t.Notes;
 attributeSet.TextContent = t.Notes;
 var dataItem = new CSSearchableItem (t.Id.ToString(), "co.conceptdev.to9o", attributeSet);
 } // delete items CSSearchableIndex.DefaultSearchableIndex.Delete (new string[] {t.Id.ToString()}, err => {}) // index all-at-once (for reference material) var dataItems = new List<CSSearchableItem>();
 foreach (var session in sessions)
 { Index (session); }
  22. 22. Responding to Search public override bool ContinueUserActivity (UIApplication application,
 NSUserActivity userActivity, 
 UIApplicationRestorationHandler completionHandler)
 {
 // Take action based on the activity type
 if (userActivity.ActivityType == CSSearchableItem.ActionType)
 {
 var uuid = userActivity.UserInfo.ObjectForKey (CSSearchableItem.ActivityIdentifier); ContinueNavigation (); // custom implementation }
  23. 23. NSUserActivity / Handoff
  24. 24. NSUserActivity / Handoff
  25. 25. Creating NSUserActivity for Handoff <key>NSUserActivityTypes</key> <array> <string>my.custom.identifier.add</string> <string>my.custom.identifier.edit</string> </array> Info.plist
  26. 26. Creating NSUserActivity for Handoff var activity = new NSUserActivity ("my.custom.identifier.add")(;
 activity.EligibleForSearch = false; // don’t use this _and_ CoreSpotlight
 activity.EligibleForPublicIndexing = false;
 activity.EligibleForHandoff = true;
 activity.Title = "Todo Detail"; var attributeSet = new CoreSpotlight.CSSearchableItemAttributeSet (); attributeSet.DisplayName = "Add Todo";
 attributeSet.ContentDescription = NSBundle.MainBundle.LocalizedString ("(new)","");
 activity.AddUserInfoEntries (NSDictionary.FromObjectAndKey(new NSString("0"), ActivityKeys.Id)); activity.ContentAttributeSet = attributeSet;
 activity.BecomeCurrent (); // ViewWillDisappear: don’t forget to ResignCurrent() ViewController
  27. 27. Responding to NSUserActivity public override bool ContinueUserActivity (UIApplication application,
 NSUserActivity userActivity, 
 UIApplicationRestorationHandler completionHandler)
 {
 // Take action based on the activity type
 if (userActivity.ActivityType == "my.custom.identifier.add")
 {
 var uuid = userActivity.UserInfo.ObjectForKey (CSSearchableItem.ActivityIdentifier); ContinueNavigation (); // custom implementation }; } AppDelegate
  28. 28. Universal Links Deep link into your app Great for search, mail-‐outs https://evolve.xamarin.com/session/56f441a3de91c6253c277bf6
  29. 29. Set up Universal Links https://evolve.xamarin.com/apple-‐app-‐site-‐association { "applinks": { "apps": [], "details": [ { "appID": "XXXX421985.com.xamarin.evolve", "paths": [ "/session/*" ] } ] } } Entitlements.plist App ID apple-‐app-‐site-‐association
  30. 30. Responding to Universal Links public override bool ContinueUserActivity (UIApplication application,
 NSUserActivity userActivity, 
 UIApplicationRestorationHandler completionHandler)
 {
 if (userActivity.ActivityType == NSUserActivityType.BrowsingWeb) {
 var data = userActivity.WebPageUrl.AbsoluteString;
 if (string.IsNullOrWhiteSpace (data) || !data.Contains ("/session/"))
 return true;
 
 var id = data.Substring (data.LastIndexOf ("/", StringComparison.Ordinal) + 1);
 ContinueNavigation (); // custom implementation } } AppDelegate
  31. 31. 3D Touch Quick Actions Info.plist
  32. 32. Responding to Quick Actions public UIApplicationShortcutItem LaunchedShortcutItem { get; set; }
 public override void OnActivated (UIApplication application)
 {
 HandleShortcutItem(LaunchedShortcutItem);
 LaunchedShortcutItem = null;
 }
 public override void PerformActionForShortcutItem (UIApplication application,
 UIApplicationShortcutItem shortcutItem, UIOperationHandler completionHandler)
 { // app already running
 var handled = HandleShortcutItem (shortcutItem);
 completionHandler (handled);
 }
 public bool HandleShortcutItem (UIApplicationShortcutItem shortcutItem)
 { // show required view controller }
 AppDelegate
  33. 33. Xamarin.Forms too! Evolve app: -‐ Core Spotlight -‐ NSUserActivity -‐ Universal Linking -‐ 3D Touch Quick Actions EVOLVE APP!!
  34. 34. VISUAL STUDIO one more thing…
  35. 35. Visual Studio on Windows Storyboards
  36. 36. Visual Studio on Windows iOS Simulator
  37. 37. Visual Studio on Windows USB Remoting
  38. 38. Sample Code github.com/conceptdev/xamarin-‐ios-‐samples > Traveller (﴾iOS)﴿ github.com/conceptdev/xamarin-‐ios-‐samples > To9o (﴾iOS)﴿ github.com/xamarin/xamarin-‐forms-‐samples > Todo (﴾Xamarin.Forms)﴿ github.com/xamarinhq/app-‐evolve > Evolve (﴾Xamarin.Forms)﴿ github.com/nishanil/TouristAttractions > Android app (﴾@nishanil)﴿
  39. 39. Craig Dunn
 Xamarin
 @conceptdev THANK YOU!

×