Back in the 2020

In last year’s “A Survey of Swift’s Current status in the iOS ecosystem”, we analyzed the current state of the overall environment. After the article was published, we got a lot of attention. One year later, let’s see what’s changed.

Swift language

Version changes

First, from last year’s 5.2 release to the upcoming 5.4 release, Swift has undergone two minor version changes, 5.3 and 5.4 respectively

Version 5.3 provides the following language features:

  • SE-0276[1] : Catch statements can be more flexible when catching errors, such as catching more than one error at a time or binding error values.

  • SE 0279[2] : Support for multiple trailing closures, a feature primarily intended for SwiftUI.

  • SE-0266[3] : Enum supports the COMPARABLE protocol and determines its size based on order

  • SE 0269[4] : The self keyword declaration can be avoided in some scenarios

  • SE 0281[5] : Locates the program entry with the @main keyword

  • SE-0267[6] : Statements containing the WHERE keyword can be used in generics and extensions of functions

  • SE-0280[7] : Protocol witness matching model is strengthened in enumeration values

  • SE-0277[8] : Adds the data type of Float16

  • SE 0268[9] : didSet method optimization and semantic update

  • Firstly, in SE 0271[10], Swift Package Manager has further improved its support for resource files, meanwhile, in SE 0278[11], SPM has improved its support for localized resources, and in SE 0272[12], The SPM finally supports components in binary form. In SE 0273[13], SPM allows us to configure special dependencies for specific targets.

The following language features will be added in the upcoming 5.4 release:

  • SE-0287[14] : Improved type inference for implicit member expressions.

  • SE-0284[15] : Multiple variable parameters can be defined in a function.

  • SE 0289[16] : The Function Builder published in 5.1 was officially named Result Builder, and improved on the original basis.

  • Sr-10069 [17] : Nested functions support overloading SE 0294[18] : The new executable type target makes the new feature of SE 0281[19] even more

  • Easy to use. In addition to being properties, a Property wrapper can also be used as a local variable inside a function.

On the road to Swift 6

In January 2021, Ted Kremenek[20] of the Swift community, who is also Manager of the Languages and Runtime Team @apple, Swift.org Forum [21] published an article entitled “On the Road to Swift 6” [22]

In this article, some plans for Swift 6 are mentioned. In general, Ted makes three points:

  1. Accelerate the development of the entire Swift software ecosystem: include more compatible development platforms, simplify software installation and deployment, and vigorously develop various tool libraries.

  2. Create the ultimate development experience: faster build times, better debugging tools, more sensitive code completion, and richer diagnostic information.

  3. Further develop the language features with developer feedback: improve the DESIGN of the API, expand its application scenarios in underlying systems, servers and machine learning, and support some of the mainstream language features, such as concurrency and memory-related features.

At the same time, Swift’s core team also experienced some changes, with Saleem Abdulrasool[23] and Tom Doron[24] joining the core team as new members, while [Dave Abrahams] left the core team.

To mention a little, Tom is the core developer of SwiftNIO and the main initiator of SSWG(Swift Server Work Group) project, while Saleem is the core initiator of Swift to Windows. These two changes combine the three main directions from the beginning, and you can see that the entire core team is consistent with what they say.

And here’s what Ted said about the release date of Swift 6:

Instead of announcing a specific timeline for “Swift 6”, the plan is for the community to be a part of seeing these efforts progress, with focused efforts and goals, and we release Swift 6 when those efforts culminate. 

I learn English at the cost of my holidays. I learn English at the cost of my holidays. I learn English at the cost of my holidays.

On the flip side, Swift 5 will be the major release to use in the near future. (PS: Hope this year’s WWDC 21 doesn’t get slapped in the face)

Technical community

Language rankings

Similarly, take a look at the programming language leaderboards TIOBE[25] and PYPL[26]. In TIOBE’s leaderboards, Swift is ranked 15th this year, and Objective-C is completely out of the top 20.

Swift and Objective-C are relatively close on PYPL’s leaderboards.

