Giter Site home page Giter Site logo

Comments (19)

zkhCreator avatar zkhCreator commented on May 27, 2024 1

@jfbomber You can see the fix code in zkhCreator#1

from calendarview.

jibrank avatar jibrank commented on May 27, 2024

i'am facing the same issue the style part of calendar is not working.

  let style = CalendarView.Style()

    style.cellShape                = .round
    style.cellColorDefault         = UIColor.clear
    style.cellTextColorDefault     = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
    
    style.cellColorToday           = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
    style.cellTextColorToday       = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
    

    
    style.headerTextColor          = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
    style.headerBackgroundColor    = UIColor.white
    
    
    style.cellEventColor           = UIColor.clear
    
    
    style.cellTextColorWeekend     = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
    style.firstWeekday             = .sunday
    style.weekdaysBackgroundColor  = UIColor.white
    style.cellColorOutOfRange      = #colorLiteral(red: 0.6000000238, green: 0.6000000238, blue: 0.6000000238, alpha: 1)
    
    

    style.cellSelectedBorderColor = UIColor(red: 193.0/255.0, green: 165.0/255.0, blue: 139.0/255.0, alpha: 1.0);
    style.cellSelectedColor = UIColor(red: 193.0/255.0, green: 165.0/255.0, blue: 139.0/255.0, alpha: 1.0);
    style.cellSelectedTextColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
    style.cellSelectedBorderWidth = 1.0

from calendarview.

jfbomber avatar jfbomber commented on May 27, 2024

@jibrank Have you had any luck updating it?

I have tried editing the project code but it seems to be something with the update of the UICollectionView on iOS 15.

from calendarview.

zkhCreator avatar zkhCreator commented on May 27, 2024

@jfbomber I find the problem.
In apple's document, they said:

You typically do not set the value of this property directly. Changing the value of this property programmatically does not change the appearance of the cell. The preferred way to select the cell and highlight it is to use the selection methods of the collection view object.

and in Calender, it called cell.isSelected and force reload the collectoinView.

It makes UICollectionView didn't show the style of the cell.
If you want to fix it, you can change these things. Like disable selectionStyle and create a new method for cell to update style.
And if you want to use multiSelection, you can set the collectionView's multiSelection property.

from calendarview.

nik6018 avatar nik6018 commented on May 27, 2024

@zkhCreator I integrated your code, still it's not showing Selected Cells Border :( .

from calendarview.

jfbomber avatar jfbomber commented on May 27, 2024

@nik6018 It did work for me. I just used his forked version of the branch
pod 'KDCalendar', :git => 'https://github.com/zkhCreator/CalendarView'

from calendarview.

nik6018 avatar nik6018 commented on May 27, 2024

@jfbomber Thanks for informing. @zkhCreator Can you please confirm if any more changes are needed to be included other than the commit mentioned in the above comment ?

from calendarview.

zkhCreator avatar zkhCreator commented on May 27, 2024

@nik6018 the border color is ok in my repo.
Maybe you should use the master branch, don't copy the merge request code, because I fix some bug not in the merge request.
here is the screenshoot.
IMG_7568 2

from calendarview.

khedheri avatar khedheri commented on May 27, 2024

@zkhCreator seems like you correct the issue , but you forget to upgrade the s.version in "KDCalendar.podspec", so when users try to update pods, cocoapods can't recognise that a new version is available.
upgrade the version number "KDCalendar.podspec", then users can update the pod

from calendarview.

zkhCreator avatar zkhCreator commented on May 27, 2024

@khedheri you can use my repo's master branch, because of my repo is not the main repo of Calendar repo.If I update the podspec, it will influence the version of main repo

from calendarview.

nik6018 avatar nik6018 commented on May 27, 2024

EDIT :

After further inspection it seems like if I make the allowSelection property on CalendarView false programmatic selection doesn't work (it used to work on pre-iOS15).
My requirement is a bit unusual as in I want programmatic selection but disable selection via user input :(
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

@zkhCreator I tried by downloading your master branch but still I am not getting the result I want :(

If I wasn't clear I am trying to select the date programmatically using calendarView.selectDate(_:) method and want to display a border around the selected cell.

Selecting the dates by directly tapping on the Calendar View is working as expected, but in my case I only want to select the dates programmatically.

While checking the class CalendarDayCell the isSelected computed property contains the following lines

    switch isSelected {
            case true:
                self.bgView.layer.borderColor = style.cellSelectedBorderColor.cgColor
                self.bgView.layer.borderWidth = style.cellSelectedBorderWidth
                self.bgView.backgroundColor =  style.cellSelectedColor

The color & border color applied on the bgView doesn't show for some reason, if dates are selected programmatically.

But If I copy the above 3 lines and put them in the updateTextColors() method inside the isSelected if condition, then selected cell border color shows properly like before iOS 15.

Any idea why this is the case ?

from calendarview.

lygon55555 avatar lygon55555 commented on May 27, 2024

@zkhCreator thank you so much for fixing the code👍

from calendarview.

jibrank avatar jibrank commented on May 27, 2024

@zkhCreator i used your code but few things are not working as it was working before

  1. i can select out of range dates
  2. Programatically dates cant be selected.
    Simulator Screen Shot - iPhone 13 Pro - 2022-01-17 at 19 22 39

from calendarview.

jibrank avatar jibrank commented on May 27, 2024

@nik6018 you can use this, it has same functionalities
https://github.com/WenchaoD/FSCalendar

from calendarview.

prapawity avatar prapawity commented on May 27, 2024

iOS 15.3 issue was solved, but why, iOS 15.3 just security update

from calendarview.

Agisight avatar Agisight commented on May 27, 2024

https://stackoverflow.com/a/31387259

Here is the solution:
Снимок экрана 2022-12-08 в 17 17 27

        dayCell.isSelected = selectedIndexPaths.contains(indexPath)
        if dayCell.isSelected {
            collectionView.selectItem(at: indexPath, animated: true, scrollPosition: .centeredHorizontally)
        }

@mmick66

from calendarview.

mmick66 avatar mmick66 commented on May 27, 2024

Please write a RP. Thank you.

from calendarview.

Agisight avatar Agisight commented on May 27, 2024

@mmick66
I see a new working PR which fixed the issue. So you can choose which one is better. I vote for andygeers/ios15 version. So, do you still need my PR?

Merge pull request #143 from andygeers/ios15 2e677a0 Michael Michailidis [email protected] 7 дек. 2022 г., 16:45

from calendarview.

Agisight avatar Agisight commented on May 27, 2024

#145

Here is a PR with my lines above

from calendarview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.