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.
news
IOS three organizations co-branded t-shirts, limited time sale
Design+Code SwiftUI tutorial offers for a limited time
Scan code to buy on the basis of 50% off input iOSWeekly promo code to discount 20 yuan, limited time to buy!!
The novice recommended
Decode Row & Column
@Bangben: If you develop Flutter, you will be exposed to the Row and Column widgets. This article gives a very detailed example of how to use the parameters of the two widgets. The main ones involved are mainAxisAlignment, crossAxisAlignment, and mainAxisSize. Where mainAixsSize indicates that the control is not paved over the remaining space.
The article
π π Revisit the optimization of iOS Autorelease that may inadvertently be affected
AidenRao: very hardcore article, the compiler will determine if the method name starts with alloc/new/copy/mutableCopy, if not, it will automatically register the returned object in the Autorelease Pool. And the compiler will objc_autoreleaseReturnValue and objc_retainAutoreleasedReturnValue based on TLS (Thread Local Storage) the judgment of the optimization, Autorelease is not executed per se.
But this optimization logic can be changed by code we write without knowing it, causing strange problems. The author built a demo to analyze how a single piece of code invalidates the AutoRelease optimization, resulting in a large amount of MemoryGraph data held by @Autoreleasepool Content. Leaks is not a memory leak.
π π In-depth comparative analysis of React Native and Flutter in the whole network
Tom510230: The author of this paper comprehensively analyzed and compared the current React Native and Flutter from seven aspects, including environment construction, implementation principle, programming development, plug-in development, compilation and operation, stable performance and future development. In fact, there are some things that are not considered in this article. Here are some related details
- Cost for developers to get started: There is no doubt that the React Native solution, based on the JS syntax, provides a better experience for developers
- Mixing with Native: Both frameworks are the pot calling the kettle black, and neither can be 100% perfect. From the experience of big companies such as Toutiao, Xianyu, Ctrip and Tencent, this is not a problem as long as there are human resources to do the infrastructure
- True cross-platform: Last year’s Article on Airbnb made people realize that React Native was actually a “fake” cross-platform solution. The JS part required a variety of code to determine the container, and in many cases it was difficult to use Native plug-ins (just look at the UI layer). Flutter has a much higher code reuse rate.
- Direction of applets: React Native applets have been developed and launched by many major manufacturers. The applets based on Flutte R are still under discussion. It is not yet determined how much better Flutter is than React Native on applets
π 360 Mobile terminal performance monitoring practice QDAS-APM
App performance issues can seriously affect user experience, including crashes, network request errors or timeouts, slow UI response times, main thread stuttering, high CPU and memory usage, high power consumption, and so on. By summarizing daily problems and learning the implementation principle of the relatively perfect performance monitoring platform in the industry, 360 R&D team developed a set of performance monitoring solution on mobile terminal line — QDAS-APM. The article introduces the implementation details and principles in detail according to the functions. At present, the following functions have been achieved:
- Page rendering time
- The main thread is stuck
- Network error
- FPS
- Large file storage
- CPU
- Memory usage
- Crash
- The start time
reference
- IOS performance monitoring scheme
π IOS development: detailed summary of “Blocks” (2) underlying principles
@Laofeng: This is the second article in my Blocks series. It introduces the following content in detail:
- The essence of the Blocks
- Block intercepts local variables and special region variables
- The storage area of a Block
- A circular reference to a Block
There are a lot of articles in the iOS community that introduce the underlying principles of Blocks in recent years. Recommended reading
- Book: “Objective-C Advanced Programming for iOS with OS X Multithreading and Memory Management”
π Using Sky Segmentation to create stunning background animations in iOS
Kyo: For those of you who have ever taken photography, you may have taken a picture that was not as good as it should have been due to a dull or grey sky. If you want to save this picture, changing the sky is one way. So, you might open PhotoShop, use the quick selection tool to select the sky and replace it. The reason why you can quickly select the sky in Photoshop is because the color of the sky is uniform and similar, but sometimes you need to adjust it a little bit more. Wouldn’t it be fun to imagine a tool that could automatically recognize the sky and replace it? This tool is now available to iOS developers, and it is Fritz. It realizes sky segmentation such a computer vision task through machine learning, so that we developers can realize some interesting ideas through it. The author really wants to use it to make a small tool APP to save many of my waste films which are too lazy to be replaced by PS because of the bad weather. Students who are interested or have better ideas can use it to try. Fritz Project Address
π Rendering SwiftUI views to HTML
J_Knight_ : The author of this article developed a tool from SwiftUI to HTML, currently the tool does not support all SwiftUI elements, the author just rendered the first page of the Demo of SwiftUI tutorial to HTML.
The author shared the problems, solutions and some gains in the process of developing this tool. Meanwhile, he compared React and Flutter in terms of rendering methods, C++ and Java in terms of language level, and also made certain comparison and analysis on Go.
Recommended reading:
- SwiftRocks’ article on SwiftUI’s Tricks
- Kateinoigakukun’s article on how SwiftUI uses ABI Stability for its magic
π Uber uses QUIC protocol to optimize App network performance
@Siniang: Due to the particularity of the use scenario, Uber has strict requirements on network delay. If the delay is too long, it is often identified as the TCP implementation of the system, so they finally decide to use QUIC protocol instead. QUIC, as the underlying protocol of the new generation of HTTP3, is more advanced than TCP in connection establishment, congestion control and other aspects. In this article, they describe in detail the differences between the two schemes, the process of QUIC access and the network delay data after access.
π Mocking a remote API in iOS
Xiaofei86: The author of this article uses simple code to demonstrate how to Mock netlayer data in a protocol-oriented manner and to illustrate the importance and benefits of Mock data (simulating network latency, network errors, skipping logins, etc.). We can learn from this when implementing our own network layer.
π π Zhihu iOS client engineering tool Venom
Venom, named from Venom, is a componentized management system for Zhihu client group to integrate componentized integration and collaboration. Complete Venom consists of three parts:
- Venom macOS App: Integrated GUI tool for visual management components
- Venom kernel: DSL extensions based on Cocoapods, with specified extension elements on top of the wrapper, and ultimately converted to a POD-related configuration for operation
- Venom Server: Manages and configures the remote Server
It mainly solves the following core componentized problems:
- Engineering construction: locked dependent Gem toolset version and Cocoapods version, to ensure the unity of the project construction environment, developers do not need to dongcheng project configuration problems
- Binary construction: Venom can be seen as a superset of POD, providing functions related to switch management based on static library source code. The switch scheme refers to the binary scheme implemented by CocoaPods in Zhihu iOS.
- Component management: Custom local component development (analogous to :path development in Cocoapods), other repositories can specify any tag/commit/branch (analogous to: Git development in Cocoapods)
- Debug tools: Venom can “coexist” source code with static libraries, as described in this article. Such a global search will contain all source code will not contain omissions, in addition to package GCC fDEBUg-prefix-map =oldPath=newPath parameter to rewrite the source code path in Debug mode, to achieve a quick switch from static library to source code, to achieve the effect of compiling and debugging source code
- Others: some other project customization features are also provided, such as hummingbird image scanning tool, project certificate management, etc
Read more: Didi’s OneTool and JD’s iBiu
tool
Flutter Studio, Version 2
The goal of the Flutter Studio Web application update is to be more flexible, more complete, more responsive and with higher accuracy. Apps can now better accommodate different screen sizes and display precisely in all directions on all types of devices, allowing you to work more consistently and with more focus. In addition, Flutter Studio 2 can now generate complete, runnable code and build files, and has a more complete set of widgets, some of which have never even appeared in the widgets directory of Flutter. IO.
code
π SwiftWebUI
Damonwong: SwiftUI is definitely a must-see technology for iOS developers right now. But the cross-platform concept of Apple Only has disappointed many.
Last week, however, Helge HeΓ, a developer who used to work at Apple, broke Apple Only’s cross-platform pattern by creating a SwiftWebUI framework on top of SwiftUI that can write Web pages directly using Swift.
It’s still Demo, but I think it’s a very exciting technology. Here’s an introduction to how to use it, but those interested can read it below. The missing β οΈ : SwiftWebUI
ValidatedPropertyKit
JimQ: In our daily development, we often need to put constraints on the value of the defined attribute, so we need to rewrite the set/get method of the attribute and add various constraint logic. The constraint logic may be simple (eg. If a string property isEmpty (length 0) it is automatically converted to nil), but it is generic or common for our business. With more logic like this, our property definitions become long and repetitive. The master said to have encapsulation, so there’s the ValidatedPropertyKit. It mainly contains the following features:
- Validation of properties is easy and concise based on the @propertyWrapper syntax sugar.
- Built in a lot of generic validation, easy out of the box. Support to check whether the current value conforms to the specified verification, if not, can be rolled back to the value of the last verification, and support to specify the attribute keyPath to add authentication.
- Support for combining validation with logical operators (that is, and or not).
- You can flexibly customize and configure them based on your own requirements to encapsulate common logic of your own services in a unified manner.
Inspired by this, there will be more libraries based on @propertyWrapper (such as in conjunction with Diff) to make our property implementation more elegant and beautiful.
Burritos
@ Parsifal: The @propertyWrapper feature widely used by SwiftUI (@state, @Binding, @ObjectBinding, @environmentobject, and @Environment, etc.) It’s already known in WWDC19. Burritos takes advantage of this feature by extending more Property Wrappers for ease of use, such as @Dynamicuicolor, @UserDefault and @DefaultValue.
Expanded Reading: Property Wrappers Proposal SwiftUI and Swift 5.1 New feature (2) Property Delegates
Tfef-imatrix /MXFlutter: A High-performance Dynamic Framework for Flutter based on JS
Tom510230: Open source code from mobile QQ team, mainly to solve the pain point of Flutter development: it cannot be dynamic. The principle is this: declare UI controls on top in your preferred development language (usually also a scripting language) and then throw them to the rendering engine of Flutter for dynamic development.
The overall structure is as follows:
Read More: MXFlutter, a High-performance Dynamic Framework for Flutter based on JS
book
Using Combine
CrazyCoderShi: The amazing SwiftUI at WWDC19 is pretty familiar to everyone. In the first few days you can almost read articles and reviews about it in the developer community news, but there is an important Easter egg behind the Combine that has been overlooked. Combine is a functional responsive programming framework released with SwiftUI. If you’ve worked with RxSwift/ ReactivecoA before, you can see what Combine is. They have similarities, but Combine also has its own unique features. The key is official release. This book teaches you how to use Combine by hand. Even better, many examples in the book are directly taken from Swiftui-Notes, which can be combined with edible effect π, this book is open source.
push
Bytedance 2020 has been promoted in advance
Bytedance’s autumn recruitment advance application is open for 2020 graduates within a limited time. Positions in iOS/Android client, front end, back end and test development are open to applicants.
- Resume should be sent to: [email protected] (recommended title: Pre-approval of school enrollment – post – Name – city), such as: Pre-approval of School enrollment -iOS client – Wang Fugui – Beijing
- Does not affect the follow-up autumn recruit to deliver again, welcome to forward ~
- The validity period expires at 2019.07.17
PS: Wang Fugui said: This is a very good opportunity, don’t miss it (~ O ~ 3 ~)
Conventional 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 every issue will be released on the official account (OldDriverWeekly), welcome to follow.
RSS feeds are also supported: github.com/SwiftOldDri… .
instructions
π§ indicates the need to climb the wall, and π indicates the editor’s recommendation
Estimated reading time: π in a short time (1-10 mins); π medium (10-20 mins); π’ slow (20+ mins)