我一直在尝试为我的应用设置CocoaPods CVCalendar
,但在将其集成到我的Xcode项目后,内容无法通过UIViews
显示。实质上,每当我将视图连接到CVCalendarView
和CVCalendarMenuView
变量时,视图就不会显示。这是我到目前为止的ViewController
代码,非常感谢帮助!
import UIKit
import CVCalendar
class ViewController: UIViewController, CVCalendarViewDelegate, CVCalendarMenuViewDelegate {
@IBOutlet weak var menuView: CVCalendarMenuView!
@IBOutlet weak var calendarView: CVCalendarView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
calendarView.commitCalendarViewUpdate()
menuView.commitMenuViewUpdate()
}
func presentationMode() -> CalendarMode {
return .MonthView
}
func firstWeekday() -> Weekday {
return .Sunday
}
}
答案 0 :(得分:3)
答案 1 :(得分:0)
如果由于某种原因您想手动设置CVCalendar,则必须执行以下步骤。