Monday Hero
Website
V2
V2
  • Overview
  • Workflow Basics
  • Getting Started
    • Installing the Desktop App
    • Log In & Create a Project
    • Prepare Design to Get the Best Code Results
    • Import Design Files into Monday Hero
      • Import Figma Design Files into Monday Hero
        • Import Your Figma Text Style and Color Library
      • Import Adobe XD Design Files into Monday Hero
      • Import Sketch Design Files Into Monday Hero
    • Share Your Project & Manage Roles
  • DESIGN TO FLUTTER
    • Convert Design to Flutter
    • Create Flutter Components
      • System Components
        • Material & Cupertino Components
        • Flutter Supported Components
      • Custom Components
    • Create Responsive Code
    • Colors
    • Text Styles
    • Assets
    • Sync Code
    • Flutter Project Base
      • Fast Start with Monday Hero Starter Project
      • Integrate Monday Hero to your Existing Project
    • Shadows, Gradients, and Other Design Elements
    • Troubleshooting Guide
      • Checklist for Design Element Review and Code Generation
      • Github Monday Hero Starter Project Troubleshooting
  • DESIGN TO SWIFT
    • Convert Design to Swift
    • Create Swift Components
      • System Components
        • Views
        • Texts
        • Images
        • Button
        • TextField/EditText
        • Text Area
        • Status Bar
        • Search Bar
        • List
        • Grid
        • Swift Supported Components
      • Custom Components
      • Video Player Code Component
    • Colors
    • Text Styles
    • Assets
    • Shadows, Gradients, and Other Design Elements
    • Firebase
      • How to get Video URL from Firebase
    • Export Code
      • Integrating Exported Files into an Existing Xcode Project
  • Hero AI Assistant
    • Hero AI Assistant
  • Design to React
    • Convert Design to React
  • Step-By-Step Tutorials
    • 🏖️Travel App
  • Support
    • Roadmap
    • Suggest a New Feature
    • Report a Bug
    • Product Announcements
    • Mail to Support
    • Frequently Asked Questions
  • Join & Follow Us
    • YouTube
    • Discord Community
    • GitHub
    • Twitter
    • LinkedIn
    • Blog
    • Instagram
    • Facebook
Powered by GitBook
On this page
  • Automatically Detected Texts
  • Custom Texts

Was this helpful?

  1. DESIGN TO SWIFT
  2. Create Swift Components
  3. System Components

Texts

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

PreviousViewsNextImages

Last updated 1 year ago

Was this helpful?

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.

Monday Hero names texts on the design as Labels. However, it's also possible to convert label into components like buttons or create Custom Labels to reuse elements on the page like HeaderLabel below:

Automatically Detected Texts

In the image above, there is a Welcome to Travel App label. It's code is autogenerated like below.

Label

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

//Signup Page, Welcome Label
import UIKit

class SignUpViewController: UIViewController {

	// MARK: - Properties
	@IBOutlet private weak var welcomeLabel: UILabel!

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

}

extension SignUpViewController {
	private func setupViews() {

		welcomeLabel.textColor = UIColor.black
		welcomeLabel.numberOfLines = 0
		welcomeLabel.font = UIFont.textStyle7
		welcomeLabel.textAlignment = .center
		welcomeLabel.text = NSLocalizedString("welcome.to.travel.app", comment: "")

	}

	private func setupLayout() {
		//Constraints are defined in Storyboard file.
	}

}

TextView

Texts are called as TextView in the Android Kotlin/Java XML. Let's see the already generated code and its attributes.

<!--activityExample.xml-->

	<TextView
	android:id="@+id/titleTextView"
	android:layout_width="0dp"
	android:layout_height="wrap_content"
	android:text="@string/title_text"
	style="@style/textStyle13"
	android:textAlignment="center"
	android:textColor="?attr/black"
	android:layout_marginStart="39dp"
	android:layout_marginEnd="39dp"
	android:layout_marginBottom="12dp"
	app:layout_constraintStart_toStartOf="parent"
	app:layout_constraintEnd_toEndOf="parent"
	app:layout_constraintTop_toBottomOf="@+id/mondayHeroLogoImageView"
	app:layout_constraintBottom_toTopOf="@+id/descriptionTextView"/>
	
<!--strings.xml-->
<string name="title_text">"SimpleText"</string>
<string name="description_text">"This is a textView example and textViews are better while it kept short and legible."</string>

Custom Texts

In order to reuse the same styled labels like header1, header2, create custom texts. Here is how to do it:

The code will be generated like below for custom texts:

//HeaderLabel.swift

import UIKit

class HeaderLabel: UILabel {

	// MARK: - Initializers
	override init(frame: CGRect) {
		super.init(frame: frame)
		initialize()
	}

	required init?(coder aDecoder: NSCoder) {
		super.init(coder: aDecoder)
		initialize()
	}

	func initialize() {
		applyDefaultStyle()
	}

	// MARK: - Styling
	func applyDefaultStyle() {
		self.textColor = UIColor.pebble
		self.numberOfLines = 0
		self.font = UIFont.textStyle18
		self.textAlignment = .left
	}

	func set(text: String){
		self.text = text
	}

}
import UIKit

class SignupPage: UIViewController {

	// MARK: - Properties
	@IBOutlet private weak var welcomeLabel: HeaderLabel!

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

}

extension SignupPage {
	private func setupViews() {

		welcomeLabel.set(text: NSLocalizedString("welcome.to.travel.app", comment: ""))

	}

	private func setupLayout() {
		//Constraints are defined in Storyboard file.
	}

}

Coming soon.

Automatically detected labels(Text) and components
Create a reusable label