Sebastian Faltoni Software Architect. Passionate about Clean Code, Tech, Web, AI, .NET, Python, IOT, Swift, SwiftUI and also Blazor

A better way to programmatically handle constraints on iOS

18 sec read

There are many libraries for simplifying constraints definition from code.

The best one i have found for my self is SnapKit.

Lets say that you have a vertical stack that your want to constraint with it’s parent edges , but your want also to add some edge offset.

 vstack.snp.makeConstraints {
            (make) -> Void in
            make.left.equalToSuperview().offset(30)
            make.right.equalToSuperview().offset(-30)
            make.bottom.equalToSuperview().offset(-30)
            make.top.equalToSuperview().offset(30)
  }

SnapKit has also many more extensions that will help you make your constraint definition easier.

Sebastian Faltoni Software Architect. Passionate about Clean Code, Tech, Web, AI, .NET, Python, IOT, Swift, SwiftUI and also Blazor

A simple extension to use Combine with PromiseKit and…

Because ServiceStack use PromiseKit for it’s async calls on Swift, i made this little extension that convert a PromiseKit request into a Combine publisher....
Sebastian Faltoni
39 sec read

Leave a Reply

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