Smart Layout coded with Swift