We're sunsetting PodQuest on 2025-07-28. Thank you for your support!
Export Podcast Subscriptions
People
J
Jeff
使用ChatGPT来改善关系和解决争论
Topics
Jeff: App Intents 允许用户通过多种方式与应用交互,无需每次都打开应用。这包括快捷指令、Spotlight、Widgets、Siri 等。App Intents 的核心是将应用的单个原子化操作暴露给系统,以便与其他应用或系统操作结合使用。最初,App Intents 主要与快捷指令结合使用,但其应用范围已扩展到自定义控件、焦点过滤器、Spotlight 操作、实时活动等。一个好的 App Intent 应用场景是用户在无意识中使用它,例如通过 Siri 完成特定操作。在 Bark 应用中,我使用 App Intent 来显示条形码,未来会将其扩展到 Spotlight 搜索。App Intents 的设计理念是将应用设计为一系列操作,而不是 UI,然后构建 UI 来执行这些操作。每个应用操作都应该对应一个 App Intent,以便用户可以重新组合应用的功能。这使得应用更强大,用户体验更好,并且可以跨平台使用。 Jeff: App Intents 的核心是将应用的单个原子化操作暴露给系统,以便与其他应用或系统操作结合使用。我最初为 Bark 应用只提供了有限数量的快捷指令,但未来会添加更多,以提供更细粒度的功能访问。通过将应用功能细粒度地暴露为 App Intents,用户可以构建自己的界面,无需开发者构建复杂的UI。将应用的所有功能暴露给系统,可以让用户在无需打开应用的情况下使用应用的功能。App Intents 可以让小部件更具可定制性,而不是提供大量不同的预设小部件。随着 AI 技术的进步,App Intents 将在用户与设备的自然交互中发挥更大的作用。App Intents 可以简化 UI 设计,并实现跨平台的一致性。 Jeff: 创建 App Intent 的过程非常简单,无需进行额外的注册或配置。可以通过添加属性包装器来为 App Intent 添加额外的配置参数。App Parameter 属性包装器允许从用户处获取额外的参数,例如字符串、数字、文件或 URL。App Entity 是应用中数据的表示,可以通过 App Entity Query 查询。App Entity Query 适用于有限数量的项目,例如用户搜索过的城市,而不是所有城市。App Intent 可以执行应用可以执行的任何操作,包括网络调用,但并非不受限制。可以通过快捷指令访问照片库,而无需在应用中直接请求照片权限。App Entity Query 允许通过标识符查找实体,并提供建议实体列表。可以通过采用 Widget Configuration Intent 协议来为小部件添加自定义功能。App Entity 查询允许应用向系统公开其数据,并在小部件配置中使用。可以通过隐藏参数和 openWhenRun 属性来简化 App Intent 的调用流程。 Peter: App Intents 的应用和开发,以及如何设计以操作为中心的应用。 supporting_evidences Jeff: 'There is some great Docker containers for doing Swift development...' Jeff: 'So this week, I think I have finally wrapped up the update for Job Finder Tracker...' Jeff: 'So what an App Intent is, in a very broad way, is it gives you the ability to, for users in different ways...' Jeff: 'I would say that app intents are basically a way of exposing a single atomic action...' Jeff: 'And what the... Biggest benefit and also the biggest curse of doing app intense with shortcuts is that...' Jeff: 'However, as I've explored more into App Intents and as I've explored more into what they're capable of...' Jeff: 'I think maybe the definition here of like a really good use of an app intent is when the user doesn't realize they're using one...' Jeff: 'For example, in my app Bark, I've got a intent that just shows you a given barcode...' Jeff: 'Being able to configure a widget...' Jeff: 'And he has a article called Action-Centered Design...' Jeff: 'So if I'm thinking about my app Bark, for example, I can...' Jeff: 'And I started scribbling down a list...' Jeff: 'and I have no idea if I pronounced that name right, so sorry, Michael. Talking about like really, honestly, you really should have every single action that your app can do exposed as an app intent...' Jeff: 'But I do know that in a future release, I have like 10 more that I want to do because I want every tiny piece of the app available...' Jeff: 'And so it allows for all of these individual actions all of these individual things that a lot of them are in fact already in the app but you know take a bunch of taps or take a bunch of of uh steps to do and if i expose them as app intense in a very granular fashion users are basically able to build their own interface for it' Jeff: 'gives them the benefit of your app without you having to build out special features explicitly...' Jeff: 'I think that would have made a better experience where you are using App Intents to take a more limited user interface...' Jeff: 'But as things like AI and that come along and you have this more, hopefully, natural conversation with your devices...' Jeff: 'Having all of this in your actual UI means that you've made your UI more complicated for everyone...' Jeff: 'Okay, so I'm going to give you a very simple example here based on the videos...' Jeff: 'But that is all you need to do to get a very basic working app intent that's exposed to the system...' Jeff: 'So yeah, the basic app intent, as you described, is just a Swift struct with a certain protocol and a few default parameters...' Jeff: 'And you can take in a bunch of different values...' Jeff: 'And that's called an app entity...' Jeff: 'Cricket has a question about can you still define a model? Yes, question mark...' Jeff: 'So, for example, a better example here would be a weather app...' Jeff: 'App entities can basically do anything an app can do...' Jeff: 'But one thing that you can do right now if you really want to have access to your photo library...' Jeff: 'So yeah, we talked about app entities...' Jeff: 'So let's go ahead...' Jeff: 'Is that you are telling the app, hey, here's how my data is exposed to the system and here's what might go in here...' Jeff: 'So let's go ahead. You've definitely got more experience with that side of things than I do...' Jeff: 'I guess it's kind of like that writing functions, right? Write a small function that does one thing.'

Deep Dive

Chapters
This chapter introduces App Intents, explaining their core functionality: enabling users to interact with apps without launching them. It explores various access points like Spotlight, widgets, Siri, and shortcuts, highlighting their potential for enhancing user experience.
  • App Intents allow users to interact with apps without opening them.
  • Access points include Spotlight, widgets, Siri, Control Center, and shortcut actions.
  • They are a way to expose atomic actions for seamless user interaction.

Shownotes Transcript

App intents can be exposed in various ways beyond shortcuts, such as custom controls, focus filters, and spotlight actions. They enable users to perform specific actions without launching the app, making them more accessible and user-friendly. App intents can also be used to configure widgets, interact with hardware, and handle preferences, providing a seamless user experience across different platforms.

  • (00:00) - Introduction

  • (04:20) - App Intents

  • (06:57) - Become a member

  • (07:17) - Some examples

  • (16:31) - Action Centered Design

  • (17:52) - Get some Coffee

  • (20:04) - Examples from Barc

  • (21:39) - What makes a good App Intent

  • (27:26) - Creating an App Intent

  • (30:03) - Using Queries and Configuration

  • (32:36) - Get SetApp

  • (55:35) - Cocoatype.com

  • (55:38) - Support the podcast

Mentioned in this episodeThe way we interact with apps is changing, so should the way they are designed)WWDC Developer video for getting started with App Intents)Become a Patreon member and help this Podcast survivehttps://www.patreon.com/compileswift) Follow me on Mastodonhttps://iosdev.space/@Compileswift)

Thanks to our monthly supporters

  • Marko Wiese

  • Adam Wulf

  • bitSpectre

  • Arclite

** ★ Support this podcast on Patreon ★) **