サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
iPhone 16
airspeedvelocity.net
UPDATE: now conforms to Swift 2.1b2 Following on from the previous post, here’s some more on building collections from enums. For our book on Swift, we wrote a simple linked list example to use in a section on conforming to CollectionType. Prior to indirect, it was written using a box, and I wanted to update it. But I hit a snag, of which more later. First, a bit about lists and value types. Here
UPDATE: now conforms to Swift 2.1b2 Suppose you want an ordered set. Set is great and all, but it’s unordered. You could always use a Set anyway, and sort the contents when needed. Or you could use an array, keep it sorted, and always insert new elements in the right place. Or, you could use a tree. One way to build a tree in Swift would be with a class that refers to itself. Something like this f
OK don’t panic – it might look like a lot has changed, but not really. It’s more… transformed. For the better. Nothing the migration assistant shouldn’t be able to handle. By far the biggest change in the standard library is due to the new protocol extensions. The free map function is dead, long live the map extensions to CollectionType and SequenceType. Which means now you only ever call map as a
In a talk last week at Swift Summit, I spoke a bit about Swift and performance, and about how structs and generic functions in Swift allow you to write high-level code without paying a significant performance penalty. This built on the example I posted a couple of weeks back about sorting nibbles in Swift. Towards the end, I gave a couple of lines of code that seemingly behave the same, but are ac
So, you’ve figured out the whole indices versus distances situation, and now you’re feeling pretty happy and you start trying out some more generic collection algorithms. And before long you smack your head against one of the more confusing things about generic collections: a sequence’s SubSequence doesn’t necessarily contain the same element type as that sequence. This usually manifests itself in
I managed to catch a copy of beta 6 before it was pulled. Though not a copy of the release notes, so apologies if I duplicate some items (and hopefully don’t misspeak about stuff better explained in them!). On the assumption the binaries will be the same except re-signed, here’s a rundown of the changes to the standard library. (edit: they were) Feels like Swift might be approaching the 1.0 home-s
このページを最初にブックマークしてみませんか?
『Airspeed Velocity』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く