-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added configuration for calendar orientation * added changes for horizontal paging Co-authored-by: Ishmeet Sethi <[email protected]>
- Loading branch information
1 parent
d8e7103
commit d96eb04
Showing
7 changed files
with
150 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Sources/ElegantCalendar/Helpers/Extensions/Axis+Invert.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Kevin Li - 12:07 PM - 8/4/20 | ||
|
||
import SwiftUI | ||
|
||
extension Axis { | ||
|
||
var inverted: Axis { | ||
(self == .vertical) ? .horizontal : .vertical | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
Sources/ElegantCalendar/Helpers/Models/Protocols/Calendar+Axis.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Kevin Li - 12:43 PM - 8/4/20 | ||
|
||
import SwiftUI | ||
|
||
public protocol AxisModifiable: Buildable { | ||
|
||
var axis: Axis { get set } | ||
|
||
} | ||
|
||
extension AxisModifiable { | ||
|
||
/// Sets the axis of the calendar to vertical | ||
public func vertical() -> Self { | ||
axis(.vertical) | ||
} | ||
|
||
/// Sets the axis of the calendar to vertical | ||
public func horizontal() -> Self { | ||
axis(.horizontal) | ||
} | ||
|
||
/// Sets the axis of the calendar | ||
/// | ||
/// - Parameter axis: the intended axis of the calendar | ||
public func axis(_ axis: Axis) -> Self { | ||
mutating(keyPath: \.axis, value: axis) | ||
} | ||
|
||
} | ||
|
||
extension MonthlyCalendarView: AxisModifiable { } | ||
extension YearlyCalendarView: AxisModifiable { } | ||
extension ElegantCalendarView: AxisModifiable { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters