'SwiftUI : How to set image in MacOs?

please help me to set image in macOs application using swiftUI

Here is my Implementation:

import SwiftUI

struct SigninView: View {
  var body: some View {
    VStack{
      Image("Profile")
        .resizable()
        .foregroundColor(.white)
    }
  }
}


but image is not visible in View

Image in not visible in view



Solution 1:[1]

import SwiftUI

struct SigninView: View {
  var body: some View {
    VStack{
      Image("Profile") // this is image name from xcassets
     // Image(nsImage: NSImage(named: NSImage.folderName) ?? NSImage()) // method for system image 
        .resizable()
        .scaledToFill()
        .frame(width: 75, height: 75)
        .clipped()
        .aspectRatio(contentMode: .fill)
        .padding()
    }
  }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1