Old driver iOS weekly, just for you to present valuable information.
You can also contribute to the project, if you find valuable information, articles, tools, etc., please send it to us in Issues, we will deal with it as soon as possible. Be sure to include a reason for your recommendation. Suggestions and comments are also welcome to Issues.
WWDC20
This week we have 4 articles from WWDC20 on our official account, and every one of them is great!
- App Clips Explore the journey
- SwiftUI Programming Guide
- App Clips development design point north
- Build App Clips for other merchants
The article
π π Flutter 1.20 has been released
@Bangben: The release of Flutter 1.20 brings a lot of new features, but the update speed of Flutter is still very satisfactory.
- Icon font tree shaker (remove unused icon fonts and reduce their size)
- Provide SKSL warm-up function, optimize animation effect (need to be set).
- Optimized mouse hit test to improve Web performance.
- Dart 2.9 optimizes the UTF-8 decoder for English text and 400 percent for Chinese text on low-end ARM devices.
- Supports automatic completion for Android and iOS.
- Updated the InteractiveViewer component (for panning, scaling, dragging, resizing, and so on).
- Update Meterial Slider, RangeSlider, TimePicker, and DatePicker.
- AboutDialog is used to display all package licenses used
- Pubspec. yaml is a new format that specifies a particular platform
- VSCode integrates with Dart DevTools.
- DevTools supports network analysis.
- VSCode renames or moves the auto-update reference.
- A Channel generator (Pigeon), a tool that generates Channel three-terminal communication code through the Dart declaration.
- There are also lots of bugfixes and some new features.
In addition to performance optimizations, it’s particularly recommended to keep an eye on Pigeon to save you a lot of time writing channels.
π π The advanced layout rules of Flutter must read for starters
@Damien: This article uses 29 examples to show the rules of Flutter advanced layout and summarizes the principles of Flutter layout as follows:
- Widget gets its own constraints from its parent. A “constraint” is made up of four double values: minimum and maximum widths, and minimum and maximum heights.
- The Widget iterates through its list of Children. The Widget tells each child its constraints individually (constraints can be different for each child) and then asks what size each child wants to set.
- Next, the widgets locate the child items one by one (horizontal on the X axis, vertical on the Y axis).
- Finally, the Widget tells the parent about its size (which also fits the original constraint).
This article is a good explanation of the rules of Flutter layout for those who are beginning to Flutter.
π’ Verify your appβs integrity with the new App Attest API
Anotheren: The new App Attest API is part of the DeviceCheck framework that helps protect apps on iOS 14 and later from security threats, thereby reducing fraudulent use of the service. App Attest allows you to generate a special encryption key on the device and use that key to verify the integrity of the App before the server provides access to sensitive data. The core class is DCAppAttestService. Apple has provided a series of articles detailing how to use the new feature, including: establishing application integrity; Verify the application connected to the server; Assessing the risk of fraud; Prepare to use the App Attest service.
π Dependency Injection via Property Wrappers
Dependency injection is a way to solve high and low level abstract coupling. This article shows how to implement this pattern in Swift easily and optimize its syntax using @propertyWrapper:
struct ContentView: View {
@Inject var dependency: MyDependency
var body: some View {
Button("Tap Me", action: dependency.doSomething)
"Next level injection π" when tapped}}Copy the code
π’ Swift ΚΌ s Collection Types
JonyFang: This article expands on Sequence, Collection and Array and explains the functionality of some important protocols and why they exist. Two considerations are introduced before delving into complex structures:
- 1. How to design the API to meet minimum requirements?
- 2. How to design shared and specialized implementations?
Sequences and Iterators are the basis for building other protocols and specific types, which are described in part. Finally with the Collection, BidirectionalCollecton, RandomAccessCollection, MutableCollection, RangeReplaceableCollection contrast analysis, Explains why these protocols exist and the improvements they can make. For further reading, you can also delve into the source code, although Swift itself is written in C++, much of the standard library is written in Swift, including the public API source directory. You can start with the source code for the Sequence and Collection types.
π MessageMock: Elegant simulation of Objective-C methods
In code testing, you can mock out objects that are not easy to get. In iOS, there are well-known open source frameworks like OCMock that address this problem. But the problem with OCMock is that it can be cumbersome to use, and testing a small feature can be cumbersome to use. This article provides a new idea for this scenario, based on objc_msgSend to “simulate” and “validate” methods.
Project source code
π Self-Sizing UITableView Cells with SwiftUI
Zvving: How to use SwiftUI with Hybrid in existing UIKit projects, many friends are concerned about this question. The author tries to use SwiftUI in a slightly more complex scenario: adaptive UITableviewCell. How to solve adaptive height, cell reuse? How are state changes updated? The author makes a careful exploration of these problems and provides a good reference for practice.
tool
Why don’t Flutter Hooks get much attention and attention?
# TestBoy: Hooks, which originated in React, allow us to manage our state without having to write classes. Flutter Hooks do not need to learn React. They allow us to easily share the same code in multiple widgets. They provide another way of thinking about state management. In Flutter_hooks we can either use a function or create a class to create a hook. For more information, refer to the documentation in pub.dev.
code
ConfigableCollectionView
@ old peak: A similar use iOS 13 UICollectionViewDiffableDataSource + CellRegistration configuration UICollectionView library, CellRegistration encapsulates the DataSource compact API configuration CollectionView, DiffableDataSource provides an EFFICIENT and secure DATA manipulation API for those interested in UICollectionView.
Recommended by: Zhuang Dai Chunhua
HappyCodable
EyreFree: Making Codable code more enjoyable for people to use is using the SourceScaffolding Framework to automatically generate Codable code for them:
- Support to customize the Coding Key of an attribute;
- [Fixed] Support for ignoring certain uncodable attributes
- Enum that supports automatic composition of non-RAWRepresentable representations;
- Decode supports multiple Coding keys to map the same attribute.
- Easy to debug;
- You can use model defaults;
- Support for simple type conversions, such as 0/1 to False/True, “123” to 123 of Int or vice versa.
Recommended by: Zhuang Dai Chunhua
push
Senior driver Weekly team combined knowledge collection and SwiftGG Translation group included a reliable internal promotion position.
If you want to looking for a job, click here: www.yuque.com/iosalliance…
If you want to recruit people, click here: www.yuque.com/iosalliance…
Of course, you are also welcome to pay attention to our weekly report, we will update the editorial post at the bottom of each weekly report.
Pay attention to our
We have opened an official account, and the official account (LSJCoding) will push a message when each issue is released, welcome your attention.
RSS feeds are also supported: github.com/SwiftOldDri… .
instructions
π§ indicates that a tool is required, and π indicates that editing is recommended
Estimated reading time: π in a short time (1-10 mins); π medium (10-20 mins); π’ slow (20+ mins)