Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2021 EssentialsApp Services

WWDC21 · 30 min · Essentials / App Services

Build light and fast App Clips

App Clips give people the power to discover and download a small part of your app at a moment’s notice to complete tasks and transactions. Explore tips and best practices to help you create compact App Clips that emphasize modern features and elegant design. Learn how you can build reliable and secure App Clips to ensure that people can always access your experience when scanning a physical App Clip Code or viewing it through your website. And we’ll take you through specific strategies for testing an App Clip before releasing it to the world.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 3 snippets

SF Symbol and Text swift · at 14:18 ↗
label.text = "Hello"

// TextStyle for label and image
let textStyle = UIFont.TextStyle.largeTitle

// Use the same TextStyle for label and image
label.font = .preferredFont(forTextStyle: textStyle)
let config = UIImage.SymbolConfiguration(textStyle: textStyle)

imageView.image = UIImage(systemName: "pencil.and.outline", withConfiguration: config)

// Align baseline of text and symbol image
imageView.firstBaselineAnchor.constraint(equalTo: label.firstBaselineAnchor).isActive = true
Meta Tag xml · at 18:08 ↗
<meta name="apple-itunes-app" content="app-id=myAppStoreID, app-clip-bundle-id=appClipBundleID, app-clip-display=card">
Location Confirmation swift · at 27:41 ↗
if let activationPayload = userActivity?.appClipActivationPayload {
  activationPayload.confirmAcquired(in: region)
  { inRegion, error in
    if let error = error as? APActivationPayloadError {
      if error.code ==
      APActivationPayloadError.disallowed {
        // User denied permission
        // Or invocation was not from visual code or NFC
      } else if error.code ==
      APActivationPayloadError.doesNotMatch {
        // Activation payload is not the most recent
        // Catch in testing. Handle as above.
      }
    } else if error == nil {
      // Platform was able to determine location
      // OK to check inRegion
    }
  }
}

Resources