sindresorhus/CircularProgress

Enforce aspect ratio in Interface Builder #2

sindresorhus posted onGitHub

Currently, you're able to set it to 300x100 in Interface Builder, which makes it look broken. Would be nice to enforce aspect ratio of 1:1 using auto layout. According to https://forums.developer.apple.com/thread/4108, it should be possible:

Currently Interface Builder does not allow overriding the layout interactions of a view via IBDesignable (e.g. overriding the standard resizing behaviors in IB). You should, however, be able to add an aspect ratio constraint to your view in your code and IB's auto layout integration will pick this up and properly size the view whenever you choose the "Update Frames" command in the canvas.

But I could not get it working.

How to create aspect ratio constraint: https://stackoverflow.com/questions/31334017/how-can-i-set-aspect-ratio-constraints-programmatically-in-ios


Fund this Issue

$50.00
Rewarded

Rewarded pull request

Recent activities

boyvanamstel was rewarded by sindresorhus for sindresorhus/CircularProgress# 2
about 6 years ago