Category: SwiftUI
-
Preparing and Submitting an iOS App to the App Store
After developing an iOS application, the final step is submitting it to Apple’s App Store. Preparing and submitting an application is a multi-step process details of which will be covered in this chapter. Verifying the iOS Distribution Certificate The chapter entitled How to Join the Apple Developer Program covered the steps involved in generating signing…
-
Integrating SwiftUI with UIKit
Apps developed before the introduction of SwiftUI will have been developed using UIKit and other UIKit-based frameworks included with the iOS SDK. Given the benefits of using SwiftUI for future development, it will be a common requirement to integrate the new SwiftUI app functionality with the existing project code base. Fortunately, this integration can be…
-
Integrating UIViewControllers with SwiftUI
The previous chapter outlined how to integrate UIView based components into SwiftUI using the UIViewRepresentable protocol. This chapter will focus on the second option for combining SwiftUI and UIKit within an iOS project in the form of UIViewController integration. UIViewControllers and SwiftUI The UIView integration outlined in the previous chapter is useful for integrating either…
-
Integrating UIViews with SwiftUI
Prior to the introduction of SwiftUI, all iOS apps were developed using UIKit together with a collection of UIKit-based supporting frameworks. Although SwiftUI is provided with a wide selection of components with which to build an app, there are instances where there is no SwiftUI equivalent to options provided by the other frameworks. Given the…
-
Troubleshooting Live Activity Push Notifications
It can be frustrating when a Live Activity fails to update in response to a push notification, and identifying the cause can initially seem challenging. Part of the problem is that push notifications and Live Activities use systems over which we have little control, such as the APNs, the predictive engine that decides when the…
-
Testing Live Activity Push Notifications
The previous chapter explained how to add support for push notifications to a Live Activity. Once enabled for push notifications, the Live Activity is ready for testing. Test push notifications can be sent from the CloudKit console or the command line using the curl tool. This chapter will demonstrate both options, including generating the authentication…
-
An iOS 17 Live Activity Push Notifications Tutorial
Although we have demonstrated that Live Activities can be updated from within an app, a more likely scenario is that the updates will be generated by a remote server and sent to the device. This can be achieved using push notifications. This chapter will introduce push notifications and convert the LiveActivityDemo project from local updates…
-
Adding a Refresh Button to an iOS 17 Live Activity
The previous chapters introduced Live Activities and created an example project demonstrating Live Activities in action. While testing the example app, it became evident that, regardless of configuration settings, Live Activity updates can be infrequent when the app is in background mode. While we have limited control over when an update will be processed, this…
-
A SwiftUI Live Activity Tutorial
In this chapter, we will create a project demonstrating how to add a Live Activity to a SwiftUI-based iOS app using WidgetKit and ActivityKit. The project will include support for lock screen, Dynamic Island, and alert activity views, providing a practical example of activity widget attributes and creating, updating, and managing Live Activity instances. About…
-
An Overview of Live Activities in SwiftUI
The previous chapters introduced WidgetKit and demonstrated how it can be used to display widgets that provide information to the user on the home screen, lock screen, and Today view. Widgets of this type present information based on a timeline you create and pass to WidgetKit. In this chapter, we will introduce ActivityKit and Live…