Skip to content
Permalink
Browse files

Code cleaned..

  • Loading branch information...
ShashikantBhadke committed Sep 18, 2019
1 parent 577ff28 commit 3d758905df02c75698180405e049ec0d84417fb8
Binary file not shown.
@@ -17,9 +17,6 @@ extension SBTableVC: UITableViewDataSource {

public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: SBTableCell.self), for: indexPath) as? SBTableCell else { return UITableViewCell() }
// guard let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: SBTableCell.self)) as? SBTableCell else {
// return UITableViewCell()
// }
cell.imgSelected = self.imgSelected
cell.imgDeSelected = self.imgDeSelected

@@ -18,10 +18,7 @@ public extension UIViewController {
func showSBDatePicker(strTitle: String = "Select Date", currentDate: Date = Date(), minDate: Date? = nil, maxDate: Date? = nil, sourceView: UIView, sourceRect: CGRect? = nil, type: [SBDateEnum] = [.Date, .Time], key: Any? = nil) {
SBDropDown.shared.showSBDatePicker(strTitle: strTitle, currentDate: currentDate, minDate: minDate, maxDate: maxDate, delegate: self, sourceView: sourceView, sourceRect: sourceRect, type: type, key: key)
}
/// Note below methods is not work for ipad...😒😞
/*func showSBActionDatePicker(strTitle: String = "Select Date", currentDate: Date = Date(), minDate: Date? = nil, maxDate: Date? = nil, sourceView: UIView, sourceRect: CGRect? = nil, type: [SBDateEnum] = [.Date, .Time], key: Any? = nil) {
SBDropDown.shared.showSBActionDatePicker(strTitle: strTitle, currentDate: currentDate, minDate: minDate, maxDate: maxDate, delegate: self, sourceView: sourceView, sourceRect: sourceRect, type: type, key: key)
}*/

} //extension

@@ -106,28 +106,17 @@ public class SBDropDown {
case 0:
sbTableVC = nil

//let bundleTable = Bundle(for: SBTableVC.self)
//sbTableVC = SBTableVC(nibName: String(describing: SBTableVC.self), bundle: bundleTable)
sbTableVC = mainStoryBoard?.instantiateViewController(withIdentifier: String(describing: SBTableVC.self)) as? SBTableVC
case 1:
sbDateVC = nil

//let bundleDate = Bundle(for: SBDateVC.self)
//sbDateVC = SBDateVC(nibName: String(describing: SBDateVC.self), bundle: bundleDate)
sbDateVC = mainStoryBoard?.instantiateViewController(withIdentifier: String(describing: SBDateVC.self)) as? SBDateVC
default:
sbTableVC = nil
sbDateVC = nil
sbDateVC = mainStoryBoard?.instantiateViewController(withIdentifier: String(describing: SBDateVC.self)) as? SBDateVC
sbTableVC = mainStoryBoard?.instantiateViewController(withIdentifier: String(describing: SBTableVC.self)) as? SBTableVC

// let bundleTable = Bundle(for: SBTableVC.self)
// sbTableVC = SBTableVC(nibName: String(describing: SBTableVC.self), bundle: bundleTable)
//
// let bundleDate = Bundle(for: SBDateVC.self)
// sbDateVC = SBDateVC(nibName: String(describing: SBDateVC.self), bundle: bundleDate)
}
}

@@ -203,40 +192,7 @@ public class SBDropDown {

presentController(strTitle: strTitle, vc: dropDownVC, delegate: delegate)
}
/*
public func showSBActionDatePicker(strTitle: String, currentDate: Date = Date(), minDate: Date? = nil, maxDate: Date? = nil, delegate: UIViewController, sourceView: UIView? = nil, sourceRect: CGRect? = nil, type: [SBDateEnum] = [.Date, .Time], key: Any?) {
guard UIDevice.current.userInterfaceIdiom != .pad else {
self.showSBDatePicker(strTitle: strTitle, currentDate: currentDate, minDate: minDate, maxDate: maxDate, delegate: delegate, sourceView: sourceView, sourceRect: sourceRect, type: type, key: key)
return
}
setUpDropDown(1)
guard let dropDownVC = sbDateVC else {
debugPrint("---❌ Error while getting SBDateVC ❌---")
return
}
dropDownVC.key = key
dropDownVC.type = type
dropDownVC.dateMax = maxDate
dropDownVC.dateMin = minDate
dropDownVC.pickerMode = pickerMode
dropDownVC.date = currentDate
dropDownVC.segTintColor = segTintColor
dropDownVC.segTextColor = segTextColor
dropDownVC.segBackColor = segBackColor
dropDownVC.isShowSegment = isShowSegment
dropDownVC.strSelectBtnTitle = strSelectBtnTitle
dropDownVC.strDateFormatter = strDateFormatter
dropDownVC.strTimeFormatter = strTimeFormatter
dropDownVC.cgButtonWidth = cgSelectButtonWidth
dropDownVC.cgSegmentWidth = cgDateSegmentWidth
dropDownVC.segTextSelectedColor = segTextSelectedColor
dropDownVC.delegate = delegate as? SBDateProtocol
dropDownVC.sbDelegete = self
dropDownVC.isShowSelectBtn = (UIDevice.current.userInterfaceIdiom == .pad)
showActionSheet(strTitle: strTitle, controller: dropDownVC, delegate: delegate, sourceView: sourceView)
}*/

} // class

0 comments on commit 3d75890

Please sign in to comment.
You can’t perform that action at this time.