iGraphics

Quickly add familiar default graphics to your app. πŸ–Ό πŸ“„ πŸ”² πŸ†’

1.

Install iGraphics.

2.

Add iGraphics to your project.

import SwiftUI
import iGraphics

struct ContentView: View {
    var body: some View {
        iGraphicsBox()
    }
}

3.

Customize your iGraphics.



Examples

Shopping App

Add demo shopping rows.

import SwiftUI
import iGraphics

struct ContentView: View {
    var body: some View {
        ScrollView {
            iGraphicsBox(.photo)
                .stack(10)
        }
    }
}

Default Graphics

Use these graphics to quickly give your app personality.

import SwiftUI
import iGraphics

struct ContentView: View {
    var body: some View {
        ScrollView(.horizontal) {
            HStack {
                iGraphicsView(.first)
                iGraphicsView(.second)
                iGraphicsView(.third)
            }
        }
    }
}

Customize

The iGraphics package has several built-in View structures. Each struct has a set of initializers that remain consistent across all structs.


Use our exhaustive input list to customize your colors.

Poperty, Initializer, or Modifier Description
iGraphicsBox.init(_ style: Style = .photo) 
iGraphicsBox's are light gray boxes meant to resemble common UI components πŸ‘€. The struct takes one of four style parameters: 1️⃣ photo, 2️⃣ caption, 3️⃣ paragraph, or 4️⃣ card.
.flip() -> iGraphicsBox 
Flips the of iGraphicsBox across its horizontal axis, πŸ‘ˆπŸ‘‰ so the image is on the right and the text is on the left. Applies only to the Style.photo style, since the others are symmetrical.
.textSize(_ size: CGFloat) -> iGraphicsBox 
Modifies the text size πŸ“ƒ that the boxes of words are meant to simulate. β–ͺ️◾️◼️⬛️
.photoSize(_ size: CGFloat) -> iGraphicsBox 
Modifies the photo size πŸ–Ό that the boxes are meant to simulate. β–«οΈβ—½οΈβ—»οΈβ¬œοΈ
.stack(_ number: Int, alternating: Bool = false) -> some View 
Modifies how many graphics boxes are stacked on top of each other πŸ₯žπŸ“š. Allows you to easily stack simulated graphics without worrying about spacing and without creating your own VStack object. Will stack based on the style specificied in the constructor.
.stack(_ styles: [Style], alternating: Bool = false) -> some View 
Modifies how many graphics boxes are stacked on top of each other πŸ”’πŸ₯ž. Allows you to easily stack simulated graphics without worrying about spacing creating your own VStack object. Will stack based on the styles specificied in the styles parameter.
iGraphicsText.init(_ style: .first) 
Creates great-looking dummy text πŸ“–πŸ“ƒ object to be used for placeholding with specified style.
iGraphicsImage.init(_ style: .first) 
Creates a iGraphicsImage from a specified style of image. iGraphicsImage is a great-looking dummy image view πŸ–Ό that displays as a square, and can show a number of different images.
iGraphicsView.init(_ style: .first) 
Creates a new iGraphicsView from a specified style of image. iGraphicsView is a great-looking dummy combined image πŸ™ and text πŸ“œ view. Comes in several different styles created from a sequence. Ideal for display in a page view.
iGraphicsView.all: [iGraphicsView] 
Easily access an array to all the iGraphicsView views, in order, to be used, for example, in a page view.

Community

Meet the developers behind iGraphics.

@benjaminsage


iOS 13.0+

WatchOS 6.0+