 		self.underlineStroke.removeFromSuperview()
 
 		// Get tabCount from dataSource
-
-		if let num = self.dataSource!.numberOfTabs?(self) {
+		
+		if let dataSource = self.dataSource,
+			let num = dataSource.numberOfTabs?(self) {
 			self.tabCount = num
 		} else {
 			self.tabCount = tabControllers.count



	func tabViewAtIndex(_ index: Int) -> TabView? {
		if index >= self.tabCount {
			return nil
		}

		if (self.tabs[index] as UIView?) == nil {

			var tabViewContent = UIView()
			if let tab = self.dataSource.tabViewForIndex?(index, pager: self) {
				tabViewContent = tab
			} else {
				tabViewContent = tabViews[index]

	open var tabsTextColor: UIColor = UIColor.white
	open var selectedTabTextColor = UIColor.white
	open var tabsImageViewContentMode = UIViewContentMode.scaleAspectFit
	open weak var dataSource: PagerDataSource?
	open weak var delegate: PagerDelegate?
	open var tabHeight: CGFloat = 44.0
	open var tabTopOffset: CGFloat = 0.0
	open var tabOffset: CGFloat = 56.0
