Skip to content

Commit

Permalink
Fixes mmick66#27
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Michailidis committed Jan 8, 2018
1 parent 10144f6 commit 2ce7239
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 27 deletions.
10 changes: 5 additions & 5 deletions KDCalendar/CalendarView/CalendarDayCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

import UIKit

class CalendarDayCell: UICollectionViewCell {
open class CalendarDayCell: UICollectionViewCell {

override var description: String {
override open var description: String {
let dayString = self.textLabel.text ?? " "
return "<DayCell (text:\"\(dayString)\")>"
}
Expand All @@ -53,7 +53,7 @@ class CalendarDayCell: UICollectionViewCell {
}
}

override var isSelected : Bool {
override open var isSelected : Bool {
didSet {
switch isSelected {
case true:
Expand Down Expand Up @@ -88,11 +88,11 @@ class CalendarDayCell: UICollectionViewCell {
}


required init?(coder aDecoder: NSCoder) {
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

override func layoutSubviews() {
override open func layoutSubviews() {

super.layoutSubviews()

Expand Down
6 changes: 3 additions & 3 deletions KDCalendar/CalendarView/CalendarFlowLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

import UIKit

class CalendarFlowLayout: UICollectionViewFlowLayout {
open class CalendarFlowLayout: UICollectionViewFlowLayout {


override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
override open func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {

return super.layoutAttributesForElements(in: rect)?.map { attrs in
let attrscp = attrs.copy() as! UICollectionViewLayoutAttributes
Expand All @@ -38,7 +38,7 @@ class CalendarFlowLayout: UICollectionViewFlowLayout {

}

override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
override open func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {

if let attrs = super.layoutAttributesForItem(at: indexPath) {
let attrscp = attrs.copy() as! UICollectionViewLayoutAttributes
Expand Down
4 changes: 2 additions & 2 deletions KDCalendar/CalendarView/CalendarHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import UIKit

class CalendarHeaderView: UIView {
open class CalendarHeaderView: UIView {

lazy var monthLabel : UILabel = {

Expand Down Expand Up @@ -64,7 +64,7 @@ class CalendarHeaderView: UIView {

}()

override func layoutSubviews() {
override open func layoutSubviews() {

super.layoutSubviews()

Expand Down
8 changes: 4 additions & 4 deletions KDCalendar/CalendarView/CalendarView+DataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import UIKit

extension CalendarView: UICollectionViewDataSource {

func numberOfSections(in collectionView: UICollectionView) -> Int {
public func numberOfSections(in collectionView: UICollectionView) -> Int {

guard let dateSource = self.dataSource else { return 0 }

Expand Down Expand Up @@ -58,7 +58,7 @@ extension CalendarView: UICollectionViewDataSource {

}

internal func getMonthInfo(for date: Date) -> (firstDay: Int, daysTotal: Int)? {
public func getMonthInfo(for date: Date) -> (firstDay: Int, daysTotal: Int)? {

var firstWeekdayOfMonthIndex = self.calendar.component(.weekday, from: date)
firstWeekdayOfMonthIndex = firstWeekdayOfMonthIndex - 1 // firstWeekdayOfMonthIndex should be 0-Indexed
Expand All @@ -72,7 +72,7 @@ extension CalendarView: UICollectionViewDataSource {
return (firstDay: firstWeekdayOfMonthIndex, daysTotal: numberOfDaysInMonth)
}

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {

var monthOffsetComponents = DateComponents()
monthOffsetComponents.month = section;
Expand All @@ -88,7 +88,7 @@ extension CalendarView: UICollectionViewDataSource {
}


func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {

let dayCell = collectionView.dequeueReusableCell(withReuseIdentifier: cellReuseIdentifier, for: indexPath) as! CalendarDayCell

Expand Down
8 changes: 4 additions & 4 deletions KDCalendar/CalendarView/CalendarView+Delegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import UIKit

extension CalendarView: UICollectionViewDelegateFlowLayout {

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

guard let date = self.dateFromIndexPath(indexPath) else { return }

Expand All @@ -52,7 +52,7 @@ extension CalendarView: UICollectionViewDelegateFlowLayout {
}


func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool {
public func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool {

guard let dateBeingSelected = self.dateFromIndexPath(indexPath) else { return false }

Expand All @@ -66,12 +66,12 @@ extension CalendarView: UICollectionViewDelegateFlowLayout {

// MARK: UIScrollViewDelegate

func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
self.updateAndNotifyScrolling()

}

func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
public func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
self.updateAndNotifyScrolling()
}

Expand Down
12 changes: 4 additions & 8 deletions KDCalendar/CalendarView/CalendarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extension CalendarViewDelegate {
}


class CalendarView: UIView {
open class CalendarView: UIView {

struct Style {

Expand Down Expand Up @@ -156,20 +156,16 @@ class CalendarView: UIView {
}
}





override init(frame: CGRect) {
super.init(frame: frame)
self.setup()
}

required init?(coder aDecoder: NSCoder) {
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

override func awakeFromNib() {
override open func awakeFromNib() {
super.awakeFromNib()
self.setup()
}
Expand Down Expand Up @@ -212,7 +208,7 @@ class CalendarView: UIView {
return self.collectionView.collectionViewLayout as! CalendarFlowLayout
}

override func layoutSubviews() {
override open func layoutSubviews() {

super.layoutSubviews()

Expand Down
2 changes: 1 addition & 1 deletion KDCalendar/CalendarView/EventsLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import Foundation
import EventKit

class EventsLoader {
open class EventsLoader {

private static let store = EKEventStore()

Expand Down

0 comments on commit 2ce7239

Please sign in to comment.