//
//  ServiceItemWebviewCell.swift
//  kt
//
//  Created by Assylkhan Rakhatov on 19.10.16.
//  Copyright © 2016 Alexandr Zalutskiy. All rights reserved.
//

import Foundation
import UIKit

class ServiceItemWebviewCell: UITableViewCell {
  //  @IBOutlet weak var webview: UIWebView!
  //  @IBOutlet weak var webviewHeight: NSLayoutConstraint!
  @IBOutlet weak var webWrapperView: UIView!
  var vc: ServiceItemScrollViewController!
  
  override func awakeFromNib() {
    super.awakeFromNib()
    NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ServiceItemWebviewCell.webViewDidFinishLoading), name: ServiceItemScrollViewController.webViewDidFinishedLoading, object: nil)
  }
  
  deinit {
    NSNotificationCenter.defaultCenter().removeObserver(self)
  }
  
  func webViewDidFinishLoading() {
    //    webViewHeight.constant = vc.webView.scrollView.contentSize.height
    vc.webView.userInteractionEnabled = true
    vc.webView.scrollView.bounces = false
    //    webview.translatesAutoresizingMaskIntoConstraints = false
    //    webviewHeight.constant = webview.scrollView.contentSize.height
    //    webview.userInteractionEnabled = true
    //    webview.scrollView.bounces = false
    
    //    self.vc.view.sizeToFit()
    //    self.pvc.subviewHeight.constant = self.view.frame.height
    //    self.vc.pvc.contentView.sizeToFit()
    //    UIView.animateWithDuration(1) {
    //      self.tariffsTableView.reloadData()
    //      self.pvc.contentView.bringSubviewToFront(self.tariffsTableView)
    //      self.pvc.view.layoutIfNeeded()
    //    }
    
  }
}
