Access Dynamic Island in Xcode – Swift

I am too curious to know how to access or work with Dynamic island in Xcode with Swift.

To be honest, till now they haven’t released anything like that for the developers like us. iPhone 14 users can use the dynamic island with some specific applications.

Apple developer tools engineer confirmed on a forum that Live Activities can be implemented through ActivityKit Framework.

It will be added to iOS 16 at the end of this year 2022.

So you just can’t use that now. After releasing it you will be able to interact with Dynamic Island through this cool framework.

You can refer to this news:

Apple has clearly mentioned that it is in beta mode and we can’t use that feature in an initial public release.

We are excited too to interact with Dynamic Island. We are expecting that we can add the info messages too in Dynamic Island. But if Apple restricts or set boundaries on what we can do with that then we will be able to do some limited things on that.

We will try to give you an update here on this page after releasing that.


I have received an Update and Xcode now added iPhone 14 emulator.

And they have also added the documentation of ActivityKit. But it is in the Beta version. The documentation will update soon.

To add a dynamic island in Swift, you will need to use the UICollectionView class. A collection view is a flexible and customizable view for presenting a collection of data items in rows or columns.

Here is an example of how to set up a basic collection view with a dynamic island layout in a SwiftUI view:

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationView {
                .navigationBarTitle("Dynamic Island")

struct CollectionView: UIViewControllerRepresentable {
    func makeUIViewController(context: Context) -> UICollectionViewController {
        let collectionView = UICollectionViewController(collectionViewLayout: createLayout())
        collectionView.collectionView.backgroundColor = .systemBackground
        collectionView.collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "cell")
        return collectionView

    func updateUIViewController(_ uiViewController: UICollectionViewController, context: Context) {}

    func createLayout() -> UICollectionViewLayout {
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)

        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalWidth(0.2))
        let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 2)

        let section = NSCollectionLayoutSection(group: group)

        return UICollectionViewCompositionalLayout(section: section)

This example creates a collection view with a dynamic island layout that displays a grid of cells with two columns. The layout is created using the UICollectionViewCompositionalLayout class, which allows you to create flexible and customizable layouts using a declarative API.

You can customize the layout further by adjusting the itemSize, groupSize, and section properties to suit your needs. For example, you can change the number of columns or rows, specify fixed or estimated sizes for the items and groups, and add supplementary views to the layout.

Some Examples of Uses of Dynamic Island in SwiftUI

  • If you are planning to build a live score App then you can show the live scores in the Dynamic Island area.
  • For the fitness app, you can show the information as well.
  • You can show download and upload status too.
  • If we render a video we can show that rendering status too.
  • For the music app, we can show the duration and current playing time live.

These are only a few examples.

Basic understanding of Live Activity in SwiftUI

We have seen widgets in iOS 14 and Activity is simply a widget.

For different states, we can set different UI in SwiftUI.

For example, if you make an App then the main App will be responsible for adding or removing the activity by sending the necessary data to this Activity widget. Thus we can also update the Activity spontaneously.

Dynamic Island SwiftUI

So from the above image, we can see that Target sends the activity attributes to the Activity widget and the system will handle all the Dynamic information and animations as well.

In this tutorial, I am not going to dive deep into the coding part, but you can do it on your own by reading this article.

Which version of Xcode Actually supports the Live Activity or the Dynamic Island

You must have to install Xcode 14.1 in order to use the Dynamic Island feature in your Application.

The iOS version should be 16.1 or Higher.

So make sure you have set the iOS version of your app to at least 16.1

Note that: Dynamic Island is not supported on iPhone 14. So if you are going to run your application, make sure you use iPhone 14 pro simulator or a Physical device. In Xcode 14.1 you will be able to do so.

How to setup Live Activities in our App

We must have to add support for Live Activities. In order to do that, we have to add a key Supports Live Activities to our info.plist file. Set the value to “YES”.

Now get the proper idea of how our widget is going to work.

I am taking an example of a Music Player App.

So in this type of App, the duration of a particular Music (Playing right now) is constant and the current play time is going to be updated. We can also think of the remaining time of the Music playing right now.


To Build a Simple Dynamic Island that will pop up a message you can see this tutorial: Replicating the Dynamic Island Animation in SwiftUI

The iOS is really great as it does most of the work by itself. It saves a lot of time for the developers.

Three different layouts of Dynamic Island

There are three types of layouts:

  1. Compact
  2. Minimal
  3. Expanded

Compact mode

It is the regular mode. If we exit the app it shrinks into the dynamic island.

Minimal Mode

It’s for minimal view at the time when another app is shrinking.


If we press and hold down the Dynamic Island it will give you a larger space to have more options in it.

Leave a Reply

Your email address will not be published. Required fields are marked *