Texts

Monday Hero can automatically understand the texts, and convert design to Swift/Kotlin code.

Text Design to Code

Texts are automatically detected and their code is generated by Monday Hero. With texts, you can describe an interface element or provide messages. Texts display static text with no editing features. A Simple label image is and its code is shown below.

Generated iOS/Android Code of Texts

Label

Texts are called as Label in the Swift language. Let's see the generated code and its attributes.

//HomePageViewController.swift 
import UIKit

class HomePageViewController: UIViewController {

//Connection from an Interface Builder to a UI component
@IBOutlet private weak var simpleExampleLabel: UILabel!

	override func viewDidLoad() {
		super.viewDidLoad()
		setupViews()
	}

}

extension HomePageViewController {
	private func setupViews() {
	
		//Text properties
		simpleExampleLabel.text = NSLocalizedString("simple.example", comment: "")
		simpleExampleLabel.textColor = UIColor.black
		simpleExampleLabel.numberOfLines = 0
		simpleExampleLabel.font = UIFont.textStyle10
		simpleExampleLabel.textAlignment = .center
		
}

Last updated