Simple SwiftUI ViewModifier to easily align your views!

Related tags

SwiftUI App Align
Overview

Align

Align gives you an easy way to align views in SwiftUI.

Simply import Align in whichever SwiftUI view you like and you're good to go. Align supplies the simple align ViewModifier which you can add to any view.

To put your view on the left, it's as simple as:

Text("Hello, world!").align(.left)

There are 6 different alignments provided by my ViewAlignment enum:

left
centerX
right
top
centerY
bottom

The way it works is by creating spacers in a VStack / HStack around your view to position it how you like.

This library is pretty simple at just one source file - check out Sources/Align/Align.swift for the code and SwiftUI previews for each alignment.

I would honestly recommend just copying the source code directly your own project to avoid littering your code with import Align. If you do, I'd really appreciate a star on Github!

Pull requests and constructive criticism welcome.

You might also like...
SwiftUI Resume - A simple resume writed by swiftUI + Combine
SwiftUI Resume - A simple resume writed by swiftUI + Combine

SwiftUI_Resume a simple "resume" writed by swiftUI + Combine

SwiftUI-Card - Simple card ui designed using SwiftUI
SwiftUI-Card - Simple card ui designed using SwiftUI

SwiftUI - Card Simple card ui designed using SwiftUI Preview

Pegase is a beautifully easy tool to keep track of your financial life on all your macOS
Pegase is a beautifully easy tool to keep track of your financial life on all your macOS

Pegase 🎉 Features 📒 Documentation Personal account software Pegase is a beautifully easy tool to keep track of your financial life on all your macOS

iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.
iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.

iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.While the cost of storage seems expensive in comparison to other online storage services, its advantage is that it works natively across all your devices.

iOS Trakt Client - Keep track of your favorite TV shows and movies on your iPhone. (Under development)

CouchTracker Keep track of your favorite movies and tv shows on your iPhone Setup for development You will need Xcode 11.2.1 Swift 5.1.2 Run the follo

Show off your GitHub contributions from your lock screen 📱
Show off your GitHub contributions from your lock screen 📱

GitHubContributionsiOS V2 NOTICE: V2 is published. It is a complete rewrite using SwiftUI and Catalyst. Source code are now hosted on the version/2.x

Simple iOS app to keep all your Warranties tagged!
Simple iOS app to keep all your Warranties tagged!

Warrenty-Tag A simple iOS app to keep all your Warranties tagged! Description Ever find it difficult to get hold of all your warranties and bills? or

Simple app that tracks your works hours from the status bar.
Simple app that tracks your works hours from the status bar.

Track Your Work Hours Simple app that tracks your works hours from status bar. Features: Simple and private. Data is stored in CSV in the Documents fo

Simple application to manage your task in IOS
Simple application to manage your task in IOS

ToDoList-in-IOS Simple application to manage your task in IOS Functional Require

Owner
Jacob's Apps
I'm an iOS dev / aspiring entrepreneur in London.
Jacob's Apps
Joseph Heck 21 Dec 14, 2022
Animated shine effect for your views

Shine-View-SwiftUI Animated shine effect for your views @State var animateTrigger = false var body: some View { Button(action: { animate

Алексей 9 Sep 14, 2022
A realistic reflective shimmer to SwiftUI Views that uses device orientation. Position any View relative to device orientation to appear as if through a window or reflected by the screen.

A 3d rotation effect that uses Core Motion to allow SwiftUI views to appear projected in a specific direction and distance relative to the device in r

Ryan Lintott 235 Dec 30, 2022
A collection of Swift functions, extensions, and SwiftUI and UIKit Views.

J's Helper A collection of Swift functions, extensions, and SwiftUI and UIKit Views. Legend: ?? UIKit ?? SwiftUI ?? Shared Installation In XCode 12 go

Jem Alvarez 3 Oct 1, 2022
Visualize your dividend growth. DivRise tracks dividend prices of your stocks, gives you in-depth information about dividend paying stocks like the next dividend date and allows you to log your monthly dividend income.

DivRise DivRise is an iOS app written in Pure SwiftUI that tracks dividend prices of your stocks, gives you in-depth information about dividend paying

Kevin Li 78 Oct 17, 2022
Rhythm helps those with Parkinson's more easily coordinate their gait with rhythmic audio.

Rhythm-Parkinson-s-App Rhythm helps those with Parkinson's more easily coordinate their gait with rhythmic audio. Research https://davisphinneyfoundat

Andreas Ink 1 Dec 13, 2021
A package that allows you to easily enable the Xcode canvas to a UIKit view.

UIViewCanvas This package allows you to enable a SwiftUI Xcode canva to a UIView or a entire ViewController. Why? Run emulator everytime you need to t

Wender 14 Jun 9, 2022
Easily create UIViewControllers for news articles similar to those in the News app.

MRArticleViewController This framework allows you to easily setup View Controllers to display News Articles inspired by those from the Apple News App.

Matt Rigdon 104 Apr 18, 2022
SwiftUI Backports - Introducing a collection of SwiftUI backports to make your iOS development easier

SwiftUI Backports Introducing a collection of SwiftUI backports to make your iOS development easier. Many backports support iOS 13+ but where UIKIt fe

Shaps 530 Dec 28, 2022
A simple SwiftUI Application to demonstrate creation of UI using SwiftUI.

WatchShop_UI A simple SwiftUI Application to demonstrate creation of UI using SwiftUI. How to run the project ? Fork the project. Run the project usin

Shubham Kr. Singh 12 Apr 15, 2022