hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
276 stars 22 forks source link

Swift: QuickStart #416

Open hhstore opened 5 months ago

hhstore commented 5 months ago

📖 Abstract:

💯 Related:

hhstore commented 5 months ago

Swift 教程:

官方文档:


# 当前最新版本: 
swift: 5.9
xcode: 15

中文翻译:

资源:

社区讨论:

hhstore commented 5 months ago

Swift 安装:


# macOS: 12.6.2
╰─>$ xcodebuild -version                                                       12:55:16
Xcode 14.2
Build version 14C18

╰─>$ swift --version                                                                                                                   
swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: x86_64-apple-macosx12.0

Swift 创建一个新项目:


mkdir try-swift/

cd try-swift/;

# 初始化, 默认生产一堆模板文件
swift package init --type=executable

tree try-swift/ -L 3                                                                                                              

try-swift/
├── Package.swift
├── README.md
├── Sources
│   └── try-swift
│       └── try_swift.swift
└── Tests
    └── try-swiftTests
        └── try_swiftTests.swift

5 directories, 4 files

cd try-swift/

# 编译+运行: 打印 hello
swift run
cd try-swift/

swift test

Swift 配置开发环境:

Swift + xcode 开发环境:

Swift + vscode 开发环境:

hhstore commented 5 months ago

UI 框架:

🔥 Swift UI:

🦄 官方:

状态:

参考:

视频:

🔥 UIKit:

hhstore commented 5 months ago

1

hhstore commented 5 months ago

1

hhstore commented 5 months ago

1

hhstore commented 5 months ago

1