[swift-users] Creating a NSAttributedString from HTML

2016-09-15 Thread Félix Cloutier via swift-users
I'm trying to create a NSAttributedString from its HTML representation in Swift 3 (from the Xcode 8 GM build). However, this doesn't work: > import Foundation > import AppKit > > let html = "hello world" > let data = html.data(using: .utf8, allowLossyConversion: true)! > let attributed =

Re: [swift-users] [swift-evolution] How does "Sequence.joined" work?

2017-08-09 Thread Félix Cloutier via swift-users
Yes, exactly. An Array is a struct wrapper for a reference type representing storage. Mutating functions first check if they own the only reference to the storage using isKnownUniquelyReferenced . If not, they

Re: [swift-users] [swift-evolution] How does "Sequence.joined" work?

2017-08-09 Thread Félix Cloutier via swift-users
The benefit that standard library containers have over containers from other modules is that they're optimized as if they were part of your own module, so you can get the same thing by including the collection classes in your own executable instead of linking with the module. It's my