Image source: The Verge Apple's self-guided car, mouse pad support on the iPad, camera on the Apple Watch and even more news in the new release of the iOS digest. At the same time, let's see how good SwiftUI is in terms of performance and how to use the Combine framework if the RxSwift chains no longer cling to the soul.
Industry news
The Verge publication reports that Apple is considering the possibility of embedding a camera in its watch. We can only guess how serious these plans are, but the company just in case issued several patents on the integration of the camera in the strap, one of which dates back to 2016. During this time, the camera has not appeared in new versions, but it will still be there. It is reported that it will be possible to photograph using voice control or holding the clock. Judging by the images, to remove from the right angle, it is enough to turn the strap (which looks much more convenient than turning the hand if the camera was built into the case itself).
The iPad is overgrown with the number of possible mating devices: in addition to the keyboard and the stylus, iPadOS has added support for a computer mouse. There was no official announcement, this functionality is disabled by default, but can be enabled in the Universal Access settings.
Apple bought a startup Drive.ai , which is developing a self-driving car. About the fact that Apple is working on its own car with autonomous control, it was already known, but last year there was news that the project was closed. Apparently not, the work continues.
Apple hired one of the top ARM processor designers to work on its own MacBook processor, reports Bloomberg . Judging by the available information, a plan for replacing Intel processors already exists for several years, and the goal has been to switch to their birthmarks on the basis of ARM in 2020.
IOS development news
Developers continue to play with the new version of ARKit 3, several interesting demos have been released: for example, one with the ability to remove people from real-time video. Probably, the function “Block user” in social networks for smart glasses will look like this in the future.
So far, without concrete practical use, but splitting the body into particles in real time looks pretty sticky:
Did you manage to try to do something similar using ARKit? Share ideas in the comments.
The complexity of the Swift language increases, with each update adding more and more functionality. In Swift 5.1, it is possible to write wrappers for properties of classes and structures (in the original property wrappers). They are needed in order to declaratively add some functionality and behavior over the declared type of the variable, thereby increasing the security of the code.
For example, consider a wrapper that automatically cuts spaces and newlines in a line:
import Foundation @propertyWrapper struct Trimmed { private(set) var value: String = "" var wrappedValue: String { get { value } set { value = newValue.trimmingCharacters(in: .whitespacesAndNewlines) } } init(initialValue: String) { self.wrappedValue = initialValue } }
The variant of the declaration and use in the code will look as follows: ')
structPost{ @Trimmedvar title: String @Trimmedvar body: String } let quine = Post(title: " Swift Property Wrappers ", body: "...") quine.title // "Swift Property Wrappers" (no leading or trailing spaces!) quine.title = " @propertyWrapper " quine.title // "@propertyWrapper" (still no leading or trailing spaces!)
It turns out that the new Xcode 11 Preview feature can be used without SwiftUI, but you will have to change the minimally supported version of iOS, which looks a little crutch and may not be applicable to an existing large project. The order of action can be found here .
If you, like me, are interested in the issue of synchronization of client data, be sure to read the article Apple's New CloudKit-Based Core Data Sync . In it, the developer of the data synchronization library Ensembles reflects on the new CloudKit reincarnation of the CoreData synchronization framework from Apple.
For those interested: at the Mobius past in May, I had the opportunity to make a report on the problems of data synchronization on mobile clients with co-editing. In addition, in July it will be possible to personally communicate with one of the ambassadors of the data synchronization issues Martin Kleppman at the Hydra 2019 conference, which will be held July 11-12, 2019 in St. Petersburg. In the meantime, there is an opportunity to read a great interview with him.
Twitter reports that the animation performance of the SwiftUI interface is not inferior to primitives written using CALayer and CoreGraphics.
SwiftUI can process 5-10 times more primitives before performance drops below 60 FPS.