The language leaderboards in the community, while at first glance it may seem like Swift and Objective-C are co-existing, reflect that Swift has been accepted by the majority of developers.

Community activity

GitHub was also analyzed by GitHut 2.0[27].

The Y-axis of the four figures below represents the number of Pull Requests, Intermediate Requests, Stars, and Issues, with the blue line representing Objective-C and the light orange line representing Swift.

It can be found that in terms of Pull Request, Swift accounts for about 0.595%, while Objective-C accounts for about 0.335%

Meanwhile, Swift accounted for about 0.476% of Push, while Objective-C accounted for about 0.310%

In terms of Stars, Swift accounted for about 2.107%, while Objective-C accounted for about 1.067%

In terms of issues, Swift accounted for about 0.767%, while Objective-C accounted for about 0.607%

Overall, in the GitHub environment, Swift continues to be a positive and relatively active community of developers, especially Star, which is nearly twice as strong as Objective-C.

Technical selection of commercial SDK

We’ve also seen some interesting developments this year, as many commercial SDKS have started migrating to Swift.

For example, Nordic Semiconductor[28], a Semiconductor company in Northern Europe, mainly focuses on Bluetooth chips and is in the leading position in the industry. Many teams using other chips will be involved in firmware upgrade. Wireless upgrade scheme requires firmware transmission, verification, upgrade management and other actions. All of this is done using the SDK provided by their home.

                                                                          

On the GitHub page [29] of Nordic Semiconductor, we can see that currently available commercial SDKS only have Swift version [30] on the iOS side and Java version [31] on the Android side.

At the same time, Google’s Firebase has clearly pointed out in its RoadMap[32] that it will pay more attention to the use experience of Swift and started some transformation.

In the near future, we expect more and more vendors to join the Swift community. In addition to the fact that Swift is the future and everyone knows it, the new features in the last two years, such as ABI stability, Module stability, and SPM support for binary components, will change the attitude of vendors. This is especially true for vendors who need to distribute components in non-source form, since these features fundamentally solve their engineering problems.

Apple ecological

The SDK ability

Similarly, we went on to analyze 239 topics under Apple Developer Documentation[33] and found that this year’s Swift and Objective-C exclusive SDKS were as follows

In terms of Swift exclusive, three SDKS have been added, which are Developer Tools Support, System, WidgetKit, System[34] is a library for low-level file operation, which seems to be Apple’s first System low-level library written in Swift. Another important point to mention is WidgetKit[35], which is the first time Apple has forced developers to use Swift technology when promoting new features in the system. This strategy I think is very clever, and it provides a new way for Swift technology to be promoted and applied.

There is also a new SCSIControllerDriverKit[36] for objective-C exclusive aspects, but compared to last year, Professional Video Applications[37] and IOUSBHost[38], two objective-C specific SDKS, have been modified to work with both Swift and Objective-C. And QTKit was completely abandoned.

So, for the first time, there are more Swift exclusive libraries than Objective-C exclusive libraries. Isn’t that interesting?

Native App Analytics

Foreign developer Timac[39] analyzed the use of Swift and SwiftUI in iOS14 in his article “Apple’s Use of Swift and SwiftUI in iOS14” [40].

IOS 14.0 includes 291 binaries using Swift technology (PS: Another caliber is 351, but Timac excluded it because there are so many applications that use Swift so rudimentary), which is more than twice as many as iOS 13, and Swift UI is also widely used on iOS 14, with 43 now. The new translation App added last year was an App written entirely using Swift and SwiftUI.

The development of different programming languages in iOS

Timac’s article Evolution of the Programming Languages from iPhone OS 1.0 to iOS 14 [41] offers some interesting conclusions.

First, in iOS 14, there are a total of 4173 binaries. For a detailed list, refer to iOS 14.0 (18A373) statistics [42], where:

  • 88% use Objective – C

  • Using c + + 17%

  • 8% use Swift

  • 8% of all C

  • 1% use SwiftUI

Note that binaries can contain multiple languages, so the total in the table below may be greater than the total number of binaries. For example, in iOS 14.0 44 + 351 + 337 + 708 + 3667 > 4173

