Skip to content

mlballack/WeeklyCalendar

Repository files navigation

WeeklyCalendar

Platforms Swift License Twitter

WeeklyCalendar is an week display calendar view in SwiftUI emulating iPhone's Calendar app UI.

light mode git

Color type

light mode dark mode

Table of Contents

Installation

Swift Package Manager

Package

You can add this package to Package.swift, include it in your target dependencies.

let package = Package(
    dependencies: [
        .package(url: "https://github.com/mlballack/WeeklyCalendar", .upToNextMajor(from: "0.1.0")),
    ],
    targets: [
        .target(
            name: "<your-target-name>",
            dependencies: ["WeeklyCalendar"]),
    ]
)

Xcode

You can add this package on Xcode. See documentation.

How to use

You can just import WeeklyCalendar to use it.

import SwiftUI
import WeeklyCalendar

struct ContentView: View {
    @State var selectedDate: Date = .now
    
    var body: some View {
        VStack {
            WeeklyCalendar()
                .setColorTheme(.dark)
                .onChangeDate { selected in
                    selectedDate = selected
                }
            // Any View
        }
    }
}

and if you want to choose your own colors, you can customize it as follows

WeeklyCalendar()
    .setColorTheme(.custom(
        bgColor: <#T##Color#>,
        weekdayTextColor: <#T##Color#>,
        weekendTextColor: <#T##Color#>,
        todayTextColor: <#T##Color#>,
        selectedTextColor: <#T##Color#>,
        selectedCircleColor: <#T##Color#>,
        todaySelectedCircleColor: <#T##Color#>,
        dateTextColor: <#T##Color#>
    ))

Requirements

  • iOS 16.0+
  • Xcode 14.0+

Contribution

I would be happy if you contribute !!

Stats

Stats

License

This project is licensed under the MIT License - see the License file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages