Using Images

Adding image to a view.

  • adding image view is done by using Image key word.
Image("name of the image goes here")
  • SwiftUI will add this image to original proportions.
  • this can be fix by using
  • modifier, this modifier cause the image to fit within its view.
  • to keep the aspect ratio following modifier can be used.
.aspectRatio(contentMode: .fit)
  • for specifying width and height of the image.
.frame(width: 200, height: 200)

for details about other modifiers please look into project file and