Search code examples
iosswiftxcodenslayoutconstraintswift5

Swift constraint using multiplier working with trailing but not leading


I have the following two texts the Timer constraint works fine. However when doing the complete same with Score just using leading constraint it's stuck.

Anyone has an idea what I'm missing?

enter image description here enter image description here


Solution

  • Because leading has zero value unlike trailing which = view width , so applying multiplier to zero results in a zero

    You can make it with centerX / trailing also

    enter image description here