One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
\hi\ |
// | |
// rfc3339.swift | |
// Alwyzon for iPhone and iPad | |
// | |
import Foundation | |
/// Parse RFC 3339 date string to NSDate | |
/// | |
/// :param: rfc3339DateTimeString string with format "yyyy-MM-ddTHH:mm:ss.SSS" |
import Foundation | |
import XCTest | |
/// Basic sanity check that ensures that we are able to retrieve localized strings for all languages | |
/// we support. | |
final class L10NTests: XCTestCase { | |
func testLocalizations() { | |
let locales = ["en", "es", "zh-Hans", "zh-Hant", "fi"] | |
for locale in locales { |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
@propertyWrapper | |
struct Expirable<Value: ExpressibleByNilLiteral> { | |
let duration: TimeInterval | |
private var expirationDate = Date() | |
private var innerValue: Value = nil | |
private var hasExpired: Bool { | |
expirationDate < Date() | |
} |
I've been working through the exercises in the excellent iOS Unit Testing by Example book by Jon Reid, which I highly recommend. However, the book is in beta at the moment and there are some curveballs thrown by iOS 13 that aren't handled in the text yet. Specifically, when I hit the section about using a testing AppDelegate
class I thought "This is very good. But what about the SceneDelegate
?"
In Chapter 4 the recommendation is to remove the @UIApplicationMain
decoration and make a manual top-level call to UIApplicationMain
. To wit:
import UIKit