๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Develop Study ๐Ÿ’ป

swift study calender

728x90

https://github.com/WenchaoD/FSCalendar

 

WenchaoD/FSCalendar

A fully customizable iOS calendar library, compatible with Objective-C and Swift - WenchaoD/FSCalendar

github.com

import UIKit

import FSCalendar

 

class ViewController: UIViewController, FSCalendarDelegate, FSCalendarDataSource {

    @IBOutlet weak var calendar: FSCalendar!

    override func viewDidLoad() {

        super.viewDidLoad()

        // Do any additional setup after loading the view, typically from a nib.

         

        calendar.cellShape = .Rectangle//์„ ํƒ๋œ ๋‚ ์งœ์˜ ํ˜•ํƒœ๊ฐ€ ๋„ค๋ชจ๋กœ ํ‘œ์‹œ๋˜๋„๋ก

        calendar.allowsMultipleSelection =true //์—ฌ๋Ÿฌ๋‚ ์งœ๋ฅผ ๋™์‹œ์— ์„ ํƒํ•  ์ˆ˜ ์žˆ๋„๋ก

        calendar.clipsToBounds =true //๋‹ฌ๋ ฅ ๊ตฌ๋ถ„ ์„  ์ œ๊ฑฐ

         

        calendar.delegate =self

        calendar.dataSource =self

    }

 

    // ๊ฐ ๋‚ ์งœ์— ํŠน์ • ๋ฌธ์ž์—ด์„ ํ‘œ์‹œ

    func calendar(calendar: FSCalendar, subtitleForDate date: NSDate) ->String? {

        return "W"

    }

 

    // ํŠน์ • ๋‚ ์งœ๋ฅผ ์„ ํƒํ–ˆ์„ ๋•Œ, ๋ฐœ์ƒ

    func calendar(calendar: FSCalendar, didSelectDate date: NSDate) {

        print(date)

    }

     

    // ์Šค์™€์ดํ”„๋ฅผ ํ†ตํ•ด์„œ ๋‹ค๋ฅธ ๋‹ฌ(month)์˜ ๋‹ฌ๋ ฅ์œผ๋กœ ๋„˜์–ด๊ฐˆ ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ.

    func calendarCurrentMonthDidChange(calendar: FSCalendar) {

        print(calendar)

    }

}

 

728x90

'Develop Study ๐Ÿ’ป' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

TCP/IP ์†Œ์ผ“ํ”„๋กœ๊ทธ๋ž˜๋ฐ 2  (0) 2020.04.17
TCP/IP ์†Œ์ผ“ํ”„๋กœ๊ทธ๋ž˜๋ฐ on MAC  (0) 2020.04.10
swift study  (0) 2019.11.04
swift fastcampus ์ˆ˜๊ฐ•์ค‘  (0) 2019.10.30
flutter  (0) 2019.09.25