Skip to content

Commit

Permalink
Add spm support (#14)
Browse files Browse the repository at this point in the history
* Add spm support

* Add missing imports

* Raise minimum ios version

* Add missing import
  • Loading branch information
sambae authored Oct 5, 2022
1 parent 8f51d05 commit e9f39d9
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Colander.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Colander'
s.version = '0.2.5'
s.version = '0.3.0'
s.summary = 'A highly customizable iOS calendar view'

s.description = <<-DESC
Expand All @@ -14,12 +14,12 @@ Pod::Spec.new do |s|
s.author = { 'Bryan Oltman' => '[email protected]' }
s.source = { :git => 'https://github.com/blueapron/Colander.git', :tag => s.version.to_s }

s.ios.deployment_target = '10.0'
s.swift_version = '5.0'
s.ios.deployment_target = '13.0'
s.swift_version = '5.7'

s.source_files = 'Colander/Classes/**/*'
s.source_files = 'Sources/Colander/Classes/**/*'

s.dependency 'SnapKit', '~> 5.0.1'
s.dependency 'SwiftDate', '~> 6.3.1'
s.dependency 'SnapKit', '~> 5.6.0'
s.dependency 'SwiftDate', '~> 7.0.0'

end
Empty file removed Colander/Classes/.gitkeep
Empty file.
23 changes: 23 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"pins" : [
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SnapKit/SnapKit.git",
"state" : {
"revision" : "f222cbdf325885926566172f6f5f06af95473158",
"version" : "5.6.0"
}
},
{
"identity" : "swiftdate",
"kind" : "remoteSourceControl",
"location" : "https://github.com/malcommac/SwiftDate.git",
"state" : {
"revision" : "5d943224c3bb173e6ecf27295611615eba90c80e",
"version" : "7.0.0"
}
}
],
"version" : 2
}
26 changes: 26 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Colander",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "Colander",
targets: ["Colander"]),
],
dependencies: [
.package(url: "https://github.com/SnapKit/SnapKit.git", from: "5.6.0"),
.package(url: "https://github.com/malcommac/SwiftDate.git", from: "7.0.0")
],
targets: [
.target(
name: "Colander",
dependencies: [])
],
swiftLanguageVersions: [.v5]
)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if canImport(UIKit)

import UIKit

open class CalendarDayCell: UICollectionViewCell, Dated, DateFormatting {
public let dateFormatter: DateFormatter = {
let formatter = DateFormatter()
Expand Down Expand Up @@ -39,3 +43,5 @@ open class CalendarDayCell: UICollectionViewCell, Dated, DateFormatting {
date = nil
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#if canImport(UIKit)

import UIKit
import SnapKit
import SwiftDate
import UIKit

public protocol CalendarViewDataSource: AnyObject {
var calendar: Calendar { get }
Expand Down Expand Up @@ -336,3 +338,5 @@ extension CalendarView: UICollectionViewDelegateFlowLayout {
delegate?.calendar(self, didDeselectCell: cell, forDate: date)
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2017 Blue Apron. All rights reserved.
//

#if canImport(UIKit)

import Foundation
import SwiftDate

Expand Down Expand Up @@ -137,3 +139,5 @@ class CalendarViewModel {
return dates
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#if canImport(UIKit)

import Foundation
import SwiftDate

internal extension Calendar {
static let gregorian = Calendar(identifier: Calendar.Identifier.gregorian)
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2017 Blue Apron. All rights reserved.
//

#if canImport(UIKit)

import Foundation
import SwiftDate

Expand All @@ -23,3 +25,5 @@ struct MonthInfo {
self.numberOfDaysInMonth = date.monthDays
}
}

#endif

0 comments on commit e9f39d9

Please sign in to comment.