学计算机的那个

不是我觉到、悟到,你给不了我,给了也拿不住;只有我觉到、悟到,才有可能做到,能做到的才是我的.

0%

Scene

A scene contains the view hierarchy of your app.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import SwiftUI


@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
TabView {
ContentView()
.tabItem {
Label("Journal", systemImage: "book")
}
SettingsView()
.tabItem {
Label("Settings", systemImage: "gear")
}
}
}
}
}

In this sample, body returns the primary scene WindowGroup, which describes the view hierarchy of the sample’s main window.

WindowGroup: It provides platform-specific behaviors for your app, such as supporting multiple windows in macOS and iPadOS.

The computed body property can return one or more primary and secondary scenes.

阅读全文 »

常用的宏方法

@main

The @main attribute identifies the app’s entry point.

1
2
3
4
5
6
7
8
9
10
11
import SwiftUI


@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}

The entry point is responsible for the start up of the app.

The MyApp structure conforms to the App protocol,

The structure implements the computed property body, which is a requirement of the App protocol.

SwiftUI provides different types of scenes including WindowGroup, Window, DocumentGroup, and Settings

阅读全文 »

一些在后台运行的任务,需要在特定条件下对用户发起通知,如果有跨端要求,可以用第三方库,不过需要付费,优势在于可同时兼容移动端和桌面端,这里只是个人使用,所以推荐使用Mac自带Apple Script来添加,本来考虑通过向Reminders添加Event的方式,实现Mack & iOS同时提醒,不过只找到OC和Swift的API,没找到Py的API

阅读全文 »

机器学习是人工智能的一个分支。人工智能的研究历史有着一条从以“推理”为重点,到以“知识”为重点,再到以“学习”为重点的自然、清晰的脉络。

机器学习是实现人工智能的一个途径之一,即以机器学习为手段,解决人工智能中的部分问题。

阅读全文 »

问题

你有没有想过为什么你的UITableView加载“几乎”完美?我的意思是,当然——你已经向iOS明确表示,所有重要的cell工作(如从远程URL下载图像或渲染内容)都将在后台线程上异步计算。但有时这还不够,主要有两个原因:

  1. 一旦cell离开了可见区域,您调用的异步操作仍在工作。这通常会导致不必要的系统资源使用,甚至由于操作不知道完成后返回到哪个cell而导致错误的table行为。

  2. UITableViewCells经常被重用。这意味着加载到视图中的单元格有时可能包含最初加载到完全不同的单元格中的数据。这通常会导致“cell切换”行为,这可能会让你完全生气。

阅读全文 »