通过Cocoapods设置CVCalendar:视图Aren不显示

时间:2016-02-09 00:27:51

标签: ios xcode swift cocoapods

我一直在尝试为我的应用设置CocoaPods CVCalendar,但在将其集成到我的Xcode项目后,内容无法通过UIViews显示。实质上,每当我将视图连接到CVCalendarViewCVCalendarMenuView变量时,视图就不会显示。这是我到目前为止的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
    }

}

2 个答案:

答案 0 :(得分:3)

  • 您的ViewController类是故事板中的类吗?
  • 您是否与代表联系? Delegate setup
    • 您将渲染委托给ViewController /
    • 您需要拖动到黄色视图控制器结点。

答案 1 :(得分:0)

如果由于某种原因您想手动设置CVCalendar,则必须执行以下步骤。

Refer here