サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
2024年ランキング
oleb.net
Added two footnotes with clarifications from people who were there. In episode 1 of the new Swift Community Podcast, Chris Lattner, Garric Nahapetian, and John Sundell spoke about the origins of Swift and the current state of the Swift community, among other things. This is a transcript (edited for readability) of the parts I found most interesting. You’ll see I mainly quoted Chris Lattner because
I’m not a fan of the default file header comment Xcode adds to new source files. I’d argue that most of the information in the file header is either irrelevant or better tracked through source control. Moreover, these comments can quickly become outdated as files and projects get renamed. In my personal projects, my first step after creating a new file is always to delete this header comment. Unti
Chris Lattner was a guest on a Swift panel during WWDC a few weeks ago. Here are some quotes I found interesting, edited for brevity and clarity. (I’m focusing on Chris Lattner here, but the other panelists — Kamilah Taylor, Lily Ballard, and Jesse Squires — also had interesting things to say. You should really watch the whole thing if you can.) On the debate whether the open Swift evolution proce
In Swift Talk episode 31, Chris and Florian present a solution for mutating nested, heterogeneous dictionaries of type [String: Any] in Swift. It’s an interesting discussion, I encourage you to watch it or read the excellent transcript. I helped a little in the preparation of the episode and while experimenting with this problem developed something that ultimately didn’t make it into the video, so
Do you know this problem? You want to display an optional value in the UI or log it to the console for debugging, but you don’t like the default string conversion for optionals, which results in either "Optional(…)" or "nil". For example: var someValue: Int? = 5 print("The value is \(someValue)") // → "The value is Optional(5)" someValue = nil print("The value is \(someValue)") // → "The value is
The raw value syntax for enums in Swift is “just” a shorthand for conformance to the RawRepresentable protocol. It’s easy to add this manually if you want to use otherwise unsupported types as raw values. When you define an enum in Swift, you can choose to have each enum case “backed” by a raw value. For example, here’s an enum that models the terrain type of a map tile in a game, and each case ha
I’m a big fan of Swift 3. There’s a bunch of relatively small syntax changes that make the language more consistent. The most important of these is certainly the consistent handling of parameter labels in functions (yay!). Another small change I really like is that the @warn_unused_result behavior is now the default. It’s one of those little things that make it harder to screw up unless you explic
By Ole Begemann More about me and contact info April 30, 2014 Last update: May 8, 2014 I am a big fan of Mike Ash’s Let’s Build … series of articles, in which he explains how certain Cocoa features work by rebuilding them from scratch. In this post, I am gonna try to do something similar by writing my own little scroll view with just a few lines of code. But first, let’s take a closer look how coo
Note: This article is based on Swift 2.x. Please check out Ranges in Swift 3 for an overview of what changed in Swift 3. In my previous post on pattern matching, I mentioned that the standard library includes overloads of the pattern matching operator ~= for ranges and intervals. These two data types are related, but have some important differences. I’d like to talk a bit more about them because t
By Ole Begemann More about me and contact info November 20, 2014 Last update: November 24, 2014 As you probably know by now, the iPhone 6 Plus renders things differently than every other iOS device to date. To developers, the device exposes a screen rectangle of 414 × 736 points, which the system renders at 3× scale into a backing store of 1242 × 2208 “logical” pixels.1 Since the iPhone 6 Plus dis
In Debug 47, former Apple managers Don Melton and Nitin Ganatra talk about, among many other things, work habits at Apple. Here’s a transcript of the relevant section, starting at the 23-minute mark (edited for clarity, emphasis mine): Don Melton: I wrote that blog post a couple of years ago after I retired about how Sunday is a work night for everybody at Apple. Nitin Ganatra: Right. Melton: Beca
By Ole Begemann More about me and contact info August 28, 2014 Last update: September 1, 2014 Earlier this week, tweets from Nick Lockwood and James Thomson alerted me to an as yet undocumented new feature in the iOS 8 SDK: you can now use a storyboard scene in place of your app’s launch images. Launch Images iOS uses launch images to give users the impression that apps launch instantly. While an
Completely rewritten to incorporate the fundamental changes in Xcode 6 beta 4. A Character can now hold full grapheme clusters.
By Ole Begemann More about me and contact info June 11, 2014 Last update: June 23, 2014 In iOS 8 and OS X Yosemite, Core Data gains the ability to detect and report violations of its concurrency model.1 I think this is a very valuable feature because accessing a managed object context from the wrong queue is a simple mistake to make and can be fatal if it causes your users’ data to get corrupted.2
I am a big fan of CodeRunner, Nikolai Krill’s Mac app that lets you quickly run few lines of code without the need to create a project or to even save the file first. I have used it primarily for testing Objective-C snippets until now, but naturally I would also like to use it with Swift. In this post, I want to show you how to add Swift support to CodeRunner. Playgrounds and the Swift REPL Arguab
With the release of the beta versions of iOS 8 and OS X Yosemite at WWDC 2014 yesterday, Apple has also updated the legal agreements for registered iOS and Mac developers. Among other changes, Apple has added the following sentence to section “10.1 Information Deemed Apple Confidential” of the iOS Developer Program License Agreement: Further, Apple agrees that You will not be bound by the foregoin
Update August 15, 2019: Five years after I wrote this, Dropbox’s Eyal Guthmann announced that Dropbox has completely backed off from this strategy of using C++ for code sharing between iOS and Android in favor of using each platform’s native languages and SDKs directly. Eyal’s article is a very honest account of the downsides of choosing a non-standard tech stack, from integrating with platform AP
By Ole Begemann More about me and contact info May 21, 2014 Last update: June 30, 2014 Update June 30, 2014: Updated to reflect changes I made to OLEContainerScrollView’s public interface. The container scroll view now exposes a read-only contentView property. You should add any subviews you want managed by the container scroll view directly to its content view. In this article, I am introducing O
By Ole Begemann More about me and contact info May 2, 2014 Last update: February 21, 2015 A list of photos in a collection view. Note the parallax effect of the images when the list scrolls. Download the video (H.264) . Parallax scrolling is a big UI design trend these days. In this article, I want to show you how to write a collection view that applies a nice parallax effect to its cells during s
In OS X 10.7 and iOS 5.0, Apple added an inconspicuous new function named CGPathCreateCopyByStrokingPath() to the Core Graphics framework. As the documentation says and the name implies, this function [c]reates a stroked copy of another path. … The new path is created so that filling the new path draws the same pixels as stroking the original path. Sounds like a pretty obscure function that is rar
By Ole Begemann More about me and contact info April 25, 2013 Last update: December 13, 2013 Compiler warnings are one of the most helpful tools for developers. The compiler can not only warn you about obvious mistakes (such as a method you forgot to implement); it also identifies many code patterns that, though syntactically correct, are potentially dangerous (like signed/unsigned conversion) or
By Ole Begemann More about me and contact info March 31, 2013 Last update: March 3, 2014 Working with Cocoa Auto Layout for the first time is very different from the springs and struts model Cocoa developers have known for more than a decade. Despite the complexity of Auto Layout, I have found that you need to understand just a few basic rules to make the concept click. This article is an attempt
Automating Strings Extraction From Storyboards for Localization Update April 24, 2014: I just learned that Apple does in fact provide a coomand line tool named AppleGlot that supports incremental localization of .strings files, NIBs, and storyboards. AppleGlot just got updated to version 4.0 (v159.1) on April 15, 2014, and the release notes list support for Xcode 5 file formats. I haven’t tried it
By Ole Begemann More about me and contact info December 2, 2011 Last update: December 21, 2011 Let me follow up on last month’s little series about date and time handling in Cocoa with a practical example. Say you want to implement a list of your future appointments similar to the List view in Apple’s Calendar app on the iPhone. Calendar events should be listed in a table view, with each day getti
By Ole Begemann More about me and contact info February 5, 2013 Last update: February 7, 2013 (Or: What The Hell Is MPGobblerGestureRecognizer?) Now that Apple has released iOS 6.1, I wanted to see whether the new OS version contained any exciting new APIs beside the rather meager additions in the public API diffs. With the help of Nicolas Seriot’s excellent iOS Runtime Headers repository, I compi
By Ole Begemann More about me and contact info October 1, 2012 Last update: October 5, 2012 In my previous article on sharing in iOS 6, I hinted at the possibility that Apple was working on a more powerful method to enable sharing between apps without compromising the iOS security architecture. In fact, Apple is already using a new undocumented concept called Remote View Controllers in iOS 6. This
By Ole Begemann More about me and contact info September 20, 2012 Last update: September 24, 2012 In a last minute change to iOS 6, Apple added an option for users to opt out of targeted advertising. The setting can be found in the iOS Settings app under General > About > Advertising. I see no reason why Apple did not place it in the more obvious new Privacy section other than to hide it from most
By Ole Begemann More about me and contact info May 31, 2012 Last update: March 5, 2014 Apple’s Event Kit framework (introduced in the iOS 4.0 SDK) lets developers interact with a device’s calendar database. You can not only read out existing events but also create new calendar events and even entirely new calendars from your app. In this article, let’s have a look at how creating and deleting cale
By Ole Begemann More about me and contact info January 31, 2012 Last update: May 10, 2012 Update May 10, 2012: In the meantime, Ole has submitted DocSets to the App Store and perhaps surprisingly, Apple approved it. I encourage you to buy the app on the App Store both to support Ole and make future updates easier. Have you ever tried to use Apple’s developer documentation on your iOS device? While
次のページ
このページを最初にブックマークしてみませんか?
『Ole Begemann』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く