Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (41 sloc) 1.2 KB
//
// TextViewModel.swift
// Fields
//
// Copyright © 2019 Radiant Tap
// MIT License · http://choosealicense.com/licenses/mit/
//
import UIKit
/// Model that corresponds to TextViewCell instance.
class TextViewModel: FieldModel {
/// unique identifier (across the containing form) for this field
let id: String
/// Minimal size of the text-view
var minimalHeight: CGFloat
/// String to display in the title label
var title: String?
/// Value to show inside the textField
var value: String?
/// Custom configuration for the textView.
///
/// Default implementation does nothing.
var customSetup: (UITextView) -> Void = {_ in}
/// Method called every time value inside the field changes.
///
/// Default implementation does nothing.
var valueChanged: (String?, TextViewCell) -> Void = {_, _ in}
init(id: String,
minimalHeight: CGFloat = 60,
title: String? = nil,
value: String? = nil,
customSetup: @escaping (UITextView) -> Void = {_ in},
valueChanged: @escaping (String?, TextViewCell) -> Void = {_, _ in}
){
self.id = id
self.title = title
self.value = value
self.minimalHeight = minimalHeight
self.customSetup = customSetup
self.valueChanged = valueChanged
}
}
You can’t perform that action at this time.