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
🌟 T-salon – How can mobile developers break the Internet Winter
The first T Salon of 2019 Shanghai will be held on April 20 at 1:30 PM in Building B, Helen Center, 172 Tianshui Financial Street, Hongkou District, Shanghai. The event invited industry veterans from Ele. me, iTutorGroup, Aurora, and Watch The Snow Forum to share their practice and thinking on the depth and breadth of mobile technology. I hope this event can inspire the confused mobile developers in the cold winter of the Internet, and successfully break the game! Click the link above for free registration.
SwiftNIO 2.0 released
With the release of Swift 5, SwiftNIO has officially released version 2.0, which has two major updates:
- Built-in BoringSSL as Vendor, no longer dependent on system OpenSSL
- The HTTP2 protocol is implemented using pure Swift, no longer dependent on NGHTTP2
Smoke Framework 1.0 released
Amazon’s previously open source Swift Web Framework released 1.0 with a lot of deep integration around AWS services. 1.0 Developed using Swift 4.2, SwiftNIO 1.x, Swift 5 and SwiftNIO 2 will be released soon, Contains SmokeHTTP,SmokeAWS, SmokeDynamoDB, SmokeAWSCredentials submodules.
The novice recommended
🌟 🐕 Pure Swift project – Xib | Storyboard collaboration skills
@LOoping: This article puts forward my own opinions on some problems or doubts that may arise after using Storyboard, and lists relevant practices and suggestions. It shows that Storyboard and Xib have some shortcomings, but they are worth studying and studying:
- Use custom specifications, proper division of tasks, and the use of tools in moderation to avoid the pitfalls of multi-person collaboration — the abuse of storyboards (the authors also give their team’s specifications for using storyboards in the article);
- Through good module design, skilled use of Storyboard separation of code several schemes to avoid the problem of ViewController code bloat caused by Storyboard;
- If you need to change the class name or variable name, you should make good use of the refactoring function of Xcode to avoid the troubleshooting and locating problems such as application crash caused by omission of manually modified code.
- When tested, storyboards and XIBs are not as inefficient as expected, and are actually more efficient at repeatedly creating instances than pure code;
- When using storyboards and XIbs for layout, errors will be presented if constraints are missing or conflicts occur. Interface Builder tests can also be switched directly for different devices, which is much more efficient and accurate than hand-written adaptation codes.
The article
🌟 IOS app seconds on H5 optimization summary
In order to make the H5 page inside the app open in seconds, many projects have adopted the way of loading local H5 offline package. How to achieve such a second to start from two aspects.
- Offline package distribution and download
- Local loading of WebView
It needs to be added that in this paper, the local loading of WebView is based on the idea of blocking local loading. UIWebView can naturally use NSURLProtocol smoothly, but in WKWebView, it faces great obstacles. The author gives an alternative scheme or WKURLSchemeHandler interception, but the cost is also the original front-end interception scheme is now forced to be affected by the front-end, when packaging the resource protocol header adaptation, which is slightly different from the offline package scheme of many companies.
In WKWebView, even with the use of WKURLSchemeHandler, the way of resource interception is also faced with serious differentiation from Android, serious intrusion on the front end and other problems. Many companies choose another path for offline package scheme, App from the local server run front-end offline package page, So that the WebView is not aware of the current is an “offline” page, so as to maximize the front-end for the offline package “insensitive”, but also can ignore the interception API platform differences caused by the framework implementation differences.
On the local server of this scheme, you can refer to the implementation of WKWebView offline resource loading based on LocalWebServer. It introduces a scheme based on Local Web Server to realize offline Local H5 page open in seconds. If you are interested in this solution, you can take a detailed look at several open source solutions of Local Web Server introduced in this article. The article also has Demo code for reference. This article also provides a detailed overview of the problems associated with deploying local services, such as certificate signing.
🌟 🐢 Building a dynamic modular iOS architecture
Lianhu: In previous articles about iOS architecture/design mode, they often focused on how to design a certain functional module, such as MVC, MVP, VIPER, MVVM, etc., while there were few discussions about the design mode and organization method of the whole project. This paper starts from the architecture of the whole project, proposes a layered architecture of the project, and selects dynamic and static libraries for different layers to carry it, so as to achieve an engineering architecture that is easy to expand, combinable and low coupling, and can take into account both compilation time and start-up time. The feature level or process level can be well compatible with requirements changes of different granularity. The article also provides a beginner friendly Example app to describe its ideas, avoiding readers’ exploration time in project configuration (after all, it is a bit painful to configure a bunch of dynamic and static library dependencies). Worth reading.
🌟 🐢 Baidu App network depth optimization series (I) : DNS optimization
Kyo: What is the most important thing for companies in the mobile Internet era? I think most of the answer is traffic. Of course, this article is not to discuss how to obtain more traffic and other issues, after all, that is more product operations, and for traffic to do escort, is the network. Therefore, how to optimize the network, is also the direction of each factory to explore. For apps with larger traffic, network optimization will bring greater benefits. This article is written by baidu App RESEARCH and development team [Baidu App network depth optimization series] the first article, DNS optimization, summed up from baidu this hundred million daily active App’s own practice, is very worth a good look.
🌟 🐎 Pure protocol factory for Interface Builder-based views
@looping: Code merge conflicts caused by multiple collaborations are one of the biggest headaches in Storyboard development. A common solution to avoid this kind of collaboration problem is to have a specification that mandates a Storyboard for each interface, maintained by a single person. This solves the collaboration problem, but if you don’t optimize when you write the instantiation code, you still end up with redundant code that isn’t very friendly, or even hard coded. Let controller = UIStoryboard(name: “MyViewController”, bundle: bundle (for: MyViewController.self)).instantiateInitialViewController() as? MyViewController.
The author of this article shares an optimization idea. He designs a PROTOCOL (IBConstructible) for UIViewController with nibName and bundle properties. Taking advantage of Swift’s ability to provide a default implementation of the protocol via Extension, the final instantiation code is very concise, let Controller = myViewController.fromnib.
If you have a Storyboard development team that has not yet optimized the code, you can use the solutions provided in this article to make the code simpler. If it has been optimized, might as well share their ideas. The optimization tips in this article can also be applied to many code refactoring scenarios.
🐎 RunLoop Combat: Real-time lag monitoring
Kyo: Even though mobile devices are getting better and better, lag is still an issue in our daily development in pursuit of a better experience. Currently, companies use a variety of third-party libraries or self-written libraries to monitor lattices, but no matter what the libraries are, they can’t get around Runloop. In this paper, the author briefly introduced the principle of monitoring the lag, and then made a Runloop feature can monitor the lag Demo.
🐎 Indeterminate Types chuwith Codable in Swift
Speedboy: Codable is a serialization and deserialization protocol introduced after Swift 4. This article describes two ways to handle uncertainty types in Codable protocols:
- Enumerations are used to associate different types of attribute values that you want to store.
- use
Any
Keyword to store the desired type.
This article mainly recommends using the Any keyword, which can be modified flexibly compared to using enumerations while maintaining a similar development experience.
Recommended by yuhanle
🐎 An article to understand HTTPS and the encryption behind it
J_Knight_ : The author introduces HTTPS from the aspects of the comparison between symmetric encryption and asymmetric encryption, digital certificate, digital signature, and the establishment process of HTTPS communication.
🐕 Stubbing in pair with Swift compiler: a spy registration
Zvving: In Issue 45 we introduced lightweight Stubbing implementations in Unit Tests, where registering stub bodies before test cases are executed is a bit cumbersome. Now the authors have gone a step further and designed a pluggable mechanism called Arguments Spy to try to solve the problem of dynamically changing stub body implementations in Unit Tests. For those of you interested in functional programming, don’t miss it.
tool
optionals
Zhang Jiafu: a website showing various uses of Swift (optional).
onesignal
@bangben: a collection of foreign services (mobile push, Web push, internal purchase, mail), the old routine, basic services free, advanced services cost money. Therefore, if you have overseas business and develop personal APP students may wish to have a look.
code
Solutions to LeetCode by Swift
Zvving: Algorithms have become a must for job interviews. Brushing through LeetCode, whether preparing for an interview or practicing your algorithmic and programming skills, is helpful. This version is relatively perfect and worthy of reference in code specification, classification, time (space) complexity sorting and other aspects.
LeetCode has been settled in China, the Chinese name “Li Kou”, you can have a try.
Related reading:
- LeetCodeAnimation
Codextended
A suite of extensions that makes Swift’s Codable API easier to use, giving it the Type inference capability. Codexbobbie is not a wrapper or a new framework, but an extremely lightweight way to enhance Codexbobbie. Codable is powerful and convenient, but the standard API for Codable can get pretty verbose if you need some customization (like converting some decoded data or providing default values for some keys). It does not take full advantage of Swift’s powerful type inference capabilities, resulting in a lot of unnecessary duplicate code. Let me let codextry try to solve that problem.
Brooklyn
Brew Cask Install Brooklyn is a beautiful screensaver inspired by Apple’s release on October 30, 2018.
SecureDefaults
@small Non 86: SecureDefaults is a lightweight encapsulation of UserDefaults, written using Swift, with additional support for AES-256 encryption (key 256 bits). If you want to improve the security of your App’s persistent data and insist on using the UserDefaults interface, SecureDefaults provides a flexible alternative to Keychain.
book
🌟 🐎 Swift 5.0 Chinese official document
Swift 5.0 was officially released last month, which is an important iteration in the history of Swift. The SwiftGG Translation team has also recently updated the Official Documentation for Swift 5.0, which covers the basic syntax and advanced features of Swift.
Audio and video
🌟 Small ggtalk | three organization revealed knowledge set x iOS x SwiftGG weekly newspaper
Parsifal: Knowledge collection x iOS weekly x SwiftGG has become one of the three most recognized community organizations in the iOS community. This issue of GGTalk invited the founders of our three organizations — Xiaoji Nanfengzi, Liang Jie of SwiftGG, and Mu Zhuo, a generation student of our weekly team, to talk about the stories of our three organizations.
It has been more than a year since the first issue of the weekly newspaper was published in January 2018 to the 63rd issue. But the weekly newspaper actually in this year more than time, also had encountered many small problems. It has been half a year since I took over the operation of the weekly newspaper from Lao Zhuo around October last year. Based on the foundation laid by Lao Zhuo, as well as the efforts of 30 editors of the weekly, we still output high-quality content stably in each issue, and tried new ways such as gold digging boiling point, topic discussion and GitHub Release. Under the operation of @DamonWong, @Bangben and @Red paper, the official account is operated by @DamonWong, @Bangben and @Red Paper. It’s getting on the right track. So far I can say the same thing.
As Leong said, “There is always an end to an organization”, but I still hope that there will be three or four generations of weekly newspapers in the future… Thank you to all the participants in our three organizations, as well as to all our readers and listeners.
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)