what is preview
if you write a preview in code,
first xcode examine the change you made
and recompile the minimal amount of code and
second re-run your preview
once you have a preview defined,xcode can run that preview in different contexts automatically without you needing to write any additional code(for example,you can test it in dark mode or different type sizes and orientations)