最新发布第16页
排序
ScrollViewReader
Scroll View Reader 让你可以访问一个名为 scrollTo 的函数。通过这个函数,你可以通过自动滚动使滚动视图中的某个视图可见。 介绍 使用 ScrollViewReader 访问 scrollTo 函数,以便以编程方式...
How to use continuations to convert completion handlers into async functions 如何使用 continuations 将完成处理程序转换为异步函数
Older Swift code uses completion handlers for notifying us when some work has completed, and sooner or later you’re going to have to use it from an async function –&nbs...
Understanding actor initialization 了解 actor 初始化
Swift's actors run on their own executor most of the time, so they manage how and where their work is done. However, during the actor's initialization its executor isn't ready to t...
How to serialize parameterized tests with Swift Testing 如何使用 Swift Testing 序列化参数化测试
Swift Testing's parameterized tests allow us to send multiple values into a single test, and they'll be run in parallel for maximum performance. If you don't want this – if you wa...
Layout
Jetpack Compose 提供了多种选项,用于在容器内对齐和排列 UI 元素,比如 Column、Row、Box。 常用的布局类型 Arrangement Arrangement 用于控制子项在主轴方向上的间距,因此在 Column 中会看...
macOS Python 多版本管理
安装 Homebrew Homebrew 的官网 https://brew.sh/ 在终端输入以下命令进行安装 /bin/bash -c '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)' 安装完成后...
Day 1 – Python 变量与数据管理
打印 Python 中的打印语句 print('Hello world!') 字符串操作 字符串连接 字符串的连接可以使用+操作符 print('Hello' + ' ' + 'world!') 字符串长度 字符串的长度计算,使用len()函数 输入函数...
Day 9 – 字典与嵌套
字典 基本语法 字典是由键值对组成,基本的语法如下 {key1:value1, key2: value2, ...} 示例 # 字典示例 colors = { 'apple': 'red', 'pear': 'green', 'banana': 'yellow' } 基本使用 字典的基...
Day 16 – 面向对象编程(OOP)
面向对象编程(Object Oriented Programming, OOP),模拟事物为对象(Object),每个对象都有自己的属性(attribute)以及方法(methods)。 对象与类 在 OOP 中,有类(Class)以及对象(Obje...
一对一关系
一对一关系意味着每个 A对象都有一个对应的B对象,例如说每个人都有一本护照,或者每只宠物都有一个主人。 例如,如果我们有 Country 和 City 模型,它们之间有一个真正的一对一关系,那么在创...





