From 20c72d7ce42edbf3fdf2b16156a4012b1593c4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 3 Sep 2015 13:20:24 +0200 Subject: [PATCH] Inner documentation --- GRDB/RowModel.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/GRDB/RowModel.swift b/GRDB/RowModel.swift index d6ae52804..51dc5d95e 100644 --- a/GRDB/RowModel.swift +++ b/GRDB/RowModel.swift @@ -145,9 +145,15 @@ public class RowModel { required public init(row: Row) { // IMPLEMENTATION NOTE // - // This initializer is defined so that subclasses can distinguish - // the simple init() from init(row: Row), and perform distinct - // initialization for fetched models. + // Swift requires a required initializer so that we can fetch RowModels + // in SelectStatement.fetch(type: RowModel.Type, arguments: StatementArguments? = nil) -> AnySequence + // + // This required initializer *can not* be the simple init(), because it + // would prevent subclasses to provide handy initializers made of + // optional arguments like init(firstName: String? = nil, lastName: String? = nil). + // See rdar://22554816 for more information. + // + // OK so the only initializer that we can require in init(row:Row). // // IMPLEMENTATION NOTE //