The tenth issue of old Drivers iOS weekly has more than 1000 stars on GitHub, which has been recognized by everyone and has strengthened our determination to continue to do the weekly.
Welcome @Ye Gucheng, also known as Daniel Wu, to join our editorial team.
At the beginning of this issue, we use an animal at the beginning of each article to indicate the expected reading time:
- π can be read in no time (1-10 mins)
- π Medium (10-20 mins)
- π’ slow (20+ mins)
news
WWDC 2018 time is confirmed
Apple has announced that WWDC 2018 will take place June 4-8 in SAN Jose. Registration is now open (registration closes March 22) and eligibility will be determined through a lottery.
In addition, Apple offers free admission to good school students for free. Here is an article about WWDC18 Scholarships written by WWDC 2017 Scholarships winners.
The article
π The author of iOS Weekly put together a subscription to his iOS blog
Recently, the author of iOS Weekly compiled a list of his iOS blog subscriptions. After all imports, in the list, we see the latest active Swift by Sundell, Ole Begemann… If you are interested, you can download the OPML file and import it directly into your RSS reader.
π Solving a Mysterious Heap Corruption Crash
This is a tragic story, the author’s business encountered a weird memory problem caused by the crash, every way to trace, went through a lot of difficulties, suspected that it was complicated AR business code, but also suspected that it was C/C++ low level code memory control caused by improper. Then he started to remove all the tripartite libraries in the business crazily step by step, still crashing, and removed the heavy business code, still crashing. Finally, it was confirmed that it was a bug of Xcode, which was repaired by the new version of Xcode after submitting the bug. Although it was a tragic story, However, the whole process from finding bugs to solving bugs to digging out why is worth learning from.
π’ πThe AppDelegate Slimming Guide
Putting any code in an AppDelegate is a common problem in the industry. The authors tidy up the way AppDelegate code is decoupled:
- FRDModuleManager: The module manager manages sub-modules in a unified manner.
- (JSjammed) (Act 49) To create a custom AppDelegate class that decouples the App life cycle into several proxies, rather than having all the proxies in the same class as native AppDelegate;
- AppDelegate categorization (Category) : This is a common scenario where code is divided into Category files by function;
- JLRoutes and MGJRouter are also the policies managed by module managers after modularization. They only combine the registration mode of routing system with the first one, which is slightly different.
- Object: Solves using a lightweight dependency injection framework. However, this approach is not mainstream, and it doesn’t really solve the problem of AppDelegate design.
π Getting Started with Flutter
This is a very standard article about Getting Started With XX. You experience a Flutter from several aspects, including brief introduction, configuration environment, HelloWorld, hot reload debugging, component reuse, network request, Table interface, pictures and network, and use theme. Practice and feel for yourself.
The editor thinks this is another giant wheel, let’s see how it works, and whether the business is determined to use it on a large scale needs to be compared and measured.
π IOS wechat special character protection scheme
I believe you all remember the crash of iOS devices caused by special characters. Later, the wechat team protected special characters.
Since there is no way to know in advance that a string contains special characters, you can only let it type/draw first to see if there is a problem. The method is to set the marker bit before typesetting/drawing the string, and remove the marker bit after typesetting/drawing. If a token bit is found, it means that there may be a problem with the string and the string will not be displayed next time.
π What will happen to machine learning and mobile?
Since the release of CoreML with iOS11, machine learning applications on mobile have become more and more important. Zhihu has also carried out a hot discussion on it, among which “Netizen Fine-tuning” shared his insightful views on “the reasons why mobile devices are suitable for machine learning”, “the specific application of mobile terminal machine learning” and “characteristics of machine learning in mobile terminal”.
π Add a current method to NSBundle
Nsbundles are a common class in our development, but Apple does not provide an API to get the current bundle directly from [NSBundle Current]. So the author and his friends have an imagination. They use backtrace() to get the function pointer of the caller, and then use dladdr() to get the library path of the function. Finally, they use this path to match allBundles and allFrameworks. To implement the [NSBundle current] method.
π Look at things from different angles – metaprogramming from Codable to Swift
In this new article, we introduce three solutions to the problem of converting a type into a dictionary: Codable, Mirror, and code generation. But more importantly, meow-shen wants to convey the idea of how to use “metaprogramming” thinking to solve repetitive physical labor problems encountered in projects. (PS: Meow God recently opened a small column, very worthy of attention!)
π Quick access to the Swift static library
This paper records some of the author’s practices on the Swift static library. The authors used a trick trick to quickly add static_framework support to each third-party library by adding custom scripts to their podfiles. However, since it is of a practical type, if you want to introduce it into your own project, there may be some pits that you need to deal with yourself.
π’ Using Swift Server API 0.1.0
This is a Swift Http API usage introduction, a total of three articles, for Swift server development interested friends can take a look:
- Raw API: Describes how to use the Swift Http Raw API
- Β΅Express: 350 lines of code to build a express.js like web framework based on the original API
- Swift Nio: Use the latest SWIFt-NIO to process network requests
π π§ Best iOS Development Tips and Tricks
This article introduces some practical tips on how to use Xcode, and it’s worth checking out in five minutes how to configure Xcode to dramatically improve your productivity.
π Chart control in Apple’s ResearchKit
ResearchKit provides five kinds of default chart UI controls, including common PIE chart (Line chart), Line chart (Line chart), Multi lines graph, and scatter graph (Discreate graph). Mutl Discrate graph. It is also very simple to use, similar to tableView, just set up the DataSource of each table. However, there are too many third-party frameworks for pie charts and wireframes. I doubt how often these controls are used.
design
π’ Great UI Animations tips
This paper mainly analyzes several common design methods of Transition animation. You can learn a lot about the design and purpose of the Transition. For example, how to design transitions when different states need to display the same content. With plenty of GIF explanations, it’s well worth a look.
π π§ Designing a better notification experience for iOS
From the design point of view, Apple should analyze how to optimize the current iOS notification system, filter noise through “grouping” and “temporary mute” two ways, so that users can quickly and easily understand the information.
tool
Sophie
Sophie is a Carthage graphical interface management tool, the current function is still relatively simple, but the basic management functions have been. For graphic interface enthusiasts is a very good tool software.
code
Open-Source iOS Apps
The open source list of iOS, watchOS and tvOS apps, currently collected over 700 projects, GitHub Stars over 16,000 times, is worth a reference.
ZIKCellularAuthorization
There is a bug that the authorization Alert will not be fired when the App is installed on iOS 10 devices for the first time when obtaining network permissions, which makes many developers helpless. The open source author solved this problem through a series of investigations and finally using a proprietary API, and the whole solution and thinking are well worth learning.
In addition, since iOS 11 coverage is currently close to 70%, and this issue only appears in iOS 10-10.3.1, the editors recommend that we carefully consider whether to apply this solution to online apps.
The current editor
@No story zhuo, @Siniang, @Mmoaay, @Xiangerxian, @Eyrefree, @DamonWong, @Msg, @Zhang Jiafu, @Aidenrao, @Parsifal, @Ye Gucheng
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)