awesome-swift

Contents

Swift-Release

swift5.2~5.4

Swift 5.2到5.4新特性整理

swift5.5

Swift 5.5 新特性
Swift 5.5 新特性

swift 5.6

new in Swift 5.6
SE-0335 introduces a new any keyword to mark existential types SE-0315 introduces the concept of type placeholders SE-0290 introduces an inverted form of #available called #unavailable
Swift 5.6 新特性

swift 5.7

Swift 5.7 新特性介绍
Swift 5.7新特性 (上)
Swift 5.7 新特性(下)
Combining opaque return types with primary associated types

5.7 Embrace Swift generics

Embrace Swift generics
Using the ‘some’ and ‘any’ keywords to reference generic protocols in Swift 5.7

5.7 Design protocol interfaces in Swift

Design protocol interfaces in Swift
Swift_5.7_Generics
Design protocol interfaces in Swift

Swift 5.8

#file behavior change in Swift 5.8

Swift 5.9

What’s new in Swift 5.9
Swift 5.9 有哪些新特性(一)



Swift-Evolution

0195-dynamic-member-lookup

https://github.com/apple/swift-evolution/blob/master/proposals/0195-dynamic-member-lookup.md https://juejin.cn/post/6844903621306351624

0216-dynamic-callable

https://github.com/apple/swift-evolution/blob/master/proposals/0216-dynamic-callable.md
https://www.jianshu.com/p/49b8e6f6a51d
https://medium.com/swlh/calling-ios-and-macos-hidden-api-in-style-1a924f244ad1

0296-async-await

https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md https://www.enekoalonso.com/articles/getting-started-with-async-await-in-swift https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/AlternativeToolchains.html https://ordinarycoding.com/articles/managing-toolchains-in-xcode/

0054-abolish-iuo

0054-abolish-iuo
[Coercion of implicitly unwrappable value]https://useyourloaf.com/blog/coercion-of-implicitly-unwrappable-value/

0289-result-builders

Result builders
NSAttributedStringBuilder
使用 Swift 特性 Result Builder 定制 DSL
ViewBuilder 研究(上)—— 掌握 Result builders
ViewBuilder 研究(下) —— 从模仿中学习
result-builders/

KeyPath在Swift中的妙用
Dynamic Member Lookup combined with key paths in Swift

0306-actors

0306-actors
【译】SE-0306 Actors

[译]Swift中的原子属性装饰器
Property Wrappers in Swift explained with code examples
Projecting a Value From a Property Wrapper
Accessing a property wrapper’s enclosing instance
Attaching Property Wrappers to function and closure parameters

0393-parameter-packs

0393-parameter-packs
Generalize APIs with parameter packs
Value and Type Parameter Packs

SE-0302 Sendable 和 @Sendable 闭包

【译】SE-0302 Sendable 和 @Sendable 闭包

Existential any in Swift explained with code examples
Some keyword in Swift: Opaque types explained with code examples

dynamicReplacement

dynamicReplacement
Swift Native method swizzling
Swift 5 Method Swizzling, @_dynamicReplacement



POP

Combining protocols in Swift
Abstract types and methods in Swift (讨论面向对象与面向协议什么时候使用更合理)
Alternatives to protocols in Swift (讨论除了协议以外的其它选择比如枚举喝范型或者多个子协议)
PROTOCOL & GENERIC IN SWIFT
Why can’t certain protocols, like Equatable and Hashable, be referenced directly?
Different flavors of type erasure in Swift
Using generic type constraints in Swift
Type erasure using closures in Swift
Avoiding race conditions in Swift
Swift 中的幻象类型
Tagged with Protocols
Tagged with Generics

Opaque Types some && swift 多态度

some
Swift 的类型多态

Dependency Injection in Swift

Dependency Injection in Swift using latest Swift features



Concurrency

swift concurrency