From this perspective, several interesting conclusions can be drawn:

  • First, iOS gets more complex with each version

  • The use of Swift is on the rise and, at least for now, it has surpassed that of C

  • Objective-c is growing fairly steadily

  • Growth in C++ is slow, or rather slow

  • The increase in C is almost unchanged

If the above diagram doesn’t seem obvious, we can see the trend through this diagram.

Of course, the above analysis is based on quantity, but what if we look at it in terms of volume, in terms of binary size?

In their article Comparing iPhone OS 1.0 with iOS 14 Using Tree Maps [43], Timac gives some of its own interpretation.

The following is a tree Map for iOS 14 drawn by Timac based on relevant data and scripts [44]

  • Preinstalled Assets and Linguistic Data are preset resources related to machine learning

  • Health-related content is not a small part of iOS 14, which shows how important it is

  • Since iOS 3.1, dyld Shared Cache technology has been introduced. The red area is the framework that supports this feature.

Of course, Timac breaks this down a little bit more, and its results are as follows

It’s clear that Apple’s AI is driving machine learning on devices, such as object detection in images and video, language analysis, voice classification, and text recognition.

So if you want to continue developing on iOS in the future, machine learning may be a necessary foundation (PS: if you’ve ever developed a widget like IntentConfiguration[45], I think you know what I’m talking about).

Application status of domestic and foreign clients

The data sample

Last year, we analyzed the use of Swift by domestic and foreign apps. This year, we continue to go forward.

The principle of scanning is borrowed from how to Detect if an iOS application is using Swift? [46], which I co-wrote with my gay friend OneeMe[47].

The data source of the App ranking is provided by Qimai Data [48], and the date is March 21, 2021. The Top 100 domestic free apps [49] and the Top 100 foreign free apps [50]

Here are the results of the scan:

On GitHub, there is a Snake List[51] compiled by Flexih[52], which includes Weex, React Native, Flutter and other technologies.

In 2021,

Among the Top 100 free applications abroad, Swift mix accounted for 91%.

Among the Top 100 free apps in China, Swift mix accounts for 59 percent.

In a previous post, “A Survey of Swift’s status in the iOS ecosystem,” we also put together some data.

In 2019, the domestic and foreign mixed Swift applications accounted for 22% and 78% respectively; in 2020, the domestic and foreign mixed Swift applications accounted for 30.4% and 82.3% respectively.

If the data of recent years are viewed together, the change trend of Swift at home and abroad is shown in the following figure:

Data interpretation

Looking purely at the data:

  • In China, the proportion of Swift mix reached 59%, which increased by 29% compared with 30% last year, and the overall proportion has reached more than half!

  • Abroad, Swift mix accounted for 91%, up 9% from 82.3% last year, and pure Objective-C apps were in the single digits.

So let’s look at some of the data behind the scenes:

  • On the surface, in addition to BAT mentioned last year, Toutiao, Kuaishou, Didi, Alipay, JD, Pinduoduo and many other apps have also completed the initial experience of Swift this year. What is interesting is that meituan’s apps (Meituan, Dianping, Meituan Takeout) seem to have no movement at all.

  • Although the proportion of mixed Swift in China has become higher, I personally believe that this does not represent that most domestic companies will start to transform Swift technology. This change is mainly caused by the Widget technology added by Apple last year, because the technology related to Swift must be used to develop widgets. Most of the applications mentioned above provide widgets.

  • If history is any guide, the domestic Swift share in 2021 (59%) will be fairly close to the foreign Swift share in 2019 (78%), at least not as big a gap as last year (30% vs. 82.3%). Can we predict that in the next 3-5 years, the proportion of Swift mixed applications in China will reach about 90%?

PS: At the time of writing this document, I found that micro-blog also supports widgets, so it is estimated that the above data will be increased by 1%.

Summary and Prospect

