Original link: https://github.com/SwiftOldDriver/iOS-Weekly/releases/tag/%23262
The veteran iOS weekly report only presents you with valuable information.
You can also contribute to this project. If you find valuable information, articles, tools, etc., you can mention it to us in Issues and we will deal with it as soon as possible. Remember to write down the reasons for your recommendation. Suggestions and comments are also welcome to Issues .
news
WebP Heap Buffer Overflow Security Vulnerability
On September 12, 2023, Libwebp announced a high-risk vulnerability , CVE-2023-4863 , with a rating of Critical(8.8) . There are many affected parties, including browsers such as Chrome and Firefox; client APPs integrating libWebP, and some versions of Electron and flutter. List some of the affected components:
- webP (< 1.3.2 ), it is recommended to upgrade directly to 1.3.2
- Electron(< 26.2.2/25.8.2/24.8.3/22.3.24)
- flutter(< 3.13.4)
Since the vulnerability has been made public, there is a risk of being exploited and attacked (the specific attack method is not easy to develop). You can upgrade according to the project situation.
article
iOS NinePatch Analysis
@Barney : The article mainly introduces the practical application of iOS Dianjiu Tu. There are principle introductions and codes. It is a very specific practice and is worth learning.
- Dot nine pictures are produced.
- Introduction to PNG file format and coding practice.
Out-of-the-box – Mobile network IPv6 concentration detection tool
@半笑 Drink arsenic : This article introduces a mobile network IPv6 concentration detection tool, aiming to promote the widespread application of IPv6 technology. This article explains in detail the background and usage of this tool, as well as how to evaluate the IPv6 traffic proportion of mobile applications through packet capture and data analysis, thereby guiding network improvement work. In addition, this article also provides other detection methods such as mobile phone packet capture and Safari debugging to help readers better understand and promote the application of IPv6 technology in mobile networks.
Shake to undo in a SwiftUI app
@zoeGuo : This article introduces how to implement the “Shake to Undo” function in SwiftUI applications. The author provides information on how to use UndoManager in SwiftUI, how to implement the “shake” gesture in SwiftUI, giving users appropriate prompts to ensure that data will not be lost by misuse, and monitoring the occurrence of undo operations to correctly handle the logic. Detailed steps and ideas for using SwiftUI to implement the “Shake to Undo” function. The author finally shows that by encapsulating all these logic and UI implementations into a reusable modifier, the entire function’s usage code becomes extremely concise.
How to build an iOS Live Activity
@anotheren : This is an article for novices. It gives full-process guidance on how to build your first “Live Activity” from aspects such as creation, UI display, data update, etc. It’s time to turn Live Activity into The activity is added to your application.
Swift Macro: Revisited – The Strengths and Essence
@AidenRao : This article explores the advantages and essence of Swift macros in detail.
- Code is generated by transforming the programmer’s code at compile time. It has type checking and syntax tree checking capabilities, which can limit the usage scenarios of macros and clarify the parameter types accepted by macros.
- For standalone macros, they can affect control flow where used and share lexical scope.
- For additional macros, they can extend the type by converting existing member variables to another form, and override properties by adding accessors. Extensions not only bring new behavior, but also share the “namespace” of the extension point. It’s also worth noting that adding an accessor to a stored property also changes its semantics from a stored property to a computed property.
Compared with existing code reuse methods in Swift, Swift Macro improves the code reusability of the language by embracing different design concepts.
Swift Macro: Revisited – Traps and Pitfalls
This article provides examples of some pitfalls that may arise when using Swift macros, such as:
- If the macro contains return and is used in a for loop, expansion will directly return instead of continuing execution.
- Definition naming conflicts, conflicts caused by propertyWrapper of other frameworks, or lazy conflicts, repeated access, etc.
- semantic conflict
The solution article also gives suggestions:
- The macro name is clear. If it is not allowed to be used in a certain scenario, you can write it clearly.
- Protect macro expansion by placing it inside a closure
- When referencing other libraries, try to ensure unique naming
- No variables are defined inside the macro
- Provides renaming methods
- Provide ignore method
- Provide corresponding usage documentation
The expanded problem will also encounter similar scenarios when you use macros in OC. When using macros in large-scale and complex scenarios, you need to pay special attention to such abnormal cases.
iPhone 15 Screen Sizes
@ChenghzhiHuang : This article summarizes the screen information of the iPhone 15 series, including StatusBarHeight, SafeArea, screen resolution, etc. Students who need to adapt can read it by themselves.
tool
Flutter’s best animation library is “fully commercialized”, have you fully understood Rive 2?
@CrazyCoderShi : Rive animation in the Flutter field is similar to Lottie’s position on iOS and Android. It also provides an online editor; of course, Rive also supports all platforms. This article will take you to get started with Rive animation in detail, from production to code linkage.
code
ExampleKit
@Cooper Chen : This open source project provides the ability to create your own library and perform release management in Swift Playgrounds. It details how to create templates, source control and other operations. This is useful for developers who need to develop the same code on different platforms. A practical tool.
SnapshotTesting
@J_Knight_ : Provides an open source Snapshot Testing framework for Swift development. In addition to supporting snapshots of UIViews, other data types and snapshots on different device models are supported.
Referral
We have restarted updating the “iOS Reliable Internal Recommendation Topic” and sorted out the positions that are currently recruiting for your reference.
[Beijing] Baidu Netdisk – Infrastructure/Business – iOS/Android/FE
[Shanghai/Hangzhou/Beijing] TikTok – Short Video – iOS/Android/TL
[Guangshen] TikTok Live – Social Interaction Team – iOS/Android
[Hangzhou] Taobao – Terminal Platform – iOS/Android/C++
[Guangzhou] WeChat public account – iOS
[Beijing] Kuaishou – Local Life – iOS
[Shanghai/Beijing] MiniMax – iOS
[Beijing] Zhihu – Membership Business – iOS
[Shanghai] Scanner – iOS
[Shenzhen] Mobile QQ – Terminal Architecture – iOS – T10/T11
For specific information, please go to: https://www.yuque.com/iosalliance/article/bhutav (if you have any recruitment needs, please contact iTDriverr)
Follow us
We are “Old Driver Technology Weekly”, a technical public account that continues to pursue high-quality iOS content. Welcome to follow us.
Follow us politely, follow [Old Driver Technical Weekly], reply “2023”, and receive the internal reference for 2023 and previous years.
RSS subscriptions are also supported: https://github.com/SwiftOldDriver/iOS-Weekly/releases.atom .
illustrate
Indicates the need for a certain tool, Indicates editor recommendation
Estimated reading time: Can be read quickly (1 – 10 mins); Medium (10 – 20 mins); Slow (20+ mins)
This article is reproduced from: https://github.com/SwiftOldDriver/iOS-Weekly/releases/tag/%23262
This site is only for collection, and the copyright belongs to the original author.