Funding (my) OpenSource work

Yes, ObjectivePGP is backed by the organization of a Fortune 500 company founder. We signed a 1-year long grant agreement, two months ago, and I'm delighted with it. What does that mean? That happened. My three years old project got funding. Around May we had the first talk about the…

Selling t-shirt > selling mobile apps. Dinosaurs.

Stop doing the apps. Start selling t-shirts. I spent an enormous amount of time doing apps, or even programs (before we begun to call it apps). I spent days on doing more or less challenging stuff like PGP implementation or Cryptography. Even the PDF counts (the spec is 756 pages)…

Framed faces. The real world status board.

Three weeks ago I got this idea to build something new. The Idea At PSPDFKit we use Slack a lot. It's in our veins. One of the routines is to check-in whenever one starts work. To do so, we go to the #inout channel and type just in or out…

Peculiar inheritance of enum

It turns out that Swift 3 nested enums combine options, but it's not inheritance. It's a little know "feature" you should be aware of when designing API with Swift 3. I didn't know that, and my (I have to admit reasonable assumption) lead to the problem that can't be easily…

Conditional Swift testing

The problem Some tests need to be skipped when executing on CI (continuous integration like travis.org). What tests? In my case, it's performance tests. Why? because I can't trust all CI results and sometimes, randomly, some tests will fail without good reason, like this one: error: testPerformance : failed: The…

Package.swift - manual

Here is documentation for SPM manifest file Package.swift. I couldn't find a list of possible configuration values for Package.swift, so I created one, for future reference. I put here all available settings, with examples of use. Please find examples at the end of the post. Preamble Package.swift…

Sharing distribution certificate. automat.

One thing at a time Importing and sharing iOS/macOS certificates and keys required for AppStore distribution of application can be pain 🔥 as we know it. with a little command line, I can help myself a little bit. Here, I'm building command line shell script that will load certificates if…

Documenting Swift protocol

In Swift, I can write documentation at a protocol level now. There is a kick-ass feature added recently to Xcode 8 (beta 4). If I add documentation of function at the protocol level, it's available at the level of implementation. look, I wrote documentation to Task.run() and I can…

Queues are not bound to any specific thread

It all started with this snippet from @jspahrsummers #import <Foundation/Foundation.h> int main (int argc, const char **argv) { @autoreleasepool { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_sync(dispatch_get_main_queue(), ^{ NSLog(@"is main thread? %i", (int)[NSThread isMainThread]); }); }); dispatch_main(); } return…

Status of Portable Swift code

Portable Swift source code is so damn hard to do. Main problem is that OSX and Linux Swift is using different Foundation codebase. Linux is using SwiftFoundation and OSX is using Foundation. What's the difference ? Foundation vs SwiftFoundation Foundation is written in Objective-C, it's complete and stable. SwiftFoundation on the…

CloudKit Security model

CloudKit security model is barely described in documentation, yet it's very important aspect of this cloud solution. I do care about privacy and I believe privacy aspect is important when implementing Cloud driven solutions. The subject is not widely explained in documentation, hence I'm writing this blog post as a…

Overload Swift type ambiguity

I may define default type for overloaded functions. sometimes. This is Swift return overloading that may lead to ambiguity: extension String { func encode() -> NSData? { return self.dataUsingEncoding(NSUTF8StringEncoding)?.base64EncodedDataWithOptions([]) } func encode() -> String? { return self.dataUsingEncoding(NSUTF8StringEncoding)?.base64EncodedStringWithOptions([]) } } I have two functions encode() that returns value of…

Retry! in the wild

In perfect world every action finish with the success. In real world it's not. In perfect world sending network request returns with a result. In real world it fail sometimes due to dozen of reasons, and since we're living in the real world I have to deal with it. don't…

How to be awesome Swift developer

I don't know, but I received enough emails from various people asking me how to be "awesome Swift developer" to write this post. I’d be an iOS developer and it would be amazing if you could me advise on the right path to follow to accomplish that. Lets say…

Linux compatible Swift and Swift Package Manager

Apple opensourced Swift today, as promised in early 2015. This is great, awesome etc... but I'm not about that here. Together with Swift - programming language, Apple presented Linux port of Swift compiler and some tools. One of the tools is Swift Package Manager - that's the reason of this…

Code at the end of the queue

NSOperation and NSOperationQueue are great and useful Foundation framework tools for asynchronous tasks. One thing puzzled me though: How can I run code after all my queue operations finish? The simple answer is: use dependencies between operations in the queue (unique feature of NSOperation). It's just 5 lines of code…

Swift reflection about food

Reflection in practice Reflection technique may be useful to build quasi generic functions that operate at runtime. It may be quasi type safe, though it uses runtime too - as such can't be optimised/validated during compilation. With Objective-C we used <runtime/objc.h> and do all the…

Where "where" may be used?

This is by far the most faved/retweeted Swift tip of mine lately: don't forget you can do this 🎉 in Swift #swiftlang pic.twitter.com/izVlfcqOYv— Marcin Krzyzanowski (@krzyzanowskim) November 10, 2015 indeed cool, unexpected and forgettable feature of Swift pattern-matching. The fact is you can use…

Swift London about Natalie, the talk

Earlier this month (October 19, 2015), I had the pleasure to be part of Swift London meetup. I talked about Natalie - Storyboard Code Generator presenting my approach to the "problem" of Storyboards and Swift. Below you can find my presentation, along with an amateur video recording (captured by iPhone)…

ChunkSequence 🔪🍰

Have cake and eat it Have a cake and consume the cake by the Swift function, at the same time. Magic. The nature of the Swift type is that it is copied or copied on write. When I assign A to B (A = B), then effectively B is copy of…