SimpleCalendar
将简单日历的功能直接引入您的应用程序中。它没有花哨的滑块,其目的也不是模仿 Apple 的日历应用程序。正如其标题所示,它的目的就是一个简单的日历。
最初是为 Swift Island 应用程序构建的,此日历后来被分离出来,成为一个独立的 Github 项目,以便其他人可以轻松地将其集成到其他应用程序中。
Simple Calendar 可以通过 Swift Package Manager 安装。
https://github.com/ppeelen/SimpleCalendar.git
Simple Calendar 在 Xcode 内部自带文档,但这里有一些快速示例。
添加 Simple Calendar 只需要一行代码。
SimpleCalendarView(
events: eventList,
selectionAction: .sheet
)
上面示例中的 eventList
是 EventRepresentable
类型的项目列表;例如 Event
。更多示例请参阅示例应用程序。
当用户在日历中选择一个事件时,Simple Calendar 可以通过闭包通知您,显示默认的 sheet 视图、自定义的 sheet 视图或移动到自定义的目标位置。
您可以在这里找到文档: https://ppeelen.github.io/SimpleCalendar/docs/documentation/simplecalendar