Swift UIView作为leftCalloutAccessoryView

Swift UIView作为leftCalloutAccessoryView,swift,uiview,swift2,mapkit,mapkitannotation,Swift,Uiview,Swift2,Mapkit,Mapkitannotation,我试图添加UIView作为MapKitAnnotation的leftCalloutAccessoryView,但我添加到UIView的textlabel没有显示,我不明白为什么 let orderInfoView = UIView(frame: CGRectMake(0, 0, 100, annotationView!.frame.size.height)) orderInfoView.backgroundColor = UIColor.blackColor() let textLabel =

我试图添加UIView作为MapKitAnnotation的leftCalloutAccessoryView,但我添加到UIView的textlabel没有显示,我不明白为什么

let orderInfoView = UIView(frame: CGRectMake(0, 0, 100, annotationView!.frame.size.height))
orderInfoView.backgroundColor = UIColor.blackColor()

let textLabel = UILabel(frame: CGRectMake(0, 0, 100, 10))
textLabel.text = "Foobar"
textLabel.textAlignment = .Center

orderInfoView.addSubview(textLabel)

annotationView?.leftCalloutAccessoryView = orderInfoView
[更新]

这段代码打破了它,把它变成了一个数值常量,使它工作起来

annotationView!.frame.size.height