Skip to content

Get Started

Borinschi Ivan edited this page Apr 25, 2024 · 1 revision

To get started with DSKit, a design system toolkit for SwiftUI applications, you can integrate it into your projects using Swift Package Manager (SPM), which is Apple’s dependency manager for Swift projects. Below is a step-by-step guide on how to add DSKit to your project and begin using it to enhance your UI development.

Step 1: Adding DSKit via Swift Package Manager (SPM)

To add DSKit to your project, follow these steps:

  1. Open your Xcode project: Launch Xcode and open the project where you want to include DSKit.

  2. Add the package dependency:

    • Go to File > Swift Packages > Add Package Dependency...
    • Enter the repository URL for DSKit (you'll need to obtain this from the DSKit GitHub repository or the provider).
    • Select the version of the package you wish to add. You can choose a specific release or the latest commit.
    • Xcode will download the package and ask which of your project's targets to add it to. Select the target where you want to use DSKit.

Step 2: Importing DSKit

Once DSKit is added to your project, you can start using it by importing the package at the top of your Swift files where you want to use the design system components:

import DSKit

Step 3: Using DSKit in Your Screens

To integrate DSKit components and modifiers into your SwiftUI views, simply use them like any other SwiftUI component or modifier. Here’s an example of how you might use DSKit:

import SwiftUI
import DSKit

struct ContentView: View {
    var body: some View {
        DSVStack {
            DSText("Welcome to DSKit")
                .dsPadding()
                .dsBackground(.primary)
            DSText("Design with ease")
                .dsPadding()
                .dsBackground(.secondary)
        }
        .dsPadding()
    }
}

In this example, DSVStack, DSText, and various modifiers like dsPadding() and dsBackground() are used. These components and modifiers are part of DSKit and help apply consistent styling and spacing as defined in your design system.

Clone this wiki locally