[swift-corelibs-dev] Testcases for NSDateFormatter

Will Stanton willstanton1 at yahoo.com
Fri Feb 26 19:28:46 CST 2016


Hello Taylor,

If I understand what you’re asking, I feel like NS(Date/Number)Formatter property getters should be like:
CFDateFormatterCopyProperty(_cfObject, __CF_PROPERTY__)

Perhaps Philippe or Tony can confirm? Would like to know what they think.
(And while I’m at it: Any plans for CFAttributedString and write/read streams to become available?)


So, ex. for month symbols:
internal var _monthSymbols: [String]!
public var monthSymbols: [String]! {
    get {
            var symbols = Array<String>()
            let cfSymbols = CFDateFormatterCopyProperty(_cfObject, kCFDateFormatterMonthSymbols) as! NSArray
            for obj in cfSymbols {
                symbols.append((obj as! NSString)._swiftObject)
            }
            return symbols
    }
    set {
        _reset()
        _monthSymbols = newValue
    }
}


Perhaps there is a more efficient way to make a CFArray into an Array<String>…

Regards,
Will Stanton

> On Feb 26, 2016, at 7:25 PM, Taylor Franklin via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
> 
> Although, all that is unrelated to my latest question of getting some of the NSDateFormatter properties their proper default values?



More information about the swift-corelibs-dev mailing list