最新发布第22页
How to create continuations that can throw errors 如何创建可以抛出错误的continuations-Stewed Noodles 资源

How to create continuations that can throw errors 如何创建可以抛出错误的continuations

Swift provides withCheckedContinuation() and withUnsafeContinuation() to let us create continuations that can’t throw errors, but if the API you’re using ...
How to make async command-line tools and scripts 如何制作异步命令行工具和脚本-Stewed Noodles 资源

How to make async command-line tools and scripts 如何制作异步命令行工具和脚本

If you’re writing a command-line tool with Swift, you can use async code in two ways: if you're using main.swift you can immediately make and use async functions as norm...
How to create and use task local values 如何创建和使用任务本地值-Stewed Noodles 资源

How to create and use task local values 如何创建和使用任务本地值

Swift lets us attach metadata to a task using task-local values, which are small pieces of information that any code inside a task can read.Swift 允许我们使用 task-local ...
What’s the difference between actors, classes, and structs? Actors、Classes和 Structs 之间有什么区别?-Stewed Noodles 资源

What’s the difference between actors, classes, and structs? Actors、Classes和 Structs 之间有什么区别?

Swift provides four concrete nominal types for defining custom objects: actors, classes, structs, and enums. Each of these works a little differently from the others, but the first...
CardView-Stewed Noodles 资源

CardView

用于通过带有圆角布局和特定阴影效果来显示各种数据。CardView 可以用于创建 ListView 或 RecyclerView 中的条目布局。 创建CardView 1. CardView 条目布局 一个用于表示 RecyclerView 中单个条...
it 关键字-Stewed Noodles 资源

it 关键字

当 Lambda 表达式或匿名函数只接收 一个参数 时,it 会作为这个参数的 隐式名称(默认参数名)。 val numbers = listOf(1, 2, 3, 4, 5) // it 表示参数 println(numbers.map { it * it }) // [1...
matplotlib 中文显示-Stewed Noodles 资源

matplotlib 中文显示

在 PyChorm 中使用利用虚拟环境进行matplotlib绘制图像中显示中文。 下载字体 使用 SimHei字体,点击此处链接进行字体下载。 ttf文件存储位置 进入 Python 脚本,执行以下操作 >>> imp...
Widget 的 Container Background-Stewed Noodles 资源

Widget 的 Container Background

Widget 的 Container Background(容器背景) 是在 iOS 17 中引入的。在 Widget 的开发过程中,可能会在预览中遇到如下的错误 Widget needs to adopt container background. 容器背景用途 iOS 1...
What’s the difference between await and async let? await 和 async let 有什么区别?-Stewed Noodles 资源

What’s the difference between await and async let? await 和 async let 有什么区别?

Swift lets us perform async operations using both await and async let, but although they both run some async code they don’t quite run the same: await wai...
How to manipulate an AsyncSequence using map(), filter(), and more 如何使用 map()、filter() 等作 AsyncSequence-Stewed Noodles 资源

How to manipulate an AsyncSequence using map(), filter(), and more 如何使用 map()、filter() 等作 AsyncSequence

AsyncSequence has implementations of many of the same methods that come with Sequence, but how they operate varies: some return a single value that fulfills you...