Giter Club home page Giter Club logo

nhcalendar's Introduction

NHCalendar swift练习写的 ,有不足的地方 共同交流提高

思路 1.今天的日期 2.这个月有几天 3.本月第一天是星期几

#//这里 之间把NHCalendarView添加到视图里就可以了 class ViewController: UIViewController,NHCalendarViewDelegate { override func viewDidLoad() { super.viewDidLoad() let view = NHCalendarView() view.frame = CGRectMake(0, 100, self.view.bounds.size.width, 250) view.delegate = self self.view.addSubview(view) } #//点击选择日期功能 func NHCalendarViewSelectDate(year: Int, month: Int, day: Int) { print("(year)-(month)-(day)") } #增加闭包用法 NHCalendarView.show(self.view, frame: CGRectMake(0, 100, self.view.bounds.size.width, 250)) { (year, month, day) -> Void in print("(year)-(month)-(day)") } #便利构造器用法 self.calendar = NHCalendarView(frame: CGRectMake(0, 100, self.view.bounds.size.width, 250), view: self.view, selectDate: { (year, month, day) -> Void in print("(year)-(month)-(day)") }) #增加回到今天功能 self.calendar?.backToDay()

#逐步完善一下功能 1。点击选择时期,给出选择的效果 2。可自定义颜色和字体 3。增加事件日期功能 4. 可选闭包回调和代理回调2种 5.可多选日期

nhcalendar's People

Contributors

shijinliang avatar sunnynh avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.