From 8b87bbe2508277fda0748805fe3edc61fa55ff38 Mon Sep 17 00:00:00 2001 From: WenchaoD Date: Fri, 23 Sep 2016 22:30:52 +0800 Subject: [PATCH] var -> let. Update README.md. --- README.md | 6 +++++- SwiftExample/SwiftExample/ViewController.swift | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 20732ad..453988a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ # Updates -To get the iOS7 compatibility, You need to include [NSCalendarExtension](https://github.com/WenchaoD/NSCalendarExtension) into your project. +[NSCalendarExtension](https://github.com/WenchaoD/NSCalendarExtension) is required to get iOS7 compatibility. # [中文介绍](http://www.jianshu.com/notebooks/4276521/latest) [**QQ交流群: 323861692**](#qq_group) @@ -128,6 +128,9 @@ calendar.delegate = self view.addSubview(calendar) self.calendar = calendar ``` + +> **FSCalendar** is fully compatible for Swift3, see `SwiftExample` for more details. +
## Warning @@ -157,6 +160,7 @@ self.calendar = calendar # Pre-knowledge ## How to create NSDate object + * By **NSCalendar**. ```objc diff --git a/SwiftExample/SwiftExample/ViewController.swift b/SwiftExample/SwiftExample/ViewController.swift index c2265f6..0efe02e 100644 --- a/SwiftExample/SwiftExample/ViewController.swift +++ b/SwiftExample/SwiftExample/ViewController.swift @@ -13,12 +13,12 @@ class ViewController: UIViewController, FSCalendarDataSource, FSCalendarDelegate @IBOutlet weak var calendar: FSCalendar! @IBOutlet weak var calendarHeightConstraint: NSLayoutConstraint! - private var formatter: DateFormatter = { + private let formatter: DateFormatter = { let formatter = DateFormatter() formatter.dateFormat = "yyyy/MM/dd" return formatter }() - private var gregorian: NSCalendar! = NSCalendar(calendarIdentifier:NSCalendar.Identifier.gregorian) + private let gregorian: NSCalendar! = NSCalendar(calendarIdentifier:NSCalendar.Identifier.gregorian) let datesWithCat = ["2015/05/05","2015/06/05","2015/07/05","2015/08/05","2015/09/05","2015/10/05","2015/11/05","2015/12/05","2016/01/06", "2016/02/06","2016/03/06","2016/04/06","2016/05/06","2016/06/06","2016/07/06"]