Customizable School Timetable Library

Related tags

UI JHTimeTable
Overview

JHTimeTable

SwiftUI Customizable School TimeTable Library

screenshot

설치

  • Swift Package Manager

사용하기

  • JHTimeTable뷰를 선언합니다.

    JHTimeTable(lineColor : .secondary,
                lineWidth : 1,
                resources : $data,
                onTapAction : { classdata in 
                    //사용자가 수업을 터치했을 때 액션
                })
  • JHTimeTable에서 resources는 ClassProtocol를 채택한 구조체 배열을 사용합니다. ClassProtocol은 다음과 같습니다.

    public protocol ClassProtocol : Identifiable {
    
        associatedtype TimeItem : ClassTimeProtocol
    
        /// 강의명
        var name : String { get set }
    
        /// 강의실
        var room : String? { get set }
    
        /// 시간표에 표시될 색상 (16진수 코드)
        var color : String { get set }
    
        /// 강의 시간에 대한 정보
        var times : [TimeItem] { get set }
    }
    
  • 강의 시간에 대한 정보는 ClassTimeProtocol를 채택해야합니다. ClassTimeProtocol는 다음과 같습니다.

    public protocol ClassTimeProtocol : Identifiable{
    
        /// 주일
        ///
        /// 시간표에 주일이 표시될 때는 자동으로 지역화되어 표시됩니다.
        var weekday : ClassWeekType { get set }
    
        /// 시작되는 시간
        ///
        /// HH : mm 에 대한 정보만 이용합니다.
        var start : Date { get set }
    
        /// 끝나는 시간
        ///
        /// HH : mm 에 대한 정보만 이용합니다.
        var end : Date { get set }
    }
  • JHTimeTable/Example/ExampleModel.swift 에서 사용하는 데이터 예제를 확인하세요.

커스텀하기

  • JHTimeTable은 뷰를 커스텀할 수 있는 EnvironmentKey를 제공합니다. 제공하는 EnvironmentKey항목은 다음과 같습니다.

    EnvironmentKey content
    timetableWeek 시간표에 표시될 주일 (자동으로 지역화 되어 표시됩니다.)
    timetableWeekFont 시간표 주일 폰트
    timetableWeekColor 시간표 주일 색상
    timetableWeekHeight 시간표 주일을 나타내는 부분의 높이
    timetableMinTime 시간표 시작 시간
    timetableMaxTime 시간표 최대 시간
    timetableTimeFont 시간표 시간 폰트
    timetableTimeColor 시간표 시간 색상
    timetableTimeWidth 시간표 시간을 나타내는 부분의 넓이
    timetableClassFont 시간표 수업 이름 폰트
    timetableRoomFont 시간표 강의실 폰트
    timetableHeight 시간표 셀의 높이
    timetableCornerRadius 시간표 테두리 곡률 (최대 23)
  • 예시

    JHTimeTable(lineColor:.secondary.opacity(0.3),
                lineWidth: 1,
                resources: $data)
            .frame(width:300) //시간표 넓이 지정
            .environment(\.timetableWeek, [.Mon,.Tue,.Wed,.Thu,.Fri]) //시간표에 표시될 주일 지정
            .environment(\.timetableWeekHeight, 20) //시간표 주일 높이 지정
            .environment(\.timetableCornerRadius, 20) //시간표 테두리 곡률 지정
            .environment(\.timetableMaxTime, 17) //시간표 최대 시간 지정
            .environment(\.timetableMinTime, 9) //시간표 시작 시간 지정
            .environment(\.timetableHeight, 40) //시간표 시간 셀 높이 지정
You might also like...
Fully customizable Facebook reactions like control
Fully customizable Facebook reactions like control

Reactions is a fully customizable control to give people more ways to share their reaction in a quick and easy way. Requirements • Usage • Installatio

Customizable CheckBox / RadioButton component for iOS
Customizable CheckBox / RadioButton component for iOS

GDCheckbox An easy to use CheckBox/Radio button component for iOS, with Attributes inspector support. Requirements Xcode 10+ Swift 5 iOS 9+ Installati

A beautiful radar view to show nearby items (users, restaurants, ...) with ripple animation, fully customizable
A beautiful radar view to show nearby items (users, restaurants, ...) with ripple animation, fully customizable

HGRippleRadarView Example To run the example project, clone the repo, and run pod install from the Example directory first. This project is inspired b

Easy to use, highly customizable gauge view
Easy to use, highly customizable gauge view

GDGauge - Customizable Gauge View Requirements Xcode 11+ Swift 5 iOS 9+ Installation Swift Package Manager .package(url: "https://github.com/saeid/GDG

The CITPincode package provides a customizable pincode view
The CITPincode package provides a customizable pincode view

The CITPincode package provides a customizable pincode view. It includes an optional resend code button with a built-in cooldown and an optional divider to be placed anywhere between the cells.

BulletinBoard is an iOS library that generates and manages contextual cards displayed at the bottom of the screen
BulletinBoard is an iOS library that generates and manages contextual cards displayed at the bottom of the screen

BulletinBoard is an iOS library that generates and manages contextual cards displayed at the bottom of the screen. It is especially well

A library to recreate the iOS Apple Music now playing transition
A library to recreate the iOS Apple Music now playing transition

DeckTransition DeckTransition is an attempt to recreate the card-like transition found in the iOS 10 Apple Music and iMessage apps. Hereʼs a GIF showi

:octocat:💧 A slider widget with a popup bubble displaying the precise value selected. Swift UI library made by @Ramotion
:octocat:💧 A slider widget with a popup bubble displaying the precise value selected. Swift UI library made by @Ramotion

FLUID SLIDER A slider widget with a popup bubble displaying the precise value selected written on Swift. We specialize in the designing and coding of

A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed flag
A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed flag

HidesNavigationBarWhenPushed A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed

Releases(2.0.3)
Owner
LeeProgrammer
WWDC2021 Swift Student Challenge Winner
LeeProgrammer
A minimalistic looking banner library for iOS. It supports multiple customizable kinds of Banner types

A minimalistic looking banner library for iOS. It supports multiple customizable kinds of Banner types

Emre Armagan 12 Oct 10, 2022
A simple, customizable view for efficiently collecting country information in iOS apps.

CountryPickerView CountryPickerView is a simple, customizable view for selecting countries in iOS apps. You can clone/download the repository and run

Kizito Nwose 459 Dec 27, 2022
📊 A customizable gradient progress bar (UIProgressView).

GradientProgressBar A customizable gradient progress bar (UIProgressView). Inspired by iOS 7 Progress Bar from Codepen. Example To run the example pro

Felix M. 490 Dec 16, 2022
A customizable color picker for iOS in Swift

IGColorPicker is a fantastic color picker ?? written in Swift. Table of Contents Documentation Colors Style Other features Installation Example Gettin

iGenius 272 Dec 17, 2022
Modular and customizable Material Design UI components for iOS

Material Components for iOS Material Components for iOS (MDC-iOS) helps developers execute Material Design. Developed by a core team of engineers and

Material Components 4.6k Dec 29, 2022
Highly customizable Action Sheet Controller with Assets Preview written in Swift

PPAssetsActionController Play with me ▶️ ?? If you want to play with me, just tap here and enjoy! ?? ?? Show me ?? Try me ?? The easiest way to try me

Pavel Pantus 72 Feb 4, 2022
RangeSeedSlider provides a customizable range slider like a UISlider.

RangeSeekSlider Overview RangeSeekSlider provides a customizable range slider like a UISlider. This library is based on TomThorpe/TTRangeSlider (Objec

WorldDownTown 644 Dec 12, 2022
Simple and highly customizable iOS tag list view, in Swift.

TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient

Ela Workshop 2.5k Jan 5, 2023
An easy to use UI component to help display a signal bar with an added customizable fill animation

TZSignalStrengthView for iOS Introduction TZSignalStrengthView is an easy to use UI component to help display a signal bar with an added customizable

TrianglZ LLC 22 May 14, 2022
A customizable Joystick made with SwiftUI

SwiftUIJoystick ??️ A customizable Joystick made with SwiftUI Create your own Base and Thumb/Handle view using SwiftUI Examples ?? Installation Swift

Michaellis 19 Nov 13, 2022