-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple Way To Write Infinite Scrolling? #585
Comments
https://github.com/geoffreygonzales/Honeydew I think the solution would be to use anchor date but idk how to implement it :( |
|
thank you I have a function that automatically sets start and end date after that, would it be best to call calendarView.reloadData() and then calendarView.scrollToDate(currentDateInView, animateScroll: false) |
That should work. but how about reload with this instead? |
perfect perfect perfect thank you very much. also : 1 when the app loads initially, the dates and other configurations are set, is there a way to skip / set step 2, for the initial launch of the app? (since if I call reload data here it crashes) |
@geoffreygonzales Can you put this in your
This version will be release in about a week or so. Let me know if step 2 goes away when you scroll to date on |
I'm getting this error when running pod update [!] There are multiple dependencies with different sources for
|
this not a primary issue for me, as the 100ms view of the so no pressure :) I have another question about setting the size and position of the calendar programmatically: func setCalendarSizeAndPosition()
{
// Get Screen Properties
let screenWidth = UIScreen.main.bounds.width
let screenHeight = UIScreen.main.bounds.height
// Set Size And Position Properties
let calendarWidth = screenWidth * 0.85625
let calendarHeight = screenHeight * 0.630281690140845
let calendarX = (screenWidth / 2) - (calendarWidth / 2)
let calendarY = screenHeight * 0.419014084507042
// Set The Global Variable For Resting The Calendars Resting Y Position
calendarRestingPosition = calendarY
// Set Calendar Size And Position
calendarView.frame.size.width = calendarWidth
calendarView.frame.size.height = calendarHeight
calendarView.frame.origin.x = calendarX
calendarView.frame.origin.y = calendarY
} I use this when toggling the calendar // Hides The Calendar Below The Screen
func putCalendarToSleep()
{
UIView.animate(withDuration: 0.08)
{
self.calendarContentView.frame.origin.y += self.calendarContentView.frame.size.height
}
}
// Shoes The Calendar Below The Screen
func wakeCalendarUp()
{
UIView.animate(withDuration: 0.08)
{
self.calendarContentView.frame.origin.y -= self.calendarContentView.frame.size.height
}
} this is the behavior I experience: 0 during 1 when 2 I have a button that toggles 3 at the end of the 1st scroll, when finger is lifted off the screen, the calendar resizes and repositions itself to the size and position that it was at during EDIT: maybe the framework does something during I think the solution for this would be a better way to programmatically alter height width x and y that the framework has set somewhere bc it uses these to reset those values every time I also cant do it in interface builder with precision bc of apples dumb size class thingy that no longer allows for device specific constraints. |
will look at this in the morning. |
I pushed a project that recreated the bug 1 try with the watch the console hope this helps :) |
@geoffreygonzales Hey, may i get a link to that project please? |
oops I thought I pasted it |
I made another branch called it initially sets the y position of the calendar below the view, and the buttons show and hide it fine the console shows it call EDIT I’m still a noob dev, and have no idea how the calendar framwork works, but maybe this will help http://aplus.rs/2015/uicollectionviewcell-woes-with-bounds-change/ |
The calendar is a Also note that, any change you make to the calendar that results in a change in the UICOllectionView layout, it will invalidate the layout. Are you just trying to show and hide the calendar? |
Oh really? I thought I was being simple with the code. oops I’m trying to accomplish 1 calculate the size and width of the calendar and it’s days of week and it’s container based on the uiscreen.main.bounds.height on the initial app load the main issue I’m running into is after animating it up from the bottom, and then scrolling - it calls layout sub views and goes all crazy and it docent scroll it just hides below the screen. Is that what you mean by the layout gets invalidated? because it’s position and size were changed and saved below the screen? thanks for the support so far! |
No. By invalidation I meant this -> From Apple docs If your calendar is hiding below the screen, then maybe there is something in the code doing this? For instance, i did a inspect on your views. I think you need to double check by how much exactly you are moving the calendar's frame. |
I solved animating it up and down. I put it in a sub view and then I animate the sub view :) We’re you able to run and try scrolling on branch 2? |
Yes. I posted the image of the results on branch 2. Above. |
Could you use the buttons to animate it up and down? EDIT : Oh I didn't know you could inspect like that; I thought that was just the interface builder. Try it on the iPhone 5s please, because I haven't yet implemented it automatically resizing at build time |
I pushed an update on branch2 if you want to check out the scrolling |
hello,
was gonna send an email but your thing said just open an issue
anyway I've been writing stuff to calculate new start and end dates, but was wondering if there was a simple way to
1 write infinite scrolling to the future and past
2 when view did load setting the content offset of the calendar view to the date of today
3 call a function to scroll to a date
I've also forked the file; I'm not that good at coding yet but as I was reading through it I've been spellchecking the comments to have you pull later :)
thanks jay
The text was updated successfully, but these errors were encountered: