 		}
 	}
 	
+	override open func awakeFromNib() {
+		super.awakeFromNib()
+		if expyDelegate == nil {
+			//Set UITableViewDelegate even if ExpyTableViewDelegate is nil. Because we are getting callbacks here in didSelectRowAtIndexPath UITableViewDelegate method.
+			super.delegate = self
+		}
+	}
+	
 	open func getActionType(forSection section: Int) -> ExpyActionType {
 		let sectionIsVisible = visibleSections[section] ?? false
 		return sectionIsVisible ? .expand : .collapse
-	}
-	
-	open override func awakeFromNib() {
-		super.awakeFromNib()
-		
-		//Set UITableViewDelegate even if ExpyTableViewDelegate is nil. Because we are getting callbacks here in didSelectRowAtIndexPath UITableViewDelegate method.
-		if expyDelegate == nil {
-			super.delegate = self
-		}
 	}
 }
 

	}
	
	private func animate(_ tableView: ExpyTableView, with type: ExpyActionType, forSection section: Int) {
		
		guard let sectionIsExpandable = expandableSections[section], sectionIsExpandable else { return }
		
		//If section is visible and action type is expand, OR,
		//If section is not visible and action type is collapse, return.
		if ((type == .expand) && (visibleSections[section] == true)) ||
		((type == .collapse) && (visibleSections[section] == false)) { return }
		
		visibleSections[section] = (type == .expand)
		

	fileprivate weak var expyDataSource: ExpyTableViewDataSource?
	fileprivate weak var expyDelegate: ExpyTableViewDelegate?
	
	public fileprivate(set) var expandableSections: [Int: Bool] = [:]
	public fileprivate(set) var visibleSections: [Int: Bool] = [:]
	
	open var expandingAnimation: UITableViewRowAnimation = .fade
	open var collapsingAnimation: UITableViewRowAnimation = .fade
