Dark Mode
No big surprise was the presentation of the system-wide Dark Mode. As it has been possible in macOS since
Mojave, iOS can also be given a dark appearance from now on. Depending on the user's
settings, the apps should of course also reflect the configured settings.
The new semantic colors of UIColor make it very easy for
developers to support dark mode. For example, colors for light and dark appearance can
be defined for UIColor.label, UIColor.secondaryLabel, UIColor.systemBackground and many
more standard elements. When developing the views, care should then be taken not to use
explicit colors such as UIColor.red, but instead to use the semantic colors described
earlier. A middle way offers the use of standard colors, but then UIColor.systemRed
should be used instead of UIColor.red, because here at least the color tone adapts
somewhat to the current appearance.
If there are certain reasons, it is also possible to always use Light or Dark Mode in
certain areas of the app. This can be configured in each UIViewController.
iPad OS
The introduction of iPadOS offers a big change. While the iOS operating system previously
included both iPhone and iPad, there is now a dedicated name for the operating system of
Apple's tablets. Even though it is more of a marketing name - iOS still runs under the
hood - some innovations have been introduced that will please Pro users.
Probably the biggest new feature for iPad users is the revamped multitasking. Developers
are challenged by the ability to have multiple windows of the same app open side by
side. The new classes UIScene, UIWindowScene as well as the
UIWindowSceneDelegate play a major role in this. If
the user opens several windows of an app, each is referred to as a scene, but all
windows still use the same AppDelegate. A SceneDelegate is responsible for each scene,
and Xcode 11 generates a SceneDelegate in addition to the AppDelegate in a new project.
An interesting feature that went unmentioned in the keynote is the ability to control the iPad with a mouse. The
configuration is possible via the Operating Aids menu in the settings.
Project Catalyst
At the end of the keynote, Apple provided great innovations and opportunities for
developers. On the one hand, Project Catalyst was shown, which was already announced
last year and was previously known under the codename Marzipan. This should now make it
possible to port iOS apps to the Mac.
In the Xcode 11 beta version, it is possible to specify that an app should be available
for macOS in addition to iPhone and iPad. Merely checking the box should thus already
bring a native app experience to the Mac. All code of the existing iOS app is ported to
the Mac and can then be refined for an optimal Mac experience. In any case, Catalyst offers great potential,
Twitter and Atlassian
(Jira) among others, announced that they would bring their existing iOS apps to the Mac.
Swift UI
Apple finally caused great astonishment with its last announcement of the evening. With
SwiftUI
a completely new framework was presented that is supposed to make it much easier to
define user interfaces for all platforms.
Figure 1: Example for the setup of a table with SwiftUI
Apple has already provided some Tutorials
und Ressourcen for the new UI framework. Among them, there is also a Tutorial on how SwiftUI can interact with UIKit.
It is interesting to note that SwiftUI is not just a simple abstraction layer to UIKit.
In one of Apple's test projects, developer Adam Bell
was able to determine that a UILabel was not simply used for the displayed text.
Instead, it is simple UIViews/CALayers.
However, SwiftUI requires the latest versions of the Apple platforms and is therefore not
interesting for many developers at this point, since the principle here is usually to
support the two most current versions, for iOS this would be iOS 13 and iOS 12. However,
the potential is great and the planned WWDC sessions this week should provide even more
insight into what is possible with the new UI framework. Projects created in Xcode 11
are at least already generated without Main.storyboard.
More new frameworks
In addition to SwiftUI, several other new frameworks for developers were introduced. One
of them is the framework Combine, which could possibly be called Apple's
answer to RxSwift and similar frameworks from the field of reactive programming.
This is intended to simplify the handling of asynchronous events, which makes techniques
such as data binding easy. This allows, for example, user interface views to be
automatically updated when something changes in the data source.
The Framework BackgroundTasks is supposed to make it
possible to execute tasks in the background. This is to ensure that the app's content is
kept up to date and to execute tasks that sometimes take over minutes.
Apple
CryptoKit offers new possibilities to execute operations securely and
efficiently. Like SwiftUI, all of the above frameworks can only be used from the latest
versions of all Apple platforms.
All other new frameworks can be found here.
SF Symbols
With SF Symbols, Apple offers over 1000 icons and symbols that can be used from the
latest versions iOS 13, watchOS 6 and tvOS 13. It is somewhat surprising that macOS
10.15 is not mentioned in the Documentation.
Figure 2: SF Symbols App (macOS Mojave 10.14.4 and later)
Each icon comes in three sizes (small, medium and large) and can also be exported as a
template vector graphic to modify for your own purposes. For the use of SF Symbols there
is a new UIImage initializer UIImage(systemName:), in which the name of the desired
symbol must be passed as a string. For macOS (10.14.4+) there is also an SF Symbols app
where all icons can be viewed. This can be downloaded from the documentation page.
Xcode 11
The new version of Apple's development environment offers direct integration of the Swift
Package Manager. GitHub repositories can be easily added as a dependency in a project,
making the Swift Package Manager an interesting alternative to the existing dependency
managers CocoaPods and Carthage.
Furthermore, a small map has been integrated into Xcodes Editor on the right side, which
serves as an orientation at which point of the code you are currently located. This
feature already exists in well-known editors such as Sublime Text and can be seen in the
image on the right. Comments in Xcode now support rich text and can therefore display parts in bold or italics, for example.
Apple provided many interesting innovations at the WWDC keynote, first and foremost
Project Catalyst and the new SwiftUI framework. It is a bit of a shame that most of the
innovations require the latest versions of all platforms, which still makes it difficult
for productive use if you do not want to exclude all users of older versions.
Yesterday evening also offered much more than was pointed out in this article and thus
enough exciting news. Finally, it should be said that Apple explicitly points out under
the disclaimer „Important Note for Thrill Seekers“ that the
first beta version is only intended for developers, which is also reflected in the Release
Notes.
Text and image references: