I am using https://github.com/WenchaoD/FSCalendar in my project . MaximumSelectedDate is a read-only property .Then how can disable future dates ?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
You should be using the delegate method to address this
A workaround could be to edit
FSCalendar
method file. First make a bool variable, sayisAllowedToLimitFutureDates
and a string variablemaxValidFutureDateAsString
then change line 172 of this link to:So when you want to limit the dates set
isAllowedToLimitFutureDates = true
.Similar approach to line 1707.
In case you cannot edit file and used PODs, then you can customize this control and override them.
Hope that helps!
for Swift 3
@Devraj answer is correct, there are delegates for both minimum and maximum dates, all you need to do is implementing the proper one (the later one in your case) in the controller that's conforming to
FSCalendarDelegate
and that'll do the trick.func maximumDateForCalendar(calendar: FSCalendar) -> NSDate { return NSDate() // NSDate of your choosing here }