Comments (10)
Does your issue look something like this?
from jtapplecalendar.
Yes exactly like that.
from jtapplecalendar.
If it looks like that then, did you follow the step in the tutorial which has this code?
extension ViewController: JTAppleCalendarViewDataSource, JTAppleCalendarViewDelegate {
// Setting up manditory protocol method
func configureCalendar(calendar: JTAppleCalendarView) -> (startDate: NSDate, endDate: NSDate, numberOfRows: Int, calendar: NSCalendar) {
// You can set your date using NSDate() or NSDateFormatter. Your choice.
let formatter = NSDateFormatter()
formatter.dateFormat = "yyyy MM dd"
let firstDate = formatter.dateFromString("2016 01 05")
let secondDate = NSDate()
let numberOfRows = 6
let aCalendar = NSCalendar.currentCalendar() // Properly configure your calendar to your time zone here
return (startDate: firstDate!, endDate: secondDate, numberOfRows: numberOfRows, calendar: aCalendar)
}
}
from jtapplecalendar.
Remember, your calendar has to conform to the dataSource protocol. If it does not conform to the datasource, XCode will scream at you :)
from jtapplecalendar.
I believe so, I wrote this in the class same class as that manages the calendar view.
func configureCalendar(calendar: JTAppleCalendarView) -> (startDate: NSDate, endDate: NSDate, numberOfRows: Int, calendar: NSCalendar){
let formatter = NSDateFormatter()//access to date formatter method
formatter.dateFormat = "yyyy MM dd"
let firstDate = formatter.dateFromString("2016 05 10")
let secondDate = NSDate()
let numberOfRows = 6
let aCalendar = NSCalendar.currentCalendar()
//return logical calendar for current user
return(startDate: firstDate!, endDate: secondDate, numberOfRows: numberOfRows, calendar: aCalendar)
}
from jtapplecalendar.
But examining it currently I notice that I missed this line.
extension ViewController: JTAppleCalendarViewDataSource, JTAppleCalendarViewDelegate
Would that have caused this to occur?
from jtapplecalendar.
Yes. That is what caused the issue.
You should either have this:
class MonthViewController: UIViewController, JTAppleCalendarViewDataSource, JTAppleCalendarViewDelegate {
...
...
...
}
Or this
extension ViewController: JTAppleCalendarViewDataSource, JTAppleCalendarViewDelegate
Doing that tells the calendar that:
Yes, i conform to your required protocol
If you leave it out, then the calendar does not know that you conform to the protocol and XCode will scream at you.
It is your choice as to where you want to put it. I like putting mine in the extension to keep my code neat.
Once you insert that missing line, your error should go away
from jtapplecalendar.
Let me know if your issue is resolved. And if it is, then you can close this issue 👍
from jtapplecalendar.
That fixed it!
from jtapplecalendar.
awesome! Now go build a extremely cool looking calendar and post an image!
have a good one.
from jtapplecalendar.
Related Issues (20)
- Doesn
- Doesn't Compile in Xcode 15 HOT 4
- Stored properties cannot be marked unavailable with '@available' HOT 2
- Spacing between dates HOT 1
- Xcode15: Stored properties cannot be marked unavailable with '@available' HOT 3
- JTACMonthView.reloadData completion handler is not always invoked HOT 6
- Application got crashed :
- Application got crashed at JTACMonthLayout
- Application got crashed at JTACMonthLayout due to nil value HOT 11
- Calendar crashing on iOS 17 HOT 4
- Crashlytics Reports 100% Crash Rate in iOS 17 HOT 8
- Stored properties cannot be marked unavailable with '@available' error on Xcode 15 HOT 4
- Error - Stored properties cannot be marked unavailable with '@available' HOT 3
- Xcode 15 Error "Stored properties cannot be marked unavailable with '@available" HOT 4
- xCode 15 compatibility issue
- Only iOS 17 Crash - JTACMonthLayout - setupDataFromDelegate HOT 11
- I use Xcode Version 14.3.1 (14E300c). But the bug? issue has 'No such module 'JTAppleCalendar' HOT 3
- Additional line of days in previous month if use cellState.dateBelongsTo for cells hide or style HOT 5
- Stored properties cannot be marked unavailable with '@available' HOT 10
- View dependend protocols should be marked with @MainActor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jtapplecalendar.