-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add .gitignore and prepare for SPM * Make certain classes and properties public * Make ColorSettings public
- Loading branch information
Showing
11 changed files
with
247 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
|
||
# Created by https://www.gitignore.io/api/macos,swift,swiftpackagemanager | ||
# Edit at https://www.gitignore.io/?templates=macos,swift,swiftpackagemanager | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### Swift ### | ||
# Xcode | ||
# | ||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | ||
|
||
## Build generated | ||
build/ | ||
DerivedData/ | ||
|
||
## Various settings | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata/ | ||
|
||
## Other | ||
*.moved-aside | ||
*.xccheckout | ||
*.xcscmblueprint | ||
|
||
## Obj-C/Swift specific | ||
*.hmap | ||
*.ipa | ||
*.dSYM.zip | ||
*.dSYM | ||
|
||
## Playgrounds | ||
timeline.xctimeline | ||
playground.xcworkspace | ||
|
||
# Swift Package Manager | ||
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. | ||
# Packages/ | ||
# Package.pins | ||
# Package.resolved | ||
.build/ | ||
# Add this line if you want to avoid checking in Xcode SPM integration. | ||
# .swiftpm/xcode | ||
|
||
# CocoaPods | ||
# We recommend against adding the Pods directory to your .gitignore. However | ||
# you should judge for yourself, the pros and cons are mentioned at: | ||
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control | ||
# Pods/ | ||
# Add this line if you want to avoid checking in source code from the Xcode workspace | ||
# *.xcworkspace | ||
|
||
# Carthage | ||
# Add this line if you want to avoid checking in source code from Carthage dependencies. | ||
# Carthage/Checkouts | ||
|
||
Carthage/Build | ||
|
||
# Accio dependency management | ||
Dependencies/ | ||
.accio/ | ||
|
||
# fastlane | ||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the | ||
# screenshots whenever they are needed. | ||
# For more information about the recommended setup visit: | ||
# https://docs.fastlane.tools/best-practices/source-control/#source-control | ||
|
||
fastlane/report.xml | ||
fastlane/Preview.html | ||
fastlane/screenshots/**/*.png | ||
fastlane/test_output | ||
|
||
# Code Injection | ||
# After new code Injection tools there's a generated folder /iOSInjectionProject | ||
# https://github.com/johnno1962/injectionforxcode | ||
|
||
iOSInjectionProject/ | ||
|
||
### SwiftPackageManager ### | ||
Packages | ||
xcuserdata | ||
*.xcodeproj | ||
|
||
|
||
# End of https://www.gitignore.io/api/macos,swift,swiftpackagemanager |
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,31 @@ | ||
// swift-tools-version:5.1 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "RKCalendar", | ||
platforms: [ | ||
.iOS(.v13), | ||
], | ||
products: [ | ||
// Products define the executables and libraries produced by a package, and make them visible to other packages. | ||
.library( | ||
name: "RKCalendar", | ||
targets: ["RKCalendar"]), | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
// .package(url: /* package url */, from: "1.0.0"), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages which this package depends on. | ||
.target( | ||
name: "RKCalendar", | ||
dependencies: []), | ||
// .testTarget( | ||
// name: "RKCalendarTests", | ||
// dependencies: ["RKCalendar"]), | ||
] | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,33 @@ | ||
// | ||
// RKColorSettings.swift | ||
// RKCalendar | ||
// | ||
// Copyright © 2019 Raffi Kian. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
import SwiftUI | ||
|
||
public class RKColorSettings : ObservableObject { | ||
|
||
// foreground colors | ||
@Published public var textColor: Color = Color.primary | ||
@Published public var todayColor: Color = Color.white | ||
@Published public var selectedColor: Color = Color.white | ||
@Published public var disabledColor: Color = Color.gray | ||
@Published public var betweenStartAndEndColor: Color = Color.white | ||
// background colors | ||
@Published public var textBackColor: Color = Color.clear | ||
@Published public var todayBackColor: Color = Color.gray | ||
@Published public var selectedBackColor: Color = Color.red | ||
@Published public var disabledBackColor: Color = Color.clear | ||
@Published public var betweenStartAndEndBackColor: Color = Color.blue | ||
// headers foreground colors | ||
@Published public var weekdayHeaderColor: Color = Color.primary | ||
@Published public var monthHeaderColor: Color = Color.primary | ||
// headers background colors | ||
@Published public var weekdayHeaderBackColor: Color = Color.clear | ||
@Published public var monthBackColor: Color = Color.clear | ||
|
||
} |
File renamed without changes.
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,56 @@ | ||
// | ||
// RKManager.swift | ||
// RKCalendar | ||
// | ||
// Created by Raffi Kian on 7/14/19. | ||
// Copyright © 2019 Raffi Kian. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public class RKManager : ObservableObject { | ||
|
||
@Published public var calendar = Calendar.current | ||
@Published public var minimumDate: Date = Date() | ||
@Published public var maximumDate: Date = Date() | ||
@Published public var disabledDates: [Date] = [Date]() | ||
@Published public var selectedDates: [Date] = [Date]() | ||
@Published public var selectedDate: Date! = nil | ||
@Published public var startDate: Date! = nil | ||
@Published public var endDate: Date! = nil | ||
|
||
@Published public var mode: Int = 0 | ||
|
||
public var colors = RKColorSettings() | ||
|
||
public init(calendar: Calendar, minimumDate: Date, maximumDate: Date, selectedDates: [Date] = [Date](), mode: Int) { | ||
self.calendar = calendar | ||
self.minimumDate = minimumDate | ||
self.maximumDate = maximumDate | ||
self.selectedDates = selectedDates | ||
self.mode = mode | ||
} | ||
|
||
public func selectedDatesContains(date: Date) -> Bool { | ||
if let _ = self.selectedDates.first(where: { calendar.isDate($0, inSameDayAs: date) }) { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
public func selectedDatesFindIndex(date: Date) -> Int? { | ||
return self.selectedDates.firstIndex(where: { calendar.isDate($0, inSameDayAs: date) }) | ||
} | ||
|
||
public func disabledDatesContains(date: Date) -> Bool { | ||
if let _ = self.disabledDates.first(where: { calendar.isDate($0, inSameDayAs: date) }) { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
public func disabledDatesFindIndex(date: Date) -> Int? { | ||
return self.disabledDates.firstIndex(where: { calendar.isDate($0, inSameDayAs: date) }) | ||
} | ||
|
||
} |
File renamed without changes.
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
File renamed without changes.