サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
買ってよかったもの
alisoftware.github.io
In Swift, protocols can’t specify access control to the properties they declare. If a property is listed in a protocol, you have to make conforming types declare those properties explicitly. But sometimes, even if you need those properties in order to provide your implementations, you don’t want those properties to be used outside the type. Let’s see how to workaround that problem. A simplified ex
Ok, so sadly I wasn’t at WWDC this year 😢 and followed it only on video 🎥 and Twitter. I bet you all saw the big announcements made during the keynote and the Platform State of the Union talks 🎉. But did you know about all those other new APIs that were added more silently? 🕵 Purpose The problem with the WWDC each year is there are tons of info and announcements and videos and so little time t
Pattern Matching, Part 4: if case, guard case, for case May 16, 2016 Updated: Oct 17, 2016 7 minute read — Also available in: 🇨🇳 Chinese Now that we’ve revisited the various syntaxes for pattern matching in part 1, part 2 and part 3, let’s finish this blog post series with some advanced syntax using if case let, for case where and all! Let’s use what we saw in previous articles and apply them al
Today we’ll see how we can be more efficient ⚡️ by… being la💤y 😴. In particular, we’ll talk about lazy var and LazySequence. And cats 😸. The problem Let’s say you are making a chat app and want to represent your users using an avatar. You might have different resolutions for each avatar, so let’s represent them this way: extension UIImage { func resizedTo(size: CGSize) -> UIImage { /* Some comp
In a previous article, I talked about error handling in Swift using throw. But what happens when you deal with asynchronous workflows, where throw can’t really fit? What’s wrong with throw and async? As a reminder, a function which can fail can use throw in the following way: // Define an error type and a throwing function enum ComputationError: ErrorType { case DivisionByZero } func inverse(x: Fl
Happy New Year everybody 🎇🎉🎊🎆! My first post of 2016 will be a useful trick I want to share, which will demonstrate the power of Swift’s generics and how they can be really handy when dealing with UITableViewCells and UICollectionViewCells. Introduction I don’t like string-typed stuff. Using constants is way better than using string literals to identify stuff uniquely. But when it comes to UIT
このページを最初にブックマークしてみませんか?
『alisoftware.github.io』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く