After this year’s survey, what can we conclude?

  • Swift seems to be on an accumulation path at this stage, but with WidgetKit, the iconic SDK, I believe it will move from accumulation to growth, now that the ABI is stable, the Modules are stable, and support for binary components is available. And the Swift language itself has been steadily changing, which gives Swift good support.

  • Swift’s direction is not just for the Apple ecosystem. We can see from the community planning and Timac’s analysis that Swift is committed to diversifying. Swift really wants to break out of the loop.

  • The development of Swift in China has been boosted by the new features of iOS 14 last year, and WidgetKit has contributed a lot. Although it is not yet clear that most companies will make the transition, at least most leading companies on the Internet are already compatible with Swift, which is a good start. I believe that in the foreseeable future, Apple’s determination to transform will inevitably make domestic companies pay more attention to the importance of this work.

In closing, a few other things I learned this year:

Not long ago, Google archived the Swift for TensorFlow[53] project, which made many people underestimate Swift’s development in machine learning or ARTIFICIAL intelligence, but IN fact, I think it is a little unnecessary. Swift’s development in this area is actually not dependent on Google. If you are interested, you should check out the website Machine Learning Research at Apple[54], which represents the true level of Machine Learning of Apple and Swift.

In addition, while you can still see phrases like “Swift is useless “, “Swift is not going anywhere “, “we don’t need to develop in Swift” in some tech groups, the numbers are actually less and less than they were in previous years.

In addition, as far as I know, bytedance’s Tiktok team will all migrate to the Swift technology stack in Q2 2021. This migration is not only about the upper business changes, but also seems to include the underlying base library, which means they will use Swift for development in the near future. At the same time, I also heard that kuaishou team is vigorously developing Swift.

Although this is just an example of many domestic companies, I believe that with the joining of these leading manufacturers, Swift will become the mainstream trend of native development in China more and more obviously. Of course, we have to admit that cross-end technology also has a huge market share in China, so IT is estimated that as a programmer on iOS in the future, Language technology stacks of Objective-C, Swift, JavaScript/TypeScript, and Flutter may be required.

Well, this year’s research report is over, we will see you next year!

Click to get:IOS Interview Materials

Reference documentation

  • SketchK – a survey of the current state of Swift in the iOS ecosystem

  • Paul Hudson – Hacking with Swift – What’s new in Swift 5.3? [55]

  • Paul Hudson – Hacking with Swift – What’s new in Swift 5.4? [56]

  • Swift.org forum – On the road to Swift 6[57]

  • TIOBE[58]

  • PYPL[59]

  • GitHut 2.0 [60]

  • Apple – Apple Developer Documentation[61]

  • Timac-comparing iPhone OS 1.0 with iOS 14 Using Tree Maps [62]

  • Timac-evolution of Programming Languages from iPhone OS 1.0 to iOS 14[63]

  • Timac-apple’s Use of Swift and SwiftUI in iOS 14[64]

  • Timac – How do I detect if an iOS application is using Swift?

  • OneeMe – Swift App Analyzer[65]

  • Flexih – Snake List[66]

  • Apple – Machine Learning Research at Apple[67]

The resources

[1] SE – 0276: github.com/apple/swift…

[2] the SE – 0279: github.com/apple/swift…

[3] SE – 0266: github.com/apple/swift…

[4] SE – 0269: github.com/apple/swift…

[5] SE – 0281: github.com/apple/swift…

[6] SE – 0267: github.com/apple/swift…

[7] SE – 0280: github.com/apple/swift…

[8] SE – 0277: github.com/apple/swift…

[9] SE – 0268: github.com/apple/swift…

[10] SE – 0271: github.com/apple/swift…

[11] SE – 0278: github.com/apple/swift…

[12] the SE – 0272: github.com/apple/swift…

[13] SE – 0273: github.com/apple/swift…

[14] SE – 0287: github.com/apple/swift…

[15] SE – 0284: github.com/apple/swift…

[16] SE – 0289: github.com/apple/swift…

[17] the SR – 10069: bugs.swift.org/browse/SR-1…

[18] SE – 0294: github.com/apple/swift…