Swift 并发初步
Swift 结构化并发
What role do Tasks play within Swift’s concurrency system?
Async and Await in Swift 5.5
WWDC21 Explore structured concurrency in Swift
Using AsyncSequence in Swift
https://www.imgeek.org/article/825359559
AsyncExtensions
闲话 Swift 协程
Limit Swift Concurrency's cooperative pool
Swift 并发编程:原理探究
【WWDC21 10132/10133/10134】认识 Swift 中的异步与并发



Combine

https://developer.apple.com/documentation/combine
https://theswiftdev.com/urlsession-and-the-combine-framework/
https://onevcat.com/2020/01/customize-publisher/
https://www.jianshu.com/p/df8535b40079
https://www.jianshu.com/p/a9c04a84d911
https://github.com/cx-org/CombineX
https://github.com/yanglfree/SwiftUI-Combine-Coding
https://learnku.com/articles/36322
https://zhuanlan.zhihu.com/p/343631974
深入浅出 Apple 响应式框架 Combine
Apple 官方异步编程框架:Swift Combine 简介
Apple 官方异步编程框架:Swift Combine 应用
Combine 框架,从0到1 —— 5.Combine 提供的发布者(Publishers)
UIKit Combine
Combine 简明教程一: Publisher、Subscriber
Combine 简明教程二:自定义 Subscriber、Publisher
Combine 简明教程三:Subject
Combine 简明教程四:Operators
从响应式编程到 Combine 实践



Swift 正则速查手册



Swift-Macros

WWDC23 10167 - 初见 Swift 宏
WWDC23 一文看懂 Swift Macro
Swift-Macros A curated list of awesome Swift Macros



Swift-Charts

Swift Charts Construct and customize charts on every Apple platform.



CommandLineApp

Lets build a Command line app in Swift
Scripting in Swift: Git Hooks



Best-Practices

Refactoring Swift

Refactoring Swift: Best Practices to succeed

Pattern matching

Pattern matching on error codes
Pattern Matching in Swift
Ranges and Intervals in Swift
More Pattern Matching Examples

Wrapping functions in structs

Wrapping functions in structs

AnyObject, Any, and any

AnyObject, Any, and any: When to use which?

Loops

Loops

"let names = ["John", "Emma", "Robert", "Julia"] var string = ""

for name in names where string.count < 8 { string.append(name) }

print(string) // "JohnEmma""

" for index in names.indices { print(index, names[index]) } "

Array

Swift子数组提取性能优化分析
reduce-in-swift
Lazy Sequences in Swift And How They Work
Which Collection?
Group and sort Swift collections like a pro

Range

Ranges in Swift explained with code examples

Algorithms&Collection

初探 Swift 算法和集合

Swift之struct二进制大小分析

https://juejin.cn/post/7191406877819797561
https://github.com/erduoniba/HDSwiftStructSizeDemo



Swift-Tips

SwiftEchoes-Tips
swift-tips
https://github.com/vincent-pradeilles/swift-tips



awesome

https://github.com/matteocrippa/awesome-swift



Other

《The Swift Programming Language》in Chinese

ABI

Swift ABI 稳定对我们到底意味着什么
app 尺寸会变小 是的,但是这是 Apple 通过 App Thinning 帮我们完成的,不需要你操心。在提交 app 时,Apple 将会按照 iOS 系统创建不同的下载包。对于 iOS 12.2 的系统,因为它们预装了 Swift 5 的 runtime,所以不再需要 Swift 的库,它们会被从 app bundle 中删掉。对于 iOS 12.2 以下的系统,外甥打灯笼,照旧。 一个新创建的空 app,针对 iOS 12.2 打包出来压缩后的下载大小是 26KB,而对 iOS 12.0 则是 2.4MB。如果你使用了很多标准库里的东西,那这个差距会更大 (因为没有用到的标准库的符号会被 strip 掉),对于一个比较有规模的 app 来说,一般可以减小 10M 左右的体积。