import Foundation

public final class Configuration {

    public static var headersWithBoldTrait = false

    static var defaultBoldFormatter: AttributeFormatter {
        get {
            if headersWithBoldTrait {
                return BoldWithShadowForHeadingFormatter()
            } else {
                return BoldFormatter()
            }
        }
    }
}

import Foundation

public final class Configuration {

    public static var headersWithBoldTrait = false

    static var defaultBoldFormatter: AttributeFormatter = {
        if headersWithBoldTrait {
            return BoldWithShadowForHeadingFormatter()
        } else {
            return BoldFormatter()
        }
    } ()
}

--- 
+++ 
@@ -4,11 +4,13 @@
 
     public static var headersWithBoldTrait = false
 
-    static var defaultBoldFormatter: AttributeFormatter = {
-        if headersWithBoldTrait {
-            return BoldWithShadowForHeadingFormatter()
-        } else {
-            return BoldFormatter()
+    static var defaultBoldFormatter: AttributeFormatter {
+        get {
+            if headersWithBoldTrait {
+                return BoldWithShadowForHeadingFormatter()
+            } else {
+                return BoldFormatter()
+            }
         }
-    } ()
+    }
 }
Create a formatter for each call.
