 //  Created by Mukesh Thawani on 12/11/16.
 //  Copyright © 2016 Mukesh Thawani. All rights reserved.
 //
-
 import Foundation
 
 public class FAQView: UIView {

class FAQViewCell: UITableViewCell {
  
  var questionLabel = UILabel()
  var answerLabel = UILabel()
  var indicatorImageView = UIImageView()
  var answerLabelBottom = NSLayoutConstraint()
  private var containerView =  UIView()

  override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    self.questionLabel.translatesAutoresizingMaskIntoConstraints = false
    self.answerTextView.translatesAutoresizingMaskIntoConstraints = false
    self.indicatorImageView.translatesAutoresizingMaskIntoConstraints = false
    self.containerView.translatesAutoresizingMaskIntoConstraints = false
    self.questionLabel.numberOfLines = 0
    answerTextView.isScrollEnabled = false
    answerTextView.backgroundColor = UIColor.clear
    let insets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
    answerTextView.textContainerInset = insets
    answerTextView.isEditable = false
    answerTextView.dataDetectorTypes = []
    let indicatorImage = UIImage(named: "DownArrow", in: Bundle(for: FAQView.self), compatibleWith: nil)
    self.indicatorImageView.image = indicatorImage
    self.indicatorImageView.contentMode = .scaleAspectFit
    self.containerView.addSubview(indicatorImageView)
    contentView.addSubview(questionLabel)
    contentView.addSubview(answerTextView)
    contentView.addSubview(containerView)
    addLabelConstraints()
  }
