diff --git a/README.md b/README.md index afca77dfd..83aaf207c 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,6 @@ While project update ,you won't need to compile it manually in local, only need 代码说明参看这篇[《如何用 SwiftUI + Combine + Swift Concurrency Aysnc/Await Actor 欢畅开发》](https://ming1016.github.io/2022/01/03/develop-macos-with-swiftui-combine-concurrency-aysnc-await-actor/)文章 - +小册子文字版 《[戴铭的 Swift 小册子](https://ming1016.github.io/2021/11/23/daiming-swift-pamphlet/)》 diff --git a/SwiftPamphletApp.xcodeproj/project.pbxproj b/SwiftPamphletApp.xcodeproj/project.pbxproj index 35c22548f..7ce87a0a8 100644 --- a/SwiftPamphletApp.xcodeproj/project.pbxproj +++ b/SwiftPamphletApp.xcodeproj/project.pbxproj @@ -244,6 +244,8 @@ 08CD61FE27758B8A008C0935 /* Lexer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08CD61FC27758B8A008C0935 /* Lexer.swift */; }; 08CD61FF27758B8A008C0935 /* Token.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08CD61FD27758B8A008C0935 /* Token.swift */; }; 08D107BD278826BB007B7009 /* HTMLEntities in Frameworks */ = {isa = PBXBuildFile; productRef = 08D107BC278826BB007B7009 /* HTMLEntities */; }; + 08F4BE6028609D8700733F12 /* PlayCharts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08F4BE5F28609D8600733F12 /* PlayCharts.swift */; }; + 08F4BE6228616DC100733F12 /* PlayWeatherKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08F4BE6128616DC100733F12 /* PlayWeatherKit.swift */; }; 08F51BC527A374A500693AB6 /* footer_js.html in Resources */ = {isa = PBXBuildFile; fileRef = 08F51BC427A374A500693AB6 /* footer_js.html */; }; /* End PBXBuildFile section */ @@ -483,6 +485,8 @@ 08CD61F727758AF0008C0935 /* ParseStandXML.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseStandXML.swift; sourceTree = ""; }; 08CD61FC27758B8A008C0935 /* Lexer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Lexer.swift; sourceTree = ""; }; 08CD61FD27758B8A008C0935 /* Token.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Token.swift; sourceTree = ""; }; + 08F4BE5F28609D8600733F12 /* PlayCharts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayCharts.swift; sourceTree = ""; }; + 08F4BE6128616DC100733F12 /* PlayWeatherKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayWeatherKit.swift; sourceTree = ""; }; 08F51BC427A374A500693AB6 /* footer_js.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = footer_js.html; sourceTree = ""; }; /* End PBXFileReference section */ @@ -933,6 +937,7 @@ 08522BD727CF344B005FF059 /* PlaySliderView.swift */, 08522BDB27CF5079005FF059 /* PlayStepperView.swift */, 08522BEA27CF7744005FF059 /* PlayKeyboard.swift */, + 08F4BE5F28609D8600733F12 /* PlayCharts.swift */, ); path = ViewComponent; sourceTree = ""; @@ -1099,6 +1104,7 @@ isa = PBXGroup; children = ( 08C411F127951152006FC340 /* PlayFoundation.swift */, + 08F4BE6128616DC100733F12 /* PlayWeatherKit.swift */, 08C411F327951181006FC340 /* PlaySyntax.swift */, 08448F0A2797F73200B61353 /* PlayArchitecture.swift */, 08448F0C2799035600B61353 /* PlaySecurity.swift */, @@ -1525,6 +1531,7 @@ 08BE635027C4C0F2002BC6A8 /* PlayFormView.swift in Sources */, 086A5F402744EDCE00FECE02 /* RepoVM.swift in Sources */, 08BE636627C88750002BC6A8 /* PlayProgressView.swift in Sources */, + 08F4BE6028609D8700733F12 /* PlayCharts.swift in Sources */, 086A5F2E2744ED8600FECE02 /* ActiveDeveloperListView.swift in Sources */, 08BE637227CC6F13002BC6A8 /* PlayScrollView.swift in Sources */, 08CD61FE27758B8A008C0935 /* Lexer.swift in Sources */, @@ -1557,6 +1564,7 @@ 086A5F3B2744EDA500FECE02 /* GitHubAPIModel.swift in Sources */, 08BE635227C4D2BC002BC6A8 /* PlayListView.swift in Sources */, 086A5F072744E88E00FECE02 /* SwiftPamphletAppApp.swift in Sources */, + 08F4BE6228616DC100733F12 /* PlayWeatherKit.swift in Sources */, 08AEAEDB277EA5C300B969E2 /* RSSModel.swift in Sources */, 08BE637D27CDDA47002BC6A8 /* DataListView.swift in Sources */, 08AEAEF1277F09D000B969E2 /* IntroView.swift in Sources */, diff --git a/SwiftPamphletApp/Resource/Archive/archiveDevelopers.json b/SwiftPamphletApp/Resource/Archive/archiveDevelopers.json index b54acbed4..52f9291d1 100644 --- a/SwiftPamphletApp/Resource/Archive/archiveDevelopers.json +++ b/SwiftPamphletApp/Resource/Archive/archiveDevelopers.json @@ -1,4 +1,30 @@ [ + { + "name":"编译", + "id":2204191232, + "users":[ + { + "id":"AlexDenisov", + "des":"写过很多 LLVM 相关文章" + }, + { + "id":"CodaFi", + "des":"Swift 编译开发" + }, + { + "id":"harlanhaskins", + "des":"Swift 编译开发" + }, + { + "id":"LiarPrincess", + "des":"做过 python 解释器和 gb 模拟器" + }, + { + "id":"banach-space", + "des":"LLVM 开发者,llvm-tutor 作者" + } + ] + }, { "name":"逆向", "id":2201220814, diff --git a/SwiftPamphletApp/Resource/Archive/archiveRepos.json b/SwiftPamphletApp/Resource/Archive/archiveRepos.json index 39d94b5b2..328506421 100644 --- a/SwiftPamphletApp/Resource/Archive/archiveRepos.json +++ b/SwiftPamphletApp/Resource/Archive/archiveRepos.json @@ -20,6 +20,30 @@ { "id":"sbarex/SourceCodeSyntaxHighlight", "des":"源码高亮的 macOS 系统插件" + }, + { + "id":"krzyzanowskim/STTextView", + "des":"没有 NSTextView 包袱的 TextKit2 文本视图" + }, + { + "id":"Witiko/markdown", + "des":"一个用于在TeX中转换和渲染markdown文档的软件包" + }, + { + "id":"simonbs/Runestone", + "des":"适用于iOS的高性能纯文本编辑器,具有语法高亮、行数、隐形字符和更多功能。" + }, + { + "id":"pbek/QOwnNotes", + "des":"纯文本文件记事本和待办事项列表管理器" + }, + { + "id":"codemirror/codemirror.next", + "des":"前端处理超大容量文本不卡的库" + }, + { + "id":"danielsaidi/RichTextKit", + "des":"RichTextKit 是一个基于 Swift 的库,用于在 UIKit、AppKit 和 SwiftUI 中处理富文本。" } ] }, @@ -48,6 +72,18 @@ { "id":"cloudreve/Cloudreve", "des":"云存储部署" + }, + { + "id":"omniedgeio/n2n", + "des":"Peer-to-peer VPN" + }, + { + "id":"omniedgeio/omniedge-macOS", + "des":"OmniEdge macOS App" + }, + { + "id":"omniedgeio/omniedge-iOS", + "des":"OmniEdge iOS Client" } ] }, @@ -74,6 +110,18 @@ { "id":"CleverRaven/Cataclysm-DDA", "des":"以世界末日为背景的生存游戏" + }, + { + "id":"LiarPrincess/Swift-plays-Pokemon", + "des":"用 Swift 编写的 Game Boy 模拟器" + }, + { + "id":"CytopiaTeam/Cytopia", + "des":"像素艺术风格的开源城市模拟器45度角" + }, + { + "id":"microsoft/Microsoft-3D-Movie-Maker", + "des":"这是1995年发布的 Microsoft 3D Movie Maker 的原始源代码" } ] }, @@ -88,6 +136,10 @@ { "id":"blender/blender", "des":"新起开源 3D 建模渲染软件" + }, + { + "id":"mifi/lossless-cut", + "des":"LosslessCut 的目标是成为跨平台 FFmpeg GUI,用于对视频、音频、字幕和其他相关媒体文件进行快速无损的操作" } ] }, @@ -150,6 +202,18 @@ { "id":"RangerNJU/Static-Program-Analysis-Book", "des":"静态程序分析入门教程" + }, + { + "id":"LiarPrincess/Violet", + "des":"用 Swift 编写的 Python 虚拟机" + }, + { + "id":"Enna1/LLVM-Clang-Study-Notes", + "des":"LLVM/Clang 学习笔记" + }, + { + "id":"cesanta/elk", + "des":"用于嵌入式系统的低占用 JavaScript 引擎" } ] }, @@ -188,6 +252,18 @@ { "id":"hughkli/Lookin", "des":"Xcode 的 UI Inspector 和 Reveal 的开源实现" + }, + { + "id":"dani-gavrilov/GDPerformanceView-Swift", + "des":"在状态栏上方显示 FPS、CPU 和内存使用情况、设备型号、应用程序和 iOS 版本,并通过代理回调报告 FPS、CPU 和内存使用情况。" + }, + { + "id":"cirruslabs/tart", + "des":"swift 写的 在 Apple Silicon 上的 macOS 虚拟机可用于 CI 和其他自动化工作" + }, + { + "id":"Kiprey/Skr_Learning", + "des":"天问之路 - 学习笔记&学习周报。内容包括但不限于C++ STL、编译原理、LLVM IR Pass代码优化、CSAPP Lab、uCore操作系统等等。持续更新ing..." } ] }, @@ -224,6 +300,13 @@ { "id":"Wechat-ggGitHub/Awesome-GitHub-Repo", "des":"收集整理 GitHub 上高质量、有趣的开源项目" + }, + { + "id":"timqian/chinese-independent-blogs" + }, + { + "id":"papers-we-love/papers-we-love", + "des":"来自计算机科学界的论文,可以阅读和讨论。" } ] }, @@ -246,6 +329,22 @@ { "id":"zotero/zotero", "des":"收集、组织、引用和分享你的研究资料" + }, + { + "id":"facebook/lexical", + "des":"facebook 开源的编辑器" + }, + { + "id":"source-academy/sicp", + "des":"SICP JS 版本" + }, + { + "id":"alex/what-happens-when", + "des":"当你在浏览器中输入 google.com 并且按下回车之后发生了什么?完整详细完美解释" + }, + { + "id":"lxgw/LxgwWenKai", + "des":"一款开源中文字体,基于 FONTWORKS 出品字体 Klee One 衍生。" } ] }, @@ -255,6 +354,14 @@ "repos":[ { "id":"wordpress-mobile/WordPress-iOS" + }, + { + "id":"SwiftcordApp/Swiftcord", + "des":"一个完全原生的 MacOS Discord 客户端,100% 由 Swift 和 SwiftUI 构建" + }, + { + "id":"signalapp/Signal-iOS", + "des":"聊天" } ] }, @@ -281,6 +388,10 @@ { "id":"rxhanson/Rectangle", "des":"在 macOS 上用键盘快捷键和捕捉区移动和调整窗口大小" + }, + { + "id":"lexrus/SwiftyMenu", + "des":"Finder 菜单" } ] }, @@ -370,6 +481,14 @@ { "id":"agarrharr/awesome-cli-apps", "des":"命令行应用程序收藏" + }, + { + "id":"httpswift/swifter", + "des":"swift 写的 http 服务器引擎" + }, + { + "id":"swhitty/FlyingFox", + "des":"使用 async/await 用 Swift 编写的轻量级 HTTP 服务器。" } ] }, diff --git a/SwiftPamphletApp/Resource/Guide/1.md b/SwiftPamphletApp/Resource/Guide/1.md index 0897790df..f3fab4b86 100644 --- a/SwiftPamphletApp/Resource/Guide/1.md +++ b/SwiftPamphletApp/Resource/Guide/1.md @@ -1,25 +1,8 @@ -## 小册子动态 - -欢迎你的内容分享和留言,请发到 [议题里](https://github.com/KwaiAppTeam/SwiftPamphletApp/issues),也欢迎你的 PR :) 。 - -* 22.02.10 发布[4.1](https://github.com/KwaiAppTeam/SwiftPamphletApp/releases/tag/4.1):完善内容,补齐基础语法 -* 22.02.08 发布[4.0](https://github.com/KwaiAppTeam/SwiftPamphletApp/releases/tag/4.0):视觉更新。更新了小册子的icon。排版用了赫蹏(hètí),字体是霞鹜文楷,更新了代码高亮风格。 -* 22.01.24 发布[3.1](https://github.com/KwaiAppTeam/SwiftPamphletApp/releases/tag/3.1):可不设置 Github access token,生成 dmg -* 22.01.03 发布2.0:新动态支持提醒,包括博客RSS、开发者、好库和探索库 -* 21.11.16 发布1.0:Swift 指南语法速查完成 - -## Done - -* 开发者动态、仓库动态、议题列表、议题页、语法速查 -* 网络请求重试、网络异常处理 -* 开发者和仓库动态更新提醒(本地对比判断更新) -* 完善开发者事件不同类型的区分处理 -* 可不设置 Github access token 浏览手册内容 +## 动态 ## Todo -* 特性内容、专题内容、SwiftUI 和 Combine 内容完善 -* 一键提醒全部已读 +* 设计功能 ## 当前在用开发工具速链 diff --git a/SwiftPamphletApp/Resource/Guide/SwiftUI/UseViewComponent/147.md b/SwiftPamphletApp/Resource/Guide/SwiftUI/UseViewComponent/147.md index 8eb6783cc..6ad08af2d 100644 --- a/SwiftPamphletApp/Resource/Guide/SwiftUI/UseViewComponent/147.md +++ b/SwiftPamphletApp/Resource/Guide/SwiftUI/UseViewComponent/147.md @@ -85,4 +85,4 @@ struct V: View { } } } -``` \ No newline at end of file +``` diff --git a/SwiftPamphletApp/Resource/News/repos.json b/SwiftPamphletApp/Resource/News/repos.json index 7ebe6b0a1..753cd1e20 100644 --- a/SwiftPamphletApp/Resource/News/repos.json +++ b/SwiftPamphletApp/Resource/News/repos.json @@ -142,6 +142,10 @@ { "id":"ZeeZide/CodeEditor", "des":"使用 Highlight.js 的来做语法高亮的 SwiftUI 编辑器" + }, + { + "id":"tw93/MiaoYan", + "des":"轻灵的 Markdown 笔记本伴你写出妙言" } ] }, @@ -479,6 +483,14 @@ { "id":"analogcode/Swift-Radio-Pro", "des":"电台应用" + }, + { + "id":"bizz84/SwiftyStoreKit", + "des":"应用内购框架" + }, + { + "id":"wikimedia/wikipedia-ios", + "des":"" } ] }, @@ -524,6 +536,10 @@ { "id":"InvadingOctopus/octopuskit", "des":"2D游戏引擎,用的 GameplayKit + SpriteKit + SwiftUI" + }, + { + "id":"a-little-org-called-mario/a-little-game-called-mario", + "des":"用 Godot 引擎做的马里奥游戏" } ] }, @@ -578,9 +594,6 @@ "id":"dkhamsing/open-source-ios-apps", "des":"开源的完整 App 例子" }, - { - "id":"timqian/chinese-independent-blogs" - }, { "id":"vlondon/awesome-swiftui" }, @@ -925,6 +938,18 @@ { "id":"chaozh/awesome-blockchain-cn", "des":"区块链 awesome" + }, + { + "id":"argentlabs/web3.swift", + "des":"以太坊 Swift API,支持智能合约、ENS 和 ERC20" + }, + { + "id":"chainfeeds/RSSAggregatorforWeb3", + "des":"web3 的 rss feed 订阅源" + }, + { + "id":"Planetable/Planet", + "des":"由 IPFS 和以太坊名称系统提供支持的去中心化博客和网站" } ] }, diff --git a/SwiftPamphletApp/Resource/Play/Guide/PlayWeatherKit.swift b/SwiftPamphletApp/Resource/Play/Guide/PlayWeatherKit.swift new file mode 100644 index 000000000..c4ba26d83 --- /dev/null +++ b/SwiftPamphletApp/Resource/Play/Guide/PlayWeatherKit.swift @@ -0,0 +1,23 @@ +// +// PlayWeatherKit.swift +// SwiftPamphletApp +// +// Created by Ming Dai on 2022/6/21. +// +// +//import WeatherKit +//import CoreLocation +// +//class PlayWeatherKit { +// +// func simpleShowWeather() { +// do { +// if #available(macOS 13.0, *) { +// let wt = WeatherService() +// } else { +// // Fallback on earlier versions +// } +// let place = CLLocation(latitude: 39.9042, longitude: 116.4074) +// } +// } +//} diff --git a/SwiftPamphletApp/Resource/Play/SwiftUI/ViewComponent/PlayCharts.swift b/SwiftPamphletApp/Resource/Play/SwiftUI/ViewComponent/PlayCharts.swift new file mode 100644 index 000000000..1ebb80d16 --- /dev/null +++ b/SwiftPamphletApp/Resource/Play/SwiftUI/ViewComponent/PlayCharts.swift @@ -0,0 +1,39 @@ +// +// PlayCharts.swift +// SwiftPamphletApp +// +// Created by Ming Dai on 2022/6/20. +// + +//import SwiftUI +//import Charts +// +//struct PChartModel: Hashable { +// var day: String +// var amount: Int = .random(in: 1..<100) +//} +// +//extension PChartModel { +// static var data: [PChartModel] { +// let calendar = Calendar(identifier: .gregorian) +// let days = calendar.shortWeekdaySymbols +// return days.map { day in +// PChartModel(day: day) +// } +// } +//} +// +//struct PlayCharts: View { +// var body: some View { +// if #available(macOS 13.0, *) { +// Chart(PChartModel.data, id: \.self) { v in +// BarMark(x: .value("天", v.day), y: .value("数量", v.amount)) +// +// } +// .padding() +// } else { +// // Fallback on earlier versions +// } +// } +//} + diff --git a/SwiftPamphletApp/Resource/Play/SwiftUI/ViewComponent/PlayScrollView.swift b/SwiftPamphletApp/Resource/Play/SwiftUI/ViewComponent/PlayScrollView.swift index d7da374bd..4184e59b5 100644 --- a/SwiftPamphletApp/Resource/Play/SwiftUI/ViewComponent/PlayScrollView.swift +++ b/SwiftPamphletApp/Resource/Play/SwiftUI/ViewComponent/PlayScrollView.swift @@ -20,11 +20,18 @@ struct PlayScrollView: View { var body: some View { // 标准用法 ScrollViewReader { s in - ScrollView { - ForEach(0..<300) { i in - Text("\(i)") - .id(i) + if #available(macOS 13.0, *) { + ScrollView { + ForEach(0..<300) { i in + Text("\(i)") + .id(i) + } } + .scrollDisabled(false) + .scrollDismissesKeyboard(.interactively) + .scrollIndicators(.visible) + } else { + // Fallback on earlier versions } Button("跳到150") { withAnimation { diff --git a/SwiftPamphletApp/SwiftPamphletAppApp.swift b/SwiftPamphletApp/SwiftPamphletAppApp.swift index c15952252..eff23bf20 100644 --- a/SwiftPamphletApp/SwiftPamphletAppApp.swift +++ b/SwiftPamphletApp/SwiftPamphletAppApp.swift @@ -26,6 +26,7 @@ struct Demo: View { var body: some View { Group { // V() +// PlayCharts() // PlayTextView() // PlayLinkView() // PlayLabelView() @@ -51,7 +52,7 @@ struct Demo: View { // PlayColor() // PlayEffect() // PlayKeyboard() - PlayAnimation() +// PlayAnimation() // PlayCanvas() }