CTRubyAnnotation changes (need help fixing error)

I'm currently running into some problems when creating an NSAttributedString that displays the ruby annotation for a string.

    var reading = [.passRetained("ねこ") as Unmanaged<CFStringRef>?, .None, .None, .None]
    let annotation = CTRubyAnnotationCreate(.Auto, .Auto, 0.5, &reading) as CTRubyAnnotationRef
    let attributed = NSAttributedString(string: "猫", attributes: [
        NSFontAttributeName: font,
        NSVerticalGlyphFormAttributeName: verticalLayout,
        kCTRubyAnnotationAttributeName: annotation.takeUnretainedValue()
        ])


This is giving me the error that CTAnnotationRef doesn't have a member named takeUnretainedValue.


Has there been a change in swift or iOS 9 that now means the code doesn't work as expected? Also, is there a better way I could be creating the NSAttributedString?


The code above works fine under swift 1.2 / iOS 8.


Thanks,

Matt Delves

CTRubyAnnotation changes (need help fixing error)
 
 
Q