[19] SE – 0281: github.com/apple/swift…

[20] Ted Kremenek: twitter.com/tkremenek?r…

[21] swift.org forum: forums.swift.org/categories 

[22] On the Road to Swift 6: forums.swift.org/t/on-the-ro…

 [23] Saleem Abdulrasool: github.com/compnerd 

 [24] Tom Doron: github.com/tomerd 

[25] TIOBE: www.tiobe.com/tiobe-index…

 [26] PYPL: pypl.github.io/PYPL.html 

2.0: [27] GitHut madnight. Making. IO/GitHut / # / pu…

 [28] Nordic Semiconductor: www.nordicsemi.com/ 

[29] GitHub: github.com/NordicSemic…

[30] Swift version: github.com/NordicSemic…

[31] Java version: github.com/NordicSemic…

[32] RoadMap: github.com/firebase/fi…

[33] Apple Developer Documentation: developer.apple.com/documentati…

[34] System: developer.apple.com/documentati…

[35] WidgetKit: developer.apple.com/documentati…

[36] SCSIControllerDriverKit: developer.apple.com/documentati…

[37] Professional Video Applications: developer.apple.com/documentati…

[38] IOUSBHost: developer.apple.com/documentati…

 [39] Timac: github.com/Timac 

[40] Apple’s Use of Swift and SwiftUI in iOS 14: blog.timac.org/2020/0927-s…

[41] Programming Languages from iPhone OS 1.0 to iOS 14: blog.timac.org/2020/1019-e…

[42] iOS 14.0 (18A373) Statistics: blog.timac.org/2020/1019-e…

[43] Comparing iPhone OS 1.0 with iOS 14 Using Tree Maps: blog.timac.org/2020/1122-c…

[44] A rectangular tree structure drawing method: www.wikiwand.com/zh/%E7%9F%A…

[45] IntentConfiguration: developer.apple.com/documentati…

[46] How to detect whether an iOS application uses Swift? : mp.weixin.qq.com/s/vF\_oOWFL…

 [47] OneeMe: github.com/OneeMe

[48] Qimai Data: www.qimai.cn/

[49] Top 100 Free Apps in China: www.qimai.cn/rank/index/…

[50] Top 100 Free Apps: www.qimai.cn/rank/index/…

[51] Snake List: github.com/flexih/Snak…

 [52] Flexih: github.com/flexih

[53] Swift for TensorFlow: github.com/tensorflow/…

 [54] Machine Learning Research at Apple: machinelearning.apple.com/

[55] Paul Hudson – Hacking with Swift – What’s new in Swift 5.3? : www.hackingwithswift.com/articles/21…

[56] Paul Hudson – Hacking with Swift – What’s new in Swift 5.4? : www.hackingwithswift.com/articles/22…

[57] Swift.org Forum – On the Road to Swift 6: forums.swift.org/t/on-the-ro…

[58] TIOBE: www.tiobe.com/tiobe-index…

 [59] PYPL: pypl.github.io/PYPL.html

2.0: [60] GitHut madnight. Making. IO/GitHut / # / pu…

[61] Apple – Apple Developer Documentation: developer.apple.com/documentati…

[62] Timac-Comparing iPhone OS 1.0 with iOS 14 Using Tree Maps: blog.timac.org/2020/1122-c…

[63] Programming Languages from iPhone OS 1.0 to iOS 14: blog.timac.org/2020/1019-e…

[64] Timac-Apple’s Use of Swift and SwiftUI in iOS 14: blog.timac.org/2020/0927-s…

[65] Oneeme-Swift App Analyzer: github.com/ZRTransmitt…

[66] Flexih-Snake List: github.com/flexih/Snak…

 [67] Apple – Machine Learning Research at Apple: machinelearning.apple.com/ 

This is the end of the article, you can send me a personal message to get the iOS development and interview information. If you have any comments and suggestions, please leave me a message.

Please pay attention to iOS friends! Like words to a like it! Thank you very much! Thank you very much! thank you

blog.csdn.net/Desgard\_Du…