Skip to content

Commit

Permalink
Code cleaned..
Browse files Browse the repository at this point in the history
  • Loading branch information
ShashikantBhadke committed Sep 18, 2019
1 parent 577ff28 commit 3d75890
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 52 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions SBDropDown/Helper/UIViewController+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
46 changes: 1 addition & 45 deletions SBDropDown/SBDropDownC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 3d75890

Please sign in to comment.