 
 fileprivate extension GradientDesignable {
 
-  mutating func copyGradient(from designable: GradientDesignable) {
+  func copyGradient(from designable: GradientDesignable) {
     predefinedGradient = designable.predefinedGradient
     startColor = designable.startColor
     endColor = designable.endColor
     startPoint = designable.startPoint
   }
 
-  mutating func resetGradient(defaultStartPoint: GradientStartPoint = .top) {
+  func resetGradient(defaultStartPoint: GradientStartPoint = .top) {
     predefinedGradient = nil
     startColor = nil
     endColor = nil

      gView.startColor = ColorType(rawValue: self.colorValues.value(at: 0))?.color
      gView.endColor = ColorType(rawValue: self.colorValues.value(at: 0))?.color
    }
    var navigationBar = self.navigationController?.navigationBar as? DesignableNavigationBar
    navigationBar?.copyGradient(from: gView)
    navigationBar?.configureGradient()
  }

  override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
    var navigationBar = self.navigationController?.navigationBar as? DesignableNavigationBar
    navigationBar?.resetGradient()
    navigationBar?.setBackgroundImage(nil, for: .default)
  }

    }
    gView.configureGradient()

    let navigationBar = self.navigationController?.navigationBar as? DesignableNavigationBar
    navigationBar?.copyGradient(from: gView)
    navigationBar?.configureGradient()
  }
