Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 由于'无法访问;内部';保护级别swift 3_Ios_Iphone_Swift3 - Fatal编程技术网

Ios 由于'无法访问;内部';保护级别swift 3

Ios 由于'无法访问;内部';保护级别swift 3,ios,iphone,swift3,Ios,Iphone,Swift3,我在这行代码中遇到了这样的错误“'removeCircleLabel'由于“内部”保护级别而无法访问”。我将CVCalendar库添加到我的项目中。我添加了pod,但当我在我的项目中添加视图控制器代码时,我发现了这个错误 @IBOutlet weak var calendarView: CVCalendarView! @IBAction func removeCircleAndDot(sender: AnyObject) { if let dayView = selectedDay

我在这行代码中遇到了这样的错误“'removeCircleLabel'由于“内部”保护级别而无法访问”。我将CVCalendar库添加到我的项目中。我添加了pod,但当我在我的项目中添加视图控制器代码时,我发现了这个错误

@IBOutlet weak var calendarView: CVCalendarView!

  @IBAction func removeCircleAndDot(sender: AnyObject) {
    if let dayView = selectedDay {
        calendarView.contentController.removeCircleLabel(dayView)// **error on this line** 

        if dayView.date.day < randomNumberOfDotMarkersForDay.count {
            randomNumberOfDotMarkersForDay[dayView.date.day] = 0
        }

        calendarView.contentController.refreshPresentedMonth()
    }
}

 public typealias ContentViewController = CVCalendarContentViewController

 public final class CVCalendarView: UIView {
// MARK: - Public properties
public var manager: Manager!
public var appearance: Appearance!
public var touchController: TouchController!
public var coordinator: Coordinator!
public var animator: Animator!
public var contentController: ContentViewController!
public var calendarMode: CalendarMode!

public var (weekViewSize, dayViewSize): (CGSize?, CGSize?)
}


// MARK: Delete circle views (in effect refreshing the dayView circle)
extension CVCalendarContentViewController {
  func removeCircleLabel(_ dayView: CVCalendarDayView) {
    for each in dayView.subviews {
        if each is UILabel {
            continue
        } else if each is CVAuxiliaryView {
            continue
        } else {
            each.removeFromSuperview()
        }
    }
  }
}
@ibvar-calendarView:CVCalendarView!
@iAction func RemoveCircleandTot(发件人:AnyObject){
如果让dayView=selectedDay{
calendarView.contentController.removeCircleLabel(dayView)/**此行出错**
如果dayView.date.day
我的视图控制器代码

 import UIKit
 import CVCalendar


class MainPageViewController: UIViewController, UITableViewDelegate,     
UITableViewDataSource {

struct Color {
    static let selectedText = UIColor.white
    static let text = UIColor.black
    static let textDisabled = UIColor.gray
    static let selectionBackground = UIColor(red: 0.2, green: 0.2, blue: 1.0, alpha: 1.0)
    static let sundayText = UIColor(red: 1.0, green: 0.2, blue: 0.2, alpha: 1.0)
    static let sundayTextDisabled = UIColor(red: 1.0, green: 0.6, blue: 0.6, alpha: 1.0)
    static let sundaySelectionBackground = sundayText
}

// MARK: - Properties
@IBOutlet weak var calendarView: CVCalendarView!
@IBOutlet weak var menuView: CVCalendarMenuView!
@IBOutlet weak var monthLabel: UILabel!
@IBOutlet weak var daysOutSwitch: UISwitch!

fileprivate var randomNumberOfDotMarkersForDay = [Int]()

var shouldShowDaysOut = true
var animationFinished = true

var selectedDay:DayView!

var currentCalendar: Calendar?

override func awakeFromNib() {
    let timeZoneBias = 480 // (UTC+08:00)
    currentCalendar = Calendar.init(identifier: .gregorian)
    if let timeZone = TimeZone.init(secondsFromGMT: -timeZoneBias * 60) {
        currentCalendar?.timeZone = timeZone
    }
}


@IBOutlet weak var topCalBtnView = UIView()
@IBOutlet weak var sideBtnView = UIView()
@IBOutlet weak var calendarBigView = UIView()
@IBOutlet weak var filterBtn = UIButton()
@IBOutlet weak var calTable = UITableView()
@IBOutlet weak var calView = UIView()
var calendarContectObj = CVCalendarContentViewController()


convenience init() {
    self.init(nibName:nil, bundle:nil)
}

override func viewDidLoad() {
    super.viewDidLoad()
    self.navigationController?.navigationBar.isHidden = true

    //Calendar Stuff
    if let currentCalendar = currentCalendar {
        monthLabel.text = CVDate(date: Date(), calendar: currentCalendar).globalDescription
    }

    randomizeDotMarkers()
    // Do any additional setup after loading the view.
}

override func viewWillAppear(_ animated: Bool) {
    self.setLayout()
    navigationController?.interactivePopGestureRecognizer?.isEnabled = false

}

func setLayout(){
    ConstantFile.roundViewCorner(customVw: topCalBtnView!)
    ConstantFile.roundViewCorner(customVw: sideBtnView!)
    ConstantFile.roundViewCorner(customVw: calendarBigView!)
    ConstantFile.makeRoundBtnWithCornerRadius(btn: filterBtn!, cornerRadius: 0.02)
    ConstantFile.roundTableViewCorner(tableVw: calTable!)

}

//Mark:- IBAction
@IBAction func toggleMenuBtn(_ sender: Any) {
    let appDelegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
    appDelegate.centerDrawwerController?.toggle(MMDrawerSide.left, animated: true, completion: nil)
}

//MARK:- UITableView Delegate and Data Source
func numberOfSections(in tableView: UITableView) -> Int {
    return 1
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 4
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cellId")
    let cell = tableView.dequeueReusableCell(withIdentifier: "cellId", for: indexPath)
    return cell
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

//Mark:- Calendar Stuff
@IBAction func removeCircleAndDot(sender: AnyObject) {
    if let dayView = selectedDay {
        calendarView.contentController.removeCircleLabel(dayView)

        if dayView.date.day < randomNumberOfDotMarkersForDay.count {
            randomNumberOfDotMarkersForDay[dayView.date.day] = 0
        }

        calendarView.contentController.refreshPresentedMonth()
    }
}

@IBAction func refreshMonth(sender: AnyObject) {
    calendarView.contentController.refreshPresentedMonth()

    randomizeDotMarkers()
}

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()

    calendarView.commitCalendarViewUpdate()
    menuView.commitMenuViewUpdate()
}

private func randomizeDotMarkers() {
    randomNumberOfDotMarkersForDay = [Int]()
    for _ in 0...31 {
        randomNumberOfDotMarkersForDay.append(Int(arc4random_uniform(3) + 1))
    }
}

/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    // Get the new view controller using segue.destinationViewController.
    // Pass the selected object to the new view controller.
}
*/

}
导入UIKit
导入日历
类MainPageViewController:UIViewController、UITableViewDelegate、,
UITableViewDataSource{
结构颜色{
静态let selectedText=UIColor.white
静态let text=UIColor.black
静态let textDisabled=UIColor.gray
静态let selectionBackground=UIColor(红色:0.2,绿色:0.2,蓝色:1.0,alpha:1.0)
静态let sundayText=UIColor(红色:1.0,绿色:0.2,蓝色:0.2,阿尔法:1.0)
静态let sundayTextDisabled=UIColor(红色:1.0,绿色:0.6,蓝色:0.6,alpha:1.0)
静态let sundaySelectionBackground=sundayText
}
//标记:-属性
@IBVAR日历视图:CVCalendarView!
@IBVAR菜单视图:CVCalendarMenuView!
@IBVAR月标签:UILabel!
@IBOutlet弱var DaySourtSwitch:UISwitch!
fileprivate var randomNumberOfDotMarkersForDay=[Int]()
var shouldShowDaysOut=true
var animationFinished=true
var selectedDay:DayView!
日历:日历?
重写func awakeFromNib(){
让timeZoneBias=480/(UTC+08:00)
currentCalendar=Calendar.init(标识符:.gregorian)
如果let timeZone=timeZone.init(secondsFromGMT:-timeZoneBias*60){
currentCalendar?时区=时区
}
}
@IBOutlet弱变量topCalBtnView=UIView()
@IBOUTLE弱var sideBtnView=UIView()
@IBMOutlet弱var calendarBigView=UIView()
@IBOutlet弱无功滤波器bTN=UIButton()
@IBVAR calTable=UITableView()
@IBVAR calView=UIView()
var calendarContectObj=CVCalendarContentViewController()
便利初始化(){
self.init(nibName:nil,bundle:nil)
}
重写func viewDidLoad(){
super.viewDidLoad()
self.navigationController?.navigationBar.isHidden=true
//日历材料
如果让currentCalendar=currentCalendar{
monthLabel.text=CVDate(日期:date(),日历:currentCalendar)。全局描述
}
随机化标记()
//加载视图后执行任何其他设置。
}
覆盖函数视图将出现(uo动画:Bool){
self.setLayout()
navigationController?.InteractiveProgTestureRecognitor?.isEnabled=false
}
func setLayout(){
ConstantFile.roundViewCorner(customVw:topCalBtnView!)
ConstantFile.roundViewCorner(自定义VW:sideBtnView!)
ConstantFile.roundViewCorner(customVw:calendarBigView!)
ConstantFile.makeRoundBtnWithCornerRadius(btn:filterBtn!,cornerRadius:0.02)
ConstantFile.roundTableViewCorner(tableVw:calTable!)
}
//标记:-IBAction
@iAction func toggleMenuBtn(u发送方:任意){
让appDelegate:appDelegate=UIApplication.shared.delegate作为!appDelegate
appDelegate.CenterDrawerController?切换(MMDrawerSide.left,动画:true,完成:nil)
}
//标记:-UITableView委托和数据源
func numberOfSections(在tableView:UITableView中)->Int{
返回1
}
func tableView(tableView:UITableView,numberofrowsinssection:Int)->Int{
返回4
}
func tableView(tableView:UITableView,cellForRowAt indexath:indexPath)->UITableViewCell{
tableView.register(UITableViewCell.self,强制重用标识符:“cellId”)
let cell=tableView.dequeueReusableCell(标识符为:“cellId”,表示:indexath)
返回单元
}
重写函数didReceiveMemoryWarning(){
超级。我收到了记忆警告()
//处置所有可以重新创建的资源。
}
//马克:日历之类的东西
@iAction func RemoveCircleandTot(发件人:AnyObject){
如果让dayView=selectedDay{
calendarView.contentController.removeCircleLabel(dayView)
如果dayView.date.day// MARK: Delete circle views (in effect refreshing the dayView circle)
extension CVCalendarContentViewController {
    func removeCircleLabel(_ dayView: CVCalendarDayView) {
        for each in dayView.subviews {
            if each is UILabel {
                continue
            } else if each is CVAuxiliaryView {
                continue
            } else {
                each.removeFromSuperview()
            }
        }
    }
}