Swiftpack.co - doHernandezM/ManualStack as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by doHernandezM.
doHernandezM/ManualStack 1.1.3
Manual stack lets you conditionally choose a VStack or HStack.
⭐️ 0
🕓 2 years ago
iOS macOS
.package(url: "https://github.com/doHernandezM/ManualStack.git", from: "1.1.3")

ManualStack

Manual stack lets you conditionally choose a VStack or HStack.

Call this just like a normal stack, except pass a Bool to let it know how to behave. Set the ManualStack's isVertical to true for a VStack and false for and HStack.

Example:

ManualStack(isVertical: true){
    ForEach(allInTheRainbowsColors, id:\.self){ color in
        Rectangle()
            .frame(width: 200.0, height:50.0)
            .foregroundColor(color)
    }
}

I very much stole and butchered this from Hacking With Swift

GitHub

link
Stars: 0
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics