티스토리 뷰

 

이런 캘린더가 필요했는데... 많은 고민 끝에 FSCalendar을 SwiftUI로 바꿔서 쓰기로 결정했다. 

 

struct CalendarView: UIViewRepresentable {
  typealias UIViewType = FSCalendar
  func makeUIView(context: Context) -> FSCalendar {
    let calendar = FSCalendar()
    calendar.delegate = context.coordinator
    calendar.dataSource = context.coordinator
    return calendar
  }

  func updateUIView(_ uiView: FSCalendar, context: Context) {}
  class Coordinator: NSObject, FSCalendarDelegate, FSCalendarDataSource {}

  func makeCoordinator() -> Coordinator {
    return Coordinator()
  }
}
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함