Skip to content

Commit

Permalink
Add Swift Package Manager support
Browse files Browse the repository at this point in the history
  • Loading branch information
ffittschen committed Mar 4, 2021
1 parent d6593e9 commit dac79f2
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ Carthage
#xcshareddata
/.swiftlint.yml
/JTAppleCalendar.xcworkspace/xcshareddata/JTAppleCalendar.xcscmblueprint
.swiftpm/
29 changes: 27 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
import PackageDescription
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "JTAppleCalendar"
name: "JTAppleCalendar",
products: [
.library(
name: "JTAppleCalendar",
targets: ["JTAppleCalendar"]
),
],
targets: [
.target(
name: "JTAppleCalendar",
path: "Sources",
exclude: [
"Info-iOS.plist",
"Info-tvOS.plist"
]
),
.testTarget(
name: "JTAppleCalendarTests",
dependencies: ["JTAppleCalendar"],
path: "Tests",
exclude: [
"Info.plist"
]
),
]
)
2 changes: 2 additions & 0 deletions Sources/CalendarEnums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

/// Describes a scroll destination
public enum SegmentDestination {
/// next the destination is the following segment
Expand Down
1 change: 1 addition & 0 deletions Sources/CalendarStructs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// THE SOFTWARE.
//

import UIKit

/// Describes which month the cell belongs to
/// - ThisMonth: Cell belongs to the current month
Expand Down
2 changes: 2 additions & 0 deletions Sources/GlobalFunctionsAndExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

extension Calendar {
static let formatter: DateFormatter = {
let dateFormatter = DateFormatter()
Expand Down
2 changes: 2 additions & 0 deletions Sources/JTAppleCalendarDelegateProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

protocol JTAppleCalendarDelegateProtocol: class {
// Variables
var allowsDateCellStretching: Bool {get set}
Expand Down
2 changes: 2 additions & 0 deletions Sources/JTAppleCalendarLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

/// Methods in this class are meant to be overridden and will be called by its collection view to gather layout information.
class JTAppleCalendarLayout: UICollectionViewLayout, JTAppleCalendarLayoutProtocol {

Expand Down
1 change: 1 addition & 0 deletions Sources/JTAppleCalendarLayoutProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// THE SOFTWARE.
//

import UIKit

protocol JTAppleCalendarLayoutProtocol: class {
var minimumInteritemSpacing: CGFloat {get set}
Expand Down
2 changes: 2 additions & 0 deletions Sources/JTAppleCalendarVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

// Calculated Variables
extension JTAppleCalendarView {
/// Workaround for Xcode bug that prevents you from connecting the delegate in the storyboard.
Expand Down
2 changes: 2 additions & 0 deletions Sources/JTAppleCalendarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

let maxNumberOfDaysInWeek = 7 // Should not be changed
let maxNumberOfRowsPerMonth = 6 // Should not be changed
let developerErrorMessage = "There was an error in this code section. Please contact the developer on GitHub"
Expand Down
2 changes: 2 additions & 0 deletions Sources/JTAppleCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

/// The JTAppleCell class defines the attributes and
/// behavior of the cells that appear in JTAppleCalendarView objects.
open class JTAppleCell: UICollectionViewCell {
Expand Down
2 changes: 2 additions & 0 deletions Sources/JTAppleCollectionReusableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

/// The header view class of the calendar
open class JTAppleCollectionReusableView: UICollectionReusableView {
/// Initializes and returns a newly allocated view object with the specified frame rectangle.
Expand Down
2 changes: 2 additions & 0 deletions Sources/JTCalendarProtocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

/// Default delegate functions
public extension JTAppleCalendarViewDelegate {
func calendar(_ calendar: JTAppleCalendarView, shouldSelectDate date: Date, cell: JTAppleCell?, cellState: CellState) -> Bool { return true }
Expand Down
2 changes: 2 additions & 0 deletions Sources/UICollectionViewDelegates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

extension JTAppleCalendarView: UICollectionViewDelegate, UICollectionViewDataSource {
/// Asks your data source object to provide a
/// supplementary view to display in the collection view.
Expand Down
2 changes: 2 additions & 0 deletions Sources/UIScrollViewDelegates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// THE SOFTWARE.
//

import UIKit

extension JTAppleCalendarView: UIScrollViewDelegate {
/// Inform the scrollViewDidEndDecelerating
/// function that scrolling just occurred
Expand Down
1 change: 1 addition & 0 deletions Sources/UserInteractionFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// THE SOFTWARE.
//

import UIKit

extension JTAppleCalendarView {

Expand Down
2 changes: 1 addition & 1 deletion Tests/JTAppleCalendar_iOSTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import XCTest
@testable import JTAppleCalendar

class JTAppleCalendar_iOSTests: XCTestCas(width, cellSize.height)e {
class JTAppleCalendar_iOSTests: XCTestCase {
let calendarView = JTAppleCalendarView()
let formatter: DateFormatter = {
let aFormatter = DateFormatter()
Expand Down

0 comments on commit dac79f2

Please sign in to comment.