Monday Hero can automatically understand the images, and convert design to Swift/Kotlin code.
Images can be used to improve the UX, capture users' attention, or differentiate the product. ImageViews are non-interactive by default. Images in the designs are automatically detected after exporting. They are saved as assets, and their code is generated by Monday Hero. Icons and logos are also classified as images. Let's have an example and understand it clearly. A simple image, an icon, a logo, and their generated codes can be seen below.
All images, logos, and icons should be marked exportable before exporting the design to Monday Hero with plugins. Otherwise, the code and assets are not generated for them. Click and read here to learn more and see examples.
Generated iOS/Android Code of Images
Images are called and defined in ImageView to display image resources in both Swift/XML/Kotlin language. Let's see the generated code and its attributes.
In iOS, Images are connected to the builder and there is no additional code below since the constraints are already defined in the storyboard file automatically.
//ListPageViewController.swift importUIKitclassListPageViewController:UIViewController {// MARK: - Properties//Connection from an Interface Builder to a UI component@IBOutletprivateweakvar photoImageView: UIImageView!@IBOutletprivateweakvar iconImageView: UIImageView!@IBOutletprivateweakvar logoImageView: UIImageView!overridefuncviewDidLoad() { super.viewDidLoad()setupViews()setupLayout() }}extensionListPageViewController {privatefuncsetupViews() { }privatefuncsetupLayout() { //Constraints are defined in Storyboard file. }}
In Android, the source, layout, constraints, etc. all generated automatically as can be seen below.