diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..b846899 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Xcode +.DS_Store +*/build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +profile +*.moved-aside +DerivedData +.idea/ +*.hmap +*.xccheckout +*.mov + +#CocoaPods +Pods diff --git a/SJDatePicker.xcodeproj/project.pbxproj b/SJDatePicker.xcodeproj/project.pbxproj index 63b89e1..6a9fa1d 100644 --- a/SJDatePicker.xcodeproj/project.pbxproj +++ b/SJDatePicker.xcodeproj/project.pbxproj @@ -114,7 +114,7 @@ TargetAttributes = { 71F93C761E9D477A00FF18AA = { CreatedOnToolsVersion = 8.2.1; - DevelopmentTeam = U496Y4TUDA; + DevelopmentTeam = 8MAB78TT6T; LastSwiftMigration = 0820; ProvisioningStyle = Automatic; }; @@ -282,7 +282,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = U496Y4TUDA; + DEVELOPMENT_TEAM = 8MAB78TT6T; INFOPLIST_FILE = SJDatePicker/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = tw.sabrina.SJDatePicker; @@ -298,7 +298,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = U496Y4TUDA; + DEVELOPMENT_TEAM = 8MAB78TT6T; INFOPLIST_FILE = SJDatePicker/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = tw.sabrina.SJDatePicker; diff --git a/SJDatePicker.xcodeproj/project.xcworkspace/xcuserdata/eileen.xcuserdatad/UserInterfaceState.xcuserstate b/SJDatePicker.xcodeproj/project.xcworkspace/xcuserdata/eileen.xcuserdatad/UserInterfaceState.xcuserstate index 0cc5714..933a77c 100644 Binary files a/SJDatePicker.xcodeproj/project.xcworkspace/xcuserdata/eileen.xcuserdatad/UserInterfaceState.xcuserstate and b/SJDatePicker.xcodeproj/project.xcworkspace/xcuserdata/eileen.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SJDatePicker/Assets.xcassets/AppIcon.appiconset/Contents.json b/SJDatePicker/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..19882d5 100644 --- a/SJDatePicker/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/SJDatePicker/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -29,6 +39,11 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/SJDatePicker/SJDatePicker/PresentedViewController.swift b/SJDatePicker/SJDatePicker/PresentedViewController.swift index b5af408..026d27d 100644 --- a/SJDatePicker/SJDatePicker/PresentedViewController.swift +++ b/SJDatePicker/SJDatePicker/PresentedViewController.swift @@ -28,15 +28,15 @@ class PresentedViewController: UIViewController { public var pickerMode:UIDatePickerMode = .dateAndTime public var minimumDate:Date? = nil public var maximumDate:Date? = nil - public var date_format:dateformat = .yyyy_To_ss + public var returnDateFormat:dateformat = .yyyy_To_ss public var titleString:String? = nil - private var picker:UIDatePicker = UIDatePicker.init() - private var confirmButton:UIButton = UIButton.init() - private let cornerRadius:CGFloat = 7.5 - private let highlightedView:UIView = UIView.init() - private let pickerHeight:CGFloat = 216 - private let pickerWidth:CGFloat = UIScreen.main.bounds.size.width - 10 + fileprivate var picker:UIDatePicker = UIDatePicker.init() + fileprivate var confirmButton:UIButton = UIButton.init() + fileprivate let cornerRadius:CGFloat = 7.5 + fileprivate let highlightedView:UIView = UIView.init() + fileprivate let pickerHeight:CGFloat = 216 + fileprivate let pickerWidth:CGFloat = UIScreen.main.bounds.size.width - 10 var block:returnDate? @@ -61,16 +61,16 @@ class PresentedViewController: UIViewController { picker.layer.cornerRadius = cornerRadius picker.datePickerMode = self.pickerMode - if minimumDate != nil { - picker.minimumDate = self.minimumDate! + if let minDate = minimumDate { + picker.minimumDate = minDate } - if maximumDate != nil{ - picker.maximumDate = self.maximumDate! + if let maxDate = maximumDate { + picker.maximumDate = maxDate } - if minimumDate != nil && maximumDate != nil { - assert(minimumDate! < maximumDate!, "minimum date cannot bigger then maximum date") + if let minDate = minimumDate, let maxDate = maximumDate { + assert(minDate < maxDate, "minimum date cannot bigger then maximum date") } picker.layer.masksToBounds = true @@ -118,13 +118,12 @@ class PresentedViewController: UIViewController { if block != nil { self.dismiss(animated: true, completion: nil) let df:DateFormatter = DateFormatter.init() - df.dateFormat = date_format.rawValue + df.dateFormat = returnDateFormat.rawValue df.timeZone = TimeZone(secondsFromGMT: TimeZone.current.secondsFromGMT()) let returnDate:String = df.string(from: picker.date) block!(returnDate) } } - } extension PresentedViewController:UIViewControllerTransitioningDelegate{