当前位置:网站首页>SwiftUI SQLite教程之带有历史的搜索栏List App (教程含完整代码)
SwiftUI SQLite教程之带有历史的搜索栏List App (教程含完整代码)
2022-07-30 16:11:00 【知识大胖】
SQLite 用于以 SQL 结构将数据本地存储在应用程序内部。它是一个关系本地数据库。您可以使用此数据库在使用 Swift 和 Swift UI 的应用程序中存储数据。我们将在 Swift UI 的 iOS 应用程序中创建一个简单的搜索栏,以从数组中搜索动物并将用户搜索的字符串保存在 SQLite 数据库中。
我们将使用 SQLite 的库。要安装这个库,您必须在系统中安装 Cocoapods。
安装
您只需在终端中运行以下命令即可在系统中安装 Cocoapods:
sudo gem install cocoapods
首先,您需要在 XCode 项目的根目录中打开命令提示符(终端)并在其中运行以下命令:
pod init
现在您将看到在项目的根目录中创建了一个名为 Podfile的新文件。在文本编辑器中打开该文件并添加行以安装库。以下将是您的 Podfile 的内容:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'SQLite_Database' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for SQLite_Database
pod 'SQLite.swift', '~> 0.12.0'
end
之后,在终端中运行以下命令来安装这个库:
pod update
安
边栏推荐
- Rounding out the most practical way of several DLL injection
- 【SOC FPGA】外设KEY点LED
- go 学习03 基础知识变量类型
- Overview of TiDB Tool Functions
- Jetpack Compose 到底优秀在哪里?| 开发者说·DTalk
- FME实现CAD带属性转SHP数据方法
- 【HMS core】【Media】【Video Editing Service】 The online material cannot be displayed, it is always in the loading state or the network is abnormal
- 【SOC】经典输出hello world
- MySql 和 PostgreSQL 数据库 根据一张表update另一张表数据
- [HMS core] [FAQ] Collection of typical problems of push kit, AR Engine, advertising service, scanning service 2
猜你喜欢

完美绕开CRC32检测的无痕hook

支付系统架构设计详解,精彩!

PyQt5快速开发与实战 9.2 数据库处理

【HMS core】【Media】【Video Editing Service】 The online material cannot be displayed, it is always in the loading state or the network is abnormal

【SOC】Classic output hello world

Jetpack Compose 到底优秀在哪里?| 开发者说·DTalk

FME realizes the method of converting CAD with attribute to SHP data

【HMS core】【FAQ】push kit、AR Engine、广告服务、扫描服务典型问题合集2

Goland 开启文件保存自动进行格式化

Huawei ADS reports an error when obtaining conversion tracking parameters: getInstallReferrer IOException: getInstallReferrer not found installreferrer
随机推荐
详解最实用的几种dll注入方式
如何注册域名、备案以及解析
C语言学习之旅 【函数(二)】
云风:不加班、不炫技,把复杂的问题简单化
Qt 容器控件之Tab Widget 使用详解
【SOC】经典输出hello world
Promise笔记(一)
Placement Rules usage documentation
STM32F407定时器输入捕获
SocialFi 何以成就 Web3 去中心化社交未来
【HMS core】【FAQ】push kit、分析服务、视频编辑服务典型问题合集3
Golang分布式应用之Redis怎么使用
Why is there no data reported when the application is connected to Huawei Analytics in the application debugging mode?
完美绕开CRC32检测的无痕hook
Nervegrowold d2l (7) kaggle housing forecast model, numerical stability and the initialization and activation function
Qt 动态库与静态库
481-82 (105, 24, 82, 34, 153),
php字符串如何去除第一个字符
[flutter] What is MaterialApp and Material design
go 学习03 基础知识变量类型