From 823cb163257b72369f2d7dd9b7283842ea4d97b1 Mon Sep 17 00:00:00 2001 From: Mathias Aichinger Date: Wed, 11 Jan 2017 17:10:07 +0100 Subject: [PATCH 01/29] ADD first draft for component factories. Not happy yet; WIP --- Matrioska.xcodeproj/project.pbxproj | 28 ++++++++++++++++++++++++-- Source/JSON/ComponentFactory.swift | 15 ++++++++++++++ Source/JSON/JsonParser.swift | 21 +++++++++++++++++++ Source/JSON/StackClusterFactory.swift | 20 ++++++++++++++++++ Source/JSON/TabBarClusterFactory.swift | 20 ++++++++++++++++++ 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 Source/JSON/ComponentFactory.swift create mode 100644 Source/JSON/JsonParser.swift create mode 100644 Source/JSON/StackClusterFactory.swift create mode 100644 Source/JSON/TabBarClusterFactory.swift diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index 460a762..55e0b1f 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -7,6 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + 21E40AD81E26543700205C06 /* ComponentFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD71E26543700205C06 /* ComponentFactory.swift */; }; + 21E40ADA1E2657A100205C06 /* JsonParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD91E2657A100205C06 /* JsonParser.swift */; }; + 21E40ADC1E268A9E00205C06 /* TabBarClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */; }; + 21E40ADE1E268F6300205C06 /* StackClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */; }; 51A54328766C8548A4F3AE4A /* Pods_MatrioskaTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */; }; 5A069A980F4B0D057E6B647F /* Pods_Matrioska.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */; }; DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */; }; @@ -42,6 +46,10 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 21E40AD71E26543700205C06 /* ComponentFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentFactory.swift; sourceTree = ""; }; + 21E40AD91E2657A100205C06 /* JsonParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JsonParser.swift; sourceTree = ""; }; + 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarClusterFactory.swift; sourceTree = ""; }; + 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackClusterFactory.swift; sourceTree = ""; }; 21FF818E1DDCB7FA0017B1A1 /* Fastfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Fastfile; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 23587B9D5CB1FB404F5C7787 /* Pods-MatrioskaTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrioskaTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MatrioskaTests/Pods-MatrioskaTests.debug.xcconfig"; sourceTree = ""; }; 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -62,11 +70,11 @@ DE3E8D951DD38AAA00417AE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DE3E8D961DD38AAA00417AE5 /* ComponentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentTests.swift; sourceTree = ""; }; DE3E8D9C1DD46A2600417AE5 /* Component.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; - DE6CA3C71DDC718D00E3A570 /* StackCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = StackCluster.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + DE6CA3C71DDC718D00E3A570 /* StackCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = StackCluster.swift; sourceTree = ""; }; DE6CA3CA1DDC77E800E3A570 /* StackClusterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = StackClusterTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE6CA3CD1DDC7F2D00E3A570 /* ScrollMatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollMatcher.swift; sourceTree = ""; }; DE6CA3CF1DDC8ED600E3A570 /* IntrinsicSizeAwareScrollViewTest.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IntrinsicSizeAwareScrollViewTest.xib; sourceTree = ""; }; - DE6CA3D61DDCAF6500E3A570 /* ComponentMeta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ComponentMeta.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + DE6CA3D61DDCAF6500E3A570 /* ComponentMeta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ComponentMeta.swift; sourceTree = ""; }; DE828C211DDB0C52003443A2 /* ClusterLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; DE85E5AE1DEC842700DFF34A /* AppearanceSpyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppearanceSpyViewController.swift; sourceTree = ""; }; DEA64C8A1E017D8100687658 /* UIColor+HEX.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+HEX.swift"; sourceTree = ""; }; @@ -96,6 +104,17 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 21E40AD61E26540800205C06 /* JSON */ = { + isa = PBXGroup; + children = ( + 21E40AD71E26543700205C06 /* ComponentFactory.swift */, + 21E40AD91E2657A100205C06 /* JsonParser.swift */, + 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */, + 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */, + ); + path = JSON; + sourceTree = ""; + }; 21FF818D1DDCB7FA0017B1A1 /* fastlane */ = { isa = PBXGroup; children = ( @@ -192,6 +211,7 @@ DE3E8D9A1DD38D1C00417AE5 /* Source */ = { isa = PBXGroup; children = ( + 21E40AD61E26540800205C06 /* JSON */, DE3E8D9C1DD46A2600417AE5 /* Component.swift */, DE6CA3D61DDCAF6500E3A570 /* ComponentMeta.swift */, DE828C211DDB0C52003443A2 /* ClusterLayout.swift */, @@ -432,13 +452,17 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 21E40AD81E26543700205C06 /* ComponentFactory.swift in Sources */, + 21E40ADE1E268F6300205C06 /* StackClusterFactory.swift in Sources */, DE6CA3D71DDCAF6500E3A570 /* ComponentMeta.swift in Sources */, DEA64C8B1E017D8100687658 /* UIColor+HEX.swift in Sources */, DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */, DE828C221DDB0C52003443A2 /* ClusterLayout.swift in Sources */, DE6CA3C91DDC71A100E3A570 /* StackCluster.swift in Sources */, + 21E40ADA1E2657A100205C06 /* JsonParser.swift in Sources */, DE067DCD1DDE017700641D1A /* StackViewController.swift in Sources */, DE3E8D9D1DD46A2600417AE5 /* Component.swift in Sources */, + 21E40ADC1E268A9E00205C06 /* TabBarClusterFactory.swift in Sources */, DE2D785B1DDB0F1A00CD6E95 /* TabBarCluster.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Source/JSON/ComponentFactory.swift b/Source/JSON/ComponentFactory.swift new file mode 100644 index 0000000..e6fdf14 --- /dev/null +++ b/Source/JSON/ComponentFactory.swift @@ -0,0 +1,15 @@ +// +// ComponentJSONFactory.swift +// Matrioska +// +// Created by Mathias Aichinger on 11/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import Foundation + +public protocol ComponentFactory { + func produce(children: [Component], + meta: ComponentMeta?) -> Component? + func typeName() -> String +} diff --git a/Source/JSON/JsonParser.swift b/Source/JSON/JsonParser.swift new file mode 100644 index 0000000..41a3b34 --- /dev/null +++ b/Source/JSON/JsonParser.swift @@ -0,0 +1,21 @@ +// +// JsonParser.swift +// Matrioska +// +// Created by Mathias Aichinger on 11/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import Foundation + +class JsonParser { + var factories: [String: ComponentFactory] = [:] + + func registerFactory(factory: ComponentFactory) { + factories[factory.typeName()] = factory + } + + func parseJson(json: String) -> Component? { + return nil + } +} diff --git a/Source/JSON/StackClusterFactory.swift b/Source/JSON/StackClusterFactory.swift new file mode 100644 index 0000000..491564f --- /dev/null +++ b/Source/JSON/StackClusterFactory.swift @@ -0,0 +1,20 @@ +// +// StackCluster.swift +// Matrioska +// +// Created by Mathias Aichinger on 11/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import Foundation + +class StackClusterFactory: ComponentFactory { + func produce(children: [Component], + meta: ComponentMeta?) -> Component? { + return ClusterLayout.stack(children: children, meta: meta) + } + + func typeName() -> String { + return "stack" + } +} diff --git a/Source/JSON/TabBarClusterFactory.swift b/Source/JSON/TabBarClusterFactory.swift new file mode 100644 index 0000000..9504c2d --- /dev/null +++ b/Source/JSON/TabBarClusterFactory.swift @@ -0,0 +1,20 @@ +// +// TabBarClusterJsonFactory.swift +// Matrioska +// +// Created by Mathias Aichinger on 11/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import Foundation + +class TabBarClusterFactory: ComponentFactory { + func produce(children: [Component], + meta: ComponentMeta?) -> Component? { + return ClusterLayout.tabBar(children: children, meta: meta) + } + + func typeName() -> String { + return "tabbar" + } +} From 6eb292f57262dca34db79e147fc0de6fbe5c807e Mon Sep 17 00:00:00 2001 From: Andreas Thenn Date: Thu, 12 Jan 2017 09:39:20 +0100 Subject: [PATCH 02/29] ADD JSONReader to read a json file into a dictionary (JSONObject) MOD changed SwiftLint line length warning to 150 --- .swiftlint.yml | 2 ++ Matrioska.xcodeproj/project.pbxproj | 4 +++ Source/JSON/JSONReader.swift | 39 +++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 Source/JSON/JSONReader.swift diff --git a/.swiftlint.yml b/.swiftlint.yml index 1447a3d..73ccefb 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -23,3 +23,5 @@ excluded: - Example reporter: "xcode" + +line_length: 150 diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index 55e0b1f..f67759e 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -33,6 +33,7 @@ DE85E5AF1DEC842700DFF34A /* AppearanceSpyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE85E5AE1DEC842700DFF34A /* AppearanceSpyViewController.swift */; }; DEA64C8B1E017D8100687658 /* UIColor+HEX.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEA64C8A1E017D8100687658 /* UIColor+HEX.swift */; }; DEA64C8D1E01810500687658 /* UIColorHEXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEA64C8C1E01810500687658 /* UIColorHEXTests.swift */; }; + ED9180F71E276F0C00F73FDB /* JSONReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED9180F61E276F0C00F73FDB /* JSONReader.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -81,6 +82,7 @@ DEA64C8C1E01810500687658 /* UIColorHEXTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIColorHEXTests.swift; sourceTree = ""; }; DEECB3B21DD47C4A00F7DFB1 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; lineEnding = 0; path = README.md; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.markdown; }; E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MatrioskaTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + ED9180F61E276F0C00F73FDB /* JSONReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReader.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -111,6 +113,7 @@ 21E40AD91E2657A100205C06 /* JsonParser.swift */, 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */, 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */, + ED9180F61E276F0C00F73FDB /* JSONReader.swift */, ); path = JSON; sourceTree = ""; @@ -454,6 +457,7 @@ files = ( 21E40AD81E26543700205C06 /* ComponentFactory.swift in Sources */, 21E40ADE1E268F6300205C06 /* StackClusterFactory.swift in Sources */, + ED9180F71E276F0C00F73FDB /* JSONReader.swift in Sources */, DE6CA3D71DDCAF6500E3A570 /* ComponentMeta.swift in Sources */, DEA64C8B1E017D8100687658 /* UIColor+HEX.swift in Sources */, DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */, diff --git a/Source/JSON/JSONReader.swift b/Source/JSON/JSONReader.swift new file mode 100644 index 0000000..52fee69 --- /dev/null +++ b/Source/JSON/JSONReader.swift @@ -0,0 +1,39 @@ +// +// JsonReader.swift +// Matrioska +// +// Created by Andreas Thenn on 12/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import Foundation + +public typealias JSONObject = [String: AnyObject] + +public class JSONReader { + + class func getJSON(from data: Data) -> JSONObject? { + do { + let json = try JSONSerialization.jsonObject(with: data, + options: JSONSerialization.ReadingOptions()) as? JSONObject + return json + } catch { + assert(false, "JSON-File couldn't be parsed") + return nil + } + } + + public class func jsonObject(from jsonFilename: String, bundle: Bundle = Bundle.main) -> JSONObject? { + guard let filePath = bundle.path(forResource: jsonFilename, ofType: "json") else { + return nil + } + do { + let data = try NSData(contentsOfFile: filePath, + options: NSData.ReadingOptions.uncached) + return getJSON(from: data as Data) + } catch { + assert(false, "JSON-File couldn't be read") + return nil + } + } +} From 8c6bc88af498bb8198ffb4c156968dcacc374bb9 Mon Sep 17 00:00:00 2001 From: Mathias Aichinger Date: Thu, 12 Jan 2017 12:45:03 +0100 Subject: [PATCH 03/29] ADD unit tests for JSONReader --- Matrioska.xcodeproj/project.pbxproj | 40 +++++++---- .../{JsonParser.swift => JSONFactory.swift} | 4 +- Source/JSON/JSONReader.swift | 6 +- Tests/Assets/app_structure.json | 69 +++++++++++++++++++ Tests/Assets/invalid.json | 4 ++ Tests/JSON/JSONReaderTests.swift | 32 +++++++++ 6 files changed, 135 insertions(+), 20 deletions(-) rename Source/JSON/{JsonParser.swift => JSONFactory.swift} (83%) create mode 100644 Tests/Assets/app_structure.json create mode 100644 Tests/Assets/invalid.json create mode 100644 Tests/JSON/JSONReaderTests.swift diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index f67759e..81169b2 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -7,8 +7,11 @@ objects = { /* Begin PBXBuildFile section */ + 2198B0871E277BFF005F2E57 /* app_structure.json in Resources */ = {isa = PBXBuildFile; fileRef = 2198B0861E277BFF005F2E57 /* app_structure.json */; }; + 2198B0891E277C27005F2E57 /* JSONReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2198B0881E277C27005F2E57 /* JSONReaderTests.swift */; }; + 21DA41761E27A11000169428 /* invalid.json in Resources */ = {isa = PBXBuildFile; fileRef = 21DA41741E27A09500169428 /* invalid.json */; }; 21E40AD81E26543700205C06 /* ComponentFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD71E26543700205C06 /* ComponentFactory.swift */; }; - 21E40ADA1E2657A100205C06 /* JsonParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD91E2657A100205C06 /* JsonParser.swift */; }; + 21E40ADA1E2657A100205C06 /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD91E2657A100205C06 /* JSONFactory.swift */; }; 21E40ADC1E268A9E00205C06 /* TabBarClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */; }; 21E40ADE1E268F6300205C06 /* StackClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */; }; 51A54328766C8548A4F3AE4A /* Pods_MatrioskaTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */; }; @@ -47,11 +50,13 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 2198B0861E277BFF005F2E57 /* app_structure.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = app_structure.json; sourceTree = ""; }; + 2198B0881E277C27005F2E57 /* JSONReaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReaderTests.swift; sourceTree = ""; }; + 21DA41741E27A09500169428 /* invalid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = invalid.json; sourceTree = ""; }; 21E40AD71E26543700205C06 /* ComponentFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentFactory.swift; sourceTree = ""; }; - 21E40AD91E2657A100205C06 /* JsonParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JsonParser.swift; sourceTree = ""; }; + 21E40AD91E2657A100205C06 /* JSONFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarClusterFactory.swift; sourceTree = ""; }; 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackClusterFactory.swift; sourceTree = ""; }; - 21FF818E1DDCB7FA0017B1A1 /* Fastfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Fastfile; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 23587B9D5CB1FB404F5C7787 /* Pods-MatrioskaTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrioskaTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MatrioskaTests/Pods-MatrioskaTests.debug.xcconfig"; sourceTree = ""; }; 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4F6E46DFDCFD89ADB9C4762B /* Pods-Matrioska.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.release.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.release.xcconfig"; sourceTree = ""; }; @@ -60,7 +65,7 @@ DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ComponentMetaTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; DE067DCB1DDE017700641D1A /* StackViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackViewController.swift; sourceTree = ""; }; - DE2D785A1DDB0F1A00CD6E95 /* TabBarCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = TabBarCluster.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + DE2D785A1DDB0F1A00CD6E95 /* TabBarCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = TabBarCluster.swift; sourceTree = ""; }; DE2D785C1DDB178500CD6E95 /* TabBarClusterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = TabBarClusterTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE2D78621DDB3F7F00CD6E95 /* checkmark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "checkmark@2x.png"; sourceTree = ""; }; DE2D78661DDB43FC00CD6E95 /* IntrinsicSizeAwareScrollViewTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollViewTests.swift; sourceTree = ""; }; @@ -106,24 +111,24 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 21E40AD61E26540800205C06 /* JSON */ = { + 2198B0851E277BA3005F2E57 /* JSON */ = { isa = PBXGroup; children = ( - 21E40AD71E26543700205C06 /* ComponentFactory.swift */, - 21E40AD91E2657A100205C06 /* JsonParser.swift */, - 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */, - 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */, - ED9180F61E276F0C00F73FDB /* JSONReader.swift */, + 2198B0881E277C27005F2E57 /* JSONReaderTests.swift */, ); path = JSON; sourceTree = ""; }; - 21FF818D1DDCB7FA0017B1A1 /* fastlane */ = { + 21E40AD61E26540800205C06 /* JSON */ = { isa = PBXGroup; children = ( - 21FF818E1DDCB7FA0017B1A1 /* Fastfile */, + 21E40AD71E26543700205C06 /* ComponentFactory.swift */, + 21E40AD91E2657A100205C06 /* JSONFactory.swift */, + 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */, + 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */, + ED9180F61E276F0C00F73FDB /* JSONReader.swift */, ); - path = fastlane; + path = JSON; sourceTree = ""; }; 5E6EE110929620DA6A8B14DD /* Pods */ = { @@ -159,6 +164,8 @@ isa = PBXGroup; children = ( DE2D78621DDB3F7F00CD6E95 /* checkmark@2x.png */, + 2198B0861E277BFF005F2E57 /* app_structure.json */, + 21DA41741E27A09500169428 /* invalid.json */, ); path = Assets; sourceTree = ""; @@ -167,7 +174,6 @@ isa = PBXGroup; children = ( DEECB3B21DD47C4A00F7DFB1 /* README.md */, - 21FF818D1DDCB7FA0017B1A1 /* fastlane */, DE3E8D911DD38AAA00417AE5 /* Framework */, DE3E8D9A1DD38D1C00417AE5 /* Source */, DE3E8D941DD38AAA00417AE5 /* Tests */, @@ -198,6 +204,7 @@ DE3E8D941DD38AAA00417AE5 /* Tests */ = { isa = PBXGroup; children = ( + 2198B0851E277BA3005F2E57 /* JSON */, DE6CA3CC1DDC7F1D00E3A570 /* Helpers */, DE2D78611DDB3F7F00CD6E95 /* Assets */, DE3E8D951DD38AAA00417AE5 /* Info.plist */, @@ -352,7 +359,9 @@ buildActionMask = 2147483647; files = ( DE2D78631DDB3F7F00CD6E95 /* checkmark@2x.png in Resources */, + 2198B0871E277BFF005F2E57 /* app_structure.json in Resources */, DE6CA3D01DDC8ED600E3A570 /* IntrinsicSizeAwareScrollViewTest.xib in Resources */, + 21DA41761E27A11000169428 /* invalid.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -463,7 +472,7 @@ DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */, DE828C221DDB0C52003443A2 /* ClusterLayout.swift in Sources */, DE6CA3C91DDC71A100E3A570 /* StackCluster.swift in Sources */, - 21E40ADA1E2657A100205C06 /* JsonParser.swift in Sources */, + 21E40ADA1E2657A100205C06 /* JSONFactory.swift in Sources */, DE067DCD1DDE017700641D1A /* StackViewController.swift in Sources */, DE3E8D9D1DD46A2600417AE5 /* Component.swift in Sources */, 21E40ADC1E268A9E00205C06 /* TabBarClusterFactory.swift in Sources */, @@ -480,6 +489,7 @@ DE23D2971DDF63C400CDF333 /* ComponentTests.swift in Sources */, DE6CA3CE1DDC7F2D00E3A570 /* ScrollMatcher.swift in Sources */, DE23D29A1DDF63C400CDF333 /* StackClusterTests.swift in Sources */, + 2198B0891E277C27005F2E57 /* JSONReaderTests.swift in Sources */, DEA64C8D1E01810500687658 /* UIColorHEXTests.swift in Sources */, DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */, DE23D2991DDF63C400CDF333 /* IntrinsicSizeAwareScrollViewTests.swift in Sources */, diff --git a/Source/JSON/JsonParser.swift b/Source/JSON/JSONFactory.swift similarity index 83% rename from Source/JSON/JsonParser.swift rename to Source/JSON/JSONFactory.swift index 41a3b34..44e721f 100644 --- a/Source/JSON/JsonParser.swift +++ b/Source/JSON/JSONFactory.swift @@ -8,14 +8,14 @@ import Foundation -class JsonParser { +class JSONFactory { var factories: [String: ComponentFactory] = [:] func registerFactory(factory: ComponentFactory) { factories[factory.typeName()] = factory } - func parseJson(json: String) -> Component? { + func parseJson(filename: String) -> Component? { return nil } } diff --git a/Source/JSON/JSONReader.swift b/Source/JSON/JSONReader.swift index 52fee69..f36d193 100644 --- a/Source/JSON/JSONReader.swift +++ b/Source/JSON/JSONReader.swift @@ -11,14 +11,13 @@ import Foundation public typealias JSONObject = [String: AnyObject] public class JSONReader { - class func getJSON(from data: Data) -> JSONObject? { do { let json = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions()) as? JSONObject return json } catch { - assert(false, "JSON-File couldn't be parsed") + NSLog("Error > JSON-File couldn't be parsed") return nil } } @@ -27,12 +26,13 @@ public class JSONReader { guard let filePath = bundle.path(forResource: jsonFilename, ofType: "json") else { return nil } + do { let data = try NSData(contentsOfFile: filePath, options: NSData.ReadingOptions.uncached) return getJSON(from: data as Data) } catch { - assert(false, "JSON-File couldn't be read") + NSLog("Error > JSON-File couldn't be read") return nil } } diff --git a/Tests/Assets/app_structure.json b/Tests/Assets/app_structure.json new file mode 100644 index 0000000..de64b42 --- /dev/null +++ b/Tests/Assets/app_structure.json @@ -0,0 +1,69 @@ +{ + "structure": { + "id": "tabbar", + "type": "tabbar", + "meta": { + "default_tab_id": "main_tab" + }, + "children": [ + { + "id": "history_tab", + "type": "stack", + "meta": { + "requires_navigation": "true", + "tab_config": { + "title": { + "key": "history_title", + "type": "localized_string" + }, + "icon_name": "history_tab_icon" + } + }, + "children": [ + { + "id": "history.table_view", + "type": "table_view" + } + ] + }, + { + "id": "main_tab", + "type": "stack", + "meta": { + "requires_navigation": "true", + "tab_config": { + "title": { + "key": "main_tab_title", + "type": "localized_string" + }, + "iconName": "main_tab_icon" + } + }, + "children": [ + { + "id": "test_label", + "type": "label" + }, + { + "id": "main.test_feature", + "type": "stack", + "meta": { + "requires_navigation": "true", + "orientation": "horizontal" + } + }, + { + "id": "main.start_button", + "type": "button", + "meta": { + "title": { + "key": "start_button_title", + "type": "localized_string" + } + } + } + ] + } + ] + } +} diff --git a/Tests/Assets/invalid.json b/Tests/Assets/invalid.json new file mode 100644 index 0000000..ab67f7a --- /dev/null +++ b/Tests/Assets/invalid.json @@ -0,0 +1,4 @@ +{ + "structure": "test" + "test": "test" +} diff --git a/Tests/JSON/JSONReaderTests.swift b/Tests/JSON/JSONReaderTests.swift new file mode 100644 index 0000000..94fce9f --- /dev/null +++ b/Tests/JSON/JSONReaderTests.swift @@ -0,0 +1,32 @@ +// +// JSONReaderTests.swift +// Matrioska +// +// Created by Mathias Aichinger on 12/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import XCTest +@testable import Matrioska + +class JSONReaderTests: XCTestCase { + + func testReadingJSONFile() { + let jsonObject = JSONReader.jsonObject(from: "app_structure", bundle: Bundle(for: JSONReaderTests.self)) + XCTAssertNotNil(jsonObject) + XCTAssertNotNil(jsonObject!["structure"]) + let structure = jsonObject!["structure"] as? JSONObject + XCTAssertNotNil(structure!["id"]) + } + + func testWrongJSONPath() { + let jsonObject = JSONReader.jsonObject(from: "asdf", bundle: Bundle(for: JSONReaderTests.self)) + XCTAssertNil(jsonObject) + } + + func testInvalidJSON() { + let jsonObject = JSONReader.jsonObject(from: "invalid", bundle: Bundle(for: JSONReaderTests.self)) + XCTAssertNil(jsonObject) + } + +} From ba91bc7ec2e673b9b3e0b03d70efd8c20d9df8a8 Mon Sep 17 00:00:00 2001 From: Andreas Thenn Date: Thu, 12 Jan 2017 15:35:21 +0100 Subject: [PATCH 04/29] REM line_length setting for SwiftLint again, because new SwiftLint version uses 120 per default --- .swiftlint.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 73ccefb..9a71217 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -22,6 +22,4 @@ excluded: - Pods - Example -reporter: "xcode" - -line_length: 150 +reporter: "xcode" \ No newline at end of file From 6ecf8d048aefc434bcaaa329180e044f5098d020 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 12 Jan 2017 17:06:21 +0100 Subject: [PATCH 05/29] Add JSONFactory wrapper --- Matrioska.xcodeproj/project.pbxproj | 4 + Source/JSON/ComponentFactory.swift | 26 ++++ Source/JSON/JSONFactory.swift | 33 ++++- Source/JSON/TabBarClusterFactory.swift | 6 +- Tests/.swiftlint.yml | 7 +- Tests/JSON/JSONFactoryTests.swift | 178 +++++++++++++++++++++++++ 6 files changed, 244 insertions(+), 10 deletions(-) create mode 100644 Tests/JSON/JSONFactoryTests.swift diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index 81169b2..992da93 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 21E40ADE1E268F6300205C06 /* StackClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */; }; 51A54328766C8548A4F3AE4A /* Pods_MatrioskaTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */; }; 5A069A980F4B0D057E6B647F /* Pods_Matrioska.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */; }; + 8BCFF89D1E27C31B0053AD98 /* JSONFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */; }; DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */; }; DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */; }; DE067DCD1DDE017700641D1A /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DCB1DDE017700641D1A /* StackViewController.swift */; }; @@ -61,6 +62,7 @@ 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4F6E46DFDCFD89ADB9C4762B /* Pods-Matrioska.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.release.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.release.xcconfig"; sourceTree = ""; }; 60996A348436AB8E34E758DA /* Pods-Matrioska.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.debug.xcconfig"; sourceTree = ""; }; + 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactoryTests.swift; sourceTree = ""; }; DDE5072CEF32135290F71073 /* Pods-MatrioskaTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrioskaTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MatrioskaTests/Pods-MatrioskaTests.release.xcconfig"; sourceTree = ""; }; DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ComponentMetaTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; @@ -115,6 +117,7 @@ isa = PBXGroup; children = ( 2198B0881E277C27005F2E57 /* JSONReaderTests.swift */, + 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */, ); path = JSON; sourceTree = ""; @@ -492,6 +495,7 @@ 2198B0891E277C27005F2E57 /* JSONReaderTests.swift in Sources */, DEA64C8D1E01810500687658 /* UIColorHEXTests.swift in Sources */, DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */, + 8BCFF89D1E27C31B0053AD98 /* JSONFactoryTests.swift in Sources */, DE23D2991DDF63C400CDF333 /* IntrinsicSizeAwareScrollViewTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Source/JSON/ComponentFactory.swift b/Source/JSON/ComponentFactory.swift index e6fdf14..8698d76 100644 --- a/Source/JSON/ComponentFactory.swift +++ b/Source/JSON/ComponentFactory.swift @@ -8,8 +8,34 @@ import Foundation +/// Represents a factory that can produce components public protocol ComponentFactory { + + /// Produces a component out of a Component array and ComponentMeta + /// + /// - Parameters: + /// - children: an array of children component + /// - meta: a ComponentMeta object + /// - Returns: An optional Component func produce(children: [Component], meta: ComponentMeta?) -> Component? + + /// The name that identifies this ComponentFactory type + /// + /// - Returns: a string representing this type func typeName() -> String } + +extension ComponentFactory { + + /// A default implementation that returns a `view` Component with a plain UIViewController + func produce(children: [Component], + meta: ComponentMeta?) -> Component? { + return Component.view(builder: { _ in UIViewController() }, meta: meta) + } + + /// A default implementation that returns the name of this type + func typeName() -> String { + return String(describing: self) + } +} diff --git a/Source/JSON/JSONFactory.swift b/Source/JSON/JSONFactory.swift index 44e721f..c5c7019 100644 --- a/Source/JSON/JSONFactory.swift +++ b/Source/JSON/JSONFactory.swift @@ -8,14 +8,37 @@ import Foundation -class JSONFactory { - var factories: [String: ComponentFactory] = [:] +/// A factory that wraps ComponentFactory objects and uses them to produce Components +public class JSONFactory { - func registerFactory(factory: ComponentFactory) { + let typeKey = "type" + let idKey = "id" + let metaKey = "meta" + let childrenKey = "children" + + /// The already registered factories + private(set) var factories: [String: ComponentFactory] = [:] + + /// Registers a new ComponentFactory which will be used in `produce` + /// + /// - Parameter factory: the ComponentFactory to be registered + public func register(_ factory: ComponentFactory) { factories[factory.typeName()] = factory } - func parseJson(filename: String) -> Component? { - return nil + /// Produces a Component from a given JSONObject + /// + /// - Parameter json: the JSONObject to be used + /// - Returns: An optional Component + /// - Throws an assertion if the given JSONObject does not have typeKey or idKey keys + public func produce(from json: JSONObject) -> Component? { + guard let type = json[typeKey] as? String, + let _ = json[idKey] as? String else { fatalError("Missing mandatory fields") } + + let meta = json[metaKey] as? [String : Any] + let children = json[childrenKey] as? [JSONObject] ?? [] + let componentChildren = children.flatMap { produce(from: $0) } + + return factories[type]?.produce(children: componentChildren, meta: meta) } } diff --git a/Source/JSON/TabBarClusterFactory.swift b/Source/JSON/TabBarClusterFactory.swift index 9504c2d..fb84ca5 100644 --- a/Source/JSON/TabBarClusterFactory.swift +++ b/Source/JSON/TabBarClusterFactory.swift @@ -8,13 +8,13 @@ import Foundation -class TabBarClusterFactory: ComponentFactory { - func produce(children: [Component], +public class TabBarClusterFactory: ComponentFactory { + public func produce(children: [Component], meta: ComponentMeta?) -> Component? { return ClusterLayout.tabBar(children: children, meta: meta) } - func typeName() -> String { + public func typeName() -> String { return "tabbar" } } diff --git a/Tests/.swiftlint.yml b/Tests/.swiftlint.yml index 44c96c8..32572a9 100644 --- a/Tests/.swiftlint.yml +++ b/Tests/.swiftlint.yml @@ -1,10 +1,13 @@ disabled_rules: - trailing_whitespace # xcode add it by default, we might enable it and use autocorrect - function_body_length + - force_cast + - force_unwrapping + +line_length: 200 # goal: 110 opt_in_rules: - empty_count - - force_unwrapping - private_outlet - vertical_whitespace # - missing_docs # broken @@ -23,4 +26,4 @@ file_length: warning: 1000 error: 1500 -reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit) \ No newline at end of file +reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit) diff --git a/Tests/JSON/JSONFactoryTests.swift b/Tests/JSON/JSONFactoryTests.swift new file mode 100644 index 0000000..a26a629 --- /dev/null +++ b/Tests/JSON/JSONFactoryTests.swift @@ -0,0 +1,178 @@ +// +// JSONFactoryTests.swift +// Matrioska +// +// Created by Joan Romano on 12/01/17. +// Copyright © 2017 runtastic. All rights reserved. +// + +import XCTest +import Quick +import Nimble +@testable import Matrioska + +class JSONFactoryTests: QuickSpec { + + let bundle = Bundle(for: JSONFactoryTests.self) + let jsonFileName = "app_structure" + + override func spec() { + + let jsonObject = JSONReader.jsonObject(from: jsonFileName, bundle: bundle)! + let json = structure(from: jsonObject) + + let tabBarFactory = TabBarClusterFactory() + let stackFactory = StackClusterFactory() + let buttonFactory = ButtonFactory() + let labelFactory = LabelFactory() + let tableViewFactory = TableViewFactory() + + let factories: [ComponentFactory] = [tabBarFactory, stackFactory, buttonFactory, labelFactory, tableViewFactory] + + describe("Factories") { + + context("when no factories added") { + let jsonFactory = JSONFactory() + + it("has no factories") { + expect(jsonFactory.factories.count).to(equal(0)) + } + } + + context("when registering factories") { + let jsonFactory = JSONFactory() + let tabBarFactory = TabBarClusterFactory() + let stackFactory = StackClusterFactory() + jsonFactory.register(tabBarFactory) + jsonFactory.register(stackFactory) + + it("has the registered factories") { + expect(jsonFactory.factories.count).to(equal(2)) + expect(jsonFactory.factories[tabBarFactory.typeName()]).toNot(beNil()) + expect(jsonFactory.factories[stackFactory.typeName()]).toNot(beNil()) + } + + it("does not have non registered factories") { + expect(jsonFactory.factories["foo"]).to(beNil()) + expect(jsonFactory.factories["bar"]).to(beNil()) + } + } + + } + + describe("Produce") { + + it("throws an assertion when the JSON object does not have type or id") { + let jsonFactory = JSONFactory() + let object = ["foo" : NSString()] + let faultyProduce = { _ = jsonFactory.produce(from: object) } + + expect(faultyProduce()).to(throwAssertion()) + } + + context("when no factories are added") { + let jsonFactorry = JSONFactory() + + it("returns nil when trying to produce") { + let component = jsonFactorry.produce(from: json) + expect(component).to(beNil()) + } + } + + context("when registering some available cluster factories") { + let jsonFactory = JSONFactory() + let tabBarFactory = TabBarClusterFactory() + jsonFactory.register(tabBarFactory) + let component = jsonFactory.produce(from: json) + + it("handles only those cluster components which have registered factories") { + expect(component).toNot(beNil()) + expect(component?.viewController()).to(beAKindOf(UITabBarController.self)) + expect(component?.children().count).to(equal(0)) + } + } + + context("when registering all available cluster factories") { + let jsonFactory = JSONFactory() + jsonFactory.register(tabBarFactory) + jsonFactory.register(stackFactory) + let component = jsonFactory.produce(from: json) + + it("handles all cluster components") { + expect(component).toNot(beNil()) + expect(component?.viewController()).to(beAKindOf(UITabBarController.self)) + expect(component?.children().count).to(equal(2)) + } + + it("handles all components recursively") { + let firstChildren = component!.children().first + let secondChildren = component!.children().last + + expect(firstChildren?.viewController()).to(beAKindOf(StackViewController.self)) + expect(secondChildren?.viewController()).to(beAKindOf(StackViewController.self)) + } + + it("does not handle not registered components") { + let firstChildren = component!.children().first + let secondChildren = component!.children().last + + expect(firstChildren?.children().count).to(equal(0)) + expect(secondChildren?.children().count).to(equal(1)) + } + } + + context("when registering all available factories") { + let jsonFactory = JSONFactory() + factories.forEach { jsonFactory.register($0) } + let component = jsonFactory.produce(from: json) + + it("handles all components recursively") { + let firstChildren = component!.children().first! + let secondChildren = component!.children().last! + + expect(firstChildren.children().count).to(equal(1)) + expect(secondChildren.children().count).to(equal(3)) + expect(firstChildren.children()[0].viewController()).to(beAKindOf(UIViewController.self)) + expect(secondChildren.children()[1].viewController()).to(beAKindOf(StackViewController.self)) + } + } + } + + } + +} + +fileprivate class ButtonFactory: ComponentFactory { + fileprivate func typeName() -> String { + return "button" + } +} + +fileprivate class LabelFactory: ComponentFactory { + fileprivate func typeName() -> String { + return "label" + } +} + +fileprivate class TableViewFactory: ComponentFactory { + fileprivate func typeName() -> String { + return "table_view" + } +} + +fileprivate extension Component { + func children() -> [Component] { + switch self { + case .view(builder: _, meta: _): + return [] + case let .wrapper(builder: _, child: child, meta: _): + return [child] + case let .cluster(builder: _, children: children, meta: _): + return children + } + } +} + +fileprivate func structure(from jsonObject: JSONObject) -> JSONObject { + return jsonObject["structure"] as! JSONObject +} From 77b46268977c25f6368a8452e7fd6096be8d3422 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 12 Jan 2017 17:10:39 +0100 Subject: [PATCH 06/29] Update swiftlint tests file --- Tests/.swiftlint.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Tests/.swiftlint.yml b/Tests/.swiftlint.yml index 32572a9..4da0500 100644 --- a/Tests/.swiftlint.yml +++ b/Tests/.swiftlint.yml @@ -2,21 +2,13 @@ disabled_rules: - trailing_whitespace # xcode add it by default, we might enable it and use autocorrect - function_body_length - force_cast + - force_try - force_unwrapping line_length: 200 # goal: 110 opt_in_rules: - empty_count - - private_outlet - - vertical_whitespace -# - missing_docs # broken - - closure_spacing - - conditional_returns_on_newline - - explicit_init - - overridden_super_call - - redundant_nil_coalesing -# - switch_case_on_newline # broken type_body_length: warning: 800 From df43352cee63082bda1117940965a4fdec535d59 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 12 Jan 2017 18:16:26 +0100 Subject: [PATCH 07/29] Add tests to JSONReader --- .swiftlint.yml | 4 +- Matrioska.xcodeproj/project.pbxproj | 8 +-- Source/JSON/JSONFactory.swift | 2 +- Source/JSON/JSONReader.swift | 45 ++++++++------- Source/JSON/StackClusterFactory.swift | 7 ++- Source/JSON/TabBarClusterFactory.swift | 1 + Tests/JSON/JSONFactoryTests.swift | 4 +- Tests/JSON/JSONReaderTests.swift | 78 ++++++++++++++++++++------ 8 files changed, 100 insertions(+), 49 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 9a71217..ac257ee 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -13,6 +13,8 @@ opt_in_rules: - overridden_super_call - redundant_nil_coalesing # - switch_case_on_newline # broken + +line_length: 500 # goal: 110 included: - Source @@ -22,4 +24,4 @@ excluded: - Pods - Example -reporter: "xcode" \ No newline at end of file +reporter: "xcode" diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index 992da93..44164c0 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 2198B0871E277BFF005F2E57 /* app_structure.json in Resources */ = {isa = PBXBuildFile; fileRef = 2198B0861E277BFF005F2E57 /* app_structure.json */; }; - 2198B0891E277C27005F2E57 /* JSONReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2198B0881E277C27005F2E57 /* JSONReaderTests.swift */; }; 21DA41761E27A11000169428 /* invalid.json in Resources */ = {isa = PBXBuildFile; fileRef = 21DA41741E27A09500169428 /* invalid.json */; }; 21E40AD81E26543700205C06 /* ComponentFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD71E26543700205C06 /* ComponentFactory.swift */; }; 21E40ADA1E2657A100205C06 /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD91E2657A100205C06 /* JSONFactory.swift */; }; @@ -17,6 +16,7 @@ 51A54328766C8548A4F3AE4A /* Pods_MatrioskaTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */; }; 5A069A980F4B0D057E6B647F /* Pods_Matrioska.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */; }; 8BCFF89D1E27C31B0053AD98 /* JSONFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */; }; + 8BCFF89F1E27EC8D0053AD98 /* JSONReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF89E1E27EC8D0053AD98 /* JSONReaderTests.swift */; }; DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */; }; DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */; }; DE067DCD1DDE017700641D1A /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DCB1DDE017700641D1A /* StackViewController.swift */; }; @@ -52,7 +52,6 @@ /* Begin PBXFileReference section */ 2198B0861E277BFF005F2E57 /* app_structure.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = app_structure.json; sourceTree = ""; }; - 2198B0881E277C27005F2E57 /* JSONReaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReaderTests.swift; sourceTree = ""; }; 21DA41741E27A09500169428 /* invalid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = invalid.json; sourceTree = ""; }; 21E40AD71E26543700205C06 /* ComponentFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentFactory.swift; sourceTree = ""; }; 21E40AD91E2657A100205C06 /* JSONFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; @@ -63,6 +62,7 @@ 4F6E46DFDCFD89ADB9C4762B /* Pods-Matrioska.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.release.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.release.xcconfig"; sourceTree = ""; }; 60996A348436AB8E34E758DA /* Pods-Matrioska.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.debug.xcconfig"; sourceTree = ""; }; 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactoryTests.swift; sourceTree = ""; }; + 8BCFF89E1E27EC8D0053AD98 /* JSONReaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReaderTests.swift; sourceTree = ""; }; DDE5072CEF32135290F71073 /* Pods-MatrioskaTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrioskaTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MatrioskaTests/Pods-MatrioskaTests.release.xcconfig"; sourceTree = ""; }; DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ComponentMetaTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; @@ -116,8 +116,8 @@ 2198B0851E277BA3005F2E57 /* JSON */ = { isa = PBXGroup; children = ( - 2198B0881E277C27005F2E57 /* JSONReaderTests.swift */, 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */, + 8BCFF89E1E27EC8D0053AD98 /* JSONReaderTests.swift */, ); path = JSON; sourceTree = ""; @@ -490,9 +490,9 @@ DE85E5AF1DEC842700DFF34A /* AppearanceSpyViewController.swift in Sources */, DE23D2981DDF63C400CDF333 /* TabBarClusterTests.swift in Sources */, DE23D2971DDF63C400CDF333 /* ComponentTests.swift in Sources */, + 8BCFF89F1E27EC8D0053AD98 /* JSONReaderTests.swift in Sources */, DE6CA3CE1DDC7F2D00E3A570 /* ScrollMatcher.swift in Sources */, DE23D29A1DDF63C400CDF333 /* StackClusterTests.swift in Sources */, - 2198B0891E277C27005F2E57 /* JSONReaderTests.swift in Sources */, DEA64C8D1E01810500687658 /* UIColorHEXTests.swift in Sources */, DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */, 8BCFF89D1E27C31B0053AD98 /* JSONFactoryTests.swift in Sources */, diff --git a/Source/JSON/JSONFactory.swift b/Source/JSON/JSONFactory.swift index c5c7019..dcfcfd0 100644 --- a/Source/JSON/JSONFactory.swift +++ b/Source/JSON/JSONFactory.swift @@ -9,7 +9,7 @@ import Foundation /// A factory that wraps ComponentFactory objects and uses them to produce Components -public class JSONFactory { +public final class JSONFactory { let typeKey = "type" let idKey = "id" diff --git a/Source/JSON/JSONReader.swift b/Source/JSON/JSONReader.swift index f36d193..b025f9d 100644 --- a/Source/JSON/JSONReader.swift +++ b/Source/JSON/JSONReader.swift @@ -8,32 +8,37 @@ import Foundation -public typealias JSONObject = [String: AnyObject] +/// A JSONObject type +public typealias JSONObject = [String: Any] -public class JSONReader { - class func getJSON(from data: Data) -> JSONObject? { - do { - let json = try JSONSerialization.jsonObject(with: data, - options: JSONSerialization.ReadingOptions()) as? JSONObject - return json - } catch { - NSLog("Error > JSON-File couldn't be parsed") - return nil - } +/// A JSONReader used to convert to JSONObject +public final class JSONReader { + + /// Serializes from a given JSON Data into JSONObject + /// + /// - Parameter data: the Data object used in serialization + /// - Returns: an optional serialized JSONObject + /// - Throws: throws an error in case of failure or invalid JSON data + public class func jsonObject(from data: Data) throws -> JSONObject? { + let json = try JSONSerialization.jsonObject(with: data) as? JSONObject + + return json } - public class func jsonObject(from jsonFilename: String, bundle: Bundle = Bundle.main) -> JSONObject? { + /// Serializes from a given JSON file into JSONObject + /// + /// - Parameters: + /// - jsonFilename: the file name + /// - bundle: the bundle where the file is located + /// - Returns: an optional serialized JSONObject + /// - Throws: throws an error in case of failure or invalid JSON data + public class func jsonObject(from jsonFilename: String, bundle: Bundle = .main) throws -> JSONObject? { guard let filePath = bundle.path(forResource: jsonFilename, ofType: "json") else { return nil } - do { - let data = try NSData(contentsOfFile: filePath, - options: NSData.ReadingOptions.uncached) - return getJSON(from: data as Data) - } catch { - NSLog("Error > JSON-File couldn't be read") - return nil - } + let url = URL(fileURLWithPath: filePath) + + return try jsonObject(from: Data(contentsOf: url, options: .uncached)) } } diff --git a/Source/JSON/StackClusterFactory.swift b/Source/JSON/StackClusterFactory.swift index 491564f..d6112a9 100644 --- a/Source/JSON/StackClusterFactory.swift +++ b/Source/JSON/StackClusterFactory.swift @@ -8,13 +8,14 @@ import Foundation -class StackClusterFactory: ComponentFactory { - func produce(children: [Component], +/// A concrete ComponentFactory which produces a stack cluster component +public class StackClusterFactory: ComponentFactory { + public func produce(children: [Component], meta: ComponentMeta?) -> Component? { return ClusterLayout.stack(children: children, meta: meta) } - func typeName() -> String { + public func typeName() -> String { return "stack" } } diff --git a/Source/JSON/TabBarClusterFactory.swift b/Source/JSON/TabBarClusterFactory.swift index fb84ca5..73cec78 100644 --- a/Source/JSON/TabBarClusterFactory.swift +++ b/Source/JSON/TabBarClusterFactory.swift @@ -8,6 +8,7 @@ import Foundation +/// A concrete ComponentFactory which produces a tabBar cluster component public class TabBarClusterFactory: ComponentFactory { public func produce(children: [Component], meta: ComponentMeta?) -> Component? { diff --git a/Tests/JSON/JSONFactoryTests.swift b/Tests/JSON/JSONFactoryTests.swift index a26a629..9bae950 100644 --- a/Tests/JSON/JSONFactoryTests.swift +++ b/Tests/JSON/JSONFactoryTests.swift @@ -18,7 +18,7 @@ class JSONFactoryTests: QuickSpec { override func spec() { - let jsonObject = JSONReader.jsonObject(from: jsonFileName, bundle: bundle)! + let jsonObject = try! JSONReader.jsonObject(from: jsonFileName, bundle: bundle)! let json = structure(from: jsonObject) let tabBarFactory = TabBarClusterFactory() @@ -64,7 +64,7 @@ class JSONFactoryTests: QuickSpec { it("throws an assertion when the JSON object does not have type or id") { let jsonFactory = JSONFactory() - let object = ["foo" : NSString()] + let object = ["foo" : "bar"] let faultyProduce = { _ = jsonFactory.produce(from: object) } expect(faultyProduce()).to(throwAssertion()) diff --git a/Tests/JSON/JSONReaderTests.swift b/Tests/JSON/JSONReaderTests.swift index 94fce9f..932f91d 100644 --- a/Tests/JSON/JSONReaderTests.swift +++ b/Tests/JSON/JSONReaderTests.swift @@ -2,31 +2,73 @@ // JSONReaderTests.swift // Matrioska // -// Created by Mathias Aichinger on 12/01/2017. +// Created by Joan Romano on 12/01/17. // Copyright © 2017 runtastic. All rights reserved. // import XCTest +import Quick +import Nimble @testable import Matrioska -class JSONReaderTests: XCTestCase { +class JSONReaderTests: QuickSpec { - func testReadingJSONFile() { - let jsonObject = JSONReader.jsonObject(from: "app_structure", bundle: Bundle(for: JSONReaderTests.self)) - XCTAssertNotNil(jsonObject) - XCTAssertNotNil(jsonObject!["structure"]) - let structure = jsonObject!["structure"] as? JSONObject - XCTAssertNotNil(structure!["id"]) - } - - func testWrongJSONPath() { - let jsonObject = JSONReader.jsonObject(from: "asdf", bundle: Bundle(for: JSONReaderTests.self)) - XCTAssertNil(jsonObject) - } - - func testInvalidJSON() { - let jsonObject = JSONReader.jsonObject(from: "invalid", bundle: Bundle(for: JSONReaderTests.self)) - XCTAssertNil(jsonObject) + override func spec() { + + describe("From Data") { + context("when reading from valid data") { + let data = "{\"structure\": {\"id\": \"tabbar\", \"type\": \"tabbar\", \"meta\": { \"default_tab_id\": \"main_tab\" }}}".data(using: .utf8)! + let jsonObject = try! JSONReader.jsonObject(from: data) + + it("returns a valid JSON object") { + XCTAssertNotNil(jsonObject) + XCTAssertNotNil(jsonObject!["structure"]) + let structure = jsonObject!["structure"] as? JSONObject + XCTAssertNotNil(structure!["id"]) + } + } + + context("when reading from invalid data") { + let data = "{\"structure\": {\"id\": \"tabbar\", \"type\": \"tabbar\", \"meta\": { \"default_tab_id\": \"main_tab\" }}}}".data(using: .utf8)! + + it("throws") { + let faultyJsonObject = { _ = try! JSONReader.jsonObject(from: data) } + + expect(faultyJsonObject()).to(throwAssertion()) + } + } + } + + describe("From file") { + + context("when reading from an existing valid file") { + let jsonObject = try! JSONReader.jsonObject(from: "app_structure", bundle: Bundle(for: JSONReaderTests.self)) + + it("returns a valid JSONObject") { + XCTAssertNotNil(jsonObject) + XCTAssertNotNil(jsonObject!["structure"]) + let structure = jsonObject!["structure"] as? JSONObject + XCTAssertNotNil(structure!["id"]) + } + } + + context("when reading from an invalid file path") { + let jsonObject = try! JSONReader.jsonObject(from: "asdf", bundle: Bundle(for: JSONReaderTests.self)) + + it("returns nil") { + XCTAssertNil(jsonObject) + } + } + + context("when reading from an existing invalid file") { + it("throws") { + let faultyJsonObject = { _ = try! JSONReader.jsonObject(from: "invalid", bundle: Bundle(for: JSONReaderTests.self)) } + + expect(faultyJsonObject()).to(throwAssertion()) + } + } + } + } } From d6c16f6d2c86ac45601a093022a6268ac903a3f2 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 12 Jan 2017 18:32:49 +0100 Subject: [PATCH 08/29] Add JSONFactoryError for JSONFactory error handling --- Source/JSON/JSONFactory.swift | 19 +++++++++++++------ Tests/JSON/JSONFactoryTests.swift | 21 ++++++++++++--------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Source/JSON/JSONFactory.swift b/Source/JSON/JSONFactory.swift index dcfcfd0..591338a 100644 --- a/Source/JSON/JSONFactory.swift +++ b/Source/JSON/JSONFactory.swift @@ -8,6 +8,13 @@ import Foundation +/// An error type for JSONFactory +/// +/// - missing: specifies that a mandatory key is missing +enum JSONFactoryError: Error { + case missing(JSONObject, String) +} + /// A factory that wraps ComponentFactory objects and uses them to produce Components public final class JSONFactory { @@ -26,18 +33,18 @@ public final class JSONFactory { factories[factory.typeName()] = factory } - /// Produces a Component from a given JSONObject + /// Produces a Component from a given JSONObject, which has two mandatory keys: `typeKey` and `idKey` /// /// - Parameter json: the JSONObject to be used /// - Returns: An optional Component - /// - Throws an assertion if the given JSONObject does not have typeKey or idKey keys - public func produce(from json: JSONObject) -> Component? { - guard let type = json[typeKey] as? String, - let _ = json[idKey] as? String else { fatalError("Missing mandatory fields") } + /// - Throws: JSONFactoryError when a mandatory key is missing + public func produce(from json: JSONObject) throws -> Component? { + guard let type = json[typeKey] as? String else { throw JSONFactoryError.missing(json, typeKey) } + guard let _ = json[idKey] as? String else { throw JSONFactoryError.missing(json, idKey) } let meta = json[metaKey] as? [String : Any] let children = json[childrenKey] as? [JSONObject] ?? [] - let componentChildren = children.flatMap { produce(from: $0) } + let componentChildren = try children.flatMap { try produce(from: $0) } return factories[type]?.produce(children: componentChildren, meta: meta) } diff --git a/Tests/JSON/JSONFactoryTests.swift b/Tests/JSON/JSONFactoryTests.swift index 9bae950..c4ba095 100644 --- a/Tests/JSON/JSONFactoryTests.swift +++ b/Tests/JSON/JSONFactoryTests.swift @@ -29,7 +29,7 @@ class JSONFactoryTests: QuickSpec { let factories: [ComponentFactory] = [tabBarFactory, stackFactory, buttonFactory, labelFactory, tableViewFactory] - describe("Factories") { + describe("Register factories") { context("when no factories added") { let jsonFactory = JSONFactory() @@ -62,19 +62,22 @@ class JSONFactoryTests: QuickSpec { describe("Produce") { - it("throws an assertion when the JSON object does not have type or id") { + it("throws an assertion when the JSON object does not have mandatory keys") { let jsonFactory = JSONFactory() - let object = ["foo" : "bar"] - let faultyProduce = { _ = jsonFactory.produce(from: object) } + let faultyProduceNoKeys = { _ = try! jsonFactory.produce(from: ["foo" : "bar"]) } + let faultyProduceNoId = { _ = try! jsonFactory.produce(from: ["id" : "bar"]) } + let faultyProduceNoType = { _ = try! jsonFactory.produce(from: ["type" : "bar"]) } - expect(faultyProduce()).to(throwAssertion()) + expect(faultyProduceNoKeys()).to(throwAssertion()) + expect(faultyProduceNoId()).to(throwAssertion()) + expect(faultyProduceNoType()).to(throwAssertion()) } context("when no factories are added") { let jsonFactorry = JSONFactory() it("returns nil when trying to produce") { - let component = jsonFactorry.produce(from: json) + let component = try! jsonFactorry.produce(from: json) expect(component).to(beNil()) } } @@ -83,7 +86,7 @@ class JSONFactoryTests: QuickSpec { let jsonFactory = JSONFactory() let tabBarFactory = TabBarClusterFactory() jsonFactory.register(tabBarFactory) - let component = jsonFactory.produce(from: json) + let component = try! jsonFactory.produce(from: json) it("handles only those cluster components which have registered factories") { expect(component).toNot(beNil()) @@ -96,7 +99,7 @@ class JSONFactoryTests: QuickSpec { let jsonFactory = JSONFactory() jsonFactory.register(tabBarFactory) jsonFactory.register(stackFactory) - let component = jsonFactory.produce(from: json) + let component = try! jsonFactory.produce(from: json) it("handles all cluster components") { expect(component).toNot(beNil()) @@ -124,7 +127,7 @@ class JSONFactoryTests: QuickSpec { context("when registering all available factories") { let jsonFactory = JSONFactory() factories.forEach { jsonFactory.register($0) } - let component = jsonFactory.produce(from: json) + let component = try! jsonFactory.produce(from: json) it("handles all components recursively") { let firstChildren = component!.children().first! From 2a4fd052193fdc96c3177fefa8e37e0e9407d84d Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 00:20:37 +0100 Subject: [PATCH 09/29] Minor header fixes --- Example/Pods/Pods.xcodeproj/project.pbxproj | 22 +++++++++------------ Matrioska.xcodeproj/project.pbxproj | 4 ++-- Source/JSON/JSONFactory.swift | 2 +- Source/JSON/JSONReader.swift | 2 +- Source/JSON/StackClusterFactory.swift | 2 +- Source/JSON/TabBarClusterFactory.swift | 2 +- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 9cd29ed..0761f18 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -86,9 +86,9 @@ 041C7DFD4E40027278BABCCCD69743B2 /* ConstraintAttributes.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintAttributes.swift; path = Source/ConstraintAttributes.swift; sourceTree = ""; }; 0729DC38B02A17974FD7A7238FCB1836 /* ConstraintMultiplierTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMultiplierTarget.swift; path = Source/ConstraintMultiplierTarget.swift; sourceTree = ""; }; 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UILayoutSupport+Extensions.swift"; path = "Source/UILayoutSupport+Extensions.swift"; sourceTree = ""; }; - 1367C6F5311D05FDFBA37E96EE514019 /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SnapKit.framework; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 1367C6F5311D05FDFBA37E96EE514019 /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 14426FA5248A96FBC6A531879E24CFA5 /* SnapKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-prefix.pch"; sourceTree = ""; }; - 1CE616969B59014211F07875DEBE4D1A /* ComponentMeta.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; }; + 1CE616969B59014211F07875DEBE4D1A /* ComponentMeta.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 1F2B728DCF7E9F88008827314C2AE823 /* ConstraintInsetTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintInsetTarget.swift; path = Source/ConstraintInsetTarget.swift; sourceTree = ""; }; 212E2771F1CD458D21A0FB3CA1C914F3 /* ConstraintLayoutSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutSupport.swift; path = Source/ConstraintLayoutSupport.swift; sourceTree = ""; }; 261BC3C65CE6EBBED920977848212F6F /* ConstraintMakerPriortizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerPriortizable.swift; path = Source/ConstraintMakerPriortizable.swift; sourceTree = ""; }; @@ -110,24 +110,24 @@ 7BEA23F4393572EE30AED50A651CD185 /* ConstraintItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintItem.swift; path = Source/ConstraintItem.swift; sourceTree = ""; }; 813C2A5263E149C889A2DF40FFDD89BA /* ConstraintRelatableTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintRelatableTarget.swift; path = Source/ConstraintRelatableTarget.swift; sourceTree = ""; }; 857837F254F449F3BC19F608228401E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 86396F85619BF19FD0D1DDD19B866116 /* TabBarCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TabBarCluster.swift; sourceTree = ""; }; + 86396F85619BF19FD0D1DDD19B866116 /* TabBarCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TabBarCluster.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 8705AFD8FF18225FA8BB0228A69E72AA /* ConstraintMakerExtendable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerExtendable.swift; path = Source/ConstraintMakerExtendable.swift; sourceTree = ""; }; 87CCF4DB7EFBDC070B92BFC0BC0D2C8C /* ConstraintMakerRelatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerRelatable.swift; path = Source/ConstraintMakerRelatable.swift; sourceTree = ""; }; 8B78113584563565B18CD0248D9D0A93 /* ConstraintViewDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintViewDSL.swift; path = Source/ConstraintViewDSL.swift; sourceTree = ""; }; 90B4839DF75CDC9F2CE552657CFE7D8E /* Component.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 97F0138AE8EA08984375344610BE7E1E /* ConstraintPriorityTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintPriorityTarget.swift; path = Source/ConstraintPriorityTarget.swift; sourceTree = ""; }; 996B2CFA945E1ECA2E39EFCC886C0D9E /* StackCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackCluster.swift; sourceTree = ""; }; 9F675DF8551ECAD72F0C6D96084C6DD4 /* SnapKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SnapKit-dummy.m"; sourceTree = ""; }; 9F8ECEBD49CA569FC524CB77465180B6 /* ConstraintMakerEditable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerEditable.swift; path = Source/ConstraintMakerEditable.swift; sourceTree = ""; }; - A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Matrioska.framework; path = Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A77A10AC741F15F2412809F03C82B8FD /* Pods-MatrioskaExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MatrioskaExample.debug.xcconfig"; sourceTree = ""; }; AF1BDEFD46348EE8C41DE053AEDBFD1B /* ConstraintOffsetTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintOffsetTarget.swift; path = Source/ConstraintOffsetTarget.swift; sourceTree = ""; }; - B4E3E0231330567ABB197F1F0DA70261 /* Pods-MatrioskaExample.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-MatrioskaExample.modulemap"; sourceTree = ""; }; + B4E3E0231330567ABB197F1F0DA70261 /* Pods-MatrioskaExample.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-MatrioskaExample.modulemap"; sourceTree = ""; }; B525F7008B3760076D71FE29C0859BDC /* ConstraintLayoutGuide.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutGuide.swift; path = Source/ConstraintLayoutGuide.swift; sourceTree = ""; }; B6EE3F460D1600FAF881B500AD8D239C /* Pods-MatrioskaExample-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-MatrioskaExample-umbrella.h"; sourceTree = ""; }; - B7D4645BD3C0100FB7E1B4A6FDC96E0B /* SnapKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = SnapKit.modulemap; sourceTree = ""; }; - BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_MatrioskaExample.framework; path = "Pods-MatrioskaExample.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + B7D4645BD3C0100FB7E1B4A6FDC96E0B /* SnapKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = SnapKit.modulemap; sourceTree = ""; }; + BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MatrioskaExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BF2B524D7E160AA0C293D6D884CE4537 /* Pods-MatrioskaExample-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MatrioskaExample-acknowledgements.plist"; sourceTree = ""; }; BF6FD1FF6B76CA2F5ED2E314D51E53CF /* Matrioska.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Matrioska.xcconfig; sourceTree = ""; }; BF73CD5DB0A1A54717A1D51A96F5D7B9 /* UIColor+HEX.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+HEX.swift"; sourceTree = ""; }; @@ -139,7 +139,7 @@ CB70FEBA9EF66CAAA461E6F3F819716B /* ConstraintDescription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintDescription.swift; path = Source/ConstraintDescription.swift; sourceTree = ""; }; CCA5B74A364868C16F69B955B38B05DD /* Pods-MatrioskaExample-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MatrioskaExample-acknowledgements.markdown"; sourceTree = ""; }; CFE99A1044589BB7662A737268BCD6E7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D59F8E5674A96129F9CF53C24D3B27BC /* Matrioska.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Matrioska.modulemap; sourceTree = ""; }; + D59F8E5674A96129F9CF53C24D3B27BC /* Matrioska.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Matrioska.modulemap; sourceTree = ""; }; D61CFA974F0733418729D3C1AB335DFA /* Pods-MatrioskaExample-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MatrioskaExample-frameworks.sh"; sourceTree = ""; }; D8AA583273C076DD4A1EBAFDDA0E89A8 /* ConstraintMakerFinalizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerFinalizable.swift; path = Source/ConstraintMakerFinalizable.swift; sourceTree = ""; }; E11295210FBB75091BE22529081A2720 /* ConstraintView+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ConstraintView+Extensions.swift"; path = "Source/ConstraintView+Extensions.swift"; sourceTree = ""; }; @@ -227,7 +227,6 @@ 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */, 458932A7F6390E9028454F0A27A50A13 /* Support Files */, ); - name = SnapKit; path = SnapKit; sourceTree = ""; }; @@ -256,7 +255,6 @@ 8A1E1FBD297185C40000233E7909F3FB /* Helpers */, D0642A2099E4BAF3C79FBF2A587950B7 /* Views */, ); - name = Source; path = Source; sourceTree = ""; }; @@ -305,7 +303,6 @@ children = ( BF73CD5DB0A1A54717A1D51A96F5D7B9 /* UIColor+HEX.swift */, ); - name = Helpers; path = Helpers; sourceTree = ""; }; @@ -353,7 +350,6 @@ FB9AD5B4352D254970FAAC4B20243037 /* IntrinsicSizeAwareScrollView.swift */, 77668395D8EFB67C5E715D53C2A08AEE /* StackViewController.swift */, ); - name = Views; path = Views; sourceTree = ""; }; diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index 44164c0..df6c882 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -127,9 +127,9 @@ children = ( 21E40AD71E26543700205C06 /* ComponentFactory.swift */, 21E40AD91E2657A100205C06 /* JSONFactory.swift */, - 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */, - 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */, ED9180F61E276F0C00F73FDB /* JSONReader.swift */, + 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */, + 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */, ); path = JSON; sourceTree = ""; diff --git a/Source/JSON/JSONFactory.swift b/Source/JSON/JSONFactory.swift index 591338a..3815d9f 100644 --- a/Source/JSON/JSONFactory.swift +++ b/Source/JSON/JSONFactory.swift @@ -1,5 +1,5 @@ // -// JsonParser.swift +// JSONFactory.swift // Matrioska // // Created by Mathias Aichinger on 11/01/2017. diff --git a/Source/JSON/JSONReader.swift b/Source/JSON/JSONReader.swift index b025f9d..4c6b8c8 100644 --- a/Source/JSON/JSONReader.swift +++ b/Source/JSON/JSONReader.swift @@ -1,5 +1,5 @@ // -// JsonReader.swift +// JSONReader.swift // Matrioska // // Created by Andreas Thenn on 12/01/2017. diff --git a/Source/JSON/StackClusterFactory.swift b/Source/JSON/StackClusterFactory.swift index d6112a9..5b55ac7 100644 --- a/Source/JSON/StackClusterFactory.swift +++ b/Source/JSON/StackClusterFactory.swift @@ -1,5 +1,5 @@ // -// StackCluster.swift +// StackClusterFactory.swift // Matrioska // // Created by Mathias Aichinger on 11/01/2017. diff --git a/Source/JSON/TabBarClusterFactory.swift b/Source/JSON/TabBarClusterFactory.swift index 73cec78..a0597fe 100644 --- a/Source/JSON/TabBarClusterFactory.swift +++ b/Source/JSON/TabBarClusterFactory.swift @@ -1,5 +1,5 @@ // -// TabBarClusterJsonFactory.swift +// TabBarClusterFactory.swift // Matrioska // // Created by Mathias Aichinger on 11/01/2017. From be460f67117f982a3f6629146db27ddd2fbfab38 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 10:08:44 +0100 Subject: [PATCH 10/29] Fix swift lint rules with new version --- .swiftlint.yml | 2 +- Source/JSON/JSONFactory.swift | 4 +--- Tests/ComponentTests.swift | 2 +- Tests/JSON/JSONFactoryTests.swift | 6 ++---- Tests/StackClusterTests.swift | 14 ++++++-------- Tests/TabBarClusterTests.swift | 14 +++++++------- 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index ac257ee..0a0357e 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -14,7 +14,7 @@ opt_in_rules: - redundant_nil_coalesing # - switch_case_on_newline # broken -line_length: 500 # goal: 110 +line_length: 110 included: - Source diff --git a/Source/JSON/JSONFactory.swift b/Source/JSON/JSONFactory.swift index 3815d9f..d9d98f6 100644 --- a/Source/JSON/JSONFactory.swift +++ b/Source/JSON/JSONFactory.swift @@ -19,7 +19,6 @@ enum JSONFactoryError: Error { public final class JSONFactory { let typeKey = "type" - let idKey = "id" let metaKey = "meta" let childrenKey = "children" @@ -33,14 +32,13 @@ public final class JSONFactory { factories[factory.typeName()] = factory } - /// Produces a Component from a given JSONObject, which has two mandatory keys: `typeKey` and `idKey` + /// Produces a Component from a given JSONObject, which has one mandatory key: `typeKey` /// /// - Parameter json: the JSONObject to be used /// - Returns: An optional Component /// - Throws: JSONFactoryError when a mandatory key is missing public func produce(from json: JSONObject) throws -> Component? { guard let type = json[typeKey] as? String else { throw JSONFactoryError.missing(json, typeKey) } - guard let _ = json[idKey] as? String else { throw JSONFactoryError.missing(json, idKey) } let meta = json[metaKey] as? [String : Any] let children = json[childrenKey] as? [JSONObject] ?? [] diff --git a/Tests/ComponentTests.swift b/Tests/ComponentTests.swift index 272be71..af18810 100644 --- a/Tests/ComponentTests.swift +++ b/Tests/ComponentTests.swift @@ -15,7 +15,7 @@ class ComponentTests: QuickSpec { override func spec() { - typealias DictMeta = Dictionary + typealias DictMeta = [String:String] describe("View component") { it("should build a viewController") { diff --git a/Tests/JSON/JSONFactoryTests.swift b/Tests/JSON/JSONFactoryTests.swift index c4ba095..e7c6643 100644 --- a/Tests/JSON/JSONFactoryTests.swift +++ b/Tests/JSON/JSONFactoryTests.swift @@ -64,12 +64,10 @@ class JSONFactoryTests: QuickSpec { it("throws an assertion when the JSON object does not have mandatory keys") { let jsonFactory = JSONFactory() - let faultyProduceNoKeys = { _ = try! jsonFactory.produce(from: ["foo" : "bar"]) } - let faultyProduceNoId = { _ = try! jsonFactory.produce(from: ["id" : "bar"]) } - let faultyProduceNoType = { _ = try! jsonFactory.produce(from: ["type" : "bar"]) } + let faultyProduceNoKeys = { _ = try! jsonFactory.produce(from: ["foo": "bar"]) } + let faultyProduceNoType = { _ = try! jsonFactory.produce(from: ["id": "bar"]) } expect(faultyProduceNoKeys()).to(throwAssertion()) - expect(faultyProduceNoId()).to(throwAssertion()) expect(faultyProduceNoType()).to(throwAssertion()) } diff --git a/Tests/StackClusterTests.swift b/Tests/StackClusterTests.swift index 34ff684..f0dfcd0 100644 --- a/Tests/StackClusterTests.swift +++ b/Tests/StackClusterTests.swift @@ -22,7 +22,7 @@ class StackClusterTests: QuickSpec { let children = [ labelComponent(title: "first", color: .red), labelComponent(title: "second", color: .blue), - labelComponent(title: "third\ntwo lines", color: .orange), + labelComponent(title: "third\ntwo lines", color: .orange) ] it("should display its child and respect their intrinsic contentSize") { @@ -35,7 +35,7 @@ class StackClusterTests: QuickSpec { labelComponent(title: "first", color: .red), Component.view(builder: { _ in nil }, meta: nil), labelComponent(title: "second", color: .orange), - Component.view(builder: { _ in nil }, meta: nil), + Component.view(builder: { _ in nil }, meta: nil) ] let vc = stack(with: children) expect(vc).to(haveValidSnapshot()) @@ -46,7 +46,7 @@ class StackClusterTests: QuickSpec { it("should use the default configuration") { let children = [ labelComponent(title: "first", color: .yellow), - labelComponent(title: "second", color: .green), + labelComponent(title: "second", color: .green) ] let vc = stack(with: children, meta: ["foo": "bar"]) expect(vc).to(haveValidSnapshot()) @@ -112,7 +112,7 @@ class StackClusterTests: QuickSpec { labelComponent(title: "1", color: .red, labelSize: size), labelComponent(title: "2", color: .red, labelSize: size), labelComponent(title: "3", color: .red, labelSize: size), - labelComponent(title: "4", color: .red, labelSize: size), + labelComponent(title: "4", color: .red, labelSize: size) ] it("should be able to scroll horizontally") { @@ -173,9 +173,7 @@ class StackClusterTests: QuickSpec { context("when the content doesn't overflows") { it("should not be able to scroll") { - let children = [ - labelComponent(title: "first", color: .red), - ] + let children = [labelComponent(title: "first", color: .red)] let vc = stack(with: children) expect(vc).to(haveValidSnapshot()) let scrollView = vc?.stackView.superview as? UIScrollView @@ -195,7 +193,7 @@ class StackClusterTests: QuickSpec { let nest = [ ClusterLayout.stack(children: children, meta: meta), ClusterLayout.stack(children: fixedSizeChildren, meta: horizontalMeta), - ClusterLayout.stack(children: children, meta: nil), + ClusterLayout.stack(children: children, meta: nil) ] let vc = stack(with: nest) diff --git a/Tests/TabBarClusterTests.swift b/Tests/TabBarClusterTests.swift index 9cc7604..b2a4f5b 100644 --- a/Tests/TabBarClusterTests.swift +++ b/Tests/TabBarClusterTests.swift @@ -22,12 +22,12 @@ class TabBarClusterTests: QuickSpec { let children: [Component] = [ simpleComponent(meta: TabConfig(title: "test1"), color: .red), simpleComponent(meta: TabConfig(title: "test2"), color: .blue), - simpleComponent(meta: TabConfig(title: "test3"), color: .orange), + simpleComponent(meta: TabConfig(title: "test3"), color: .orange) ] it("should display its children") { let children: [Component] = [ - simpleComponent(meta: TabConfig(title: "test1"), color: .purple), + simpleComponent(meta: TabConfig(title: "test1"), color: .purple) ] let vc = ClusterLayout.tabBar(children: children, meta: nil).viewController() expectTabCount(vc) == 1 @@ -84,7 +84,7 @@ class TabBarClusterTests: QuickSpec { it("should ignore children without view") { let children: [Component] = [ Component.view(builder: { _ in nil }, meta: TabConfig(title: "_")), - simpleComponent(meta: TabConfig(title: "test1"), color: .red), + simpleComponent(meta: TabConfig(title: "test1"), color: .red) ] let vc = ClusterLayout.tabBar(children: children, meta: nil).viewController() expectTabCount(vc) == 1 @@ -98,7 +98,7 @@ class TabBarClusterTests: QuickSpec { it("should ignore children without config") { let children: [Component] = [ simpleComponent(meta: nil), - validComponent, + validComponent ] let vc = ClusterLayout.tabBar(children: children, meta: nil).viewController() expectTabCount(vc) == 1 @@ -109,7 +109,7 @@ class TabBarClusterTests: QuickSpec { let bundle = Bundle(for: TabBarClusterTests.self) let children: [Component] = [ simpleComponent(meta: ["title": "test", "iconName": "checkmark"]), - validComponent, + validComponent ] let vc = ClusterLayout.tabBar(children: children, meta: nil, @@ -121,7 +121,7 @@ class TabBarClusterTests: QuickSpec { it("should not use config defined as dictionaries when missing the title") { let children: [Component] = [ simpleComponent(meta: ["iconName": "_"]), - validComponent, + validComponent ] let vc = ClusterLayout.tabBar(children: children, meta: nil).viewController() expectTabCount(vc) == 1 @@ -131,7 +131,7 @@ class TabBarClusterTests: QuickSpec { it("should not use config defined as dictionaries when missing the iconName") { let children: [Component] = [ simpleComponent(meta: ["title": "_"]), - validComponent, + validComponent ] let vc = ClusterLayout.tabBar(children: children, meta: nil).viewController() expectTabCount(vc) == 1 From f52426038b3593c52ca5000a8df5655d19a61839 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 10:27:32 +0100 Subject: [PATCH 11/29] Update project set up --- .swiftlint.yml | 2 +- Matrioska.xcodeproj/project.pbxproj | 120 ++++++++++-------- .../xcshareddata/xcschemes/Matrioska.xcscheme | 2 +- Source/{ => Components}/ClusterLayout.swift | 0 Source/{ => Components}/Component.swift | 0 Source/{ => Components}/ComponentMeta.swift | 0 Source/{ => Components}/StackCluster.swift | 0 Source/{ => Components}/TabBarCluster.swift | 0 Source/Factories/ClusterFactory.swift | 18 +++ .../ComponentFactory.swift | 5 - Source/Factories/StackClusterFactory.swift | 24 ++++ Source/Factories/TabBarClusterFactory.swift | 24 ++++ Source/JSON/StackClusterFactory.swift | 21 --- Source/JSON/TabBarClusterFactory.swift | 21 --- Tests/{JSON => }/JSONFactoryTests.swift | 10 +- Tests/{JSON => }/JSONReaderTests.swift | 0 16 files changed, 139 insertions(+), 108 deletions(-) rename Source/{ => Components}/ClusterLayout.swift (100%) rename Source/{ => Components}/Component.swift (100%) rename Source/{ => Components}/ComponentMeta.swift (100%) rename Source/{ => Components}/StackCluster.swift (100%) rename Source/{ => Components}/TabBarCluster.swift (100%) create mode 100644 Source/Factories/ClusterFactory.swift rename Source/{JSON => Factories}/ComponentFactory.swift (87%) create mode 100644 Source/Factories/StackClusterFactory.swift create mode 100644 Source/Factories/TabBarClusterFactory.swift delete mode 100644 Source/JSON/StackClusterFactory.swift delete mode 100644 Source/JSON/TabBarClusterFactory.swift rename Tests/{JSON => }/JSONFactoryTests.swift (95%) rename Tests/{JSON => }/JSONReaderTests.swift (100%) diff --git a/.swiftlint.yml b/.swiftlint.yml index 0a0357e..37eb96d 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -14,7 +14,7 @@ opt_in_rules: - redundant_nil_coalesing # - switch_case_on_newline # broken -line_length: 110 +line_length: 120 included: - Source diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index df6c882..ecfde86 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -9,14 +9,20 @@ /* Begin PBXBuildFile section */ 2198B0871E277BFF005F2E57 /* app_structure.json in Resources */ = {isa = PBXBuildFile; fileRef = 2198B0861E277BFF005F2E57 /* app_structure.json */; }; 21DA41761E27A11000169428 /* invalid.json in Resources */ = {isa = PBXBuildFile; fileRef = 21DA41741E27A09500169428 /* invalid.json */; }; - 21E40AD81E26543700205C06 /* ComponentFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD71E26543700205C06 /* ComponentFactory.swift */; }; 21E40ADA1E2657A100205C06 /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD91E2657A100205C06 /* JSONFactory.swift */; }; - 21E40ADC1E268A9E00205C06 /* TabBarClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */; }; - 21E40ADE1E268F6300205C06 /* StackClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */; }; 51A54328766C8548A4F3AE4A /* Pods_MatrioskaTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */; }; 5A069A980F4B0D057E6B647F /* Pods_Matrioska.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */; }; - 8BCFF89D1E27C31B0053AD98 /* JSONFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */; }; - 8BCFF89F1E27EC8D0053AD98 /* JSONReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF89E1E27EC8D0053AD98 /* JSONReaderTests.swift */; }; + 8BCFF8A71E28D3830053AD98 /* ClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8A31E28D3830053AD98 /* ClusterFactory.swift */; }; + 8BCFF8A81E28D3830053AD98 /* ComponentFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8A41E28D3830053AD98 /* ComponentFactory.swift */; }; + 8BCFF8A91E28D3830053AD98 /* StackClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8A51E28D3830053AD98 /* StackClusterFactory.swift */; }; + 8BCFF8AA1E28D3830053AD98 /* TabBarClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8A61E28D3830053AD98 /* TabBarClusterFactory.swift */; }; + 8BCFF8B11E28D4340053AD98 /* ClusterLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AC1E28D4340053AD98 /* ClusterLayout.swift */; }; + 8BCFF8B21E28D4340053AD98 /* Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AD1E28D4340053AD98 /* Component.swift */; }; + 8BCFF8B31E28D4340053AD98 /* ComponentMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AE1E28D4340053AD98 /* ComponentMeta.swift */; }; + 8BCFF8B41E28D4340053AD98 /* StackCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AF1E28D4340053AD98 /* StackCluster.swift */; }; + 8BCFF8B51E28D4340053AD98 /* TabBarCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8B01E28D4340053AD98 /* TabBarCluster.swift */; }; + 8BCFF8BA1E28D4B90053AD98 /* JSONFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8B61E28D4990053AD98 /* JSONFactoryTests.swift */; }; + 8BCFF8BB1E28D4B90053AD98 /* JSONReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8B71E28D4990053AD98 /* JSONReaderTests.swift */; }; DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */; }; DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */; }; DE067DCD1DDE017700641D1A /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DCB1DDE017700641D1A /* StackViewController.swift */; }; @@ -24,16 +30,11 @@ DE23D2981DDF63C400CDF333 /* TabBarClusterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE2D785C1DDB178500CD6E95 /* TabBarClusterTests.swift */; }; DE23D2991DDF63C400CDF333 /* IntrinsicSizeAwareScrollViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE2D78661DDB43FC00CD6E95 /* IntrinsicSizeAwareScrollViewTests.swift */; }; DE23D29A1DDF63C400CDF333 /* StackClusterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6CA3CA1DDC77E800E3A570 /* StackClusterTests.swift */; }; - DE2D785B1DDB0F1A00CD6E95 /* TabBarCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE2D785A1DDB0F1A00CD6E95 /* TabBarCluster.swift */; }; DE2D78631DDB3F7F00CD6E95 /* checkmark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DE2D78621DDB3F7F00CD6E95 /* checkmark@2x.png */; }; DE3E8D801DD389F400417AE5 /* Matrioska.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DE3E8D761DD389F400417AE5 /* Matrioska.framework */; }; DE3E8D981DD38BC000417AE5 /* Matrioska.h in Headers */ = {isa = PBXBuildFile; fileRef = DE3E8D931DD38AAA00417AE5 /* Matrioska.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DE3E8D9D1DD46A2600417AE5 /* Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE3E8D9C1DD46A2600417AE5 /* Component.swift */; }; - DE6CA3C91DDC71A100E3A570 /* StackCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6CA3C71DDC718D00E3A570 /* StackCluster.swift */; }; DE6CA3CE1DDC7F2D00E3A570 /* ScrollMatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6CA3CD1DDC7F2D00E3A570 /* ScrollMatcher.swift */; }; DE6CA3D01DDC8ED600E3A570 /* IntrinsicSizeAwareScrollViewTest.xib in Resources */ = {isa = PBXBuildFile; fileRef = DE6CA3CF1DDC8ED600E3A570 /* IntrinsicSizeAwareScrollViewTest.xib */; }; - DE6CA3D71DDCAF6500E3A570 /* ComponentMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6CA3D61DDCAF6500E3A570 /* ComponentMeta.swift */; }; - DE828C221DDB0C52003443A2 /* ClusterLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE828C211DDB0C52003443A2 /* ClusterLayout.swift */; }; DE85E5AF1DEC842700DFF34A /* AppearanceSpyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE85E5AE1DEC842700DFF34A /* AppearanceSpyViewController.swift */; }; DEA64C8B1E017D8100687658 /* UIColor+HEX.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEA64C8A1E017D8100687658 /* UIColor+HEX.swift */; }; DEA64C8D1E01810500687658 /* UIColorHEXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEA64C8C1E01810500687658 /* UIColorHEXTests.swift */; }; @@ -53,21 +54,26 @@ /* Begin PBXFileReference section */ 2198B0861E277BFF005F2E57 /* app_structure.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = app_structure.json; sourceTree = ""; }; 21DA41741E27A09500169428 /* invalid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = invalid.json; sourceTree = ""; }; - 21E40AD71E26543700205C06 /* ComponentFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentFactory.swift; sourceTree = ""; }; 21E40AD91E2657A100205C06 /* JSONFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; - 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarClusterFactory.swift; sourceTree = ""; }; - 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackClusterFactory.swift; sourceTree = ""; }; 23587B9D5CB1FB404F5C7787 /* Pods-MatrioskaTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrioskaTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MatrioskaTests/Pods-MatrioskaTests.debug.xcconfig"; sourceTree = ""; }; 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4F6E46DFDCFD89ADB9C4762B /* Pods-Matrioska.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.release.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.release.xcconfig"; sourceTree = ""; }; 60996A348436AB8E34E758DA /* Pods-Matrioska.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.debug.xcconfig"; sourceTree = ""; }; - 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactoryTests.swift; sourceTree = ""; }; - 8BCFF89E1E27EC8D0053AD98 /* JSONReaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReaderTests.swift; sourceTree = ""; }; + 8BCFF8A31E28D3830053AD98 /* ClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClusterFactory.swift; sourceTree = ""; }; + 8BCFF8A41E28D3830053AD98 /* ComponentFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentFactory.swift; sourceTree = ""; }; + 8BCFF8A51E28D3830053AD98 /* StackClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackClusterFactory.swift; sourceTree = ""; }; + 8BCFF8A61E28D3830053AD98 /* TabBarClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarClusterFactory.swift; sourceTree = ""; }; + 8BCFF8AC1E28D4340053AD98 /* ClusterLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; + 8BCFF8AD1E28D4340053AD98 /* Component.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; + 8BCFF8AE1E28D4340053AD98 /* ComponentMeta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; }; + 8BCFF8AF1E28D4340053AD98 /* StackCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackCluster.swift; sourceTree = ""; }; + 8BCFF8B01E28D4340053AD98 /* TabBarCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarCluster.swift; sourceTree = ""; }; + 8BCFF8B61E28D4990053AD98 /* JSONFactoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactoryTests.swift; sourceTree = ""; }; + 8BCFF8B71E28D4990053AD98 /* JSONReaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReaderTests.swift; sourceTree = ""; }; DDE5072CEF32135290F71073 /* Pods-MatrioskaTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrioskaTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MatrioskaTests/Pods-MatrioskaTests.release.xcconfig"; sourceTree = ""; }; DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ComponentMetaTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; DE067DCB1DDE017700641D1A /* StackViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackViewController.swift; sourceTree = ""; }; - DE2D785A1DDB0F1A00CD6E95 /* TabBarCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = TabBarCluster.swift; sourceTree = ""; }; DE2D785C1DDB178500CD6E95 /* TabBarClusterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = TabBarClusterTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE2D78621DDB3F7F00CD6E95 /* checkmark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "checkmark@2x.png"; sourceTree = ""; }; DE2D78661DDB43FC00CD6E95 /* IntrinsicSizeAwareScrollViewTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollViewTests.swift; sourceTree = ""; }; @@ -77,13 +83,9 @@ DE3E8D931DD38AAA00417AE5 /* Matrioska.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Matrioska.h; sourceTree = ""; }; DE3E8D951DD38AAA00417AE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DE3E8D961DD38AAA00417AE5 /* ComponentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentTests.swift; sourceTree = ""; }; - DE3E8D9C1DD46A2600417AE5 /* Component.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; - DE6CA3C71DDC718D00E3A570 /* StackCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = StackCluster.swift; sourceTree = ""; }; DE6CA3CA1DDC77E800E3A570 /* StackClusterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = StackClusterTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE6CA3CD1DDC7F2D00E3A570 /* ScrollMatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollMatcher.swift; sourceTree = ""; }; DE6CA3CF1DDC8ED600E3A570 /* IntrinsicSizeAwareScrollViewTest.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IntrinsicSizeAwareScrollViewTest.xib; sourceTree = ""; }; - DE6CA3D61DDCAF6500E3A570 /* ComponentMeta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ComponentMeta.swift; sourceTree = ""; }; - DE828C211DDB0C52003443A2 /* ClusterLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; DE85E5AE1DEC842700DFF34A /* AppearanceSpyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppearanceSpyViewController.swift; sourceTree = ""; }; DEA64C8A1E017D8100687658 /* UIColor+HEX.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+HEX.swift"; sourceTree = ""; }; DEA64C8C1E01810500687658 /* UIColorHEXTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIColorHEXTests.swift; sourceTree = ""; }; @@ -113,23 +115,11 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 2198B0851E277BA3005F2E57 /* JSON */ = { - isa = PBXGroup; - children = ( - 8BCFF89C1E27C31B0053AD98 /* JSONFactoryTests.swift */, - 8BCFF89E1E27EC8D0053AD98 /* JSONReaderTests.swift */, - ); - path = JSON; - sourceTree = ""; - }; 21E40AD61E26540800205C06 /* JSON */ = { isa = PBXGroup; children = ( - 21E40AD71E26543700205C06 /* ComponentFactory.swift */, 21E40AD91E2657A100205C06 /* JSONFactory.swift */, ED9180F61E276F0C00F73FDB /* JSONReader.swift */, - 21E40ADD1E268F6300205C06 /* StackClusterFactory.swift */, - 21E40ADB1E268A9E00205C06 /* TabBarClusterFactory.swift */, ); path = JSON; sourceTree = ""; @@ -145,6 +135,29 @@ name = Pods; sourceTree = ""; }; + 8BCFF8A21E28D3830053AD98 /* Factories */ = { + isa = PBXGroup; + children = ( + 8BCFF8A31E28D3830053AD98 /* ClusterFactory.swift */, + 8BCFF8A41E28D3830053AD98 /* ComponentFactory.swift */, + 8BCFF8A51E28D3830053AD98 /* StackClusterFactory.swift */, + 8BCFF8A61E28D3830053AD98 /* TabBarClusterFactory.swift */, + ); + path = Factories; + sourceTree = ""; + }; + 8BCFF8AB1E28D4340053AD98 /* Components */ = { + isa = PBXGroup; + children = ( + 8BCFF8AC1E28D4340053AD98 /* ClusterLayout.swift */, + 8BCFF8AD1E28D4340053AD98 /* Component.swift */, + 8BCFF8AE1E28D4340053AD98 /* ComponentMeta.swift */, + 8BCFF8AF1E28D4340053AD98 /* StackCluster.swift */, + 8BCFF8B01E28D4340053AD98 /* TabBarCluster.swift */, + ); + path = Components; + sourceTree = ""; + }; AED00DD136EC847202BC799E /* Frameworks */ = { isa = PBXGroup; children = ( @@ -207,15 +220,16 @@ DE3E8D941DD38AAA00417AE5 /* Tests */ = { isa = PBXGroup; children = ( - 2198B0851E277BA3005F2E57 /* JSON */, - DE6CA3CC1DDC7F1D00E3A570 /* Helpers */, DE2D78611DDB3F7F00CD6E95 /* Assets */, - DE3E8D951DD38AAA00417AE5 /* Info.plist */, + DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */, DE3E8D961DD38AAA00417AE5 /* ComponentTests.swift */, - DE2D785C1DDB178500CD6E95 /* TabBarClusterTests.swift */, + DE6CA3CC1DDC7F1D00E3A570 /* Helpers */, + DE3E8D951DD38AAA00417AE5 /* Info.plist */, DE2D78661DDB43FC00CD6E95 /* IntrinsicSizeAwareScrollViewTests.swift */, + 8BCFF8B61E28D4990053AD98 /* JSONFactoryTests.swift */, + 8BCFF8B71E28D4990053AD98 /* JSONReaderTests.swift */, DE6CA3CA1DDC77E800E3A570 /* StackClusterTests.swift */, - DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */, + DE2D785C1DDB178500CD6E95 /* TabBarClusterTests.swift */, DEA64C8C1E01810500687658 /* UIColorHEXTests.swift */, ); path = Tests; @@ -224,13 +238,10 @@ DE3E8D9A1DD38D1C00417AE5 /* Source */ = { isa = PBXGroup; children = ( - 21E40AD61E26540800205C06 /* JSON */, - DE3E8D9C1DD46A2600417AE5 /* Component.swift */, - DE6CA3D61DDCAF6500E3A570 /* ComponentMeta.swift */, - DE828C211DDB0C52003443A2 /* ClusterLayout.swift */, - DE6CA3C71DDC718D00E3A570 /* StackCluster.swift */, - DE2D785A1DDB0F1A00CD6E95 /* TabBarCluster.swift */, + 8BCFF8AB1E28D4340053AD98 /* Components */, + 8BCFF8A21E28D3830053AD98 /* Factories */, DEA64C891E017D7300687658 /* Helpers */, + 21E40AD61E26540800205C06 /* JSON */, DE067DC91DDE017700641D1A /* Views */, ); path = Source; @@ -317,7 +328,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 0810; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = runtastic; TargetAttributes = { DE3E8D751DD389F400417AE5 = { @@ -467,19 +478,20 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 21E40AD81E26543700205C06 /* ComponentFactory.swift in Sources */, - 21E40ADE1E268F6300205C06 /* StackClusterFactory.swift in Sources */, + 8BCFF8B51E28D4340053AD98 /* TabBarCluster.swift in Sources */, + 8BCFF8B31E28D4340053AD98 /* ComponentMeta.swift in Sources */, ED9180F71E276F0C00F73FDB /* JSONReader.swift in Sources */, - DE6CA3D71DDCAF6500E3A570 /* ComponentMeta.swift in Sources */, DEA64C8B1E017D8100687658 /* UIColor+HEX.swift in Sources */, DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */, - DE828C221DDB0C52003443A2 /* ClusterLayout.swift in Sources */, - DE6CA3C91DDC71A100E3A570 /* StackCluster.swift in Sources */, + 8BCFF8A81E28D3830053AD98 /* ComponentFactory.swift in Sources */, + 8BCFF8B21E28D4340053AD98 /* Component.swift in Sources */, + 8BCFF8A91E28D3830053AD98 /* StackClusterFactory.swift in Sources */, 21E40ADA1E2657A100205C06 /* JSONFactory.swift in Sources */, + 8BCFF8B41E28D4340053AD98 /* StackCluster.swift in Sources */, + 8BCFF8B11E28D4340053AD98 /* ClusterLayout.swift in Sources */, + 8BCFF8AA1E28D3830053AD98 /* TabBarClusterFactory.swift in Sources */, DE067DCD1DDE017700641D1A /* StackViewController.swift in Sources */, - DE3E8D9D1DD46A2600417AE5 /* Component.swift in Sources */, - 21E40ADC1E268A9E00205C06 /* TabBarClusterFactory.swift in Sources */, - DE2D785B1DDB0F1A00CD6E95 /* TabBarCluster.swift in Sources */, + 8BCFF8A71E28D3830053AD98 /* ClusterFactory.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -487,15 +499,15 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8BCFF8BA1E28D4B90053AD98 /* JSONFactoryTests.swift in Sources */, DE85E5AF1DEC842700DFF34A /* AppearanceSpyViewController.swift in Sources */, DE23D2981DDF63C400CDF333 /* TabBarClusterTests.swift in Sources */, DE23D2971DDF63C400CDF333 /* ComponentTests.swift in Sources */, - 8BCFF89F1E27EC8D0053AD98 /* JSONReaderTests.swift in Sources */, DE6CA3CE1DDC7F2D00E3A570 /* ScrollMatcher.swift in Sources */, DE23D29A1DDF63C400CDF333 /* StackClusterTests.swift in Sources */, + 8BCFF8BB1E28D4B90053AD98 /* JSONReaderTests.swift in Sources */, DEA64C8D1E01810500687658 /* UIColorHEXTests.swift in Sources */, DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */, - 8BCFF89D1E27C31B0053AD98 /* JSONFactoryTests.swift in Sources */, DE23D2991DDF63C400CDF333 /* IntrinsicSizeAwareScrollViewTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Matrioska.xcodeproj/xcshareddata/xcschemes/Matrioska.xcscheme b/Matrioska.xcodeproj/xcshareddata/xcschemes/Matrioska.xcscheme index 63952be..e3aa963 100644 --- a/Matrioska.xcodeproj/xcshareddata/xcschemes/Matrioska.xcscheme +++ b/Matrioska.xcodeproj/xcshareddata/xcschemes/Matrioska.xcscheme @@ -1,6 +1,6 @@ Component? { return Component.view(builder: { _ in UIViewController() }, meta: meta) } - - /// A default implementation that returns the name of this type - func typeName() -> String { - return String(describing: self) - } } diff --git a/Source/Factories/StackClusterFactory.swift b/Source/Factories/StackClusterFactory.swift new file mode 100644 index 0000000..5d6a001 --- /dev/null +++ b/Source/Factories/StackClusterFactory.swift @@ -0,0 +1,24 @@ +// +// StackClusterFactory.swift +// Matrioska +// +// Created by Mathias Aichinger on 11/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import Foundation + +extension ClusterFactory { + + /// A concrete ComponentFactory which produces a stack cluster component + public final class StackClusterFactory: ComponentFactory { + public func produce(children: [Component], + meta: ComponentMeta?) -> Component? { + return ClusterLayout.stack(children: children, meta: meta) + } + + public func typeName() -> String { + return "stack" + } + } +} diff --git a/Source/Factories/TabBarClusterFactory.swift b/Source/Factories/TabBarClusterFactory.swift new file mode 100644 index 0000000..88f19bc --- /dev/null +++ b/Source/Factories/TabBarClusterFactory.swift @@ -0,0 +1,24 @@ +// +// TabBarClusterFactory.swift +// Matrioska +// +// Created by Mathias Aichinger on 11/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import Foundation + +extension ClusterFactory { + + /// A concrete ComponentFactory which produces a tabBar cluster component + public final class TabBarClusterFactory: ComponentFactory { + public func produce(children: [Component], + meta: ComponentMeta?) -> Component? { + return ClusterLayout.tabBar(children: children, meta: meta) + } + + public func typeName() -> String { + return "tabbar" + } + } +} diff --git a/Source/JSON/StackClusterFactory.swift b/Source/JSON/StackClusterFactory.swift deleted file mode 100644 index 5b55ac7..0000000 --- a/Source/JSON/StackClusterFactory.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// StackClusterFactory.swift -// Matrioska -// -// Created by Mathias Aichinger on 11/01/2017. -// Copyright © 2017 runtastic. All rights reserved. -// - -import Foundation - -/// A concrete ComponentFactory which produces a stack cluster component -public class StackClusterFactory: ComponentFactory { - public func produce(children: [Component], - meta: ComponentMeta?) -> Component? { - return ClusterLayout.stack(children: children, meta: meta) - } - - public func typeName() -> String { - return "stack" - } -} diff --git a/Source/JSON/TabBarClusterFactory.swift b/Source/JSON/TabBarClusterFactory.swift deleted file mode 100644 index a0597fe..0000000 --- a/Source/JSON/TabBarClusterFactory.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// TabBarClusterFactory.swift -// Matrioska -// -// Created by Mathias Aichinger on 11/01/2017. -// Copyright © 2017 runtastic. All rights reserved. -// - -import Foundation - -/// A concrete ComponentFactory which produces a tabBar cluster component -public class TabBarClusterFactory: ComponentFactory { - public func produce(children: [Component], - meta: ComponentMeta?) -> Component? { - return ClusterLayout.tabBar(children: children, meta: meta) - } - - public func typeName() -> String { - return "tabbar" - } -} diff --git a/Tests/JSON/JSONFactoryTests.swift b/Tests/JSONFactoryTests.swift similarity index 95% rename from Tests/JSON/JSONFactoryTests.swift rename to Tests/JSONFactoryTests.swift index e7c6643..1db8284 100644 --- a/Tests/JSON/JSONFactoryTests.swift +++ b/Tests/JSONFactoryTests.swift @@ -21,8 +21,8 @@ class JSONFactoryTests: QuickSpec { let jsonObject = try! JSONReader.jsonObject(from: jsonFileName, bundle: bundle)! let json = structure(from: jsonObject) - let tabBarFactory = TabBarClusterFactory() - let stackFactory = StackClusterFactory() + let tabBarFactory = ClusterFactory.TabBarClusterFactory() + let stackFactory = ClusterFactory.StackClusterFactory() let buttonFactory = ButtonFactory() let labelFactory = LabelFactory() let tableViewFactory = TableViewFactory() @@ -41,8 +41,8 @@ class JSONFactoryTests: QuickSpec { context("when registering factories") { let jsonFactory = JSONFactory() - let tabBarFactory = TabBarClusterFactory() - let stackFactory = StackClusterFactory() + let tabBarFactory = ClusterFactory.TabBarClusterFactory() + let stackFactory = ClusterFactory.StackClusterFactory() jsonFactory.register(tabBarFactory) jsonFactory.register(stackFactory) @@ -82,7 +82,7 @@ class JSONFactoryTests: QuickSpec { context("when registering some available cluster factories") { let jsonFactory = JSONFactory() - let tabBarFactory = TabBarClusterFactory() + let tabBarFactory = ClusterFactory.TabBarClusterFactory() jsonFactory.register(tabBarFactory) let component = try! jsonFactory.produce(from: json) diff --git a/Tests/JSON/JSONReaderTests.swift b/Tests/JSONReaderTests.swift similarity index 100% rename from Tests/JSON/JSONReaderTests.swift rename to Tests/JSONReaderTests.swift From 26acb591d16a881c22b5b47b1212343dad6e77dc Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 13:21:38 +0100 Subject: [PATCH 12/29] Update app_structure.json and tests to reflect current schema --- Tests/Assets/app_structure.json | 7 ------- Tests/JSONReaderTests.swift | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Tests/Assets/app_structure.json b/Tests/Assets/app_structure.json index de64b42..f11a615 100644 --- a/Tests/Assets/app_structure.json +++ b/Tests/Assets/app_structure.json @@ -1,13 +1,11 @@ { "structure": { - "id": "tabbar", "type": "tabbar", "meta": { "default_tab_id": "main_tab" }, "children": [ { - "id": "history_tab", "type": "stack", "meta": { "requires_navigation": "true", @@ -21,13 +19,11 @@ }, "children": [ { - "id": "history.table_view", "type": "table_view" } ] }, { - "id": "main_tab", "type": "stack", "meta": { "requires_navigation": "true", @@ -41,11 +37,9 @@ }, "children": [ { - "id": "test_label", "type": "label" }, { - "id": "main.test_feature", "type": "stack", "meta": { "requires_navigation": "true", @@ -53,7 +47,6 @@ } }, { - "id": "main.start_button", "type": "button", "meta": { "title": { diff --git a/Tests/JSONReaderTests.swift b/Tests/JSONReaderTests.swift index 932f91d..fcbb186 100644 --- a/Tests/JSONReaderTests.swift +++ b/Tests/JSONReaderTests.swift @@ -48,7 +48,8 @@ class JSONReaderTests: QuickSpec { XCTAssertNotNil(jsonObject) XCTAssertNotNil(jsonObject!["structure"]) let structure = jsonObject!["structure"] as? JSONObject - XCTAssertNotNil(structure!["id"]) + XCTAssertNotNil(structure!["type"]) + XCTAssertNotNil(structure!["meta"]) } } From 62ca01db694c726385f308b6ada634dfd3dcc48e Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 21:11:15 +0100 Subject: [PATCH 13/29] Refactor using a single JSONFactory which holds builder closures --- Matrioska.xcodeproj/project.pbxproj | 24 +--- Source/Factories/ClusterFactory.swift | 18 --- Source/Factories/ComponentFactory.swift | 36 ------ Source/Factories/JSONFactory.swift | 94 +++++++++++++++ Source/Factories/StackClusterFactory.swift | 24 ---- Source/Factories/TabBarClusterFactory.swift | 24 ---- Source/JSON/JSONFactory.swift | 49 -------- Tests/Assets/app_structure.json | 13 ++- Tests/ComponentTests.swift | 2 +- Tests/JSONFactoryTests.swift | 120 ++++++++------------ 10 files changed, 156 insertions(+), 248 deletions(-) delete mode 100644 Source/Factories/ClusterFactory.swift delete mode 100644 Source/Factories/ComponentFactory.swift create mode 100644 Source/Factories/JSONFactory.swift delete mode 100644 Source/Factories/StackClusterFactory.swift delete mode 100644 Source/Factories/TabBarClusterFactory.swift delete mode 100644 Source/JSON/JSONFactory.swift diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index ecfde86..70f06a6 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -9,13 +9,9 @@ /* Begin PBXBuildFile section */ 2198B0871E277BFF005F2E57 /* app_structure.json in Resources */ = {isa = PBXBuildFile; fileRef = 2198B0861E277BFF005F2E57 /* app_structure.json */; }; 21DA41761E27A11000169428 /* invalid.json in Resources */ = {isa = PBXBuildFile; fileRef = 21DA41741E27A09500169428 /* invalid.json */; }; - 21E40ADA1E2657A100205C06 /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E40AD91E2657A100205C06 /* JSONFactory.swift */; }; 51A54328766C8548A4F3AE4A /* Pods_MatrioskaTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */; }; 5A069A980F4B0D057E6B647F /* Pods_Matrioska.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */; }; - 8BCFF8A71E28D3830053AD98 /* ClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8A31E28D3830053AD98 /* ClusterFactory.swift */; }; - 8BCFF8A81E28D3830053AD98 /* ComponentFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8A41E28D3830053AD98 /* ComponentFactory.swift */; }; - 8BCFF8A91E28D3830053AD98 /* StackClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8A51E28D3830053AD98 /* StackClusterFactory.swift */; }; - 8BCFF8AA1E28D3830053AD98 /* TabBarClusterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8A61E28D3830053AD98 /* TabBarClusterFactory.swift */; }; + 8B3E4D4B1E2962BC00C82598 /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3E4D4A1E2962BC00C82598 /* JSONFactory.swift */; }; 8BCFF8B11E28D4340053AD98 /* ClusterLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AC1E28D4340053AD98 /* ClusterLayout.swift */; }; 8BCFF8B21E28D4340053AD98 /* Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AD1E28D4340053AD98 /* Component.swift */; }; 8BCFF8B31E28D4340053AD98 /* ComponentMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AE1E28D4340053AD98 /* ComponentMeta.swift */; }; @@ -54,15 +50,11 @@ /* Begin PBXFileReference section */ 2198B0861E277BFF005F2E57 /* app_structure.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = app_structure.json; sourceTree = ""; }; 21DA41741E27A09500169428 /* invalid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = invalid.json; sourceTree = ""; }; - 21E40AD91E2657A100205C06 /* JSONFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; 23587B9D5CB1FB404F5C7787 /* Pods-MatrioskaTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrioskaTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MatrioskaTests/Pods-MatrioskaTests.debug.xcconfig"; sourceTree = ""; }; 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4F6E46DFDCFD89ADB9C4762B /* Pods-Matrioska.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.release.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.release.xcconfig"; sourceTree = ""; }; 60996A348436AB8E34E758DA /* Pods-Matrioska.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.debug.xcconfig"; sourceTree = ""; }; - 8BCFF8A31E28D3830053AD98 /* ClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClusterFactory.swift; sourceTree = ""; }; - 8BCFF8A41E28D3830053AD98 /* ComponentFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentFactory.swift; sourceTree = ""; }; - 8BCFF8A51E28D3830053AD98 /* StackClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackClusterFactory.swift; sourceTree = ""; }; - 8BCFF8A61E28D3830053AD98 /* TabBarClusterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarClusterFactory.swift; sourceTree = ""; }; + 8B3E4D4A1E2962BC00C82598 /* JSONFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; 8BCFF8AC1E28D4340053AD98 /* ClusterLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; 8BCFF8AD1E28D4340053AD98 /* Component.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; 8BCFF8AE1E28D4340053AD98 /* ComponentMeta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; }; @@ -118,7 +110,6 @@ 21E40AD61E26540800205C06 /* JSON */ = { isa = PBXGroup; children = ( - 21E40AD91E2657A100205C06 /* JSONFactory.swift */, ED9180F61E276F0C00F73FDB /* JSONReader.swift */, ); path = JSON; @@ -138,10 +129,7 @@ 8BCFF8A21E28D3830053AD98 /* Factories */ = { isa = PBXGroup; children = ( - 8BCFF8A31E28D3830053AD98 /* ClusterFactory.swift */, - 8BCFF8A41E28D3830053AD98 /* ComponentFactory.swift */, - 8BCFF8A51E28D3830053AD98 /* StackClusterFactory.swift */, - 8BCFF8A61E28D3830053AD98 /* TabBarClusterFactory.swift */, + 8B3E4D4A1E2962BC00C82598 /* JSONFactory.swift */, ); path = Factories; sourceTree = ""; @@ -483,15 +471,11 @@ ED9180F71E276F0C00F73FDB /* JSONReader.swift in Sources */, DEA64C8B1E017D8100687658 /* UIColor+HEX.swift in Sources */, DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */, - 8BCFF8A81E28D3830053AD98 /* ComponentFactory.swift in Sources */, 8BCFF8B21E28D4340053AD98 /* Component.swift in Sources */, - 8BCFF8A91E28D3830053AD98 /* StackClusterFactory.swift in Sources */, - 21E40ADA1E2657A100205C06 /* JSONFactory.swift in Sources */, + 8B3E4D4B1E2962BC00C82598 /* JSONFactory.swift in Sources */, 8BCFF8B41E28D4340053AD98 /* StackCluster.swift in Sources */, 8BCFF8B11E28D4340053AD98 /* ClusterLayout.swift in Sources */, - 8BCFF8AA1E28D3830053AD98 /* TabBarClusterFactory.swift in Sources */, DE067DCD1DDE017700641D1A /* StackViewController.swift in Sources */, - 8BCFF8A71E28D3830053AD98 /* ClusterFactory.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Source/Factories/ClusterFactory.swift b/Source/Factories/ClusterFactory.swift deleted file mode 100644 index dcfbb21..0000000 --- a/Source/Factories/ClusterFactory.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// ClusterFactory.swift -// Matrioska -// -// Created by Joan Romano on 13/01/17. -// Copyright © 2017 runtastic. All rights reserved. -// - -import Foundation - -/// The standard library factories -/// 1. `TabBarClusterFactory`: A tabBar cluster factory -/// 2. `StackClusterFactory`: A stack cluster factory -/// -/// See the documentation of the factories for more informations and configuration options. -public enum ClusterFactory { - /* empty ATM, extended in other files... at some point there will be something here */ -} diff --git a/Source/Factories/ComponentFactory.swift b/Source/Factories/ComponentFactory.swift deleted file mode 100644 index 73be2f3..0000000 --- a/Source/Factories/ComponentFactory.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// ComponentJSONFactory.swift -// Matrioska -// -// Created by Mathias Aichinger on 11/01/2017. -// Copyright © 2017 runtastic. All rights reserved. -// - -import Foundation - -/// Represents a factory that can produce components -public protocol ComponentFactory { - - /// Produces a component out of a Component array and ComponentMeta - /// - /// - Parameters: - /// - children: an array of children component - /// - meta: a ComponentMeta object - /// - Returns: An optional Component - func produce(children: [Component], - meta: ComponentMeta?) -> Component? - - /// The name that identifies this ComponentFactory type - /// - /// - Returns: a string representing this type - func typeName() -> String -} - -extension ComponentFactory { - - /// A default implementation that returns a `view` Component with a plain UIViewController - func produce(children: [Component], - meta: ComponentMeta?) -> Component? { - return Component.view(builder: { _ in UIViewController() }, meta: meta) - } -} diff --git a/Source/Factories/JSONFactory.swift b/Source/Factories/JSONFactory.swift new file mode 100644 index 0000000..c57ec86 --- /dev/null +++ b/Source/Factories/JSONFactory.swift @@ -0,0 +1,94 @@ +// +// JSONFactory.swift +// Matrioska +// +// Created by Mathias Aichinger on 11/01/2017. +// Copyright © 2017 runtastic. All rights reserved. +// + +import Foundation + +/// An error type for JSONFactory +/// +/// - missing: specifies that a mandatory key is missing +enum JSONFactoryError: Error { + case missing(JSONObject, String) +} + +/// A factory that wraps ComponentFactory objects and uses them to produce Components +public final class JSONFactory { + + static let typeKey = "type" + static let metaKey = "meta" + static let childrenKey = "children" + + /// A factory closure to build a view `Component` + public typealias ViewFactoryBuilder = (ComponentMeta?) -> Component + + /// A factory closure to build a wrapper `Component` + public typealias WrapperFactoryBuilder = (Component, ComponentMeta?) -> Component + + /// A factory closure to build a cluster `Component` + public typealias ClusterFactoryBuilder = ([Component], ComponentMeta?) -> Component + + private var viewFactory: [String: ViewFactoryBuilder] = [:] + private var wrapperFactory: [String: WrapperFactoryBuilder] = [:] + private var clusterFactory: [String: ClusterFactoryBuilder] = [:] + + /// Registers a new `ViewFactoryBuilder` which will be used when producing the component + /// + /// - Parameters: + /// - type: a string identifying this factory type + /// - factoryBuilder: a `ViewFactoryBuilder` to build a `Component` + public func register(with type: String, + factoryBuilder: @escaping ViewFactoryBuilder) { + viewFactory[type] = factoryBuilder + } + + /// Registers a new `WrapperFactoryBuilder` which will be used when producing the component + /// + /// - Parameters: + /// - type: a string identifying this factory type + /// - factoryBuilder: a `WrapperFactoryBuilder` to build a `Component` + public func register(with type: String, + factoryBuilder: @escaping WrapperFactoryBuilder) { + wrapperFactory[type] = factoryBuilder + } + + /// Registers a new `ClusterFactoryBuilder` which will be used when producing the component + /// + /// - Parameters: + /// - type: a string identifying this factory type + /// - factoryBuilder: a `ClusterFactoryBuilder` to build a `Component` + public func register(with type: String, + factoryBuilder: @escaping ClusterFactoryBuilder) { + clusterFactory[type] = factoryBuilder + } + + /// Produces a `Component` from a given `JSONObject`, which has one mandatory key: `typeKey` + /// + /// - Parameter json: the `JSONObject` to be used + /// - Returns: An optional `Component` + /// - Throws: `JSONFactoryError` when a mandatory key is missing + public func component(from json: JSONObject) throws -> Component? { + guard let type = json[JSONFactory.typeKey] as? String else { + throw JSONFactoryError.missing(json, JSONFactory.typeKey) + } + + let meta = json[JSONFactory.metaKey] as? [String : Any] + let children = json[JSONFactory.childrenKey] as? [JSONObject] ?? [] + let componentChildren = try children.flatMap { try component(from: $0) } + var componentResult: Component? + + if let viewFactory = viewFactory[type] { + componentResult = viewFactory(meta) + } else if let wrapperFactory = wrapperFactory[type], + let componentChild = componentChildren.first { + componentResult = wrapperFactory(componentChild, meta) + } else if let clusterFactory = clusterFactory[type] { + componentResult = clusterFactory(componentChildren, meta) + } + + return componentResult + } +} diff --git a/Source/Factories/StackClusterFactory.swift b/Source/Factories/StackClusterFactory.swift deleted file mode 100644 index 5d6a001..0000000 --- a/Source/Factories/StackClusterFactory.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// StackClusterFactory.swift -// Matrioska -// -// Created by Mathias Aichinger on 11/01/2017. -// Copyright © 2017 runtastic. All rights reserved. -// - -import Foundation - -extension ClusterFactory { - - /// A concrete ComponentFactory which produces a stack cluster component - public final class StackClusterFactory: ComponentFactory { - public func produce(children: [Component], - meta: ComponentMeta?) -> Component? { - return ClusterLayout.stack(children: children, meta: meta) - } - - public func typeName() -> String { - return "stack" - } - } -} diff --git a/Source/Factories/TabBarClusterFactory.swift b/Source/Factories/TabBarClusterFactory.swift deleted file mode 100644 index 88f19bc..0000000 --- a/Source/Factories/TabBarClusterFactory.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// TabBarClusterFactory.swift -// Matrioska -// -// Created by Mathias Aichinger on 11/01/2017. -// Copyright © 2017 runtastic. All rights reserved. -// - -import Foundation - -extension ClusterFactory { - - /// A concrete ComponentFactory which produces a tabBar cluster component - public final class TabBarClusterFactory: ComponentFactory { - public func produce(children: [Component], - meta: ComponentMeta?) -> Component? { - return ClusterLayout.tabBar(children: children, meta: meta) - } - - public func typeName() -> String { - return "tabbar" - } - } -} diff --git a/Source/JSON/JSONFactory.swift b/Source/JSON/JSONFactory.swift deleted file mode 100644 index d9d98f6..0000000 --- a/Source/JSON/JSONFactory.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// JSONFactory.swift -// Matrioska -// -// Created by Mathias Aichinger on 11/01/2017. -// Copyright © 2017 runtastic. All rights reserved. -// - -import Foundation - -/// An error type for JSONFactory -/// -/// - missing: specifies that a mandatory key is missing -enum JSONFactoryError: Error { - case missing(JSONObject, String) -} - -/// A factory that wraps ComponentFactory objects and uses them to produce Components -public final class JSONFactory { - - let typeKey = "type" - let metaKey = "meta" - let childrenKey = "children" - - /// The already registered factories - private(set) var factories: [String: ComponentFactory] = [:] - - /// Registers a new ComponentFactory which will be used in `produce` - /// - /// - Parameter factory: the ComponentFactory to be registered - public func register(_ factory: ComponentFactory) { - factories[factory.typeName()] = factory - } - - /// Produces a Component from a given JSONObject, which has one mandatory key: `typeKey` - /// - /// - Parameter json: the JSONObject to be used - /// - Returns: An optional Component - /// - Throws: JSONFactoryError when a mandatory key is missing - public func produce(from json: JSONObject) throws -> Component? { - guard let type = json[typeKey] as? String else { throw JSONFactoryError.missing(json, typeKey) } - - let meta = json[metaKey] as? [String : Any] - let children = json[childrenKey] as? [JSONObject] ?? [] - let componentChildren = try children.flatMap { try produce(from: $0) } - - return factories[type]?.produce(children: componentChildren, meta: meta) - } -} diff --git a/Tests/Assets/app_structure.json b/Tests/Assets/app_structure.json index f11a615..13b86ee 100644 --- a/Tests/Assets/app_structure.json +++ b/Tests/Assets/app_structure.json @@ -8,7 +8,6 @@ { "type": "stack", "meta": { - "requires_navigation": "true", "tab_config": { "title": { "key": "history_title", @@ -20,13 +19,15 @@ "children": [ { "type": "table_view" + }, + { + "type": "navigation" } ] }, { "type": "stack", "meta": { - "requires_navigation": "true", "tab_config": { "title": { "key": "main_tab_title", @@ -56,6 +57,14 @@ } } ] + }, + { + "type": "navigation", + "children": [ + { + "type": "label" + } + ] } ] } diff --git a/Tests/ComponentTests.swift b/Tests/ComponentTests.swift index af18810..6a79ff8 100644 --- a/Tests/ComponentTests.swift +++ b/Tests/ComponentTests.swift @@ -15,7 +15,7 @@ class ComponentTests: QuickSpec { override func spec() { - typealias DictMeta = [String:String] + typealias DictMeta = [String: String] describe("View component") { it("should build a viewController") { diff --git a/Tests/JSONFactoryTests.swift b/Tests/JSONFactoryTests.swift index 1db8284..9cbac44 100644 --- a/Tests/JSONFactoryTests.swift +++ b/Tests/JSONFactoryTests.swift @@ -21,70 +21,39 @@ class JSONFactoryTests: QuickSpec { let jsonObject = try! JSONReader.jsonObject(from: jsonFileName, bundle: bundle)! let json = structure(from: jsonObject) - let tabBarFactory = ClusterFactory.TabBarClusterFactory() - let stackFactory = ClusterFactory.StackClusterFactory() - let buttonFactory = ButtonFactory() - let labelFactory = LabelFactory() - let tableViewFactory = TableViewFactory() - - let factories: [ComponentFactory] = [tabBarFactory, stackFactory, buttonFactory, labelFactory, tableViewFactory] - - describe("Register factories") { - - context("when no factories added") { - let jsonFactory = JSONFactory() - - it("has no factories") { - expect(jsonFactory.factories.count).to(equal(0)) - } - } - - context("when registering factories") { - let jsonFactory = JSONFactory() - let tabBarFactory = ClusterFactory.TabBarClusterFactory() - let stackFactory = ClusterFactory.StackClusterFactory() - jsonFactory.register(tabBarFactory) - jsonFactory.register(stackFactory) - - it("has the registered factories") { - expect(jsonFactory.factories.count).to(equal(2)) - expect(jsonFactory.factories[tabBarFactory.typeName()]).toNot(beNil()) - expect(jsonFactory.factories[stackFactory.typeName()]).toNot(beNil()) - } - - it("does not have non registered factories") { - expect(jsonFactory.factories["foo"]).to(beNil()) - expect(jsonFactory.factories["bar"]).to(beNil()) - } - } - + let viewBuilder: JSONFactory.ViewFactoryBuilder = { (meta: ComponentMeta?) in + Component.view(builder: { _ in UIViewController() }, meta: meta) } + let tabBarBuilder: JSONFactory.ClusterFactoryBuilder = { (children, meta) in + ClusterLayout.tabBar(children: children, meta: meta) + } + let navigationBuilder: JSONFactory.WrapperFactoryBuilder = { (child, meta) in + Component.wrapper(builder: { _ in UINavigationController() }, child: child, meta: meta) + } + let stackBuilder: JSONFactory.ClusterFactoryBuilder = ClusterLayout.stack - describe("Produce") { + describe("Component from builder factories") { it("throws an assertion when the JSON object does not have mandatory keys") { let jsonFactory = JSONFactory() - let faultyProduceNoKeys = { _ = try! jsonFactory.produce(from: ["foo": "bar"]) } - let faultyProduceNoType = { _ = try! jsonFactory.produce(from: ["id": "bar"]) } - expect(faultyProduceNoKeys()).to(throwAssertion()) - expect(faultyProduceNoType()).to(throwAssertion()) + expect { try jsonFactory.component(from: ["foo": "bar"]) }.to(throwError()) + expect { try jsonFactory.component(from: ["id": "bar"]) }.to(throwError()) } context("when no factories are added") { let jsonFactorry = JSONFactory() - it("returns nil when trying to produce") { - let component = try! jsonFactorry.produce(from: json) + it("returns nil when trying to get a component") { + let component = try! jsonFactorry.component(from: json) expect(component).to(beNil()) } } context("when registering some available cluster factories") { let jsonFactory = JSONFactory() - let tabBarFactory = ClusterFactory.TabBarClusterFactory() - jsonFactory.register(tabBarFactory) - let component = try! jsonFactory.produce(from: json) + jsonFactory.register(with: "tabbar", factoryBuilder: tabBarBuilder) + let component = try! jsonFactory.component(from: json) it("handles only those cluster components which have registered factories") { expect(component).toNot(beNil()) @@ -95,9 +64,9 @@ class JSONFactoryTests: QuickSpec { context("when registering all available cluster factories") { let jsonFactory = JSONFactory() - jsonFactory.register(tabBarFactory) - jsonFactory.register(stackFactory) - let component = try! jsonFactory.produce(from: json) + jsonFactory.register(with: "tabbar", factoryBuilder: tabBarBuilder) + jsonFactory.register(with: "stack", factoryBuilder: stackBuilder) + let component = try! jsonFactory.component(from: json) it("handles all cluster components") { expect(component).toNot(beNil()) @@ -124,41 +93,44 @@ class JSONFactoryTests: QuickSpec { context("when registering all available factories") { let jsonFactory = JSONFactory() - factories.forEach { jsonFactory.register($0) } - let component = try! jsonFactory.produce(from: json) + + jsonFactory.register(with: "tabbar", factoryBuilder: tabBarBuilder) + jsonFactory.register(with: "stack", factoryBuilder: stackBuilder) + jsonFactory.register(with: "navigation", factoryBuilder: navigationBuilder) + jsonFactory.register(with: "button", factoryBuilder: viewBuilder) + jsonFactory.register(with: "label", factoryBuilder: viewBuilder) + jsonFactory.register(with: "table_view", factoryBuilder: viewBuilder) + + let component = try! jsonFactory.component(from: json) it("handles all components recursively") { - let firstChildren = component!.children().first! - let secondChildren = component!.children().last! + let firstChildren = component!.children()[0] + let secondChildren = component!.children()[1] + let thirdChildren = component!.children()[2] - expect(firstChildren.children().count).to(equal(1)) + expect(component?.children().count).to(equal(3)) expect(secondChildren.children().count).to(equal(3)) + expect(thirdChildren.children().count).to(equal(1)) expect(firstChildren.children()[0].viewController()).to(beAKindOf(UIViewController.self)) expect(secondChildren.children()[1].viewController()).to(beAKindOf(StackViewController.self)) } + + it("does not handle registered wrapper builders with no children") { + let firstChildren = component!.children()[0] + + expect(firstChildren.children().count).to(equal(1)) + } + + it("handles registered wrapper builders with views") { + let thirdChildren = component!.children()[2] + + expect(thirdChildren.viewController()).to(beAKindOf(UINavigationController.self)) + expect(thirdChildren.children()[0].viewController()).to(beAKindOf(UIViewController.self)) + } } } } - -} - -fileprivate class ButtonFactory: ComponentFactory { - fileprivate func typeName() -> String { - return "button" - } -} - -fileprivate class LabelFactory: ComponentFactory { - fileprivate func typeName() -> String { - return "label" - } -} - -fileprivate class TableViewFactory: ComponentFactory { - fileprivate func typeName() -> String { - return "table_view" - } } fileprivate extension Component { From 06b4bcd49487f2099ec6592836e885d9bb5d1154 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 21:18:43 +0100 Subject: [PATCH 14/29] Remove swiftlint line length since we use the default --- .swiftlint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 37eb96d..1447a3d 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -13,8 +13,6 @@ opt_in_rules: - overridden_super_call - redundant_nil_coalesing # - switch_case_on_newline # broken - -line_length: 120 included: - Source From d8ff008ca403411006791793f556eeac0a55a082 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 21:29:01 +0100 Subject: [PATCH 15/29] Add public init in JSONFactory --- Example/MatrioskaExample/AppDelegate.swift | 1 + Example/Podfile.lock | 4 +- .../Local Podspecs/Matrioska.podspec.json | 10 +- Example/Pods/Manifest.lock | 4 +- Example/Pods/Pods.xcodeproj/project.pbxproj | 629 ++++++++++-------- Source/Factories/JSONFactory.swift | 5 + 6 files changed, 349 insertions(+), 304 deletions(-) diff --git a/Example/MatrioskaExample/AppDelegate.swift b/Example/MatrioskaExample/AppDelegate.swift index c268d18..e15109e 100644 --- a/Example/MatrioskaExample/AppDelegate.swift +++ b/Example/MatrioskaExample/AppDelegate.swift @@ -54,6 +54,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + let _ = JSONFactory() window = UIWindow(frame: UIScreen.main.bounds) window?.rootViewController = rootComponent.viewController() window?.makeKeyAndVisible() diff --git a/Example/Podfile.lock b/Example/Podfile.lock index eb8328d..cc3ff57 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - Matrioska (0.1.0): + - Matrioska (0.1.0-alpha1): - SnapKit (~> 3.0) - SnapKit (3.0.2) @@ -12,7 +12,7 @@ EXTERNAL SOURCES: :path: "../Matrioska.podspec" SPEC CHECKSUMS: - Matrioska: 872321eb578deb7af60323aa61126ee13e0d3fbd + Matrioska: b070c1ad36e64bdf7ab9d847033e2a5e4d2b8ec7 SnapKit: 2e456761aa92d4d4067a7a5594c18769d451a8ad PODFILE CHECKSUM: b63a58336b9471a5dbe1ffe7ea7d0b94f6dbf667 diff --git a/Example/Pods/Local Podspecs/Matrioska.podspec.json b/Example/Pods/Local Podspecs/Matrioska.podspec.json index 0dae4f0..794e896 100644 --- a/Example/Pods/Local Podspecs/Matrioska.podspec.json +++ b/Example/Pods/Local Podspecs/Matrioska.podspec.json @@ -1,19 +1,19 @@ { "name": "Matrioska", - "version": "0.1.0", - "summary": "Dynamically build UI like if you were playing with dolls 🎎", - "description": "Dynamically build UI like if you were playing with dolls 🎎", + "version": "0.1.0-alpha1", + "summary": "🎎 create your layout and define the content of your app in a simple way", + "description": "The vision of Matrioska is to let you build and prototype your app easily, reusing views and layouts as well as dynamically define the content of your app. With Matrioska you can go as far as specifing the content and layout of your views from an external source (e.g. JSON). With this power you can easily change the structure of your app, do A/B testing, staged rollout or prototype.", "homepage": "https://github.com/runtastic/Matrioska", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { - "Alex Manzella": "alex.manzella@runtastic.com" + "Alex Manzella": "manzopower@icloud.com" }, "source": { "git": "https://github.com/runtastic/Matrioska.git", - "tag": "0.1.0" + "tag": "0.1.0-alpha1" }, "platforms": { "ios": "9.0" diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index eb8328d..cc3ff57 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -1,5 +1,5 @@ PODS: - - Matrioska (0.1.0): + - Matrioska (0.1.0-alpha1): - SnapKit (~> 3.0) - SnapKit (3.0.2) @@ -12,7 +12,7 @@ EXTERNAL SOURCES: :path: "../Matrioska.podspec" SPEC CHECKSUMS: - Matrioska: 872321eb578deb7af60323aa61126ee13e0d3fbd + Matrioska: b070c1ad36e64bdf7ab9d847033e2a5e4d2b8ec7 SnapKit: 2e456761aa92d4d4067a7a5594c18769d451a8ad PODFILE CHECKSUM: b63a58336b9471a5dbe1ffe7ea7d0b94f6dbf667 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 0761f18..23bfa8c 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -7,55 +7,57 @@ objects = { /* Begin PBXBuildFile section */ - 0AE1158E0CDCA687184BB93545E2DDC4 /* ConstraintLayoutGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = B525F7008B3760076D71FE29C0859BDC /* ConstraintLayoutGuide.swift */; }; - 0CA1CC90071A7A0A0FA8AABF9DE4C78A /* ConstraintLayoutSupportDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CC7FF80150FA3840AD57BCE994C9FAB /* ConstraintLayoutSupportDSL.swift */; }; - 0D48ACF815644E224F72B7A581662BD6 /* ConstraintMakerRelatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87CCF4DB7EFBDC070B92BFC0BC0D2C8C /* ConstraintMakerRelatable.swift */; }; - 0FF2EDB3BB8E87FC07C96081E1151BC5 /* Matrioska-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F60AEA88E3CE0D8713B97C1DEBA53EBB /* Matrioska-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 153FE752F6AF4C2F16B4251EA307E36E /* ConstraintRelatableTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813C2A5263E149C889A2DF40FFDD89BA /* ConstraintRelatableTarget.swift */; }; + 041A90E3AE3B74B290DB7E16F99E8B5C /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF74E9BB4282FF36A50B1CAD0AA73CBF /* JSONFactory.swift */; }; + 0B505DD464D5BE1BA78617B055800C62 /* UILayoutGuide+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4759EEB4180EAF3DA189AAE28199AC /* UILayoutGuide+Extensions.swift */; }; + 126EB89CB67B59A0D8685DBFAF0C952D /* Debugging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 737B1700C2C19AD11C2872C1C46EC8D4 /* Debugging.swift */; }; + 133D70723039DBFD30A9821FF3B67F8E /* ConstraintInsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F2B728DCF7E9F88008827314C2AE823 /* ConstraintInsetTarget.swift */; }; + 179A9C55D3C2CB469FB2873C792B4580 /* StackCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5934E844D984EA64B0846C3DBD6A618E /* StackCluster.swift */; }; 181680AEA668ED74498F47D277AFBB65 /* Pods-MatrioskaExample-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B6EE3F460D1600FAF881B500AD8D239C /* Pods-MatrioskaExample-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 18F16A18266B47F8F124DFD74D5EED9C /* TabBarCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86396F85619BF19FD0D1DDD19B866116 /* TabBarCluster.swift */; }; - 19B56E02D5A84F8D16A28AE334574232 /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77668395D8EFB67C5E715D53C2A08AEE /* StackViewController.swift */; }; 1A10510204E489B1C3185EF8040C3DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; - 29F69BAABA4AC1D0CF9E6CA60F609CCC /* UILayoutGuide+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4759EEB4180EAF3DA189AAE28199AC /* UILayoutGuide+Extensions.swift */; }; - 2C0043A1DDA0AE4E4294901853AF22B3 /* LayoutConstraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73878F9931EAA78C3DAAF7DDA048218E /* LayoutConstraint.swift */; }; - 2CC672E1B7B37EB84F9A02F734E53879 /* ConstraintMakerPriortizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 261BC3C65CE6EBBED920977848212F6F /* ConstraintMakerPriortizable.swift */; }; - 38E2ED33D11D9549728E6CEF28CA7194 /* ConstraintLayoutGuideDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 446C79107F482F7B2D7E4061657DCA44 /* ConstraintLayoutGuideDSL.swift */; }; - 3F5AE1A2680C6E54D7768E00B1344BDF /* Matrioska-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C42CD47B20D9D5D793C8E970404B33AE /* Matrioska-dummy.m */; }; - 40F142876B84DAB8920417AFB8688109 /* UILayoutSupport+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */; }; - 41ACC6E4E446072BB2C881E7D3EB7ABB /* ConstraintView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E11295210FBB75091BE22529081A2720 /* ConstraintView+Extensions.swift */; }; - 4D7672BBA85792C78D61FC6B17A785D8 /* ConstraintMakerEditable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8ECEBD49CA569FC524CB77465180B6 /* ConstraintMakerEditable.swift */; }; - 509E10C066B9A1A0C78C3A54CBC27503 /* ConstraintAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041C7DFD4E40027278BABCCCD69743B2 /* ConstraintAttributes.swift */; }; - 5BF4021D104E9A957C93626DE0F638A9 /* Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B90EF7CA55AE01CE50EAF5C3C574CDD /* Constraint.swift */; }; - 676D2726F3703B6142FEAD40BD3F29DD /* Debugging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 737B1700C2C19AD11C2872C1C46EC8D4 /* Debugging.swift */; }; - 710422761F48315DFD4EBE7EF2E68A6B /* SnapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C42E6B36692CB79785C933E25719FA6F /* SnapKit.framework */; }; - 748B048208C24C3B98FB3C5F933EB165 /* ConstraintViewDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B78113584563565B18CD0248D9D0A93 /* ConstraintViewDSL.swift */; }; - 7E355F591692F0A1016762C3601266A0 /* Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90B4839DF75CDC9F2CE552657CFE7D8E /* Component.swift */; }; - 7FC7F65533BF08F10D4782A416FC6F50 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; - 80341FF83EA6DD4610E49A91E1DB1701 /* ConstraintOffsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1BDEFD46348EE8C41DE053AEDBFD1B /* ConstraintOffsetTarget.swift */; }; - 874962696034DA9CE3961C347846DC90 /* ClusterLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C464D9E357EA77A27389A13795C2E4B6 /* ClusterLayout.swift */; }; - 8B7CE694DD754553A38EF971D5A438A3 /* ConstraintLayoutSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212E2771F1CD458D21A0FB3CA1C914F3 /* ConstraintLayoutSupport.swift */; }; - 919B11B0542F0A0F1941B5498CACA01C /* ConstraintPriorityTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F0138AE8EA08984375344610BE7E1E /* ConstraintPriorityTarget.swift */; }; - 9238134062D063B69407121DDB578C71 /* ConstraintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBCF77FFA89397B4F19B5CD8A7BDB0A3 /* ConstraintView.swift */; }; - 9E34921BA6D014779714DAA6E21CC611 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; - A112CD92A536944FE8A8A3CD535F218A /* ConstraintDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB70FEBA9EF66CAAA461E6F3F819716B /* ConstraintDescription.swift */; }; - A4DACCE945A0F967C929B82012BF6CA8 /* ConstraintDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE15693153A62AC79B129BA5FFB7C3D /* ConstraintDSL.swift */; }; - A4FCC43261400C01A901083D79F24471 /* UIColor+HEX.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF73CD5DB0A1A54717A1D51A96F5D7B9 /* UIColor+HEX.swift */; }; - A86DA18E9DD3AF69DBA246F2D1BFE6EA /* ConstraintRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4C807430C3A7B9A82E2DDD844C58759 /* ConstraintRelation.swift */; }; - B068DFA1C842BD5271F562E6703C3CCC /* ConstraintItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BEA23F4393572EE30AED50A651CD185 /* ConstraintItem.swift */; }; - B69B6ED614FBE22D362BA3252D9C0B14 /* IntrinsicSizeAwareScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB9AD5B4352D254970FAAC4B20243037 /* IntrinsicSizeAwareScrollView.swift */; }; - C7AE922401F61979E14738D4FDB0E911 /* ConstraintInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = E855200DC6085FF07EBD87301AD370C9 /* ConstraintInsets.swift */; }; + 1DF8EFC779916FCBF31DC1DAB99A576E /* ConstraintLayoutSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212E2771F1CD458D21A0FB3CA1C914F3 /* ConstraintLayoutSupport.swift */; }; + 20215671001C72A928170398AAAE08B2 /* ConstraintOffsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1BDEFD46348EE8C41DE053AEDBFD1B /* ConstraintOffsetTarget.swift */; }; + 2CC8CC2790B55707BD59CCA33A644B5B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; + 3B20C6AEEA10C5EFB6D84650F6E8F391 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; + 3CA21434A05CE7E8A11733B64D157950 /* SnapKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 50BF4E341DC91F918DC3DD74CA4ADC22 /* SnapKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3CD17A81467309C37F0B36EF5443D9ED /* LayoutConstraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73878F9931EAA78C3DAAF7DDA048218E /* LayoutConstraint.swift */; }; + 4D88717E87CDEE1EC2B177AAF0E4AF03 /* ClusterLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF8D738ED38151046BD3CB10EA1C267 /* ClusterLayout.swift */; }; + 4E45062A9BC7EBA3B20FC644237561EF /* ConstraintMakerExtendable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8705AFD8FF18225FA8BB0228A69E72AA /* ConstraintMakerExtendable.swift */; }; + 629195AD09E0EC36A884095B83C42FAE /* ConstraintLayoutGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = B525F7008B3760076D71FE29C0859BDC /* ConstraintLayoutGuide.swift */; }; + 68BEBE9D16D73B3A436E221715EFE264 /* ConstraintDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE15693153A62AC79B129BA5FFB7C3D /* ConstraintDSL.swift */; }; + 6AAB0ED8C24C35578D0291A2BD1E45F2 /* ConstraintMakerEditable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8ECEBD49CA569FC524CB77465180B6 /* ConstraintMakerEditable.swift */; }; + 6BE59B49F53C9BAC90FE42186C335774 /* ConstraintMakerRelatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87CCF4DB7EFBDC070B92BFC0BC0D2C8C /* ConstraintMakerRelatable.swift */; }; + 6EB49641404A46AC062F611FBD8E03B8 /* ConstraintInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = E855200DC6085FF07EBD87301AD370C9 /* ConstraintInsets.swift */; }; + 70DC7BD37F0F2FD3EDF5BE9585193307 /* ConstraintConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597734A7EDE6E13F6D1939A7C7373CD1 /* ConstraintConfig.swift */; }; + 71ED6154E6DCCFA61E10D72C5CA9C4E9 /* ConstraintLayoutGuideDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 446C79107F482F7B2D7E4061657DCA44 /* ConstraintLayoutGuideDSL.swift */; }; + 72E3B01E713D6323A15BFE3E3B3B14FB /* ConstraintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBCF77FFA89397B4F19B5CD8A7BDB0A3 /* ConstraintView.swift */; }; + 7A7E19085DDA606232402F6FAF08E70B /* Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B90EF7CA55AE01CE50EAF5C3C574CDD /* Constraint.swift */; }; + 7B84D63C10DE18A2C5637DD0405A3F58 /* ConstraintRelatableTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813C2A5263E149C889A2DF40FFDD89BA /* ConstraintRelatableTarget.swift */; }; + 7F4A092AA3D9F3DBCADBA83264438BFB /* SnapKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F675DF8551ECAD72F0C6D96084C6DD4 /* SnapKit-dummy.m */; }; + 83EE98CC2495B1A1447187E4C13EEFF7 /* IntrinsicSizeAwareScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83B30B615FC5001A5EE964CD181A810D /* IntrinsicSizeAwareScrollView.swift */; }; + 842839A212DDCB988EA3725BABC60A4F /* ConstraintView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E11295210FBB75091BE22529081A2720 /* ConstraintView+Extensions.swift */; }; + 8D5D20EEBB8F2C28E5C03925C41CC31D /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22FE423B5E8C4A0EE7A6981B4552CAFC /* StackViewController.swift */; }; + 9705059DF02781C6E8AE883A31EF4510 /* ConstraintMultiplierTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0729DC38B02A17974FD7A7238FCB1836 /* ConstraintMultiplierTarget.swift */; }; + 997C1FD0F95EAA044D3932DBF6B871C9 /* TabBarCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39DF0B93DB211453EB990853DFC94773 /* TabBarCluster.swift */; }; + 9D6E5E06D9D5F46EEF357ECD4D06428B /* ConstraintViewDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B78113584563565B18CD0248D9D0A93 /* ConstraintViewDSL.swift */; }; + A1582E9A19722CF0DFC6FD9311BB0F3B /* ConstraintDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB70FEBA9EF66CAAA461E6F3F819716B /* ConstraintDescription.swift */; }; + A95814C2B75B36D83ACFB79445BFB0B8 /* Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = B202FDD7D7CE5B392F1DAF641C0DF8C2 /* Component.swift */; }; + AFB1C9F141D16648933C6A899C3155CD /* ConstraintMakerPriortizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 261BC3C65CE6EBBED920977848212F6F /* ConstraintMakerPriortizable.swift */; }; + B4050AA8BC64E340256364AFB80363C2 /* ConstraintItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BEA23F4393572EE30AED50A651CD185 /* ConstraintItem.swift */; }; + B53D9C904B60B81F7032B71CB2257A96 /* ConstraintConstantTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9319AF949935BC0602093E0830E8B10 /* ConstraintConstantTarget.swift */; }; + B75157C387F26563D8DB70BEE84089D5 /* ConstraintMakerFinalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8AA583273C076DD4A1EBAFDDA0E89A8 /* ConstraintMakerFinalizable.swift */; }; + BA032847ACC21166D8ABFCBBC9D25B23 /* ComponentMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 728A11CB93E2EC8CE71FB3C24F59AB29 /* ComponentMeta.swift */; }; + C05161B317D2D0886E9309D5CF1AD95C /* ConstraintPriorityTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F0138AE8EA08984375344610BE7E1E /* ConstraintPriorityTarget.swift */; }; + C11CBFB7B8B3FED736CFBA11AD4D2823 /* ConstraintAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041C7DFD4E40027278BABCCCD69743B2 /* ConstraintAttributes.swift */; }; + C1D0E260CB3ADCABB69E3EE0FC4EE7AD /* UIColor+HEX.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38AFDA242A23FF991F0CB99BE5AB9B08 /* UIColor+HEX.swift */; }; CBB7C95969423BCFBA41023336DAAAC0 /* Pods-MatrioskaExample-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5821DC17623EC5E1BCAD99DE87342DB1 /* Pods-MatrioskaExample-dummy.m */; }; - D01597BF824BEBCC49EF670825FF664B /* ConstraintMakerFinalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8AA583273C076DD4A1EBAFDDA0E89A8 /* ConstraintMakerFinalizable.swift */; }; - D82C32804457457AAF787544E194BF0F /* ConstraintConstantTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9319AF949935BC0602093E0830E8B10 /* ConstraintConstantTarget.swift */; }; - E36849B6B379820626DB8E98CD77AEBE /* ConstraintConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597734A7EDE6E13F6D1939A7C7373CD1 /* ConstraintConfig.swift */; }; - E8045B16631DC3D0D89AF98CB937E98E /* StackCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 996B2CFA945E1ECA2E39EFCC886C0D9E /* StackCluster.swift */; }; - E8836C5914A7CF593D95540AC88152B6 /* ConstraintMultiplierTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0729DC38B02A17974FD7A7238FCB1836 /* ConstraintMultiplierTarget.swift */; }; - E9294CC2D46E7EC701F8D69D0D2BB360 /* ComponentMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CE616969B59014211F07875DEBE4D1A /* ComponentMeta.swift */; }; - EBD364FC2D77B0CEBD95739176AC7554 /* ConstraintMaker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6167E299BA9862893D87DDBF170B70 /* ConstraintMaker.swift */; }; - F42A10C39F9C4369E0097D5F80CAC633 /* ConstraintMakerExtendable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8705AFD8FF18225FA8BB0228A69E72AA /* ConstraintMakerExtendable.swift */; }; - F74AF1EEA6215F5DF102CF506E367C2F /* ConstraintInsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F2B728DCF7E9F88008827314C2AE823 /* ConstraintInsetTarget.swift */; }; - FACA306DB85B47868AB77D9BA699ED9D /* SnapKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F675DF8551ECAD72F0C6D96084C6DD4 /* SnapKit-dummy.m */; }; - FAE12DA5B87E48A626E5D555C9DC925F /* SnapKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 50BF4E341DC91F918DC3DD74CA4ADC22 /* SnapKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CF9F59E6FDCBCA77A2DA99D235CD96BD /* ConstraintMaker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6167E299BA9862893D87DDBF170B70 /* ConstraintMaker.swift */; }; + D591C8546B6B92CF98C179090F5EACEE /* ConstraintLayoutSupportDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CC7FF80150FA3840AD57BCE994C9FAB /* ConstraintLayoutSupportDSL.swift */; }; + DF775D359AA8965680EAD71915259BF6 /* JSONReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BBA40058FEAC16CCFCC20BD48210286 /* JSONReader.swift */; }; + F5243185C7C8DDDF1FC409EB6A2377E5 /* SnapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C42E6B36692CB79785C933E25719FA6F /* SnapKit.framework */; }; + F53FF4B422C72CA8548B2FFE14D07866 /* ConstraintRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4C807430C3A7B9A82E2DDD844C58759 /* ConstraintRelation.swift */; }; + F5D5C02BB15D2CB0C8F5C3E0B772EB6A /* UILayoutSupport+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */; }; + F5FD77D0ECFFE5D064ABC734AC57C301 /* Matrioska-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 934F66C37A9D2EFA8F7CB3A14EED2333 /* Matrioska-dummy.m */; }; + FFA79DFC7102D5B7AA8A5BA23DFCE4AA /* Matrioska-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C64518B050CD965FAC8E4C4C1EA2BEA /* Matrioska-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -63,21 +65,21 @@ isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 7F92267D248C0DC51DD67F04A8C88D7F; + remoteGlobalIDString = CDAED52734CDEA3F5B1B2C7B70845F6E; remoteInfo = SnapKit; }; 7440F439AF8645D02B61F20D1643A885 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 3816F883EEBF086538810087AE362D33; + remoteGlobalIDString = 0FB92CB89E72923ECD89B42D50D69D22; remoteInfo = Matrioska; }; - 9E1E9DC91E501879E381666B58BCCF73 /* PBXContainerItemProxy */ = { + D22C25AE02B1FC6CB375F827884BD61F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 7F92267D248C0DC51DD67F04A8C88D7F; + remoteGlobalIDString = CDAED52734CDEA3F5B1B2C7B70845F6E; remoteInfo = SnapKit; }; /* End PBXContainerItemProxy section */ @@ -86,60 +88,63 @@ 041C7DFD4E40027278BABCCCD69743B2 /* ConstraintAttributes.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintAttributes.swift; path = Source/ConstraintAttributes.swift; sourceTree = ""; }; 0729DC38B02A17974FD7A7238FCB1836 /* ConstraintMultiplierTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMultiplierTarget.swift; path = Source/ConstraintMultiplierTarget.swift; sourceTree = ""; }; 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UILayoutSupport+Extensions.swift"; path = "Source/UILayoutSupport+Extensions.swift"; sourceTree = ""; }; - 1367C6F5311D05FDFBA37E96EE514019 /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 1367C6F5311D05FDFBA37E96EE514019 /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SnapKit.framework; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 14426FA5248A96FBC6A531879E24CFA5 /* SnapKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-prefix.pch"; sourceTree = ""; }; - 1CE616969B59014211F07875DEBE4D1A /* ComponentMeta.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 1F2B728DCF7E9F88008827314C2AE823 /* ConstraintInsetTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintInsetTarget.swift; path = Source/ConstraintInsetTarget.swift; sourceTree = ""; }; 212E2771F1CD458D21A0FB3CA1C914F3 /* ConstraintLayoutSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutSupport.swift; path = Source/ConstraintLayoutSupport.swift; sourceTree = ""; }; + 22FE423B5E8C4A0EE7A6981B4552CAFC /* StackViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackViewController.swift; sourceTree = ""; }; 261BC3C65CE6EBBED920977848212F6F /* ConstraintMakerPriortizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerPriortizable.swift; path = Source/ConstraintMakerPriortizable.swift; sourceTree = ""; }; 265D2639CCA0F9886680E5E6CA7A3943 /* Pods-MatrioskaExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MatrioskaExample.release.xcconfig"; sourceTree = ""; }; + 38AFDA242A23FF991F0CB99BE5AB9B08 /* UIColor+HEX.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+HEX.swift"; sourceTree = ""; }; + 39DF0B93DB211453EB990853DFC94773 /* TabBarCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TabBarCluster.swift; sourceTree = ""; }; 3A6167E299BA9862893D87DDBF170B70 /* ConstraintMaker.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMaker.swift; path = Source/ConstraintMaker.swift; sourceTree = ""; }; 3B90EF7CA55AE01CE50EAF5C3C574CDD /* Constraint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Constraint.swift; path = Source/Constraint.swift; sourceTree = ""; }; 3FE15693153A62AC79B129BA5FFB7C3D /* ConstraintDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintDSL.swift; path = Source/ConstraintDSL.swift; sourceTree = ""; }; 446C79107F482F7B2D7E4061657DCA44 /* ConstraintLayoutGuideDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutGuideDSL.swift; path = Source/ConstraintLayoutGuideDSL.swift; sourceTree = ""; }; + 4AFD95C089AB657DC457D673DF1D5B11 /* Matrioska.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Matrioska.xcconfig; sourceTree = ""; }; 50BF4E341DC91F918DC3DD74CA4ADC22 /* SnapKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-umbrella.h"; sourceTree = ""; }; 5821DC17623EC5E1BCAD99DE87342DB1 /* Pods-MatrioskaExample-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-MatrioskaExample-dummy.m"; sourceTree = ""; }; + 5934E844D984EA64B0846C3DBD6A618E /* StackCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackCluster.swift; sourceTree = ""; }; 597734A7EDE6E13F6D1939A7C7373CD1 /* ConstraintConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintConfig.swift; path = Source/ConstraintConfig.swift; sourceTree = ""; }; - 59EB19EA9AA726833FC7C108CBCEC446 /* Matrioska-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Matrioska-prefix.pch"; sourceTree = ""; }; - 5BA6CD5E29F1E7C8AEC6D24F61B848F4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6C6AA23AB7E7C6088CD75971FB1093D9 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6CC7FF80150FA3840AD57BCE994C9FAB /* ConstraintLayoutSupportDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutSupportDSL.swift; path = Source/ConstraintLayoutSupportDSL.swift; sourceTree = ""; }; + 728A11CB93E2EC8CE71FB3C24F59AB29 /* ComponentMeta.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; }; 737B1700C2C19AD11C2872C1C46EC8D4 /* Debugging.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debugging.swift; path = Source/Debugging.swift; sourceTree = ""; }; 73878F9931EAA78C3DAAF7DDA048218E /* LayoutConstraint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LayoutConstraint.swift; path = Source/LayoutConstraint.swift; sourceTree = ""; }; - 77668395D8EFB67C5E715D53C2A08AEE /* StackViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackViewController.swift; sourceTree = ""; }; 7B4759EEB4180EAF3DA189AAE28199AC /* UILayoutGuide+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UILayoutGuide+Extensions.swift"; path = "Source/UILayoutGuide+Extensions.swift"; sourceTree = ""; }; 7BEA23F4393572EE30AED50A651CD185 /* ConstraintItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintItem.swift; path = Source/ConstraintItem.swift; sourceTree = ""; }; 813C2A5263E149C889A2DF40FFDD89BA /* ConstraintRelatableTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintRelatableTarget.swift; path = Source/ConstraintRelatableTarget.swift; sourceTree = ""; }; + 83B30B615FC5001A5EE964CD181A810D /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; 857837F254F449F3BC19F608228401E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 86396F85619BF19FD0D1DDD19B866116 /* TabBarCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TabBarCluster.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + 8616FCCE508F64F7355C8931296092E0 /* Matrioska-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Matrioska-prefix.pch"; sourceTree = ""; }; 8705AFD8FF18225FA8BB0228A69E72AA /* ConstraintMakerExtendable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerExtendable.swift; path = Source/ConstraintMakerExtendable.swift; sourceTree = ""; }; + 8785ED0787E328B8ADE545DD56AD1B6F /* Matrioska.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Matrioska.modulemap; sourceTree = ""; }; 87CCF4DB7EFBDC070B92BFC0BC0D2C8C /* ConstraintMakerRelatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerRelatable.swift; path = Source/ConstraintMakerRelatable.swift; sourceTree = ""; }; 8B78113584563565B18CD0248D9D0A93 /* ConstraintViewDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintViewDSL.swift; path = Source/ConstraintViewDSL.swift; sourceTree = ""; }; - 90B4839DF75CDC9F2CE552657CFE7D8E /* Component.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 8BBA40058FEAC16CCFCC20BD48210286 /* JSONReader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONReader.swift; sourceTree = ""; }; + 934F66C37A9D2EFA8F7CB3A14EED2333 /* Matrioska-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Matrioska-dummy.m"; sourceTree = ""; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 97F0138AE8EA08984375344610BE7E1E /* ConstraintPriorityTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintPriorityTarget.swift; path = Source/ConstraintPriorityTarget.swift; sourceTree = ""; }; - 996B2CFA945E1ECA2E39EFCC886C0D9E /* StackCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackCluster.swift; sourceTree = ""; }; + 9C64518B050CD965FAC8E4C4C1EA2BEA /* Matrioska-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Matrioska-umbrella.h"; sourceTree = ""; }; 9F675DF8551ECAD72F0C6D96084C6DD4 /* SnapKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SnapKit-dummy.m"; sourceTree = ""; }; 9F8ECEBD49CA569FC524CB77465180B6 /* ConstraintMakerEditable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerEditable.swift; path = Source/ConstraintMakerEditable.swift; sourceTree = ""; }; - A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9FF8D738ED38151046BD3CB10EA1C267 /* ClusterLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; + A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Matrioska.framework; path = Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A77A10AC741F15F2412809F03C82B8FD /* Pods-MatrioskaExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MatrioskaExample.debug.xcconfig"; sourceTree = ""; }; AF1BDEFD46348EE8C41DE053AEDBFD1B /* ConstraintOffsetTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintOffsetTarget.swift; path = Source/ConstraintOffsetTarget.swift; sourceTree = ""; }; - B4E3E0231330567ABB197F1F0DA70261 /* Pods-MatrioskaExample.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-MatrioskaExample.modulemap"; sourceTree = ""; }; + B202FDD7D7CE5B392F1DAF641C0DF8C2 /* Component.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; + B4E3E0231330567ABB197F1F0DA70261 /* Pods-MatrioskaExample.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-MatrioskaExample.modulemap"; sourceTree = ""; }; B525F7008B3760076D71FE29C0859BDC /* ConstraintLayoutGuide.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutGuide.swift; path = Source/ConstraintLayoutGuide.swift; sourceTree = ""; }; B6EE3F460D1600FAF881B500AD8D239C /* Pods-MatrioskaExample-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-MatrioskaExample-umbrella.h"; sourceTree = ""; }; - B7D4645BD3C0100FB7E1B4A6FDC96E0B /* SnapKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = SnapKit.modulemap; sourceTree = ""; }; - BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MatrioskaExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B7D4645BD3C0100FB7E1B4A6FDC96E0B /* SnapKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = SnapKit.modulemap; sourceTree = ""; }; + BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_MatrioskaExample.framework; path = "Pods-MatrioskaExample.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; BF2B524D7E160AA0C293D6D884CE4537 /* Pods-MatrioskaExample-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MatrioskaExample-acknowledgements.plist"; sourceTree = ""; }; - BF6FD1FF6B76CA2F5ED2E314D51E53CF /* Matrioska.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Matrioska.xcconfig; sourceTree = ""; }; - BF73CD5DB0A1A54717A1D51A96F5D7B9 /* UIColor+HEX.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+HEX.swift"; sourceTree = ""; }; - C42CD47B20D9D5D793C8E970404B33AE /* Matrioska-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Matrioska-dummy.m"; sourceTree = ""; }; C42E6B36692CB79785C933E25719FA6F /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C464D9E357EA77A27389A13795C2E4B6 /* ClusterLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; C4C807430C3A7B9A82E2DDD844C58759 /* ConstraintRelation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintRelation.swift; path = Source/ConstraintRelation.swift; sourceTree = ""; }; CA274E8C59BA433F4975D535FA594EFA /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; CB70FEBA9EF66CAAA461E6F3F819716B /* ConstraintDescription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintDescription.swift; path = Source/ConstraintDescription.swift; sourceTree = ""; }; CCA5B74A364868C16F69B955B38B05DD /* Pods-MatrioskaExample-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MatrioskaExample-acknowledgements.markdown"; sourceTree = ""; }; CFE99A1044589BB7662A737268BCD6E7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D59F8E5674A96129F9CF53C24D3B27BC /* Matrioska.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Matrioska.modulemap; sourceTree = ""; }; D61CFA974F0733418729D3C1AB335DFA /* Pods-MatrioskaExample-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MatrioskaExample-frameworks.sh"; sourceTree = ""; }; D8AA583273C076DD4A1EBAFDDA0E89A8 /* ConstraintMakerFinalizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerFinalizable.swift; path = Source/ConstraintMakerFinalizable.swift; sourceTree = ""; }; E11295210FBB75091BE22529081A2720 /* ConstraintView+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ConstraintView+Extensions.swift"; path = "Source/ConstraintView+Extensions.swift"; sourceTree = ""; }; @@ -147,26 +152,25 @@ E855200DC6085FF07EBD87301AD370C9 /* ConstraintInsets.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintInsets.swift; path = Source/ConstraintInsets.swift; sourceTree = ""; }; E885DC7A2C93B352F3CCBAF6C4F30F7F /* SnapKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SnapKit.xcconfig; sourceTree = ""; }; EBCF77FFA89397B4F19B5CD8A7BDB0A3 /* ConstraintView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintView.swift; path = Source/ConstraintView.swift; sourceTree = ""; }; - F60AEA88E3CE0D8713B97C1DEBA53EBB /* Matrioska-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Matrioska-umbrella.h"; sourceTree = ""; }; F9319AF949935BC0602093E0830E8B10 /* ConstraintConstantTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintConstantTarget.swift; path = Source/ConstraintConstantTarget.swift; sourceTree = ""; }; - FB9AD5B4352D254970FAAC4B20243037 /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; + FF74E9BB4282FF36A50B1CAD0AA73CBF /* JSONFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 59C3216DA3D2FBFB7F34533B021AB54A /* Frameworks */ = { + AD6733DC47BCB886AD7EE3A48487916F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9E34921BA6D014779714DAA6E21CC611 /* Foundation.framework in Frameworks */, + 2CC8CC2790B55707BD59CCA33A644B5B /* Foundation.framework in Frameworks */, + F5243185C7C8DDDF1FC409EB6A2377E5 /* SnapKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 7CAEAACF7FD05F5B0349138336B8858E /* Frameworks */ = { + AF7CD9D75CED7FB190CBE16A81FA9FD5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7FC7F65533BF08F10D4782A416FC6F50 /* Foundation.framework in Frameworks */, - 710422761F48315DFD4EBE7EF2E68A6B /* SnapKit.framework in Frameworks */, + 3B20C6AEEA10C5EFB6D84650F6E8F391 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -181,16 +185,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 011F47FBF71151B2B1B20E8272D644CF /* Matrioska */ = { - isa = PBXGroup; - children = ( - 5330007F28B2347B26BAC22427735B72 /* Source */, - 9FBE26A282F72AA8D9B2F668D58BBBF3 /* Support Files */, - ); - name = Matrioska; - path = ../..; - sourceTree = ""; - }; 05703C849B29D1EF8195C8FE0EC6AF9E /* SnapKit */ = { isa = PBXGroup; children = ( @@ -227,9 +221,23 @@ 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */, 458932A7F6390E9028454F0A27A50A13 /* Support Files */, ); + name = SnapKit; path = SnapKit; sourceTree = ""; }; + 070EA31170DA453764D98F1A95C81BFF /* Source */ = { + isa = PBXGroup; + children = ( + ACD9699D6D5D155BED40EEF305C3EA7A /* Components */, + A172800B7038173179E2B03092F73359 /* Factories */, + A8307A1217EB98358B55FB1954EEFF9A /* Helpers */, + F792648E4D585EA47DDFAEBCEC848FC5 /* JSON */, + D9E91DDF8A1478085298BD150DA2E15C /* Views */, + ); + name = Source; + path = Source; + sourceTree = ""; + }; 458932A7F6390E9028454F0A27A50A13 /* Support Files */ = { isa = PBXGroup; children = ( @@ -244,20 +252,6 @@ path = "../Target Support Files/SnapKit"; sourceTree = ""; }; - 5330007F28B2347B26BAC22427735B72 /* Source */ = { - isa = PBXGroup; - children = ( - C464D9E357EA77A27389A13795C2E4B6 /* ClusterLayout.swift */, - 90B4839DF75CDC9F2CE552657CFE7D8E /* Component.swift */, - 1CE616969B59014211F07875DEBE4D1A /* ComponentMeta.swift */, - 996B2CFA945E1ECA2E39EFCC886C0D9E /* StackCluster.swift */, - 86396F85619BF19FD0D1DDD19B866116 /* TabBarCluster.swift */, - 8A1E1FBD297185C40000233E7909F3FB /* Helpers */, - D0642A2099E4BAF3C79FBF2A587950B7 /* Views */, - ); - path = Source; - sourceTree = ""; - }; 6FBBCFDAAB509CB53C9C9421A31BD9FA /* Pods-MatrioskaExample */ = { isa = PBXGroup; children = ( @@ -276,6 +270,16 @@ path = "Target Support Files/Pods-MatrioskaExample"; sourceTree = ""; }; + 766969EC9F3CD004BD796AE8853B04F6 /* Matrioska */ = { + isa = PBXGroup; + children = ( + 070EA31170DA453764D98F1A95C81BFF /* Source */, + 83C7BF7B0C6F2CD6FD52883E1E67A3CE /* Support Files */, + ); + name = Matrioska; + path = ../..; + sourceTree = ""; + }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( @@ -288,28 +292,34 @@ ); sourceTree = ""; }; - 89FF8C24D82A3BBAAF0E3412465917A7 /* Products */ = { + 83C7BF7B0C6F2CD6FD52883E1E67A3CE /* Support Files */ = { isa = PBXGroup; children = ( - A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */, - BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */, - 1367C6F5311D05FDFBA37E96EE514019 /* SnapKit.framework */, + 6C6AA23AB7E7C6088CD75971FB1093D9 /* Info.plist */, + 8785ED0787E328B8ADE545DD56AD1B6F /* Matrioska.modulemap */, + 4AFD95C089AB657DC457D673DF1D5B11 /* Matrioska.xcconfig */, + 934F66C37A9D2EFA8F7CB3A14EED2333 /* Matrioska-dummy.m */, + 8616FCCE508F64F7355C8931296092E0 /* Matrioska-prefix.pch */, + 9C64518B050CD965FAC8E4C4C1EA2BEA /* Matrioska-umbrella.h */, ); - name = Products; + name = "Support Files"; + path = "Example/Pods/Target Support Files/Matrioska"; sourceTree = ""; }; - 8A1E1FBD297185C40000233E7909F3FB /* Helpers */ = { + 89FF8C24D82A3BBAAF0E3412465917A7 /* Products */ = { isa = PBXGroup; children = ( - BF73CD5DB0A1A54717A1D51A96F5D7B9 /* UIColor+HEX.swift */, + A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */, + BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */, + 1367C6F5311D05FDFBA37E96EE514019 /* SnapKit.framework */, ); - path = Helpers; + name = Products; sourceTree = ""; }; 9396AC7FE706F8EC15E2DB9C156DE03F /* Development Pods */ = { isa = PBXGroup; children = ( - 011F47FBF71151B2B1B20E8272D644CF /* Matrioska */, + 766969EC9F3CD004BD796AE8853B04F6 /* Matrioska */, ); name = "Development Pods"; sourceTree = ""; @@ -322,35 +332,43 @@ name = "Targets Support Files"; sourceTree = ""; }; - 9FBE26A282F72AA8D9B2F668D58BBBF3 /* Support Files */ = { + A172800B7038173179E2B03092F73359 /* Factories */ = { isa = PBXGroup; children = ( - 5BA6CD5E29F1E7C8AEC6D24F61B848F4 /* Info.plist */, - D59F8E5674A96129F9CF53C24D3B27BC /* Matrioska.modulemap */, - BF6FD1FF6B76CA2F5ED2E314D51E53CF /* Matrioska.xcconfig */, - C42CD47B20D9D5D793C8E970404B33AE /* Matrioska-dummy.m */, - 59EB19EA9AA726833FC7C108CBCEC446 /* Matrioska-prefix.pch */, - F60AEA88E3CE0D8713B97C1DEBA53EBB /* Matrioska-umbrella.h */, + FF74E9BB4282FF36A50B1CAD0AA73CBF /* JSONFactory.swift */, ); - name = "Support Files"; - path = "Example/Pods/Target Support Files/Matrioska"; + name = Factories; + path = Factories; sourceTree = ""; }; - C75C61F59D5032C1A587740F37062DA5 /* iOS */ = { + A8307A1217EB98358B55FB1954EEFF9A /* Helpers */ = { isa = PBXGroup; children = ( - 857837F254F449F3BC19F608228401E0 /* Foundation.framework */, + 38AFDA242A23FF991F0CB99BE5AB9B08 /* UIColor+HEX.swift */, ); - name = iOS; + name = Helpers; + path = Helpers; + sourceTree = ""; + }; + ACD9699D6D5D155BED40EEF305C3EA7A /* Components */ = { + isa = PBXGroup; + children = ( + 9FF8D738ED38151046BD3CB10EA1C267 /* ClusterLayout.swift */, + B202FDD7D7CE5B392F1DAF641C0DF8C2 /* Component.swift */, + 728A11CB93E2EC8CE71FB3C24F59AB29 /* ComponentMeta.swift */, + 5934E844D984EA64B0846C3DBD6A618E /* StackCluster.swift */, + 39DF0B93DB211453EB990853DFC94773 /* TabBarCluster.swift */, + ); + name = Components; + path = Components; sourceTree = ""; }; - D0642A2099E4BAF3C79FBF2A587950B7 /* Views */ = { + C75C61F59D5032C1A587740F37062DA5 /* iOS */ = { isa = PBXGroup; children = ( - FB9AD5B4352D254970FAAC4B20243037 /* IntrinsicSizeAwareScrollView.swift */, - 77668395D8EFB67C5E715D53C2A08AEE /* StackViewController.swift */, + 857837F254F449F3BC19F608228401E0 /* Foundation.framework */, ); - path = Views; + name = iOS; sourceTree = ""; }; D8B25C6DF01BE2C3F2FA6A25AEE6417A /* Frameworks */ = { @@ -362,6 +380,25 @@ name = Frameworks; sourceTree = ""; }; + D9E91DDF8A1478085298BD150DA2E15C /* Views */ = { + isa = PBXGroup; + children = ( + 83B30B615FC5001A5EE964CD181A810D /* IntrinsicSizeAwareScrollView.swift */, + 22FE423B5E8C4A0EE7A6981B4552CAFC /* StackViewController.swift */, + ); + name = Views; + path = Views; + sourceTree = ""; + }; + F792648E4D585EA47DDFAEBCEC848FC5 /* JSON */ = { + isa = PBXGroup; + children = ( + 8BBA40058FEAC16CCFCC20BD48210286 /* JSONReader.swift */, + ); + name = JSON; + path = JSON; + sourceTree = ""; + }; FCB3E800ADEFE141C46C6B85E298DF53 /* Pods */ = { isa = PBXGroup; children = ( @@ -373,19 +410,19 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 93DF00053113FC9602080A0A73E73F85 /* Headers */ = { + 7D46B23F03B128D542F51E5734FFB2FE /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - FAE12DA5B87E48A626E5D555C9DC925F /* SnapKit-umbrella.h in Headers */, + 3CA21434A05CE7E8A11733B64D157950 /* SnapKit-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - D54A246A8F14855D47D7F83EC7C70C03 /* Headers */ = { + DB78BFDDB186C820313F3BED4D84C776 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 0FF2EDB3BB8E87FC07C96081E1151BC5 /* Matrioska-umbrella.h in Headers */, + FFA79DFC7102D5B7AA8A5BA23DFCE4AA /* Matrioska-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -400,6 +437,24 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 0FB92CB89E72923ECD89B42D50D69D22 /* Matrioska */ = { + isa = PBXNativeTarget; + buildConfigurationList = 07CAD9B5E98A2F5F57D96D1174303EA2 /* Build configuration list for PBXNativeTarget "Matrioska" */; + buildPhases = ( + B5E940610356DF418059D687BF3F2EDA /* Sources */, + AD6733DC47BCB886AD7EE3A48487916F /* Frameworks */, + DB78BFDDB186C820313F3BED4D84C776 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 82838968315A9F075EDF472C8A327DBE /* PBXTargetDependency */, + ); + name = Matrioska; + productName = Matrioska; + productReference = A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */; + productType = "com.apple.product-type.framework"; + }; 2C79BD22007D5C4563E92D122F63A24D /* Pods-MatrioskaExample */ = { isa = PBXNativeTarget; buildConfigurationList = E9FE26A96651107F552176A1429EE6EE /* Build configuration list for PBXNativeTarget "Pods-MatrioskaExample" */; @@ -419,31 +474,13 @@ productReference = BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */; productType = "com.apple.product-type.framework"; }; - 3816F883EEBF086538810087AE362D33 /* Matrioska */ = { - isa = PBXNativeTarget; - buildConfigurationList = 08FD2885A6C888E60B5F422919B65046 /* Build configuration list for PBXNativeTarget "Matrioska" */; - buildPhases = ( - 50EB1FACAD58412C7382C53DD34AB7E6 /* Sources */, - 7CAEAACF7FD05F5B0349138336B8858E /* Frameworks */, - D54A246A8F14855D47D7F83EC7C70C03 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - A53A4B5FBBA7CBB164759FE82EC8318A /* PBXTargetDependency */, - ); - name = Matrioska; - productName = Matrioska; - productReference = A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */; - productType = "com.apple.product-type.framework"; - }; - 7F92267D248C0DC51DD67F04A8C88D7F /* SnapKit */ = { + CDAED52734CDEA3F5B1B2C7B70845F6E /* SnapKit */ = { isa = PBXNativeTarget; - buildConfigurationList = E6C321BAD2A9074A4477A3D3384A0169 /* Build configuration list for PBXNativeTarget "SnapKit" */; + buildConfigurationList = 22CCD7F81E4357523AC131CF0D6B7A14 /* Build configuration list for PBXNativeTarget "SnapKit" */; buildPhases = ( - 8E8DED1B865F8B62A1B83D6B5396DFA7 /* Sources */, - 59C3216DA3D2FBFB7F34533B021AB54A /* Frameworks */, - 93DF00053113FC9602080A0A73E73F85 /* Headers */, + C2A00187E51C3D1AED52AB96929EFFC4 /* Sources */, + AF7CD9D75CED7FB190CBE16A81FA9FD5 /* Frameworks */, + 7D46B23F03B128D542F51E5734FFB2FE /* Headers */, ); buildRules = ( ); @@ -475,74 +512,76 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 3816F883EEBF086538810087AE362D33 /* Matrioska */, + 0FB92CB89E72923ECD89B42D50D69D22 /* Matrioska */, 2C79BD22007D5C4563E92D122F63A24D /* Pods-MatrioskaExample */, - 7F92267D248C0DC51DD67F04A8C88D7F /* SnapKit */, + CDAED52734CDEA3F5B1B2C7B70845F6E /* SnapKit */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 50EB1FACAD58412C7382C53DD34AB7E6 /* Sources */ = { + 924105E89E8A05BD7858ED2B80B08D1E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 874962696034DA9CE3961C347846DC90 /* ClusterLayout.swift in Sources */, - 7E355F591692F0A1016762C3601266A0 /* Component.swift in Sources */, - E9294CC2D46E7EC701F8D69D0D2BB360 /* ComponentMeta.swift in Sources */, - B69B6ED614FBE22D362BA3252D9C0B14 /* IntrinsicSizeAwareScrollView.swift in Sources */, - 3F5AE1A2680C6E54D7768E00B1344BDF /* Matrioska-dummy.m in Sources */, - E8045B16631DC3D0D89AF98CB937E98E /* StackCluster.swift in Sources */, - 19B56E02D5A84F8D16A28AE334574232 /* StackViewController.swift in Sources */, - 18F16A18266B47F8F124DFD74D5EED9C /* TabBarCluster.swift in Sources */, - A4FCC43261400C01A901083D79F24471 /* UIColor+HEX.swift in Sources */, + CBB7C95969423BCFBA41023336DAAAC0 /* Pods-MatrioskaExample-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 8E8DED1B865F8B62A1B83D6B5396DFA7 /* Sources */ = { + B5E940610356DF418059D687BF3F2EDA /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5BF4021D104E9A957C93626DE0F638A9 /* Constraint.swift in Sources */, - 509E10C066B9A1A0C78C3A54CBC27503 /* ConstraintAttributes.swift in Sources */, - E36849B6B379820626DB8E98CD77AEBE /* ConstraintConfig.swift in Sources */, - D82C32804457457AAF787544E194BF0F /* ConstraintConstantTarget.swift in Sources */, - A112CD92A536944FE8A8A3CD535F218A /* ConstraintDescription.swift in Sources */, - A4DACCE945A0F967C929B82012BF6CA8 /* ConstraintDSL.swift in Sources */, - C7AE922401F61979E14738D4FDB0E911 /* ConstraintInsets.swift in Sources */, - F74AF1EEA6215F5DF102CF506E367C2F /* ConstraintInsetTarget.swift in Sources */, - B068DFA1C842BD5271F562E6703C3CCC /* ConstraintItem.swift in Sources */, - 0AE1158E0CDCA687184BB93545E2DDC4 /* ConstraintLayoutGuide.swift in Sources */, - 38E2ED33D11D9549728E6CEF28CA7194 /* ConstraintLayoutGuideDSL.swift in Sources */, - 8B7CE694DD754553A38EF971D5A438A3 /* ConstraintLayoutSupport.swift in Sources */, - 0CA1CC90071A7A0A0FA8AABF9DE4C78A /* ConstraintLayoutSupportDSL.swift in Sources */, - EBD364FC2D77B0CEBD95739176AC7554 /* ConstraintMaker.swift in Sources */, - 4D7672BBA85792C78D61FC6B17A785D8 /* ConstraintMakerEditable.swift in Sources */, - F42A10C39F9C4369E0097D5F80CAC633 /* ConstraintMakerExtendable.swift in Sources */, - D01597BF824BEBCC49EF670825FF664B /* ConstraintMakerFinalizable.swift in Sources */, - 2CC672E1B7B37EB84F9A02F734E53879 /* ConstraintMakerPriortizable.swift in Sources */, - 0D48ACF815644E224F72B7A581662BD6 /* ConstraintMakerRelatable.swift in Sources */, - E8836C5914A7CF593D95540AC88152B6 /* ConstraintMultiplierTarget.swift in Sources */, - 80341FF83EA6DD4610E49A91E1DB1701 /* ConstraintOffsetTarget.swift in Sources */, - 919B11B0542F0A0F1941B5498CACA01C /* ConstraintPriorityTarget.swift in Sources */, - 153FE752F6AF4C2F16B4251EA307E36E /* ConstraintRelatableTarget.swift in Sources */, - A86DA18E9DD3AF69DBA246F2D1BFE6EA /* ConstraintRelation.swift in Sources */, - 41ACC6E4E446072BB2C881E7D3EB7ABB /* ConstraintView+Extensions.swift in Sources */, - 9238134062D063B69407121DDB578C71 /* ConstraintView.swift in Sources */, - 748B048208C24C3B98FB3C5F933EB165 /* ConstraintViewDSL.swift in Sources */, - 676D2726F3703B6142FEAD40BD3F29DD /* Debugging.swift in Sources */, - 2C0043A1DDA0AE4E4294901853AF22B3 /* LayoutConstraint.swift in Sources */, - FACA306DB85B47868AB77D9BA699ED9D /* SnapKit-dummy.m in Sources */, - 29F69BAABA4AC1D0CF9E6CA60F609CCC /* UILayoutGuide+Extensions.swift in Sources */, - 40F142876B84DAB8920417AFB8688109 /* UILayoutSupport+Extensions.swift in Sources */, + 4D88717E87CDEE1EC2B177AAF0E4AF03 /* ClusterLayout.swift in Sources */, + A95814C2B75B36D83ACFB79445BFB0B8 /* Component.swift in Sources */, + BA032847ACC21166D8ABFCBBC9D25B23 /* ComponentMeta.swift in Sources */, + 83EE98CC2495B1A1447187E4C13EEFF7 /* IntrinsicSizeAwareScrollView.swift in Sources */, + 041A90E3AE3B74B290DB7E16F99E8B5C /* JSONFactory.swift in Sources */, + DF775D359AA8965680EAD71915259BF6 /* JSONReader.swift in Sources */, + F5FD77D0ECFFE5D064ABC734AC57C301 /* Matrioska-dummy.m in Sources */, + 179A9C55D3C2CB469FB2873C792B4580 /* StackCluster.swift in Sources */, + 8D5D20EEBB8F2C28E5C03925C41CC31D /* StackViewController.swift in Sources */, + 997C1FD0F95EAA044D3932DBF6B871C9 /* TabBarCluster.swift in Sources */, + C1D0E260CB3ADCABB69E3EE0FC4EE7AD /* UIColor+HEX.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 924105E89E8A05BD7858ED2B80B08D1E /* Sources */ = { + C2A00187E51C3D1AED52AB96929EFFC4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CBB7C95969423BCFBA41023336DAAAC0 /* Pods-MatrioskaExample-dummy.m in Sources */, + 7A7E19085DDA606232402F6FAF08E70B /* Constraint.swift in Sources */, + C11CBFB7B8B3FED736CFBA11AD4D2823 /* ConstraintAttributes.swift in Sources */, + 70DC7BD37F0F2FD3EDF5BE9585193307 /* ConstraintConfig.swift in Sources */, + B53D9C904B60B81F7032B71CB2257A96 /* ConstraintConstantTarget.swift in Sources */, + A1582E9A19722CF0DFC6FD9311BB0F3B /* ConstraintDescription.swift in Sources */, + 68BEBE9D16D73B3A436E221715EFE264 /* ConstraintDSL.swift in Sources */, + 6EB49641404A46AC062F611FBD8E03B8 /* ConstraintInsets.swift in Sources */, + 133D70723039DBFD30A9821FF3B67F8E /* ConstraintInsetTarget.swift in Sources */, + B4050AA8BC64E340256364AFB80363C2 /* ConstraintItem.swift in Sources */, + 629195AD09E0EC36A884095B83C42FAE /* ConstraintLayoutGuide.swift in Sources */, + 71ED6154E6DCCFA61E10D72C5CA9C4E9 /* ConstraintLayoutGuideDSL.swift in Sources */, + 1DF8EFC779916FCBF31DC1DAB99A576E /* ConstraintLayoutSupport.swift in Sources */, + D591C8546B6B92CF98C179090F5EACEE /* ConstraintLayoutSupportDSL.swift in Sources */, + CF9F59E6FDCBCA77A2DA99D235CD96BD /* ConstraintMaker.swift in Sources */, + 6AAB0ED8C24C35578D0291A2BD1E45F2 /* ConstraintMakerEditable.swift in Sources */, + 4E45062A9BC7EBA3B20FC644237561EF /* ConstraintMakerExtendable.swift in Sources */, + B75157C387F26563D8DB70BEE84089D5 /* ConstraintMakerFinalizable.swift in Sources */, + AFB1C9F141D16648933C6A899C3155CD /* ConstraintMakerPriortizable.swift in Sources */, + 6BE59B49F53C9BAC90FE42186C335774 /* ConstraintMakerRelatable.swift in Sources */, + 9705059DF02781C6E8AE883A31EF4510 /* ConstraintMultiplierTarget.swift in Sources */, + 20215671001C72A928170398AAAE08B2 /* ConstraintOffsetTarget.swift in Sources */, + C05161B317D2D0886E9309D5CF1AD95C /* ConstraintPriorityTarget.swift in Sources */, + 7B84D63C10DE18A2C5637DD0405A3F58 /* ConstraintRelatableTarget.swift in Sources */, + F53FF4B422C72CA8548B2FFE14D07866 /* ConstraintRelation.swift in Sources */, + 842839A212DDCB988EA3725BABC60A4F /* ConstraintView+Extensions.swift in Sources */, + 72E3B01E713D6323A15BFE3E3B3B14FB /* ConstraintView.swift in Sources */, + 9D6E5E06D9D5F46EEF357ECD4D06428B /* ConstraintViewDSL.swift in Sources */, + 126EB89CB67B59A0D8685DBFAF0C952D /* Debugging.swift in Sources */, + 3CD17A81467309C37F0B36EF5443D9ED /* LayoutConstraint.swift in Sources */, + 7F4A092AA3D9F3DBCADBA83264438BFB /* SnapKit-dummy.m in Sources */, + 0B505DD464D5BE1BA78617B055800C62 /* UILayoutGuide+Extensions.swift in Sources */, + F5D5C02BB15D2CB0C8F5C3E0B772EB6A /* UILayoutSupport+Extensions.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -552,25 +591,90 @@ 0C717DA8BFFEA61C11AB7002E676EE17 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = Matrioska; - target = 3816F883EEBF086538810087AE362D33 /* Matrioska */; + target = 0FB92CB89E72923ECD89B42D50D69D22 /* Matrioska */; targetProxy = 7440F439AF8645D02B61F20D1643A885 /* PBXContainerItemProxy */; }; 6D1618E2795150E483E2A433184E2D89 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = SnapKit; - target = 7F92267D248C0DC51DD67F04A8C88D7F /* SnapKit */; + target = CDAED52734CDEA3F5B1B2C7B70845F6E /* SnapKit */; targetProxy = 3E93AD9B0F4F0B3C9EF92737F046F730 /* PBXContainerItemProxy */; }; - A53A4B5FBBA7CBB164759FE82EC8318A /* PBXTargetDependency */ = { + 82838968315A9F075EDF472C8A327DBE /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = SnapKit; - target = 7F92267D248C0DC51DD67F04A8C88D7F /* SnapKit */; - targetProxy = 9E1E9DC91E501879E381666B58BCCF73 /* PBXContainerItemProxy */; + target = CDAED52734CDEA3F5B1B2C7B70845F6E /* SnapKit */; + targetProxy = D22C25AE02B1FC6CB375F827884BD61F /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 18A6BC3CC1A9EC1164A84E2BE33A7B61 /* Release */ = { + 038FFBFAFF538BB20B9C68505BFC3D93 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E885DC7A2C93B352F3CCBAF6C4F30F7F /* SnapKit.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/SnapKit/SnapKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SnapKit/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/SnapKit/SnapKit.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = SnapKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 110AD18E52B85909FC84790D1D1C7A4D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4AFD95C089AB657DC457D673DF1D5B11 /* Matrioska.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Matrioska/Matrioska-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Matrioska/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Matrioska/Matrioska.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = Matrioska; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 225513AC1FB0C79318CC48DFC84FC213 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = E885DC7A2C93B352F3CCBAF6C4F30F7F /* SnapKit.xcconfig */; buildSettings = { @@ -681,9 +785,9 @@ }; name = Debug; }; - 9AB3C3C9A96D60B82285927CD79B5379 /* Debug */ = { + 75FEBCFF65A29CE9C537F0F281CE4AC8 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A77A10AC741F15F2412809F03C82B8FD /* Pods-MatrioskaExample.debug.xcconfig */; + baseConfigurationReference = 4AFD95C089AB657DC457D673DF1D5B11 /* Matrioska.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -696,30 +800,27 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-MatrioskaExample/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Matrioska/Matrioska-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Matrioska/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-MatrioskaExample/Pods-MatrioskaExample.modulemap"; + MODULEMAP_FILE = "Target Support Files/Matrioska/Matrioska.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_MatrioskaExample; + PRODUCT_NAME = Matrioska; SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - B44CEB594B638BAC181EACCDB5DD143A /* Debug */ = { + 9AB3C3C9A96D60B82285927CD79B5379 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BF6FD1FF6B76CA2F5ED2E314D51E53CF /* Matrioska.xcconfig */; + baseConfigurationReference = A77A10AC741F15F2412809F03C82B8FD /* Pods-MatrioskaExample.debug.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -732,18 +833,21 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Matrioska/Matrioska-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Matrioska/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-MatrioskaExample/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Matrioska/Matrioska.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-MatrioskaExample/Pods-MatrioskaExample.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Matrioska; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_MatrioskaExample; SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -790,97 +894,32 @@ }; name = Release; }; - D798C0C62D2135978557322E07E6A44E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BF6FD1FF6B76CA2F5ED2E314D51E53CF /* Matrioska.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Matrioska/Matrioska-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Matrioska/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Matrioska/Matrioska.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Matrioska; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - E3DC9322E1050DF6B6B2509A8464D179 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E885DC7A2C93B352F3CCBAF6C4F30F7F /* SnapKit.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SnapKit/SnapKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/SnapKit/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/SnapKit/SnapKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = SnapKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 08FD2885A6C888E60B5F422919B65046 /* Build configuration list for PBXNativeTarget "Matrioska" */ = { + 07CAD9B5E98A2F5F57D96D1174303EA2 /* Build configuration list for PBXNativeTarget "Matrioska" */ = { isa = XCConfigurationList; buildConfigurations = ( - B44CEB594B638BAC181EACCDB5DD143A /* Debug */, - D798C0C62D2135978557322E07E6A44E /* Release */, + 75FEBCFF65A29CE9C537F0F281CE4AC8 /* Debug */, + 110AD18E52B85909FC84790D1D1C7A4D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + 22CCD7F81E4357523AC131CF0D6B7A14 /* Build configuration list for PBXNativeTarget "SnapKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */, - B7324857C38B065FEB1EEE3105C2367A /* Release */, + 038FFBFAFF538BB20B9C68505BFC3D93 /* Debug */, + 225513AC1FB0C79318CC48DFC84FC213 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - E6C321BAD2A9074A4477A3D3384A0169 /* Build configuration list for PBXNativeTarget "SnapKit" */ = { + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - E3DC9322E1050DF6B6B2509A8464D179 /* Debug */, - 18A6BC3CC1A9EC1164A84E2BE33A7B61 /* Release */, + 59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */, + B7324857C38B065FEB1EEE3105C2367A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Source/Factories/JSONFactory.swift b/Source/Factories/JSONFactory.swift index c57ec86..c201edb 100644 --- a/Source/Factories/JSONFactory.swift +++ b/Source/Factories/JSONFactory.swift @@ -35,6 +35,11 @@ public final class JSONFactory { private var wrapperFactory: [String: WrapperFactoryBuilder] = [:] private var clusterFactory: [String: ClusterFactoryBuilder] = [:] + /// Initialize a new JSONFactory + public init() { + // Empty but needed to be initialized from other modules + } + /// Registers a new `ViewFactoryBuilder` which will be used when producing the component /// /// - Parameters: From d218084c1d79f51fa227295d90e6a59fee3e68dd Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 21:32:22 +0100 Subject: [PATCH 16/29] Fix code in example --- Example/MatrioskaExample/AppDelegate.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Example/MatrioskaExample/AppDelegate.swift b/Example/MatrioskaExample/AppDelegate.swift index e15109e..c268d18 100644 --- a/Example/MatrioskaExample/AppDelegate.swift +++ b/Example/MatrioskaExample/AppDelegate.swift @@ -54,7 +54,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - let _ = JSONFactory() window = UIWindow(frame: UIScreen.main.bounds) window?.rootViewController = rootComponent.viewController() window?.makeKeyAndVisible() From 81a720fc5d79801c2cd0b89e1acb7c21ed78ed26 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Fri, 13 Jan 2017 21:33:26 +0100 Subject: [PATCH 17/29] Fix line length violation on ExpressibleByComponentMeta documentation --- Source/Components/ComponentMeta.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Components/ComponentMeta.swift b/Source/Components/ComponentMeta.swift index 45f2fc4..b7bb7f4 100644 --- a/Source/Components/ComponentMeta.swift +++ b/Source/Components/ComponentMeta.swift @@ -77,7 +77,8 @@ extension ExpressibleByComponentMeta { /// or an already materialized meta object. /// - Returns: A materialized `ExpressibleByComponentMeta` object if the input represents correctly /// the object to be materialized. - /// - Note: This will return nil when `meta` is nil or will return the same `meta` object when `meta` is already a `Self` type. + /// - Note: This will return nil when `meta` is nil or + /// will return the same `meta` object when `meta` is already a `Self` type. public static func materialize(_ meta: ComponentMeta?) -> Self? { guard let meta = meta else { return nil From b3cc35bc9c0b57cd051323d71ef6ce818f3cc89d Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Mon, 16 Jan 2017 16:45:52 +0100 Subject: [PATCH 18/29] CRC --- Matrioska.xcodeproj/project.pbxproj | 30 +++----- Source/Factories/JSONFactory.swift | 24 +++--- .../JSON => Tests/Helpers}/JSONReader.swift | 6 +- Tests/JSONReaderTests.swift | 75 ------------------- 4 files changed, 26 insertions(+), 109 deletions(-) rename {Source/JSON => Tests/Helpers}/JSONReader.swift (93%) delete mode 100644 Tests/JSONReaderTests.swift diff --git a/Matrioska.xcodeproj/project.pbxproj b/Matrioska.xcodeproj/project.pbxproj index 70f06a6..8814619 100644 --- a/Matrioska.xcodeproj/project.pbxproj +++ b/Matrioska.xcodeproj/project.pbxproj @@ -12,13 +12,13 @@ 51A54328766C8548A4F3AE4A /* Pods_MatrioskaTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */; }; 5A069A980F4B0D057E6B647F /* Pods_Matrioska.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D4BE0A3C39644ABCB31722F /* Pods_Matrioska.framework */; }; 8B3E4D4B1E2962BC00C82598 /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3E4D4A1E2962BC00C82598 /* JSONFactory.swift */; }; + 8BB284191E2D21D600243C0A /* JSONReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BB284171E2D20C900243C0A /* JSONReader.swift */; }; 8BCFF8B11E28D4340053AD98 /* ClusterLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AC1E28D4340053AD98 /* ClusterLayout.swift */; }; 8BCFF8B21E28D4340053AD98 /* Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AD1E28D4340053AD98 /* Component.swift */; }; 8BCFF8B31E28D4340053AD98 /* ComponentMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AE1E28D4340053AD98 /* ComponentMeta.swift */; }; 8BCFF8B41E28D4340053AD98 /* StackCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8AF1E28D4340053AD98 /* StackCluster.swift */; }; 8BCFF8B51E28D4340053AD98 /* TabBarCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8B01E28D4340053AD98 /* TabBarCluster.swift */; }; 8BCFF8BA1E28D4B90053AD98 /* JSONFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8B61E28D4990053AD98 /* JSONFactoryTests.swift */; }; - 8BCFF8BB1E28D4B90053AD98 /* JSONReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BCFF8B71E28D4990053AD98 /* JSONReaderTests.swift */; }; DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */; }; DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */; }; DE067DCD1DDE017700641D1A /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE067DCB1DDE017700641D1A /* StackViewController.swift */; }; @@ -34,7 +34,6 @@ DE85E5AF1DEC842700DFF34A /* AppearanceSpyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE85E5AE1DEC842700DFF34A /* AppearanceSpyViewController.swift */; }; DEA64C8B1E017D8100687658 /* UIColor+HEX.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEA64C8A1E017D8100687658 /* UIColor+HEX.swift */; }; DEA64C8D1E01810500687658 /* UIColorHEXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEA64C8C1E01810500687658 /* UIColorHEXTests.swift */; }; - ED9180F71E276F0C00F73FDB /* JSONReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED9180F61E276F0C00F73FDB /* JSONReader.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -55,13 +54,13 @@ 4F6E46DFDCFD89ADB9C4762B /* Pods-Matrioska.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.release.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.release.xcconfig"; sourceTree = ""; }; 60996A348436AB8E34E758DA /* Pods-Matrioska.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Matrioska.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Matrioska/Pods-Matrioska.debug.xcconfig"; sourceTree = ""; }; 8B3E4D4A1E2962BC00C82598 /* JSONFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; + 8BB284171E2D20C900243C0A /* JSONReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReader.swift; sourceTree = ""; }; 8BCFF8AC1E28D4340053AD98 /* ClusterLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; 8BCFF8AD1E28D4340053AD98 /* Component.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; 8BCFF8AE1E28D4340053AD98 /* ComponentMeta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; }; 8BCFF8AF1E28D4340053AD98 /* StackCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackCluster.swift; sourceTree = ""; }; 8BCFF8B01E28D4340053AD98 /* TabBarCluster.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarCluster.swift; sourceTree = ""; }; 8BCFF8B61E28D4990053AD98 /* JSONFactoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONFactoryTests.swift; sourceTree = ""; }; - 8BCFF8B71E28D4990053AD98 /* JSONReaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReaderTests.swift; sourceTree = ""; }; DDE5072CEF32135290F71073 /* Pods-MatrioskaTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrioskaTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MatrioskaTests/Pods-MatrioskaTests.release.xcconfig"; sourceTree = ""; }; DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ComponentMetaTests.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DE067DCA1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; @@ -83,7 +82,6 @@ DEA64C8C1E01810500687658 /* UIColorHEXTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIColorHEXTests.swift; sourceTree = ""; }; DEECB3B21DD47C4A00F7DFB1 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; lineEnding = 0; path = README.md; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.markdown; }; E08AB4E968331E4711F8DCD9 /* Pods_MatrioskaTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MatrioskaTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - ED9180F61E276F0C00F73FDB /* JSONReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReader.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -107,14 +105,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 21E40AD61E26540800205C06 /* JSON */ = { - isa = PBXGroup; - children = ( - ED9180F61E276F0C00F73FDB /* JSONReader.swift */, - ); - path = JSON; - sourceTree = ""; - }; 5E6EE110929620DA6A8B14DD /* Pods */ = { isa = PBXGroup; children = ( @@ -167,8 +157,8 @@ DE2D78611DDB3F7F00CD6E95 /* Assets */ = { isa = PBXGroup; children = ( - DE2D78621DDB3F7F00CD6E95 /* checkmark@2x.png */, 2198B0861E277BFF005F2E57 /* app_structure.json */, + DE2D78621DDB3F7F00CD6E95 /* checkmark@2x.png */, 21DA41741E27A09500169428 /* invalid.json */, ); path = Assets; @@ -209,13 +199,12 @@ isa = PBXGroup; children = ( DE2D78611DDB3F7F00CD6E95 /* Assets */, - DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */, - DE3E8D961DD38AAA00417AE5 /* ComponentTests.swift */, DE6CA3CC1DDC7F1D00E3A570 /* Helpers */, + DE3E8D961DD38AAA00417AE5 /* ComponentTests.swift */, + DE067DC71DDE005400641D1A /* ComponentMetaTests.swift */, DE3E8D951DD38AAA00417AE5 /* Info.plist */, DE2D78661DDB43FC00CD6E95 /* IntrinsicSizeAwareScrollViewTests.swift */, 8BCFF8B61E28D4990053AD98 /* JSONFactoryTests.swift */, - 8BCFF8B71E28D4990053AD98 /* JSONReaderTests.swift */, DE6CA3CA1DDC77E800E3A570 /* StackClusterTests.swift */, DE2D785C1DDB178500CD6E95 /* TabBarClusterTests.swift */, DEA64C8C1E01810500687658 /* UIColorHEXTests.swift */, @@ -229,7 +218,6 @@ 8BCFF8AB1E28D4340053AD98 /* Components */, 8BCFF8A21E28D3830053AD98 /* Factories */, DEA64C891E017D7300687658 /* Helpers */, - 21E40AD61E26540800205C06 /* JSON */, DE067DC91DDE017700641D1A /* Views */, ); path = Source; @@ -238,9 +226,10 @@ DE6CA3CC1DDC7F1D00E3A570 /* Helpers */ = { isa = PBXGroup; children = ( - DE6CA3CD1DDC7F2D00E3A570 /* ScrollMatcher.swift */, - DE6CA3CF1DDC8ED600E3A570 /* IntrinsicSizeAwareScrollViewTest.xib */, DE85E5AE1DEC842700DFF34A /* AppearanceSpyViewController.swift */, + DE6CA3CF1DDC8ED600E3A570 /* IntrinsicSizeAwareScrollViewTest.xib */, + 8BB284171E2D20C900243C0A /* JSONReader.swift */, + DE6CA3CD1DDC7F2D00E3A570 /* ScrollMatcher.swift */, ); path = Helpers; sourceTree = ""; @@ -468,7 +457,6 @@ files = ( 8BCFF8B51E28D4340053AD98 /* TabBarCluster.swift in Sources */, 8BCFF8B31E28D4340053AD98 /* ComponentMeta.swift in Sources */, - ED9180F71E276F0C00F73FDB /* JSONReader.swift in Sources */, DEA64C8B1E017D8100687658 /* UIColor+HEX.swift in Sources */, DE067DCC1DDE017700641D1A /* IntrinsicSizeAwareScrollView.swift in Sources */, 8BCFF8B21E28D4340053AD98 /* Component.swift in Sources */, @@ -489,7 +477,7 @@ DE23D2971DDF63C400CDF333 /* ComponentTests.swift in Sources */, DE6CA3CE1DDC7F2D00E3A570 /* ScrollMatcher.swift in Sources */, DE23D29A1DDF63C400CDF333 /* StackClusterTests.swift in Sources */, - 8BCFF8BB1E28D4B90053AD98 /* JSONReaderTests.swift in Sources */, + 8BB284191E2D21D600243C0A /* JSONReader.swift in Sources */, DEA64C8D1E01810500687658 /* UIColorHEXTests.swift in Sources */, DE067DC81DDE005400641D1A /* ComponentMetaTests.swift in Sources */, DE23D2991DDF63C400CDF333 /* IntrinsicSizeAwareScrollViewTests.swift in Sources */, diff --git a/Source/Factories/JSONFactory.swift b/Source/Factories/JSONFactory.swift index c201edb..daa6ebb 100644 --- a/Source/Factories/JSONFactory.swift +++ b/Source/Factories/JSONFactory.swift @@ -8,6 +8,9 @@ import Foundation +/// A JSONObject type +public typealias JSONObject = [String: Any] + /// An error type for JSONFactory /// /// - missing: specifies that a mandatory key is missing @@ -15,12 +18,15 @@ enum JSONFactoryError: Error { case missing(JSONObject, String) } -/// A factory that wraps ComponentFactory objects and uses them to produce Components +/// A factory that wraps `Component` builder closures (ViewFactoryBuilder, +/// `WrapperFactoryBuilder` & `ClusterFactoryBuilder`) and uses them to produce `Component`s public final class JSONFactory { - static let typeKey = "type" - static let metaKey = "meta" - static let childrenKey = "children" + private enum Key { + static let type = "type" + static let meta = "meta" + static let children = "children" + } /// A factory closure to build a view `Component` public typealias ViewFactoryBuilder = (ComponentMeta?) -> Component @@ -70,18 +76,18 @@ public final class JSONFactory { clusterFactory[type] = factoryBuilder } - /// Produces a `Component` from a given `JSONObject`, which has one mandatory key: `typeKey` + /// Produces a `Component` from a given `JSONObject`, which has one mandatory key: `type` /// /// - Parameter json: the `JSONObject` to be used /// - Returns: An optional `Component` /// - Throws: `JSONFactoryError` when a mandatory key is missing public func component(from json: JSONObject) throws -> Component? { - guard let type = json[JSONFactory.typeKey] as? String else { - throw JSONFactoryError.missing(json, JSONFactory.typeKey) + guard let type = json[Key.type] as? String else { + throw JSONFactoryError.missing(json, Key.type) } - let meta = json[JSONFactory.metaKey] as? [String : Any] - let children = json[JSONFactory.childrenKey] as? [JSONObject] ?? [] + let meta = json[Key.meta] as? [String : Any] + let children = json[Key.children] as? [JSONObject] ?? [] let componentChildren = try children.flatMap { try component(from: $0) } var componentResult: Component? diff --git a/Source/JSON/JSONReader.swift b/Tests/Helpers/JSONReader.swift similarity index 93% rename from Source/JSON/JSONReader.swift rename to Tests/Helpers/JSONReader.swift index 4c6b8c8..8babc0a 100644 --- a/Source/JSON/JSONReader.swift +++ b/Tests/Helpers/JSONReader.swift @@ -7,12 +7,10 @@ // import Foundation - -/// A JSONObject type -public typealias JSONObject = [String: Any] +@testable import Matrioska /// A JSONReader used to convert to JSONObject -public final class JSONReader { +final class JSONReader { /// Serializes from a given JSON Data into JSONObject /// diff --git a/Tests/JSONReaderTests.swift b/Tests/JSONReaderTests.swift deleted file mode 100644 index fcbb186..0000000 --- a/Tests/JSONReaderTests.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// JSONReaderTests.swift -// Matrioska -// -// Created by Joan Romano on 12/01/17. -// Copyright © 2017 runtastic. All rights reserved. -// - -import XCTest -import Quick -import Nimble -@testable import Matrioska - -class JSONReaderTests: QuickSpec { - - override func spec() { - - describe("From Data") { - context("when reading from valid data") { - let data = "{\"structure\": {\"id\": \"tabbar\", \"type\": \"tabbar\", \"meta\": { \"default_tab_id\": \"main_tab\" }}}".data(using: .utf8)! - let jsonObject = try! JSONReader.jsonObject(from: data) - - it("returns a valid JSON object") { - XCTAssertNotNil(jsonObject) - XCTAssertNotNil(jsonObject!["structure"]) - let structure = jsonObject!["structure"] as? JSONObject - XCTAssertNotNil(structure!["id"]) - } - } - - context("when reading from invalid data") { - let data = "{\"structure\": {\"id\": \"tabbar\", \"type\": \"tabbar\", \"meta\": { \"default_tab_id\": \"main_tab\" }}}}".data(using: .utf8)! - - it("throws") { - let faultyJsonObject = { _ = try! JSONReader.jsonObject(from: data) } - - expect(faultyJsonObject()).to(throwAssertion()) - } - } - } - - describe("From file") { - - context("when reading from an existing valid file") { - let jsonObject = try! JSONReader.jsonObject(from: "app_structure", bundle: Bundle(for: JSONReaderTests.self)) - - it("returns a valid JSONObject") { - XCTAssertNotNil(jsonObject) - XCTAssertNotNil(jsonObject!["structure"]) - let structure = jsonObject!["structure"] as? JSONObject - XCTAssertNotNil(structure!["type"]) - XCTAssertNotNil(structure!["meta"]) - } - } - - context("when reading from an invalid file path") { - let jsonObject = try! JSONReader.jsonObject(from: "asdf", bundle: Bundle(for: JSONReaderTests.self)) - - it("returns nil") { - XCTAssertNil(jsonObject) - } - } - - context("when reading from an existing invalid file") { - it("throws") { - let faultyJsonObject = { _ = try! JSONReader.jsonObject(from: "invalid", bundle: Bundle(for: JSONReaderTests.self)) } - - expect(faultyJsonObject()).to(throwAssertion()) - } - } - } - - } - -} From e030bf4f0c901648ccc32ec77826264c1108ea83 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Mon, 16 Jan 2017 16:59:01 +0100 Subject: [PATCH 19/29] Use JSONObject type when possible --- Source/Factories/JSONFactory.swift | 2 +- Tests/Helpers/JSONReader.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Factories/JSONFactory.swift b/Source/Factories/JSONFactory.swift index daa6ebb..d1d9044 100644 --- a/Source/Factories/JSONFactory.swift +++ b/Source/Factories/JSONFactory.swift @@ -86,7 +86,7 @@ public final class JSONFactory { throw JSONFactoryError.missing(json, Key.type) } - let meta = json[Key.meta] as? [String : Any] + let meta = json[Key.meta] as? JSONObject let children = json[Key.children] as? [JSONObject] ?? [] let componentChildren = try children.flatMap { try component(from: $0) } var componentResult: Component? diff --git a/Tests/Helpers/JSONReader.swift b/Tests/Helpers/JSONReader.swift index 8babc0a..dbb149b 100644 --- a/Tests/Helpers/JSONReader.swift +++ b/Tests/Helpers/JSONReader.swift @@ -17,7 +17,7 @@ final class JSONReader { /// - Parameter data: the Data object used in serialization /// - Returns: an optional serialized JSONObject /// - Throws: throws an error in case of failure or invalid JSON data - public class func jsonObject(from data: Data) throws -> JSONObject? { + class func jsonObject(from data: Data) throws -> JSONObject? { let json = try JSONSerialization.jsonObject(with: data) as? JSONObject return json @@ -30,7 +30,7 @@ final class JSONReader { /// - bundle: the bundle where the file is located /// - Returns: an optional serialized JSONObject /// - Throws: throws an error in case of failure or invalid JSON data - public class func jsonObject(from jsonFilename: String, bundle: Bundle = .main) throws -> JSONObject? { + class func jsonObject(from jsonFilename: String, bundle: Bundle = .main) throws -> JSONObject? { guard let filePath = bundle.path(forResource: jsonFilename, ofType: "json") else { return nil } From dadde5d78840c2028ff271bf68b8dd5e94cb6a3c Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Wed, 18 Jan 2017 11:07:31 +0100 Subject: [PATCH 20/29] Re build example --- Example/Podfile.lock | 4 +- Example/Pods/Manifest.lock | 4 +- Example/Pods/Pods.xcodeproj/project.pbxproj | 759 +++++++++--------- Example/Pods/SnapKit/README.md | 2 +- Example/Pods/SnapKit/Source/Constraint.swift | 22 +- .../SnapKit/Source/ConstraintAttributes.swift | 2 +- .../Pods/SnapKit/Source/ConstraintDSL.swift | 12 +- .../Source/ConstraintDescription.swift | 8 +- .../Pods/SnapKit/Source/ConstraintItem.swift | 6 +- ...=> ConstraintLayoutGuide+Extensions.swift} | 2 +- .../Source/ConstraintLayoutGuide.swift | 3 +- .../Source/ConstraintLayoutGuideDSL.swift | 23 +- .../Pods/SnapKit/Source/ConstraintMaker.swift | 69 +- .../Source/ConstraintMakerRelatable.swift | 9 +- .../Source/ConstraintRelatableTarget.swift | 4 + .../SnapKit/Source/ConstraintRelation.swift | 2 +- .../SnapKit/Source/ConstraintViewDSL.swift | 44 +- .../SnapKit/Source/LayoutConstraint.swift | 2 +- .../SnapKit/Source/LayoutConstraintItem.swift | 93 +++ .../Target Support Files/SnapKit/Info.plist | 2 +- 20 files changed, 585 insertions(+), 487 deletions(-) rename Example/Pods/SnapKit/Source/{UILayoutGuide+Extensions.swift => ConstraintLayoutGuide+Extensions.swift} (97%) create mode 100644 Example/Pods/SnapKit/Source/LayoutConstraintItem.swift diff --git a/Example/Podfile.lock b/Example/Podfile.lock index cc3ff57..1a59260 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,7 +1,7 @@ PODS: - Matrioska (0.1.0-alpha1): - SnapKit (~> 3.0) - - SnapKit (3.0.2) + - SnapKit (3.1.2) DEPENDENCIES: - Matrioska (from `../Matrioska.podspec`) @@ -13,7 +13,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Matrioska: b070c1ad36e64bdf7ab9d847033e2a5e4d2b8ec7 - SnapKit: 2e456761aa92d4d4067a7a5594c18769d451a8ad + SnapKit: 12b24f569cb7c143acc9c22b9d91b23e7b1c84a2 PODFILE CHECKSUM: b63a58336b9471a5dbe1ffe7ea7d0b94f6dbf667 diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index cc3ff57..1a59260 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -1,7 +1,7 @@ PODS: - Matrioska (0.1.0-alpha1): - SnapKit (~> 3.0) - - SnapKit (3.0.2) + - SnapKit (3.1.2) DEPENDENCIES: - Matrioska (from `../Matrioska.podspec`) @@ -13,7 +13,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Matrioska: b070c1ad36e64bdf7ab9d847033e2a5e4d2b8ec7 - SnapKit: 2e456761aa92d4d4067a7a5594c18769d451a8ad + SnapKit: 12b24f569cb7c143acc9c22b9d91b23e7b1c84a2 PODFILE CHECKSUM: b63a58336b9471a5dbe1ffe7ea7d0b94f6dbf667 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 23bfa8c..ae25a81 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -7,57 +7,57 @@ objects = { /* Begin PBXBuildFile section */ - 041A90E3AE3B74B290DB7E16F99E8B5C /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF74E9BB4282FF36A50B1CAD0AA73CBF /* JSONFactory.swift */; }; - 0B505DD464D5BE1BA78617B055800C62 /* UILayoutGuide+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4759EEB4180EAF3DA189AAE28199AC /* UILayoutGuide+Extensions.swift */; }; - 126EB89CB67B59A0D8685DBFAF0C952D /* Debugging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 737B1700C2C19AD11C2872C1C46EC8D4 /* Debugging.swift */; }; - 133D70723039DBFD30A9821FF3B67F8E /* ConstraintInsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F2B728DCF7E9F88008827314C2AE823 /* ConstraintInsetTarget.swift */; }; - 179A9C55D3C2CB469FB2873C792B4580 /* StackCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5934E844D984EA64B0846C3DBD6A618E /* StackCluster.swift */; }; + 06416811072A1D77899513B3DD03D435 /* ConstraintConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA8A26EF51D384D2D1E8867E5B73F417 /* ConstraintConfig.swift */; }; + 0A256F0A8255C779467C3F4AC772C548 /* ConstraintMakerRelatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE182E16C1C28038C682A2C6788FAF4E /* ConstraintMakerRelatable.swift */; }; + 0E4D0255D61511AF58C0827A8F6526A9 /* ConstraintDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BCB532E3C41609856ED2472531853EC /* ConstraintDescription.swift */; }; + 116A4337585A520E126E822BE0AC0854 /* ClusterLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = D91E122D0C780D351532ACDDF7560AFA /* ClusterLayout.swift */; }; + 16DDC2F28AB6C514E860101B5E996793 /* JSONFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBEE224188F8E33F19948160CBAA00EC /* JSONFactory.swift */; }; 181680AEA668ED74498F47D277AFBB65 /* Pods-MatrioskaExample-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B6EE3F460D1600FAF881B500AD8D239C /* Pods-MatrioskaExample-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1A10510204E489B1C3185EF8040C3DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; - 1DF8EFC779916FCBF31DC1DAB99A576E /* ConstraintLayoutSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212E2771F1CD458D21A0FB3CA1C914F3 /* ConstraintLayoutSupport.swift */; }; - 20215671001C72A928170398AAAE08B2 /* ConstraintOffsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1BDEFD46348EE8C41DE053AEDBFD1B /* ConstraintOffsetTarget.swift */; }; - 2CC8CC2790B55707BD59CCA33A644B5B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; - 3B20C6AEEA10C5EFB6D84650F6E8F391 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; - 3CA21434A05CE7E8A11733B64D157950 /* SnapKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 50BF4E341DC91F918DC3DD74CA4ADC22 /* SnapKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3CD17A81467309C37F0B36EF5443D9ED /* LayoutConstraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73878F9931EAA78C3DAAF7DDA048218E /* LayoutConstraint.swift */; }; - 4D88717E87CDEE1EC2B177AAF0E4AF03 /* ClusterLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF8D738ED38151046BD3CB10EA1C267 /* ClusterLayout.swift */; }; - 4E45062A9BC7EBA3B20FC644237561EF /* ConstraintMakerExtendable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8705AFD8FF18225FA8BB0228A69E72AA /* ConstraintMakerExtendable.swift */; }; - 629195AD09E0EC36A884095B83C42FAE /* ConstraintLayoutGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = B525F7008B3760076D71FE29C0859BDC /* ConstraintLayoutGuide.swift */; }; - 68BEBE9D16D73B3A436E221715EFE264 /* ConstraintDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE15693153A62AC79B129BA5FFB7C3D /* ConstraintDSL.swift */; }; - 6AAB0ED8C24C35578D0291A2BD1E45F2 /* ConstraintMakerEditable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8ECEBD49CA569FC524CB77465180B6 /* ConstraintMakerEditable.swift */; }; - 6BE59B49F53C9BAC90FE42186C335774 /* ConstraintMakerRelatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87CCF4DB7EFBDC070B92BFC0BC0D2C8C /* ConstraintMakerRelatable.swift */; }; - 6EB49641404A46AC062F611FBD8E03B8 /* ConstraintInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = E855200DC6085FF07EBD87301AD370C9 /* ConstraintInsets.swift */; }; - 70DC7BD37F0F2FD3EDF5BE9585193307 /* ConstraintConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597734A7EDE6E13F6D1939A7C7373CD1 /* ConstraintConfig.swift */; }; - 71ED6154E6DCCFA61E10D72C5CA9C4E9 /* ConstraintLayoutGuideDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 446C79107F482F7B2D7E4061657DCA44 /* ConstraintLayoutGuideDSL.swift */; }; - 72E3B01E713D6323A15BFE3E3B3B14FB /* ConstraintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBCF77FFA89397B4F19B5CD8A7BDB0A3 /* ConstraintView.swift */; }; - 7A7E19085DDA606232402F6FAF08E70B /* Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B90EF7CA55AE01CE50EAF5C3C574CDD /* Constraint.swift */; }; - 7B84D63C10DE18A2C5637DD0405A3F58 /* ConstraintRelatableTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813C2A5263E149C889A2DF40FFDD89BA /* ConstraintRelatableTarget.swift */; }; - 7F4A092AA3D9F3DBCADBA83264438BFB /* SnapKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F675DF8551ECAD72F0C6D96084C6DD4 /* SnapKit-dummy.m */; }; - 83EE98CC2495B1A1447187E4C13EEFF7 /* IntrinsicSizeAwareScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83B30B615FC5001A5EE964CD181A810D /* IntrinsicSizeAwareScrollView.swift */; }; - 842839A212DDCB988EA3725BABC60A4F /* ConstraintView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E11295210FBB75091BE22529081A2720 /* ConstraintView+Extensions.swift */; }; - 8D5D20EEBB8F2C28E5C03925C41CC31D /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22FE423B5E8C4A0EE7A6981B4552CAFC /* StackViewController.swift */; }; - 9705059DF02781C6E8AE883A31EF4510 /* ConstraintMultiplierTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0729DC38B02A17974FD7A7238FCB1836 /* ConstraintMultiplierTarget.swift */; }; - 997C1FD0F95EAA044D3932DBF6B871C9 /* TabBarCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39DF0B93DB211453EB990853DFC94773 /* TabBarCluster.swift */; }; - 9D6E5E06D9D5F46EEF357ECD4D06428B /* ConstraintViewDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B78113584563565B18CD0248D9D0A93 /* ConstraintViewDSL.swift */; }; - A1582E9A19722CF0DFC6FD9311BB0F3B /* ConstraintDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB70FEBA9EF66CAAA461E6F3F819716B /* ConstraintDescription.swift */; }; - A95814C2B75B36D83ACFB79445BFB0B8 /* Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = B202FDD7D7CE5B392F1DAF641C0DF8C2 /* Component.swift */; }; - AFB1C9F141D16648933C6A899C3155CD /* ConstraintMakerPriortizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 261BC3C65CE6EBBED920977848212F6F /* ConstraintMakerPriortizable.swift */; }; - B4050AA8BC64E340256364AFB80363C2 /* ConstraintItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BEA23F4393572EE30AED50A651CD185 /* ConstraintItem.swift */; }; - B53D9C904B60B81F7032B71CB2257A96 /* ConstraintConstantTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9319AF949935BC0602093E0830E8B10 /* ConstraintConstantTarget.swift */; }; - B75157C387F26563D8DB70BEE84089D5 /* ConstraintMakerFinalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8AA583273C076DD4A1EBAFDDA0E89A8 /* ConstraintMakerFinalizable.swift */; }; - BA032847ACC21166D8ABFCBBC9D25B23 /* ComponentMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 728A11CB93E2EC8CE71FB3C24F59AB29 /* ComponentMeta.swift */; }; - C05161B317D2D0886E9309D5CF1AD95C /* ConstraintPriorityTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F0138AE8EA08984375344610BE7E1E /* ConstraintPriorityTarget.swift */; }; - C11CBFB7B8B3FED736CFBA11AD4D2823 /* ConstraintAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041C7DFD4E40027278BABCCCD69743B2 /* ConstraintAttributes.swift */; }; - C1D0E260CB3ADCABB69E3EE0FC4EE7AD /* UIColor+HEX.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38AFDA242A23FF991F0CB99BE5AB9B08 /* UIColor+HEX.swift */; }; + 1B1D2DD205BF61F5B07180619C0543BE /* StackCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43962A108464EC534C7D0B705DD5A155 /* StackCluster.swift */; }; + 28BA3D9A1DEBCFD9D48E2E3D25448CC3 /* ConstraintConstantTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 932F64317CB085F5AF53C6822F3EFBC3 /* ConstraintConstantTarget.swift */; }; + 3C61CF88B55F87AC54688F8C0995FBF5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; + 42342A2A0158936E08C934ACDBA02B06 /* ConstraintMaker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F159460515FBA865D897FD0807CDD29 /* ConstraintMaker.swift */; }; + 4924C7266548F0EC3A73D2FA37809D42 /* LayoutConstraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28BB436A3869B5D170660943395D24F6 /* LayoutConstraint.swift */; }; + 4A94F52AEF44432234C1697E69408B14 /* ConstraintMakerPriortizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BA64B4AA54CB104E0213313D7D6D934 /* ConstraintMakerPriortizable.swift */; }; + 4BFEE56751888452EABAD895D3534CB9 /* Matrioska-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = E3355B0BCCC9EDD3676AE09A24AC5FFE /* Matrioska-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5749C705A069BE4601E50D3E416B99E3 /* ConstraintMultiplierTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = BADAC8FC48CC6E183B88F09C368DD793 /* ConstraintMultiplierTarget.swift */; }; + 5AC8959915ACEA64DEBA60081B87EF38 /* ConstraintInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F065F60C461CF91942D20D1FF687316 /* ConstraintInsets.swift */; }; + 5B4C918A5B6AEC0FE70E99458443A171 /* SnapKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 93BBA53E5359D7752DB98E36BC10384F /* SnapKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5EA2D73E925409110465303E14951E77 /* ConstraintRelatableTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9912385FCF71D8E097B5978DD988FA6B /* ConstraintRelatableTarget.swift */; }; + 6538FE3F4ABE4DA4B2D476B30B061B07 /* Debugging.swift in Sources */ = {isa = PBXBuildFile; fileRef = FCBBA7FFB185B57819C967D8B5AE699E /* Debugging.swift */; }; + 6FBA68991ADF848CD716332D87F684A8 /* SnapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C42E6B36692CB79785C933E25719FA6F /* SnapKit.framework */; }; + 71B01FA7E17AC528750486C6EE82BA5D /* ConstraintLayoutSupportDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64F525860135BB4B15140D581DDBC96C /* ConstraintLayoutSupportDSL.swift */; }; + 74BCA628291BD1F1D4E57A6F77EE914F /* ConstraintLayoutGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B7CD84D6E9F6A3E62717314BF109323 /* ConstraintLayoutGuide.swift */; }; + 7E92628EBEEF5EC1DBE141CE4A484749 /* ConstraintLayoutGuide+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACAD45F99697AA414586E26D357E9FA2 /* ConstraintLayoutGuide+Extensions.swift */; }; + 838038DFBA3CE21C79F5B72246FFE6B1 /* TabBarCluster.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8A47693B9CDD5AD4665CBA69F28FEB9 /* TabBarCluster.swift */; }; + 847340DC7B98EA7FB9FBAA59FE084A81 /* ConstraintAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73DD5EE1A1A00711D127BB0AC7F0CD22 /* ConstraintAttributes.swift */; }; + 880218E912CDFE3A815AB775675C70A5 /* UIColor+HEX.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E13A60704984FFCE2EAF3EC6B388889 /* UIColor+HEX.swift */; }; + 89475FD8A492C5A798A98A8F6CD55A1F /* ConstraintMakerExtendable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41EF2450D46E21B236466CE3E0CA379D /* ConstraintMakerExtendable.swift */; }; + 96AC89E25C14E0D79ECDD33457BBEDEB /* ConstraintViewDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E30F7EABFBAB46D74E7B19A06B1D7AD /* ConstraintViewDSL.swift */; }; + 9AE3696936FBD5DA311D4CCF51A83D1A /* ConstraintMakerEditable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D5DAD773273C4A7AC377B281E0C0CBB /* ConstraintMakerEditable.swift */; }; + 9C958D72748612ED2520F42C3B61CB36 /* SnapKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1148FFA3A5A25B895091BDA89E8B6CCF /* SnapKit-dummy.m */; }; + A40E4284C5D1F4D6A8904A4A3EF994E3 /* UILayoutSupport+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 393CCE5B4F3EF728057923184C9FD2F9 /* UILayoutSupport+Extensions.swift */; }; + B02ECA8C67AE5F61034993F859285E00 /* ConstraintPriorityTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E48C3C03E21DAF8B6499ABDA6B1497 /* ConstraintPriorityTarget.swift */; }; + BB5EDFEC222EC5254AD2F4353F1C77A9 /* ConstraintDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 806B03EAD3E4480C34089B4D666AAEF8 /* ConstraintDSL.swift */; }; + BC8E6AB7927C5B26AB8FB33466D36A13 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 857837F254F449F3BC19F608228401E0 /* Foundation.framework */; }; + BCF331A96BE0E6C0C78A9163B678011B /* Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54AFDD7F5B3230CC0AD71D1A5F8B1315 /* Constraint.swift */; }; + BDB5ACCACD76A93A14353E0877D70D3F /* Component.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CFC0E627DA51A2EB7FBFC86ECF8F156 /* Component.swift */; }; + BF9167DBD5A23B820E4584E1B77061B5 /* IntrinsicSizeAwareScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4425C1059FCCD8D526EFE336FBC1DD6D /* IntrinsicSizeAwareScrollView.swift */; }; + C01BE735C49AFBCB4CDAEF9C13DA763C /* LayoutConstraintItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A7F8AAA627053DF20188AE787C733CF /* LayoutConstraintItem.swift */; }; + C0A5B37C01480DF77D4ECAF261066231 /* ConstraintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45A33EE95C11878E65CD0F5BCF9596B5 /* ConstraintView.swift */; }; + C446120EC4ED3233678F6E3B82BBFEEE /* ConstraintMakerFinalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13798C9B8EAA1DB4A2FB46ED0492D860 /* ConstraintMakerFinalizable.swift */; }; + C8BF641BEDC20159B138EA5CCBA7D9C5 /* ComponentMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3CDF0F230BCF4AE09F8F50427936928 /* ComponentMeta.swift */; }; + CB04034352789C17BB1AC56353242618 /* ConstraintInsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22CFC62BB626BFC290A3EB675D0CDB46 /* ConstraintInsetTarget.swift */; }; CBB7C95969423BCFBA41023336DAAAC0 /* Pods-MatrioskaExample-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5821DC17623EC5E1BCAD99DE87342DB1 /* Pods-MatrioskaExample-dummy.m */; }; - CF9F59E6FDCBCA77A2DA99D235CD96BD /* ConstraintMaker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6167E299BA9862893D87DDBF170B70 /* ConstraintMaker.swift */; }; - D591C8546B6B92CF98C179090F5EACEE /* ConstraintLayoutSupportDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CC7FF80150FA3840AD57BCE994C9FAB /* ConstraintLayoutSupportDSL.swift */; }; - DF775D359AA8965680EAD71915259BF6 /* JSONReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BBA40058FEAC16CCFCC20BD48210286 /* JSONReader.swift */; }; - F5243185C7C8DDDF1FC409EB6A2377E5 /* SnapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C42E6B36692CB79785C933E25719FA6F /* SnapKit.framework */; }; - F53FF4B422C72CA8548B2FFE14D07866 /* ConstraintRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4C807430C3A7B9A82E2DDD844C58759 /* ConstraintRelation.swift */; }; - F5D5C02BB15D2CB0C8F5C3E0B772EB6A /* UILayoutSupport+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */; }; - F5FD77D0ECFFE5D064ABC734AC57C301 /* Matrioska-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 934F66C37A9D2EFA8F7CB3A14EED2333 /* Matrioska-dummy.m */; }; - FFA79DFC7102D5B7AA8A5BA23DFCE4AA /* Matrioska-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C64518B050CD965FAC8E4C4C1EA2BEA /* Matrioska-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CF0DBA68E4F1AB070A87F2197B32107A /* Matrioska-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 215A66ADFE65824C82A3344F1E219AC7 /* Matrioska-dummy.m */; }; + D0199EAB499FD82A471A683D4278DF30 /* ConstraintRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C2FA711CC2C368EEDA5BAD45D4010DA /* ConstraintRelation.swift */; }; + D4E3986BE7F3BB4D2954555A3CB21D14 /* ConstraintLayoutSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2763A0EA2E6A0033D53DCA17D4FAEF8E /* ConstraintLayoutSupport.swift */; }; + D733D8E5668299A4DCE25F2FB732C2D7 /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C594D22569A20B2DD4FD2F791DE3A1F7 /* StackViewController.swift */; }; + DE90136D51F6E27D29B43681CB182D73 /* ConstraintLayoutGuideDSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DD880268101FA8A8A4BB8D1395A495E /* ConstraintLayoutGuideDSL.swift */; }; + ED12DB1CA6E5C8F2AD96E5B3CEAD956B /* ConstraintView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7734A45CA95170CC2638E6071C63FD1 /* ConstraintView+Extensions.swift */; }; + F684E98433A87DD19E44C8F30E158204 /* ConstraintOffsetTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7024DC2A56FCE4EA02DEDE4CA4EE46CE /* ConstraintOffsetTarget.swift */; }; + FE669EFBD3F03F1B1F1879D766279766 /* ConstraintItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A3F8BE1268CF6F9A6210219DF1712 /* ConstraintItem.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -65,191 +65,189 @@ isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = CDAED52734CDEA3F5B1B2C7B70845F6E; + remoteGlobalIDString = 33CA0B8CC847E9FBE27CFE805028FA4D; remoteInfo = SnapKit; }; 7440F439AF8645D02B61F20D1643A885 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 0FB92CB89E72923ECD89B42D50D69D22; + remoteGlobalIDString = 40B2396439A10813D8A9CD85474093DC; remoteInfo = Matrioska; }; - D22C25AE02B1FC6CB375F827884BD61F /* PBXContainerItemProxy */ = { + D4760210B9F94EC3F99F1012282087D6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = CDAED52734CDEA3F5B1B2C7B70845F6E; + remoteGlobalIDString = 33CA0B8CC847E9FBE27CFE805028FA4D; remoteInfo = SnapKit; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 041C7DFD4E40027278BABCCCD69743B2 /* ConstraintAttributes.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintAttributes.swift; path = Source/ConstraintAttributes.swift; sourceTree = ""; }; - 0729DC38B02A17974FD7A7238FCB1836 /* ConstraintMultiplierTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMultiplierTarget.swift; path = Source/ConstraintMultiplierTarget.swift; sourceTree = ""; }; - 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UILayoutSupport+Extensions.swift"; path = "Source/UILayoutSupport+Extensions.swift"; sourceTree = ""; }; + 02EADA41EDCFDB812BF4ED7298724198 /* SnapKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SnapKit.xcconfig; sourceTree = ""; }; + 03E48C3C03E21DAF8B6499ABDA6B1497 /* ConstraintPriorityTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintPriorityTarget.swift; path = Source/ConstraintPriorityTarget.swift; sourceTree = ""; }; + 0DD880268101FA8A8A4BB8D1395A495E /* ConstraintLayoutGuideDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutGuideDSL.swift; path = Source/ConstraintLayoutGuideDSL.swift; sourceTree = ""; }; + 0F38C8F99B3F5DB491B0EE1D96B6A068 /* Matrioska.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Matrioska.xcconfig; sourceTree = ""; }; + 1148FFA3A5A25B895091BDA89E8B6CCF /* SnapKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SnapKit-dummy.m"; sourceTree = ""; }; 1367C6F5311D05FDFBA37E96EE514019 /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SnapKit.framework; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 14426FA5248A96FBC6A531879E24CFA5 /* SnapKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-prefix.pch"; sourceTree = ""; }; - 1F2B728DCF7E9F88008827314C2AE823 /* ConstraintInsetTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintInsetTarget.swift; path = Source/ConstraintInsetTarget.swift; sourceTree = ""; }; - 212E2771F1CD458D21A0FB3CA1C914F3 /* ConstraintLayoutSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutSupport.swift; path = Source/ConstraintLayoutSupport.swift; sourceTree = ""; }; - 22FE423B5E8C4A0EE7A6981B4552CAFC /* StackViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackViewController.swift; sourceTree = ""; }; - 261BC3C65CE6EBBED920977848212F6F /* ConstraintMakerPriortizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerPriortizable.swift; path = Source/ConstraintMakerPriortizable.swift; sourceTree = ""; }; + 13798C9B8EAA1DB4A2FB46ED0492D860 /* ConstraintMakerFinalizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerFinalizable.swift; path = Source/ConstraintMakerFinalizable.swift; sourceTree = ""; }; + 1BCB532E3C41609856ED2472531853EC /* ConstraintDescription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintDescription.swift; path = Source/ConstraintDescription.swift; sourceTree = ""; }; + 1CFC0E627DA51A2EB7FBFC86ECF8F156 /* Component.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; + 215A66ADFE65824C82A3344F1E219AC7 /* Matrioska-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Matrioska-dummy.m"; sourceTree = ""; }; + 22CFC62BB626BFC290A3EB675D0CDB46 /* ConstraintInsetTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintInsetTarget.swift; path = Source/ConstraintInsetTarget.swift; sourceTree = ""; }; + 248AEA2F21F6DE9363E552EA098662E3 /* SnapKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-prefix.pch"; sourceTree = ""; }; 265D2639CCA0F9886680E5E6CA7A3943 /* Pods-MatrioskaExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MatrioskaExample.release.xcconfig"; sourceTree = ""; }; - 38AFDA242A23FF991F0CB99BE5AB9B08 /* UIColor+HEX.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+HEX.swift"; sourceTree = ""; }; - 39DF0B93DB211453EB990853DFC94773 /* TabBarCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TabBarCluster.swift; sourceTree = ""; }; - 3A6167E299BA9862893D87DDBF170B70 /* ConstraintMaker.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMaker.swift; path = Source/ConstraintMaker.swift; sourceTree = ""; }; - 3B90EF7CA55AE01CE50EAF5C3C574CDD /* Constraint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Constraint.swift; path = Source/Constraint.swift; sourceTree = ""; }; - 3FE15693153A62AC79B129BA5FFB7C3D /* ConstraintDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintDSL.swift; path = Source/ConstraintDSL.swift; sourceTree = ""; }; - 446C79107F482F7B2D7E4061657DCA44 /* ConstraintLayoutGuideDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutGuideDSL.swift; path = Source/ConstraintLayoutGuideDSL.swift; sourceTree = ""; }; - 4AFD95C089AB657DC457D673DF1D5B11 /* Matrioska.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Matrioska.xcconfig; sourceTree = ""; }; - 50BF4E341DC91F918DC3DD74CA4ADC22 /* SnapKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-umbrella.h"; sourceTree = ""; }; + 2763A0EA2E6A0033D53DCA17D4FAEF8E /* ConstraintLayoutSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutSupport.swift; path = Source/ConstraintLayoutSupport.swift; sourceTree = ""; }; + 28BB436A3869B5D170660943395D24F6 /* LayoutConstraint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LayoutConstraint.swift; path = Source/LayoutConstraint.swift; sourceTree = ""; }; + 2C2FA711CC2C368EEDA5BAD45D4010DA /* ConstraintRelation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintRelation.swift; path = Source/ConstraintRelation.swift; sourceTree = ""; }; + 2D5DAD773273C4A7AC377B281E0C0CBB /* ConstraintMakerEditable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerEditable.swift; path = Source/ConstraintMakerEditable.swift; sourceTree = ""; }; + 34761C5FA66E36E3AA4C0D5643435A84 /* Matrioska.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Matrioska.modulemap; sourceTree = ""; }; + 393CCE5B4F3EF728057923184C9FD2F9 /* UILayoutSupport+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UILayoutSupport+Extensions.swift"; path = "Source/UILayoutSupport+Extensions.swift"; sourceTree = ""; }; + 41EF2450D46E21B236466CE3E0CA379D /* ConstraintMakerExtendable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerExtendable.swift; path = Source/ConstraintMakerExtendable.swift; sourceTree = ""; }; + 43962A108464EC534C7D0B705DD5A155 /* StackCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackCluster.swift; sourceTree = ""; }; + 4425C1059FCCD8D526EFE336FBC1DD6D /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; + 45A33EE95C11878E65CD0F5BCF9596B5 /* ConstraintView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintView.swift; path = Source/ConstraintView.swift; sourceTree = ""; }; + 4BA64B4AA54CB104E0213313D7D6D934 /* ConstraintMakerPriortizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerPriortizable.swift; path = Source/ConstraintMakerPriortizable.swift; sourceTree = ""; }; + 4E13A60704984FFCE2EAF3EC6B388889 /* UIColor+HEX.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+HEX.swift"; sourceTree = ""; }; + 4F065F60C461CF91942D20D1FF687316 /* ConstraintInsets.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintInsets.swift; path = Source/ConstraintInsets.swift; sourceTree = ""; }; + 506613B752A33A3A806FA930A7CF602B /* Matrioska-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Matrioska-prefix.pch"; sourceTree = ""; }; + 54AFDD7F5B3230CC0AD71D1A5F8B1315 /* Constraint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Constraint.swift; path = Source/Constraint.swift; sourceTree = ""; }; 5821DC17623EC5E1BCAD99DE87342DB1 /* Pods-MatrioskaExample-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-MatrioskaExample-dummy.m"; sourceTree = ""; }; - 5934E844D984EA64B0846C3DBD6A618E /* StackCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackCluster.swift; sourceTree = ""; }; - 597734A7EDE6E13F6D1939A7C7373CD1 /* ConstraintConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintConfig.swift; path = Source/ConstraintConfig.swift; sourceTree = ""; }; - 6C6AA23AB7E7C6088CD75971FB1093D9 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6CC7FF80150FA3840AD57BCE994C9FAB /* ConstraintLayoutSupportDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutSupportDSL.swift; path = Source/ConstraintLayoutSupportDSL.swift; sourceTree = ""; }; - 728A11CB93E2EC8CE71FB3C24F59AB29 /* ComponentMeta.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; }; - 737B1700C2C19AD11C2872C1C46EC8D4 /* Debugging.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debugging.swift; path = Source/Debugging.swift; sourceTree = ""; }; - 73878F9931EAA78C3DAAF7DDA048218E /* LayoutConstraint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LayoutConstraint.swift; path = Source/LayoutConstraint.swift; sourceTree = ""; }; - 7B4759EEB4180EAF3DA189AAE28199AC /* UILayoutGuide+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UILayoutGuide+Extensions.swift"; path = "Source/UILayoutGuide+Extensions.swift"; sourceTree = ""; }; - 7BEA23F4393572EE30AED50A651CD185 /* ConstraintItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintItem.swift; path = Source/ConstraintItem.swift; sourceTree = ""; }; - 813C2A5263E149C889A2DF40FFDD89BA /* ConstraintRelatableTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintRelatableTarget.swift; path = Source/ConstraintRelatableTarget.swift; sourceTree = ""; }; - 83B30B615FC5001A5EE964CD181A810D /* IntrinsicSizeAwareScrollView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = IntrinsicSizeAwareScrollView.swift; sourceTree = ""; }; + 64F525860135BB4B15140D581DDBC96C /* ConstraintLayoutSupportDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutSupportDSL.swift; path = Source/ConstraintLayoutSupportDSL.swift; sourceTree = ""; }; + 7024DC2A56FCE4EA02DEDE4CA4EE46CE /* ConstraintOffsetTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintOffsetTarget.swift; path = Source/ConstraintOffsetTarget.swift; sourceTree = ""; }; + 73DD5EE1A1A00711D127BB0AC7F0CD22 /* ConstraintAttributes.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintAttributes.swift; path = Source/ConstraintAttributes.swift; sourceTree = ""; }; + 798A7BCB4028F09A0F4E7D42CDC35520 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 806B03EAD3E4480C34089B4D666AAEF8 /* ConstraintDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintDSL.swift; path = Source/ConstraintDSL.swift; sourceTree = ""; }; 857837F254F449F3BC19F608228401E0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 8616FCCE508F64F7355C8931296092E0 /* Matrioska-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Matrioska-prefix.pch"; sourceTree = ""; }; - 8705AFD8FF18225FA8BB0228A69E72AA /* ConstraintMakerExtendable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerExtendable.swift; path = Source/ConstraintMakerExtendable.swift; sourceTree = ""; }; - 8785ED0787E328B8ADE545DD56AD1B6F /* Matrioska.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Matrioska.modulemap; sourceTree = ""; }; - 87CCF4DB7EFBDC070B92BFC0BC0D2C8C /* ConstraintMakerRelatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerRelatable.swift; path = Source/ConstraintMakerRelatable.swift; sourceTree = ""; }; - 8B78113584563565B18CD0248D9D0A93 /* ConstraintViewDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintViewDSL.swift; path = Source/ConstraintViewDSL.swift; sourceTree = ""; }; - 8BBA40058FEAC16CCFCC20BD48210286 /* JSONReader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONReader.swift; sourceTree = ""; }; - 934F66C37A9D2EFA8F7CB3A14EED2333 /* Matrioska-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Matrioska-dummy.m"; sourceTree = ""; }; + 8A7F8AAA627053DF20188AE787C733CF /* LayoutConstraintItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LayoutConstraintItem.swift; path = Source/LayoutConstraintItem.swift; sourceTree = ""; }; + 8B7CD84D6E9F6A3E62717314BF109323 /* ConstraintLayoutGuide.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutGuide.swift; path = Source/ConstraintLayoutGuide.swift; sourceTree = ""; }; + 8E30F7EABFBAB46D74E7B19A06B1D7AD /* ConstraintViewDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintViewDSL.swift; path = Source/ConstraintViewDSL.swift; sourceTree = ""; }; + 8F159460515FBA865D897FD0807CDD29 /* ConstraintMaker.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMaker.swift; path = Source/ConstraintMaker.swift; sourceTree = ""; }; + 932F64317CB085F5AF53C6822F3EFBC3 /* ConstraintConstantTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintConstantTarget.swift; path = Source/ConstraintConstantTarget.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 97F0138AE8EA08984375344610BE7E1E /* ConstraintPriorityTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintPriorityTarget.swift; path = Source/ConstraintPriorityTarget.swift; sourceTree = ""; }; - 9C64518B050CD965FAC8E4C4C1EA2BEA /* Matrioska-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Matrioska-umbrella.h"; sourceTree = ""; }; - 9F675DF8551ECAD72F0C6D96084C6DD4 /* SnapKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SnapKit-dummy.m"; sourceTree = ""; }; - 9F8ECEBD49CA569FC524CB77465180B6 /* ConstraintMakerEditable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerEditable.swift; path = Source/ConstraintMakerEditable.swift; sourceTree = ""; }; - 9FF8D738ED38151046BD3CB10EA1C267 /* ClusterLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; + 93BBA53E5359D7752DB98E36BC10384F /* SnapKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-umbrella.h"; sourceTree = ""; }; + 9912385FCF71D8E097B5978DD988FA6B /* ConstraintRelatableTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintRelatableTarget.swift; path = Source/ConstraintRelatableTarget.swift; sourceTree = ""; }; A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Matrioska.framework; path = Matrioska.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A77A10AC741F15F2412809F03C82B8FD /* Pods-MatrioskaExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MatrioskaExample.debug.xcconfig"; sourceTree = ""; }; - AF1BDEFD46348EE8C41DE053AEDBFD1B /* ConstraintOffsetTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintOffsetTarget.swift; path = Source/ConstraintOffsetTarget.swift; sourceTree = ""; }; - B202FDD7D7CE5B392F1DAF641C0DF8C2 /* Component.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Component.swift; sourceTree = ""; }; + AA8A26EF51D384D2D1E8867E5B73F417 /* ConstraintConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintConfig.swift; path = Source/ConstraintConfig.swift; sourceTree = ""; }; + ACAD45F99697AA414586E26D357E9FA2 /* ConstraintLayoutGuide+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ConstraintLayoutGuide+Extensions.swift"; path = "Source/ConstraintLayoutGuide+Extensions.swift"; sourceTree = ""; }; + B242F3B275EB519225548E9F142B62AC /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B4E3E0231330567ABB197F1F0DA70261 /* Pods-MatrioskaExample.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-MatrioskaExample.modulemap"; sourceTree = ""; }; - B525F7008B3760076D71FE29C0859BDC /* ConstraintLayoutGuide.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutGuide.swift; path = Source/ConstraintLayoutGuide.swift; sourceTree = ""; }; + B595FA2F9D098E7C46DFFFAE53FA999D /* SnapKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = SnapKit.modulemap; sourceTree = ""; }; B6EE3F460D1600FAF881B500AD8D239C /* Pods-MatrioskaExample-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-MatrioskaExample-umbrella.h"; sourceTree = ""; }; - B7D4645BD3C0100FB7E1B4A6FDC96E0B /* SnapKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = SnapKit.modulemap; sourceTree = ""; }; + B7734A45CA95170CC2638E6071C63FD1 /* ConstraintView+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ConstraintView+Extensions.swift"; path = "Source/ConstraintView+Extensions.swift"; sourceTree = ""; }; + BADAC8FC48CC6E183B88F09C368DD793 /* ConstraintMultiplierTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMultiplierTarget.swift; path = Source/ConstraintMultiplierTarget.swift; sourceTree = ""; }; BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_MatrioskaExample.framework; path = "Pods-MatrioskaExample.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; BF2B524D7E160AA0C293D6D884CE4537 /* Pods-MatrioskaExample-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MatrioskaExample-acknowledgements.plist"; sourceTree = ""; }; C42E6B36692CB79785C933E25719FA6F /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C4C807430C3A7B9A82E2DDD844C58759 /* ConstraintRelation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintRelation.swift; path = Source/ConstraintRelation.swift; sourceTree = ""; }; - CA274E8C59BA433F4975D535FA594EFA /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - CB70FEBA9EF66CAAA461E6F3F819716B /* ConstraintDescription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintDescription.swift; path = Source/ConstraintDescription.swift; sourceTree = ""; }; + C594D22569A20B2DD4FD2F791DE3A1F7 /* StackViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StackViewController.swift; sourceTree = ""; }; CCA5B74A364868C16F69B955B38B05DD /* Pods-MatrioskaExample-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MatrioskaExample-acknowledgements.markdown"; sourceTree = ""; }; CFE99A1044589BB7662A737268BCD6E7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D61CFA974F0733418729D3C1AB335DFA /* Pods-MatrioskaExample-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MatrioskaExample-frameworks.sh"; sourceTree = ""; }; - D8AA583273C076DD4A1EBAFDDA0E89A8 /* ConstraintMakerFinalizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerFinalizable.swift; path = Source/ConstraintMakerFinalizable.swift; sourceTree = ""; }; - E11295210FBB75091BE22529081A2720 /* ConstraintView+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ConstraintView+Extensions.swift"; path = "Source/ConstraintView+Extensions.swift"; sourceTree = ""; }; + D81A3F8BE1268CF6F9A6210219DF1712 /* ConstraintItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintItem.swift; path = Source/ConstraintItem.swift; sourceTree = ""; }; + D91E122D0C780D351532ACDDF7560AFA /* ClusterLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClusterLayout.swift; sourceTree = ""; }; + DBEE224188F8E33F19948160CBAA00EC /* JSONFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; + DE182E16C1C28038C682A2C6788FAF4E /* ConstraintMakerRelatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerRelatable.swift; path = Source/ConstraintMakerRelatable.swift; sourceTree = ""; }; + E3355B0BCCC9EDD3676AE09A24AC5FFE /* Matrioska-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Matrioska-umbrella.h"; sourceTree = ""; }; E6FE901FA384639511979F981151B3D6 /* Pods-MatrioskaExample-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MatrioskaExample-resources.sh"; sourceTree = ""; }; - E855200DC6085FF07EBD87301AD370C9 /* ConstraintInsets.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintInsets.swift; path = Source/ConstraintInsets.swift; sourceTree = ""; }; - E885DC7A2C93B352F3CCBAF6C4F30F7F /* SnapKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SnapKit.xcconfig; sourceTree = ""; }; - EBCF77FFA89397B4F19B5CD8A7BDB0A3 /* ConstraintView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintView.swift; path = Source/ConstraintView.swift; sourceTree = ""; }; - F9319AF949935BC0602093E0830E8B10 /* ConstraintConstantTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintConstantTarget.swift; path = Source/ConstraintConstantTarget.swift; sourceTree = ""; }; - FF74E9BB4282FF36A50B1CAD0AA73CBF /* JSONFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONFactory.swift; sourceTree = ""; }; + E8A47693B9CDD5AD4665CBA69F28FEB9 /* TabBarCluster.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TabBarCluster.swift; sourceTree = ""; }; + F3CDF0F230BCF4AE09F8F50427936928 /* ComponentMeta.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ComponentMeta.swift; sourceTree = ""; }; + FCBBA7FFB185B57819C967D8B5AE699E /* Debugging.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debugging.swift; path = Source/Debugging.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - AD6733DC47BCB886AD7EE3A48487916F /* Frameworks */ = { + 1F4473C9E2AC00059452FCA8E1F17E04 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2CC8CC2790B55707BD59CCA33A644B5B /* Foundation.framework in Frameworks */, - F5243185C7C8DDDF1FC409EB6A2377E5 /* SnapKit.framework in Frameworks */, + BC8E6AB7927C5B26AB8FB33466D36A13 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - AF7CD9D75CED7FB190CBE16A81FA9FD5 /* Frameworks */ = { + D0154D10D1FE463563CCBBB532BB1775 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3B20C6AEEA10C5EFB6D84650F6E8F391 /* Foundation.framework in Frameworks */, + 1A10510204E489B1C3185EF8040C3DDA /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - D0154D10D1FE463563CCBBB532BB1775 /* Frameworks */ = { + E6EAD0AC8395C49D2A663F921B60D844 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1A10510204E489B1C3185EF8040C3DDA /* Foundation.framework in Frameworks */, + 3C61CF88B55F87AC54688F8C0995FBF5 /* Foundation.framework in Frameworks */, + 6FBA68991ADF848CD716332D87F684A8 /* SnapKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 05703C849B29D1EF8195C8FE0EC6AF9E /* SnapKit */ = { + 07C9D799D977ED30993956E6822041F4 /* Support Files */ = { isa = PBXGroup; children = ( - 3B90EF7CA55AE01CE50EAF5C3C574CDD /* Constraint.swift */, - 041C7DFD4E40027278BABCCCD69743B2 /* ConstraintAttributes.swift */, - 597734A7EDE6E13F6D1939A7C7373CD1 /* ConstraintConfig.swift */, - F9319AF949935BC0602093E0830E8B10 /* ConstraintConstantTarget.swift */, - CB70FEBA9EF66CAAA461E6F3F819716B /* ConstraintDescription.swift */, - 3FE15693153A62AC79B129BA5FFB7C3D /* ConstraintDSL.swift */, - E855200DC6085FF07EBD87301AD370C9 /* ConstraintInsets.swift */, - 1F2B728DCF7E9F88008827314C2AE823 /* ConstraintInsetTarget.swift */, - 7BEA23F4393572EE30AED50A651CD185 /* ConstraintItem.swift */, - B525F7008B3760076D71FE29C0859BDC /* ConstraintLayoutGuide.swift */, - 446C79107F482F7B2D7E4061657DCA44 /* ConstraintLayoutGuideDSL.swift */, - 212E2771F1CD458D21A0FB3CA1C914F3 /* ConstraintLayoutSupport.swift */, - 6CC7FF80150FA3840AD57BCE994C9FAB /* ConstraintLayoutSupportDSL.swift */, - 3A6167E299BA9862893D87DDBF170B70 /* ConstraintMaker.swift */, - 9F8ECEBD49CA569FC524CB77465180B6 /* ConstraintMakerEditable.swift */, - 8705AFD8FF18225FA8BB0228A69E72AA /* ConstraintMakerExtendable.swift */, - D8AA583273C076DD4A1EBAFDDA0E89A8 /* ConstraintMakerFinalizable.swift */, - 261BC3C65CE6EBBED920977848212F6F /* ConstraintMakerPriortizable.swift */, - 87CCF4DB7EFBDC070B92BFC0BC0D2C8C /* ConstraintMakerRelatable.swift */, - 0729DC38B02A17974FD7A7238FCB1836 /* ConstraintMultiplierTarget.swift */, - AF1BDEFD46348EE8C41DE053AEDBFD1B /* ConstraintOffsetTarget.swift */, - 97F0138AE8EA08984375344610BE7E1E /* ConstraintPriorityTarget.swift */, - 813C2A5263E149C889A2DF40FFDD89BA /* ConstraintRelatableTarget.swift */, - C4C807430C3A7B9A82E2DDD844C58759 /* ConstraintRelation.swift */, - EBCF77FFA89397B4F19B5CD8A7BDB0A3 /* ConstraintView.swift */, - E11295210FBB75091BE22529081A2720 /* ConstraintView+Extensions.swift */, - 8B78113584563565B18CD0248D9D0A93 /* ConstraintViewDSL.swift */, - 737B1700C2C19AD11C2872C1C46EC8D4 /* Debugging.swift */, - 73878F9931EAA78C3DAAF7DDA048218E /* LayoutConstraint.swift */, - 7B4759EEB4180EAF3DA189AAE28199AC /* UILayoutGuide+Extensions.swift */, - 0AB21FA0A2E5B45AB133215CC241236D /* UILayoutSupport+Extensions.swift */, - 458932A7F6390E9028454F0A27A50A13 /* Support Files */, + B242F3B275EB519225548E9F142B62AC /* Info.plist */, + 34761C5FA66E36E3AA4C0D5643435A84 /* Matrioska.modulemap */, + 0F38C8F99B3F5DB491B0EE1D96B6A068 /* Matrioska.xcconfig */, + 215A66ADFE65824C82A3344F1E219AC7 /* Matrioska-dummy.m */, + 506613B752A33A3A806FA930A7CF602B /* Matrioska-prefix.pch */, + E3355B0BCCC9EDD3676AE09A24AC5FFE /* Matrioska-umbrella.h */, ); - name = SnapKit; - path = SnapKit; + name = "Support Files"; + path = "Example/Pods/Target Support Files/Matrioska"; sourceTree = ""; }; - 070EA31170DA453764D98F1A95C81BFF /* Source */ = { + 1BD1630D000327EFCD41F9D49FFD154E /* Views */ = { isa = PBXGroup; children = ( - ACD9699D6D5D155BED40EEF305C3EA7A /* Components */, - A172800B7038173179E2B03092F73359 /* Factories */, - A8307A1217EB98358B55FB1954EEFF9A /* Helpers */, - F792648E4D585EA47DDFAEBCEC848FC5 /* JSON */, - D9E91DDF8A1478085298BD150DA2E15C /* Views */, + 4425C1059FCCD8D526EFE336FBC1DD6D /* IntrinsicSizeAwareScrollView.swift */, + C594D22569A20B2DD4FD2F791DE3A1F7 /* StackViewController.swift */, ); - name = Source; - path = Source; + name = Views; + path = Views; sourceTree = ""; }; - 458932A7F6390E9028454F0A27A50A13 /* Support Files */ = { + 4129BAA359D40A3B04EDC388EBCCC7FB /* SnapKit */ = { isa = PBXGroup; children = ( - CA274E8C59BA433F4975D535FA594EFA /* Info.plist */, - B7D4645BD3C0100FB7E1B4A6FDC96E0B /* SnapKit.modulemap */, - E885DC7A2C93B352F3CCBAF6C4F30F7F /* SnapKit.xcconfig */, - 9F675DF8551ECAD72F0C6D96084C6DD4 /* SnapKit-dummy.m */, - 14426FA5248A96FBC6A531879E24CFA5 /* SnapKit-prefix.pch */, - 50BF4E341DC91F918DC3DD74CA4ADC22 /* SnapKit-umbrella.h */, + 54AFDD7F5B3230CC0AD71D1A5F8B1315 /* Constraint.swift */, + 73DD5EE1A1A00711D127BB0AC7F0CD22 /* ConstraintAttributes.swift */, + AA8A26EF51D384D2D1E8867E5B73F417 /* ConstraintConfig.swift */, + 932F64317CB085F5AF53C6822F3EFBC3 /* ConstraintConstantTarget.swift */, + 1BCB532E3C41609856ED2472531853EC /* ConstraintDescription.swift */, + 806B03EAD3E4480C34089B4D666AAEF8 /* ConstraintDSL.swift */, + 4F065F60C461CF91942D20D1FF687316 /* ConstraintInsets.swift */, + 22CFC62BB626BFC290A3EB675D0CDB46 /* ConstraintInsetTarget.swift */, + D81A3F8BE1268CF6F9A6210219DF1712 /* ConstraintItem.swift */, + 8B7CD84D6E9F6A3E62717314BF109323 /* ConstraintLayoutGuide.swift */, + ACAD45F99697AA414586E26D357E9FA2 /* ConstraintLayoutGuide+Extensions.swift */, + 0DD880268101FA8A8A4BB8D1395A495E /* ConstraintLayoutGuideDSL.swift */, + 2763A0EA2E6A0033D53DCA17D4FAEF8E /* ConstraintLayoutSupport.swift */, + 64F525860135BB4B15140D581DDBC96C /* ConstraintLayoutSupportDSL.swift */, + 8F159460515FBA865D897FD0807CDD29 /* ConstraintMaker.swift */, + 2D5DAD773273C4A7AC377B281E0C0CBB /* ConstraintMakerEditable.swift */, + 41EF2450D46E21B236466CE3E0CA379D /* ConstraintMakerExtendable.swift */, + 13798C9B8EAA1DB4A2FB46ED0492D860 /* ConstraintMakerFinalizable.swift */, + 4BA64B4AA54CB104E0213313D7D6D934 /* ConstraintMakerPriortizable.swift */, + DE182E16C1C28038C682A2C6788FAF4E /* ConstraintMakerRelatable.swift */, + BADAC8FC48CC6E183B88F09C368DD793 /* ConstraintMultiplierTarget.swift */, + 7024DC2A56FCE4EA02DEDE4CA4EE46CE /* ConstraintOffsetTarget.swift */, + 03E48C3C03E21DAF8B6499ABDA6B1497 /* ConstraintPriorityTarget.swift */, + 9912385FCF71D8E097B5978DD988FA6B /* ConstraintRelatableTarget.swift */, + 2C2FA711CC2C368EEDA5BAD45D4010DA /* ConstraintRelation.swift */, + 45A33EE95C11878E65CD0F5BCF9596B5 /* ConstraintView.swift */, + B7734A45CA95170CC2638E6071C63FD1 /* ConstraintView+Extensions.swift */, + 8E30F7EABFBAB46D74E7B19A06B1D7AD /* ConstraintViewDSL.swift */, + FCBBA7FFB185B57819C967D8B5AE699E /* Debugging.swift */, + 28BB436A3869B5D170660943395D24F6 /* LayoutConstraint.swift */, + 8A7F8AAA627053DF20188AE787C733CF /* LayoutConstraintItem.swift */, + 393CCE5B4F3EF728057923184C9FD2F9 /* UILayoutSupport+Extensions.swift */, + ED78B8B0724B3FE8B8EEF081A87A318E /* Support Files */, ); - name = "Support Files"; - path = "../Target Support Files/SnapKit"; + name = SnapKit; + path = SnapKit; sourceTree = ""; }; 6FBBCFDAAB509CB53C9C9421A31BD9FA /* Pods-MatrioskaExample */ = { @@ -270,14 +268,29 @@ path = "Target Support Files/Pods-MatrioskaExample"; sourceTree = ""; }; - 766969EC9F3CD004BD796AE8853B04F6 /* Matrioska */ = { + 7032839191F8C749414D3AFF4C0AFEFC /* Source */ = { isa = PBXGroup; children = ( - 070EA31170DA453764D98F1A95C81BFF /* Source */, - 83C7BF7B0C6F2CD6FD52883E1E67A3CE /* Support Files */, + 73D084BF9297A29629B7482820E11C9C /* Components */, + 91FACC9FA1CF9266C5175FBEE29EA99D /* Factories */, + BCBFECAA49762A6A2019D199ABA1F49D /* Helpers */, + 1BD1630D000327EFCD41F9D49FFD154E /* Views */, ); - name = Matrioska; - path = ../..; + name = Source; + path = Source; + sourceTree = ""; + }; + 73D084BF9297A29629B7482820E11C9C /* Components */ = { + isa = PBXGroup; + children = ( + D91E122D0C780D351532ACDDF7560AFA /* ClusterLayout.swift */, + 1CFC0E627DA51A2EB7FBFC86ECF8F156 /* Component.swift */, + F3CDF0F230BCF4AE09F8F50427936928 /* ComponentMeta.swift */, + 43962A108464EC534C7D0B705DD5A155 /* StackCluster.swift */, + E8A47693B9CDD5AD4665CBA69F28FEB9 /* TabBarCluster.swift */, + ); + name = Components; + path = Components; sourceTree = ""; }; 7DB346D0F39D3F0E887471402A8071AB = { @@ -286,26 +299,12 @@ 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 9396AC7FE706F8EC15E2DB9C156DE03F /* Development Pods */, D8B25C6DF01BE2C3F2FA6A25AEE6417A /* Frameworks */, - FCB3E800ADEFE141C46C6B85E298DF53 /* Pods */, + C9326120DE4E11AA3972219A55E1A8DA /* Pods */, 89FF8C24D82A3BBAAF0E3412465917A7 /* Products */, 9946F224DC42175BA82CE42F1C19DB92 /* Targets Support Files */, ); sourceTree = ""; }; - 83C7BF7B0C6F2CD6FD52883E1E67A3CE /* Support Files */ = { - isa = PBXGroup; - children = ( - 6C6AA23AB7E7C6088CD75971FB1093D9 /* Info.plist */, - 8785ED0787E328B8ADE545DD56AD1B6F /* Matrioska.modulemap */, - 4AFD95C089AB657DC457D673DF1D5B11 /* Matrioska.xcconfig */, - 934F66C37A9D2EFA8F7CB3A14EED2333 /* Matrioska-dummy.m */, - 8616FCCE508F64F7355C8931296092E0 /* Matrioska-prefix.pch */, - 9C64518B050CD965FAC8E4C4C1EA2BEA /* Matrioska-umbrella.h */, - ); - name = "Support Files"; - path = "Example/Pods/Target Support Files/Matrioska"; - sourceTree = ""; - }; 89FF8C24D82A3BBAAF0E3412465917A7 /* Products */ = { isa = PBXGroup; children = ( @@ -316,10 +315,19 @@ name = Products; sourceTree = ""; }; + 91FACC9FA1CF9266C5175FBEE29EA99D /* Factories */ = { + isa = PBXGroup; + children = ( + DBEE224188F8E33F19948160CBAA00EC /* JSONFactory.swift */, + ); + name = Factories; + path = Factories; + sourceTree = ""; + }; 9396AC7FE706F8EC15E2DB9C156DE03F /* Development Pods */ = { isa = PBXGroup; children = ( - 766969EC9F3CD004BD796AE8853B04F6 /* Matrioska */, + B567BDE2AA326D2D2A3773C9A2ACBB04 /* Matrioska */, ); name = "Development Pods"; sourceTree = ""; @@ -332,43 +340,39 @@ name = "Targets Support Files"; sourceTree = ""; }; - A172800B7038173179E2B03092F73359 /* Factories */ = { + B567BDE2AA326D2D2A3773C9A2ACBB04 /* Matrioska */ = { isa = PBXGroup; children = ( - FF74E9BB4282FF36A50B1CAD0AA73CBF /* JSONFactory.swift */, + 7032839191F8C749414D3AFF4C0AFEFC /* Source */, + 07C9D799D977ED30993956E6822041F4 /* Support Files */, ); - name = Factories; - path = Factories; + name = Matrioska; + path = ../..; sourceTree = ""; }; - A8307A1217EB98358B55FB1954EEFF9A /* Helpers */ = { + BCBFECAA49762A6A2019D199ABA1F49D /* Helpers */ = { isa = PBXGroup; children = ( - 38AFDA242A23FF991F0CB99BE5AB9B08 /* UIColor+HEX.swift */, + 4E13A60704984FFCE2EAF3EC6B388889 /* UIColor+HEX.swift */, ); name = Helpers; path = Helpers; sourceTree = ""; }; - ACD9699D6D5D155BED40EEF305C3EA7A /* Components */ = { + C75C61F59D5032C1A587740F37062DA5 /* iOS */ = { isa = PBXGroup; children = ( - 9FF8D738ED38151046BD3CB10EA1C267 /* ClusterLayout.swift */, - B202FDD7D7CE5B392F1DAF641C0DF8C2 /* Component.swift */, - 728A11CB93E2EC8CE71FB3C24F59AB29 /* ComponentMeta.swift */, - 5934E844D984EA64B0846C3DBD6A618E /* StackCluster.swift */, - 39DF0B93DB211453EB990853DFC94773 /* TabBarCluster.swift */, + 857837F254F449F3BC19F608228401E0 /* Foundation.framework */, ); - name = Components; - path = Components; + name = iOS; sourceTree = ""; }; - C75C61F59D5032C1A587740F37062DA5 /* iOS */ = { + C9326120DE4E11AA3972219A55E1A8DA /* Pods */ = { isa = PBXGroup; children = ( - 857837F254F449F3BC19F608228401E0 /* Foundation.framework */, + 4129BAA359D40A3B04EDC388EBCCC7FB /* SnapKit */, ); - name = iOS; + name = Pods; sourceTree = ""; }; D8B25C6DF01BE2C3F2FA6A25AEE6417A /* Frameworks */ = { @@ -380,49 +384,36 @@ name = Frameworks; sourceTree = ""; }; - D9E91DDF8A1478085298BD150DA2E15C /* Views */ = { - isa = PBXGroup; - children = ( - 83B30B615FC5001A5EE964CD181A810D /* IntrinsicSizeAwareScrollView.swift */, - 22FE423B5E8C4A0EE7A6981B4552CAFC /* StackViewController.swift */, - ); - name = Views; - path = Views; - sourceTree = ""; - }; - F792648E4D585EA47DDFAEBCEC848FC5 /* JSON */ = { + ED78B8B0724B3FE8B8EEF081A87A318E /* Support Files */ = { isa = PBXGroup; children = ( - 8BBA40058FEAC16CCFCC20BD48210286 /* JSONReader.swift */, + 798A7BCB4028F09A0F4E7D42CDC35520 /* Info.plist */, + B595FA2F9D098E7C46DFFFAE53FA999D /* SnapKit.modulemap */, + 02EADA41EDCFDB812BF4ED7298724198 /* SnapKit.xcconfig */, + 1148FFA3A5A25B895091BDA89E8B6CCF /* SnapKit-dummy.m */, + 248AEA2F21F6DE9363E552EA098662E3 /* SnapKit-prefix.pch */, + 93BBA53E5359D7752DB98E36BC10384F /* SnapKit-umbrella.h */, ); - name = JSON; - path = JSON; - sourceTree = ""; - }; - FCB3E800ADEFE141C46C6B85E298DF53 /* Pods */ = { - isa = PBXGroup; - children = ( - 05703C849B29D1EF8195C8FE0EC6AF9E /* SnapKit */, - ); - name = Pods; + name = "Support Files"; + path = "../Target Support Files/SnapKit"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 7D46B23F03B128D542F51E5734FFB2FE /* Headers */ = { + 6C5BFE6D3C10EC31A9D1289E1A8F547B /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 3CA21434A05CE7E8A11733B64D157950 /* SnapKit-umbrella.h in Headers */, + 5B4C918A5B6AEC0FE70E99458443A171 /* SnapKit-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - DB78BFDDB186C820313F3BED4D84C776 /* Headers */ = { + A924BA8C697217A762877868BF00209A /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - FFA79DFC7102D5B7AA8A5BA23DFCE4AA /* Matrioska-umbrella.h in Headers */, + 4BFEE56751888452EABAD895D3534CB9 /* Matrioska-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -437,24 +428,6 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 0FB92CB89E72923ECD89B42D50D69D22 /* Matrioska */ = { - isa = PBXNativeTarget; - buildConfigurationList = 07CAD9B5E98A2F5F57D96D1174303EA2 /* Build configuration list for PBXNativeTarget "Matrioska" */; - buildPhases = ( - B5E940610356DF418059D687BF3F2EDA /* Sources */, - AD6733DC47BCB886AD7EE3A48487916F /* Frameworks */, - DB78BFDDB186C820313F3BED4D84C776 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 82838968315A9F075EDF472C8A327DBE /* PBXTargetDependency */, - ); - name = Matrioska; - productName = Matrioska; - productReference = A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */; - productType = "com.apple.product-type.framework"; - }; 2C79BD22007D5C4563E92D122F63A24D /* Pods-MatrioskaExample */ = { isa = PBXNativeTarget; buildConfigurationList = E9FE26A96651107F552176A1429EE6EE /* Build configuration list for PBXNativeTarget "Pods-MatrioskaExample" */; @@ -474,13 +447,13 @@ productReference = BBE9F7101D1F60A5A61A31D6CF1FEB9F /* Pods_MatrioskaExample.framework */; productType = "com.apple.product-type.framework"; }; - CDAED52734CDEA3F5B1B2C7B70845F6E /* SnapKit */ = { + 33CA0B8CC847E9FBE27CFE805028FA4D /* SnapKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 22CCD7F81E4357523AC131CF0D6B7A14 /* Build configuration list for PBXNativeTarget "SnapKit" */; + buildConfigurationList = 7EC48A2E5553FCE544F55F942211500A /* Build configuration list for PBXNativeTarget "SnapKit" */; buildPhases = ( - C2A00187E51C3D1AED52AB96929EFFC4 /* Sources */, - AF7CD9D75CED7FB190CBE16A81FA9FD5 /* Frameworks */, - 7D46B23F03B128D542F51E5734FFB2FE /* Headers */, + 10A0FA9B36862B1C8EE0C95327E058E6 /* Sources */, + 1F4473C9E2AC00059452FCA8E1F17E04 /* Frameworks */, + 6C5BFE6D3C10EC31A9D1289E1A8F547B /* Headers */, ); buildRules = ( ); @@ -491,6 +464,24 @@ productReference = 1367C6F5311D05FDFBA37E96EE514019 /* SnapKit.framework */; productType = "com.apple.product-type.framework"; }; + 40B2396439A10813D8A9CD85474093DC /* Matrioska */ = { + isa = PBXNativeTarget; + buildConfigurationList = 469A8B172273C74432E39C05CEE37D47 /* Build configuration list for PBXNativeTarget "Matrioska" */; + buildPhases = ( + 85AE76FABC78424F35359AAAD7270D38 /* Sources */, + E6EAD0AC8395C49D2A663F921B60D844 /* Frameworks */, + A924BA8C697217A762877868BF00209A /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 5C3989074DD6C4A05F4C4FA0D62E2DD6 /* PBXTargetDependency */, + ); + name = Matrioska; + productName = Matrioska; + productReference = A15769852F30012902C538DCBE3CDDF7 /* Matrioska.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -512,76 +503,76 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 0FB92CB89E72923ECD89B42D50D69D22 /* Matrioska */, + 40B2396439A10813D8A9CD85474093DC /* Matrioska */, 2C79BD22007D5C4563E92D122F63A24D /* Pods-MatrioskaExample */, - CDAED52734CDEA3F5B1B2C7B70845F6E /* SnapKit */, + 33CA0B8CC847E9FBE27CFE805028FA4D /* SnapKit */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 924105E89E8A05BD7858ED2B80B08D1E /* Sources */ = { + 10A0FA9B36862B1C8EE0C95327E058E6 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CBB7C95969423BCFBA41023336DAAAC0 /* Pods-MatrioskaExample-dummy.m in Sources */, + BCF331A96BE0E6C0C78A9163B678011B /* Constraint.swift in Sources */, + 847340DC7B98EA7FB9FBAA59FE084A81 /* ConstraintAttributes.swift in Sources */, + 06416811072A1D77899513B3DD03D435 /* ConstraintConfig.swift in Sources */, + 28BA3D9A1DEBCFD9D48E2E3D25448CC3 /* ConstraintConstantTarget.swift in Sources */, + 0E4D0255D61511AF58C0827A8F6526A9 /* ConstraintDescription.swift in Sources */, + BB5EDFEC222EC5254AD2F4353F1C77A9 /* ConstraintDSL.swift in Sources */, + 5AC8959915ACEA64DEBA60081B87EF38 /* ConstraintInsets.swift in Sources */, + CB04034352789C17BB1AC56353242618 /* ConstraintInsetTarget.swift in Sources */, + FE669EFBD3F03F1B1F1879D766279766 /* ConstraintItem.swift in Sources */, + 7E92628EBEEF5EC1DBE141CE4A484749 /* ConstraintLayoutGuide+Extensions.swift in Sources */, + 74BCA628291BD1F1D4E57A6F77EE914F /* ConstraintLayoutGuide.swift in Sources */, + DE90136D51F6E27D29B43681CB182D73 /* ConstraintLayoutGuideDSL.swift in Sources */, + D4E3986BE7F3BB4D2954555A3CB21D14 /* ConstraintLayoutSupport.swift in Sources */, + 71B01FA7E17AC528750486C6EE82BA5D /* ConstraintLayoutSupportDSL.swift in Sources */, + 42342A2A0158936E08C934ACDBA02B06 /* ConstraintMaker.swift in Sources */, + 9AE3696936FBD5DA311D4CCF51A83D1A /* ConstraintMakerEditable.swift in Sources */, + 89475FD8A492C5A798A98A8F6CD55A1F /* ConstraintMakerExtendable.swift in Sources */, + C446120EC4ED3233678F6E3B82BBFEEE /* ConstraintMakerFinalizable.swift in Sources */, + 4A94F52AEF44432234C1697E69408B14 /* ConstraintMakerPriortizable.swift in Sources */, + 0A256F0A8255C779467C3F4AC772C548 /* ConstraintMakerRelatable.swift in Sources */, + 5749C705A069BE4601E50D3E416B99E3 /* ConstraintMultiplierTarget.swift in Sources */, + F684E98433A87DD19E44C8F30E158204 /* ConstraintOffsetTarget.swift in Sources */, + B02ECA8C67AE5F61034993F859285E00 /* ConstraintPriorityTarget.swift in Sources */, + 5EA2D73E925409110465303E14951E77 /* ConstraintRelatableTarget.swift in Sources */, + D0199EAB499FD82A471A683D4278DF30 /* ConstraintRelation.swift in Sources */, + ED12DB1CA6E5C8F2AD96E5B3CEAD956B /* ConstraintView+Extensions.swift in Sources */, + C0A5B37C01480DF77D4ECAF261066231 /* ConstraintView.swift in Sources */, + 96AC89E25C14E0D79ECDD33457BBEDEB /* ConstraintViewDSL.swift in Sources */, + 6538FE3F4ABE4DA4B2D476B30B061B07 /* Debugging.swift in Sources */, + 4924C7266548F0EC3A73D2FA37809D42 /* LayoutConstraint.swift in Sources */, + C01BE735C49AFBCB4CDAEF9C13DA763C /* LayoutConstraintItem.swift in Sources */, + 9C958D72748612ED2520F42C3B61CB36 /* SnapKit-dummy.m in Sources */, + A40E4284C5D1F4D6A8904A4A3EF994E3 /* UILayoutSupport+Extensions.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - B5E940610356DF418059D687BF3F2EDA /* Sources */ = { + 85AE76FABC78424F35359AAAD7270D38 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4D88717E87CDEE1EC2B177AAF0E4AF03 /* ClusterLayout.swift in Sources */, - A95814C2B75B36D83ACFB79445BFB0B8 /* Component.swift in Sources */, - BA032847ACC21166D8ABFCBBC9D25B23 /* ComponentMeta.swift in Sources */, - 83EE98CC2495B1A1447187E4C13EEFF7 /* IntrinsicSizeAwareScrollView.swift in Sources */, - 041A90E3AE3B74B290DB7E16F99E8B5C /* JSONFactory.swift in Sources */, - DF775D359AA8965680EAD71915259BF6 /* JSONReader.swift in Sources */, - F5FD77D0ECFFE5D064ABC734AC57C301 /* Matrioska-dummy.m in Sources */, - 179A9C55D3C2CB469FB2873C792B4580 /* StackCluster.swift in Sources */, - 8D5D20EEBB8F2C28E5C03925C41CC31D /* StackViewController.swift in Sources */, - 997C1FD0F95EAA044D3932DBF6B871C9 /* TabBarCluster.swift in Sources */, - C1D0E260CB3ADCABB69E3EE0FC4EE7AD /* UIColor+HEX.swift in Sources */, + 116A4337585A520E126E822BE0AC0854 /* ClusterLayout.swift in Sources */, + BDB5ACCACD76A93A14353E0877D70D3F /* Component.swift in Sources */, + C8BF641BEDC20159B138EA5CCBA7D9C5 /* ComponentMeta.swift in Sources */, + BF9167DBD5A23B820E4584E1B77061B5 /* IntrinsicSizeAwareScrollView.swift in Sources */, + 16DDC2F28AB6C514E860101B5E996793 /* JSONFactory.swift in Sources */, + CF0DBA68E4F1AB070A87F2197B32107A /* Matrioska-dummy.m in Sources */, + 1B1D2DD205BF61F5B07180619C0543BE /* StackCluster.swift in Sources */, + D733D8E5668299A4DCE25F2FB732C2D7 /* StackViewController.swift in Sources */, + 838038DFBA3CE21C79F5B72246FFE6B1 /* TabBarCluster.swift in Sources */, + 880218E912CDFE3A815AB775675C70A5 /* UIColor+HEX.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - C2A00187E51C3D1AED52AB96929EFFC4 /* Sources */ = { + 924105E89E8A05BD7858ED2B80B08D1E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7A7E19085DDA606232402F6FAF08E70B /* Constraint.swift in Sources */, - C11CBFB7B8B3FED736CFBA11AD4D2823 /* ConstraintAttributes.swift in Sources */, - 70DC7BD37F0F2FD3EDF5BE9585193307 /* ConstraintConfig.swift in Sources */, - B53D9C904B60B81F7032B71CB2257A96 /* ConstraintConstantTarget.swift in Sources */, - A1582E9A19722CF0DFC6FD9311BB0F3B /* ConstraintDescription.swift in Sources */, - 68BEBE9D16D73B3A436E221715EFE264 /* ConstraintDSL.swift in Sources */, - 6EB49641404A46AC062F611FBD8E03B8 /* ConstraintInsets.swift in Sources */, - 133D70723039DBFD30A9821FF3B67F8E /* ConstraintInsetTarget.swift in Sources */, - B4050AA8BC64E340256364AFB80363C2 /* ConstraintItem.swift in Sources */, - 629195AD09E0EC36A884095B83C42FAE /* ConstraintLayoutGuide.swift in Sources */, - 71ED6154E6DCCFA61E10D72C5CA9C4E9 /* ConstraintLayoutGuideDSL.swift in Sources */, - 1DF8EFC779916FCBF31DC1DAB99A576E /* ConstraintLayoutSupport.swift in Sources */, - D591C8546B6B92CF98C179090F5EACEE /* ConstraintLayoutSupportDSL.swift in Sources */, - CF9F59E6FDCBCA77A2DA99D235CD96BD /* ConstraintMaker.swift in Sources */, - 6AAB0ED8C24C35578D0291A2BD1E45F2 /* ConstraintMakerEditable.swift in Sources */, - 4E45062A9BC7EBA3B20FC644237561EF /* ConstraintMakerExtendable.swift in Sources */, - B75157C387F26563D8DB70BEE84089D5 /* ConstraintMakerFinalizable.swift in Sources */, - AFB1C9F141D16648933C6A899C3155CD /* ConstraintMakerPriortizable.swift in Sources */, - 6BE59B49F53C9BAC90FE42186C335774 /* ConstraintMakerRelatable.swift in Sources */, - 9705059DF02781C6E8AE883A31EF4510 /* ConstraintMultiplierTarget.swift in Sources */, - 20215671001C72A928170398AAAE08B2 /* ConstraintOffsetTarget.swift in Sources */, - C05161B317D2D0886E9309D5CF1AD95C /* ConstraintPriorityTarget.swift in Sources */, - 7B84D63C10DE18A2C5637DD0405A3F58 /* ConstraintRelatableTarget.swift in Sources */, - F53FF4B422C72CA8548B2FFE14D07866 /* ConstraintRelation.swift in Sources */, - 842839A212DDCB988EA3725BABC60A4F /* ConstraintView+Extensions.swift in Sources */, - 72E3B01E713D6323A15BFE3E3B3B14FB /* ConstraintView.swift in Sources */, - 9D6E5E06D9D5F46EEF357ECD4D06428B /* ConstraintViewDSL.swift in Sources */, - 126EB89CB67B59A0D8685DBFAF0C952D /* Debugging.swift in Sources */, - 3CD17A81467309C37F0B36EF5443D9ED /* LayoutConstraint.swift in Sources */, - 7F4A092AA3D9F3DBCADBA83264438BFB /* SnapKit-dummy.m in Sources */, - 0B505DD464D5BE1BA78617B055800C62 /* UILayoutGuide+Extensions.swift in Sources */, - F5D5C02BB15D2CB0C8F5C3E0B772EB6A /* UILayoutSupport+Extensions.swift in Sources */, + CBB7C95969423BCFBA41023336DAAAC0 /* Pods-MatrioskaExample-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -591,27 +582,27 @@ 0C717DA8BFFEA61C11AB7002E676EE17 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = Matrioska; - target = 0FB92CB89E72923ECD89B42D50D69D22 /* Matrioska */; + target = 40B2396439A10813D8A9CD85474093DC /* Matrioska */; targetProxy = 7440F439AF8645D02B61F20D1643A885 /* PBXContainerItemProxy */; }; - 6D1618E2795150E483E2A433184E2D89 /* PBXTargetDependency */ = { + 5C3989074DD6C4A05F4C4FA0D62E2DD6 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = SnapKit; - target = CDAED52734CDEA3F5B1B2C7B70845F6E /* SnapKit */; - targetProxy = 3E93AD9B0F4F0B3C9EF92737F046F730 /* PBXContainerItemProxy */; + target = 33CA0B8CC847E9FBE27CFE805028FA4D /* SnapKit */; + targetProxy = D4760210B9F94EC3F99F1012282087D6 /* PBXContainerItemProxy */; }; - 82838968315A9F075EDF472C8A327DBE /* PBXTargetDependency */ = { + 6D1618E2795150E483E2A433184E2D89 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = SnapKit; - target = CDAED52734CDEA3F5B1B2C7B70845F6E /* SnapKit */; - targetProxy = D22C25AE02B1FC6CB375F827884BD61F /* PBXContainerItemProxy */; + target = 33CA0B8CC847E9FBE27CFE805028FA4D /* SnapKit */; + targetProxy = 3E93AD9B0F4F0B3C9EF92737F046F730 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 038FFBFAFF538BB20B9C68505BFC3D93 /* Debug */ = { + 40652EA2660409BFBEAE3D7BAD61778E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E885DC7A2C93B352F3CCBAF6C4F30F7F /* SnapKit.xcconfig */; + baseConfigurationReference = 02EADA41EDCFDB812BF4ED7298724198 /* SnapKit.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -642,70 +633,6 @@ }; name = Debug; }; - 110AD18E52B85909FC84790D1D1C7A4D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4AFD95C089AB657DC457D673DF1D5B11 /* Matrioska.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Matrioska/Matrioska-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Matrioska/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Matrioska/Matrioska.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Matrioska; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 225513AC1FB0C79318CC48DFC84FC213 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E885DC7A2C93B352F3CCBAF6C4F30F7F /* SnapKit.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SnapKit/SnapKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/SnapKit/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/SnapKit/SnapKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = SnapKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; 56C9D3A1929A0137945B6C0547DFCE26 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 265D2639CCA0F9886680E5E6CA7A3943 /* Pods-MatrioskaExample.release.xcconfig */; @@ -785,9 +712,9 @@ }; name = Debug; }; - 75FEBCFF65A29CE9C537F0F281CE4AC8 /* Debug */ = { + 71BC9CE5140D3CAFAD76A525615099F2 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4AFD95C089AB657DC457D673DF1D5B11 /* Matrioska.xcconfig */; + baseConfigurationReference = 0F38C8F99B3F5DB491B0EE1D96B6A068 /* Matrioska.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -818,6 +745,38 @@ }; name = Debug; }; + 7BF1250C7DF8EB49FE5E4B610AB43E2B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 02EADA41EDCFDB812BF4ED7298724198 /* SnapKit.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/SnapKit/SnapKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SnapKit/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/SnapKit/SnapKit.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = SnapKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; 9AB3C3C9A96D60B82285927CD79B5379 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = A77A10AC741F15F2412809F03C82B8FD /* Pods-MatrioskaExample.debug.xcconfig */; @@ -894,32 +853,64 @@ }; name = Release; }; + CA9963F868F92C27EFB4DDDACC203657 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0F38C8F99B3F5DB491B0EE1D96B6A068 /* Matrioska.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Matrioska/Matrioska-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Matrioska/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Matrioska/Matrioska.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = Matrioska; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 07CAD9B5E98A2F5F57D96D1174303EA2 /* Build configuration list for PBXNativeTarget "Matrioska" */ = { + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 75FEBCFF65A29CE9C537F0F281CE4AC8 /* Debug */, - 110AD18E52B85909FC84790D1D1C7A4D /* Release */, + 59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */, + B7324857C38B065FEB1EEE3105C2367A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 22CCD7F81E4357523AC131CF0D6B7A14 /* Build configuration list for PBXNativeTarget "SnapKit" */ = { + 469A8B172273C74432E39C05CEE37D47 /* Build configuration list for PBXNativeTarget "Matrioska" */ = { isa = XCConfigurationList; buildConfigurations = ( - 038FFBFAFF538BB20B9C68505BFC3D93 /* Debug */, - 225513AC1FB0C79318CC48DFC84FC213 /* Release */, + 71BC9CE5140D3CAFAD76A525615099F2 /* Debug */, + CA9963F868F92C27EFB4DDDACC203657 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + 7EC48A2E5553FCE544F55F942211500A /* Build configuration list for PBXNativeTarget "SnapKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */, - B7324857C38B065FEB1EEE3105C2367A /* Release */, + 40652EA2660409BFBEAE3D7BAD61778E /* Debug */, + 7BF1250C7DF8EB49FE5E4B610AB43E2B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Example/Pods/SnapKit/README.md b/Example/Pods/SnapKit/README.md index 8b14ba8..a6da596 100644 --- a/Example/Pods/SnapKit/README.md +++ b/Example/Pods/SnapKit/README.md @@ -59,7 +59,7 @@ platform :ios, '10.0' use_frameworks! target '' do - pod 'SnapKit', '~> 3.0.2' + pod 'SnapKit', '~> 3.1.2' end ``` diff --git a/Example/Pods/SnapKit/Source/Constraint.swift b/Example/Pods/SnapKit/Source/Constraint.swift index e5086c1..5c8c483 100644 --- a/Example/Pods/SnapKit/Source/Constraint.swift +++ b/Example/Pods/SnapKit/Source/Constraint.swift @@ -27,7 +27,7 @@ import AppKit #endif -public class Constraint { +public final class Constraint { internal let sourceLocation: (String, UInt) internal let label: String? @@ -73,7 +73,7 @@ public class Constraint { let layoutToAttributes = self.to.attributes.layoutAttributes // get layout from - let layoutFrom: ConstraintView = self.from.view! + let layoutFrom = self.from.layoutConstraintItem! // get relation let layoutRelation = self.relation.layoutRelation @@ -247,14 +247,18 @@ public class Constraint { } internal func activateIfNeeded(updatingExisting: Bool = false) { - guard let view = self.from.view else { - print("WARNING: SnapKit failed to get from view from constraint. Activate will be a no-op.") + guard let item = self.from.layoutConstraintItem else { + print("WARNING: SnapKit failed to get from item from constraint. Activate will be a no-op.") return } let layoutConstraints = self.layoutConstraints - let existingLayoutConstraints = view.snp.constraints.map({ $0.layoutConstraints }).reduce([]) { $0 + $1 } if updatingExisting { + var existingLayoutConstraints: [LayoutConstraint] = [] + for constraint in item.constraints { + existingLayoutConstraints += constraint.layoutConstraints + } + for layoutConstraint in layoutConstraints { let existingLayoutConstraint = existingLayoutConstraints.first { $0 == layoutConstraint } guard let updateLayoutConstraint = existingLayoutConstraint else { @@ -266,17 +270,17 @@ public class Constraint { } } else { NSLayoutConstraint.activate(layoutConstraints) - view.snp.add(constraints: [self]) + item.add(constraints: [self]) } } internal func deactivateIfNeeded() { - guard let view = self.from.view else { - print("WARNING: SnapKit failed to get from view from constraint. Deactivate will be a no-op.") + guard let item = self.from.layoutConstraintItem else { + print("WARNING: SnapKit failed to get from item from constraint. Deactivate will be a no-op.") return } let layoutConstraints = self.layoutConstraints NSLayoutConstraint.deactivate(layoutConstraints) - view.snp.remove(constraints: [self]) + item.remove(constraints: [self]) } } diff --git a/Example/Pods/SnapKit/Source/ConstraintAttributes.swift b/Example/Pods/SnapKit/Source/ConstraintAttributes.swift index 7236d24..4083235 100644 --- a/Example/Pods/SnapKit/Source/ConstraintAttributes.swift +++ b/Example/Pods/SnapKit/Source/ConstraintAttributes.swift @@ -28,7 +28,7 @@ #endif -internal struct ConstraintAttributes: OptionSet { +internal struct ConstraintAttributes : OptionSet { internal init(rawValue: UInt) { self.rawValue = rawValue diff --git a/Example/Pods/SnapKit/Source/ConstraintDSL.swift b/Example/Pods/SnapKit/Source/ConstraintDSL.swift index cda83a0..ed7b7e5 100644 --- a/Example/Pods/SnapKit/Source/ConstraintDSL.swift +++ b/Example/Pods/SnapKit/Source/ConstraintDSL.swift @@ -49,12 +49,12 @@ extension ConstraintDSL { private var labelKey: UInt8 = 0 -public protocol ConstraintAttributesDSL: ConstraintDSL { +public protocol ConstraintBasicAttributesDSL : ConstraintDSL { } -extension ConstraintAttributesDSL { +extension ConstraintBasicAttributesDSL { // MARK: Basics - + public var left: ConstraintItem { return ConstraintItem(target: self.target, attributes: ConstraintAttributes.left) } @@ -107,6 +107,12 @@ extension ConstraintAttributesDSL { return ConstraintItem(target: self.target, attributes: ConstraintAttributes.center) } +} + +public protocol ConstraintAttributesDSL : ConstraintBasicAttributesDSL { +} +extension ConstraintAttributesDSL { + // MARK: Baselines @available(*, deprecated:3.0, message:"Use .lastBaseline instead") diff --git a/Example/Pods/SnapKit/Source/ConstraintDescription.swift b/Example/Pods/SnapKit/Source/ConstraintDescription.swift index d961fb5..3521f9f 100644 --- a/Example/Pods/SnapKit/Source/ConstraintDescription.swift +++ b/Example/Pods/SnapKit/Source/ConstraintDescription.swift @@ -30,7 +30,7 @@ public class ConstraintDescription { - internal let view: ConstraintView + internal let item: LayoutConstraintItem internal var attributes: ConstraintAttributes internal var relation: ConstraintRelation? = nil internal var sourceLocation: (String, UInt)? = nil @@ -45,7 +45,7 @@ public class ConstraintDescription { let sourceLocation = self.sourceLocation else { return nil } - let from = ConstraintItem(target: self.view, attributes: self.attributes) + let from = ConstraintItem(target: self.item, attributes: self.attributes) return Constraint( from: from, @@ -61,8 +61,8 @@ public class ConstraintDescription { // MARK: Initialization - internal init(view: ConstraintView, attributes: ConstraintAttributes) { - self.view = view + internal init(item: LayoutConstraintItem, attributes: ConstraintAttributes) { + self.item = item self.attributes = attributes } diff --git a/Example/Pods/SnapKit/Source/ConstraintItem.swift b/Example/Pods/SnapKit/Source/ConstraintItem.swift index a9477da..a342c1d 100644 --- a/Example/Pods/SnapKit/Source/ConstraintItem.swift +++ b/Example/Pods/SnapKit/Source/ConstraintItem.swift @@ -28,7 +28,7 @@ #endif -public class ConstraintItem: Equatable { +public final class ConstraintItem { internal weak var target: AnyObject? internal let attributes: ConstraintAttributes @@ -38,8 +38,8 @@ public class ConstraintItem: Equatable { self.attributes = attributes } - internal var view: ConstraintView? { - return self.target as? ConstraintView + internal var layoutConstraintItem: LayoutConstraintItem? { + return self.target as? LayoutConstraintItem } } diff --git a/Example/Pods/SnapKit/Source/UILayoutGuide+Extensions.swift b/Example/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift similarity index 97% rename from Example/Pods/SnapKit/Source/UILayoutGuide+Extensions.swift rename to Example/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift index cd89d8a..c2d9e9d 100644 --- a/Example/Pods/SnapKit/Source/UILayoutGuide+Extensions.swift +++ b/Example/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift @@ -26,7 +26,7 @@ #endif -@available(iOS 9.0, *) +@available(iOS 9.0, OSX 10.11, *) public extension ConstraintLayoutGuide { public var snp: ConstraintLayoutGuideDSL { diff --git a/Example/Pods/SnapKit/Source/ConstraintLayoutGuide.swift b/Example/Pods/SnapKit/Source/ConstraintLayoutGuide.swift index f6eba82..e3e50c8 100644 --- a/Example/Pods/SnapKit/Source/ConstraintLayoutGuide.swift +++ b/Example/Pods/SnapKit/Source/ConstraintLayoutGuide.swift @@ -32,5 +32,6 @@ @available(iOS 9.0, *) public typealias ConstraintLayoutGuide = UILayoutGuide #else - public class ConstraintLayoutGuide {} + @available(OSX 10.11, *) + public typealias ConstraintLayoutGuide = NSLayoutGuide #endif diff --git a/Example/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift b/Example/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift index 62bd9b4..0007819 100644 --- a/Example/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift +++ b/Example/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift @@ -28,9 +28,30 @@ #endif -@available(iOS 9.0, *) +@available(iOS 9.0, OSX 10.11, *) public struct ConstraintLayoutGuideDSL: ConstraintAttributesDSL { + @discardableResult + public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { + return ConstraintMaker.prepareConstraints(item: self.guide, closure: closure) + } + + public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { + ConstraintMaker.makeConstraints(item: self.guide, closure: closure) + } + + public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { + ConstraintMaker.remakeConstraints(item: self.guide, closure: closure) + } + + public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { + ConstraintMaker.updateConstraints(item: self.guide, closure: closure) + } + + public func removeConstraints() { + ConstraintMaker.removeConstraints(item: self.guide) + } + public var target: AnyObject? { return self.guide } diff --git a/Example/Pods/SnapKit/Source/ConstraintMaker.swift b/Example/Pods/SnapKit/Source/ConstraintMaker.swift index 63c1be4..b20cdb5 100644 --- a/Example/Pods/SnapKit/Source/ConstraintMaker.swift +++ b/Example/Pods/SnapKit/Source/ConstraintMaker.swift @@ -143,66 +143,75 @@ public class ConstraintMaker { return self.makeExtendableWithAttributes(.centerWithinMargins) } - private let view: ConstraintView + private let item: LayoutConstraintItem private var descriptions = [ConstraintDescription]() - internal init(view: ConstraintView) { - self.view = view - self.view.translatesAutoresizingMaskIntoConstraints = false + internal init(item: LayoutConstraintItem) { + self.item = item + self.item.prepare() } internal func makeExtendableWithAttributes(_ attributes: ConstraintAttributes) -> ConstraintMakerExtendable { - let description = ConstraintDescription(view: self.view, attributes: attributes) + let description = ConstraintDescription(item: self.item, attributes: attributes) self.descriptions.append(description) return ConstraintMakerExtendable(description) } - internal static func prepareConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { - let maker = ConstraintMaker(view: view) + internal static func prepareConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { + let maker = ConstraintMaker(item: item) closure(maker) - let constraints = maker.descriptions - .map { $0.constraint } - .filter { $0 != nil } - .map { $0! } + var constraints: [Constraint] = [] + for description in maker.descriptions { + guard let constraint = description.constraint else { + continue + } + constraints.append(constraint) + } return constraints } - internal static func makeConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { - let maker = ConstraintMaker(view: view) + internal static func makeConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) { + let maker = ConstraintMaker(item: item) closure(maker) - let constraints = maker.descriptions - .map { $0.constraint } - .filter { $0 != nil } - .map { $0! } + var constraints: [Constraint] = [] + for description in maker.descriptions { + guard let constraint = description.constraint else { + continue + } + constraints.append(constraint) + } for constraint in constraints { constraint.activateIfNeeded(updatingExisting: false) } } - internal static func remakeConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { - self.removeConstraints(view: view) - self.makeConstraints(view: view, closure: closure) + internal static func remakeConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) { + self.removeConstraints(item: item) + self.makeConstraints(item: item, closure: closure) } - internal static func updateConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { - guard view.snp.constraints.count > 0 else { - self.makeConstraints(view: view, closure: closure) + internal static func updateConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) { + guard item.constraints.count > 0 else { + self.makeConstraints(item: item, closure: closure) return } - let maker = ConstraintMaker(view: view) + let maker = ConstraintMaker(item: item) closure(maker) - let constraints = maker.descriptions - .map { $0.constraint } - .filter { $0 != nil } - .map { $0! } + var constraints: [Constraint] = [] + for description in maker.descriptions { + guard let constraint = description.constraint else { + continue + } + constraints.append(constraint) + } for constraint in constraints { constraint.activateIfNeeded(updatingExisting: true) } } - internal static func removeConstraints(view: ConstraintView) { - let constraints = view.snp.constraints + internal static func removeConstraints(item: LayoutConstraintItem) { + let constraints = item.constraints for constraint in constraints { constraint.deactivateIfNeeded() } diff --git a/Example/Pods/SnapKit/Source/ConstraintMakerRelatable.swift b/Example/Pods/SnapKit/Source/ConstraintMakerRelatable.swift index d50b423..98c7158 100644 --- a/Example/Pods/SnapKit/Source/ConstraintMakerRelatable.swift +++ b/Example/Pods/SnapKit/Source/ConstraintMakerRelatable.swift @@ -57,6 +57,9 @@ public class ConstraintMakerRelatable { } else if let other = other as? ConstraintConstantTarget { related = ConstraintItem(target: nil, attributes: ConstraintAttributes.none) constant = other + } else if #available(iOS 9.0, OSX 10.11, *), let other = other as? ConstraintLayoutGuide { + related = ConstraintItem(target: other, attributes: ConstraintAttributes.none) + constant = 0.0 } else { fatalError("Invalid constraint. (\(file), \(line))") } @@ -76,7 +79,7 @@ public class ConstraintMakerRelatable { @discardableResult public func equalToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { - guard let other = self.description.view.superview else { + guard let other = self.description.item.superview else { fatalError("Expected superview but found nil when attempting make constraint `equalToSuperview`.") } return self.relatedTo(other, relation: .equal, file: file, line: line) @@ -89,7 +92,7 @@ public class ConstraintMakerRelatable { @discardableResult public func lessThanOrEqualToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { - guard let other = self.description.view.superview else { + guard let other = self.description.item.superview else { fatalError("Expected superview but found nil when attempting make constraint `lessThanOrEqualToSuperview`.") } return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line) @@ -102,7 +105,7 @@ public class ConstraintMakerRelatable { @discardableResult public func greaterThanOrEqualToSuperview(_ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable { - guard let other = self.description.view.superview else { + guard let other = self.description.item.superview else { fatalError("Expected superview but found nil when attempting make constraint `greaterThanOrEqualToSuperview`.") } return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line) diff --git a/Example/Pods/SnapKit/Source/ConstraintRelatableTarget.swift b/Example/Pods/SnapKit/Source/ConstraintRelatableTarget.swift index 4d1e37d..6976367 100644 --- a/Example/Pods/SnapKit/Source/ConstraintRelatableTarget.swift +++ b/Example/Pods/SnapKit/Source/ConstraintRelatableTarget.swift @@ -60,3 +60,7 @@ extension ConstraintItem: ConstraintRelatableTarget { extension ConstraintView: ConstraintRelatableTarget { } + +@available(iOS 9.0, OSX 10.11, *) +extension ConstraintLayoutGuide: ConstraintRelatableTarget { +} diff --git a/Example/Pods/SnapKit/Source/ConstraintRelation.swift b/Example/Pods/SnapKit/Source/ConstraintRelation.swift index 48afbfc..d53bb3b 100644 --- a/Example/Pods/SnapKit/Source/ConstraintRelation.swift +++ b/Example/Pods/SnapKit/Source/ConstraintRelation.swift @@ -28,7 +28,7 @@ #endif -internal enum ConstraintRelation: Int { +internal enum ConstraintRelation : Int { case equal = 1 case lessThanOrEqual case greaterThanOrEqual diff --git a/Example/Pods/SnapKit/Source/ConstraintViewDSL.swift b/Example/Pods/SnapKit/Source/ConstraintViewDSL.swift index 541d18b..0242c4a 100644 --- a/Example/Pods/SnapKit/Source/ConstraintViewDSL.swift +++ b/Example/Pods/SnapKit/Source/ConstraintViewDSL.swift @@ -32,27 +32,25 @@ public struct ConstraintViewDSL: ConstraintAttributesDSL { @discardableResult public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { - return ConstraintMaker.prepareConstraints(view: self.view, closure: closure) + return ConstraintMaker.prepareConstraints(item: self.view, closure: closure) } public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - ConstraintMaker.makeConstraints(view: self.view, closure: closure) + ConstraintMaker.makeConstraints(item: self.view, closure: closure) } public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - ConstraintMaker.remakeConstraints(view: self.view, closure: closure) + ConstraintMaker.remakeConstraints(item: self.view, closure: closure) } public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { - ConstraintMaker.updateConstraints(view: self.view, closure: closure) + ConstraintMaker.updateConstraints(item: self.view, closure: closure) } public func removeConstraints() { - ConstraintMaker.removeConstraints(view: self.view) + ConstraintMaker.removeConstraints(item: self.view) } - - public var contentHuggingHorizontalPriority: Float { get { return self.view.contentHuggingPriority(for: .horizontal) @@ -100,36 +98,4 @@ public struct ConstraintViewDSL: ConstraintAttributesDSL { } - internal var constraints: [Constraint] { - return self.constraintsHashTable.allObjects - } - - internal func add(constraints: [Constraint]) { - let hashTable = self.constraintsHashTable - for constraint in constraints { - hashTable.add(constraint) - } - } - - internal func remove(constraints: [Constraint]) { - let hashTable = self.constraintsHashTable - for constraint in constraints { - hashTable.remove(constraint) - } - } - - private var constraintsHashTable: NSHashTable { - let constraints: NSHashTable - - if let existing = objc_getAssociatedObject(self.view, &constraintsKey) as? NSHashTable { - constraints = existing - } else { - constraints = NSHashTable() - objc_setAssociatedObject(self.view, &constraintsKey, constraints, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - return constraints - - } - } -private var constraintsKey: UInt8 = 0 diff --git a/Example/Pods/SnapKit/Source/LayoutConstraint.swift b/Example/Pods/SnapKit/Source/LayoutConstraint.swift index 27c4105..8bb5ed2 100644 --- a/Example/Pods/SnapKit/Source/LayoutConstraint.swift +++ b/Example/Pods/SnapKit/Source/LayoutConstraint.swift @@ -28,7 +28,7 @@ #endif -public class LayoutConstraint: NSLayoutConstraint { +public class LayoutConstraint : NSLayoutConstraint { public var label: String? { get { diff --git a/Example/Pods/SnapKit/Source/LayoutConstraintItem.swift b/Example/Pods/SnapKit/Source/LayoutConstraintItem.swift new file mode 100644 index 0000000..a59de6b --- /dev/null +++ b/Example/Pods/SnapKit/Source/LayoutConstraintItem.swift @@ -0,0 +1,93 @@ +// +// SnapKit +// +// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#if os(iOS) || os(tvOS) + import UIKit +#else + import AppKit +#endif + + +public protocol LayoutConstraintItem: class { +} + +@available(iOS 9.0, OSX 10.11, *) +extension ConstraintLayoutGuide : LayoutConstraintItem { +} + +extension ConstraintView : LayoutConstraintItem { +} + + +extension LayoutConstraintItem { + + internal func prepare() { + if let view = self as? ConstraintView { + view.translatesAutoresizingMaskIntoConstraints = false + } + } + + internal var superview: ConstraintView? { + if let view = self as? ConstraintView { + return view.superview + } + + if #available(iOS 9.0, OSX 10.11, *), let guide = self as? ConstraintLayoutGuide { + return guide.owningView + } + + return nil + } + internal var constraints: [Constraint] { + return self.constraintsSet.allObjects as! [Constraint] + } + + internal func add(constraints: [Constraint]) { + let constraintsSet = self.constraintsSet + for constraint in constraints { + constraintsSet.add(constraint) + } + } + + internal func remove(constraints: [Constraint]) { + let constraintsSet = self.constraintsSet + for constraint in constraints { + constraintsSet.remove(constraint) + } + } + + private var constraintsSet: NSMutableSet { + let constraintsSet: NSMutableSet + + if let existing = objc_getAssociatedObject(self, &constraintsKey) as? NSMutableSet { + constraintsSet = existing + } else { + constraintsSet = NSMutableSet() + objc_setAssociatedObject(self, &constraintsKey, constraintsSet, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + } + return constraintsSet + + } + +} +private var constraintsKey: UInt8 = 0 diff --git a/Example/Pods/Target Support Files/SnapKit/Info.plist b/Example/Pods/Target Support Files/SnapKit/Info.plist index a080088..c11c2ee 100644 --- a/Example/Pods/Target Support Files/SnapKit/Info.plist +++ b/Example/Pods/Target Support Files/SnapKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.0.2 + 3.1.2 CFBundleSignature ???? CFBundleVersion From ae229e1f598027f9eb8e94f2378a81b78377a812 Mon Sep 17 00:00:00 2001 From: Mathias Aichinger Date: Wed, 18 Jan 2017 12:34:53 +0100 Subject: [PATCH 21/29] Added gemfile to fix buddybuild --- Example/Gemfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Example/Gemfile diff --git a/Example/Gemfile b/Example/Gemfile new file mode 100644 index 0000000..79b2910 --- /dev/null +++ b/Example/Gemfile @@ -0,0 +1 @@ +source 'https://rubygems.org' \ No newline at end of file From 452a56be87e5a167115bf3ada6be5eeea778c462 Mon Sep 17 00:00:00 2001 From: Mathias Aichinger Date: Wed, 18 Jan 2017 12:38:56 +0100 Subject: [PATCH 22/29] Added another gemfile --- Gemfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Gemfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..79b2910 --- /dev/null +++ b/Gemfile @@ -0,0 +1 @@ +source 'https://rubygems.org' \ No newline at end of file From 50dcde2c39f51d944645076efff6ad890728877f Mon Sep 17 00:00:00 2001 From: Mathias Aichinger Date: Wed, 18 Jan 2017 12:49:31 +0100 Subject: [PATCH 23/29] ADD danger to the gemfile --- Example/Gemfile | 1 - Gemfile | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 Example/Gemfile diff --git a/Example/Gemfile b/Example/Gemfile deleted file mode 100644 index 79b2910..0000000 --- a/Example/Gemfile +++ /dev/null @@ -1 +0,0 @@ -source 'https://rubygems.org' \ No newline at end of file diff --git a/Gemfile b/Gemfile index 79b2910..9a939c4 100644 --- a/Gemfile +++ b/Gemfile @@ -1 +1,3 @@ -source 'https://rubygems.org' \ No newline at end of file +source 'https://rubygems.org' + +gem 'danger', '~> 4.0', '>= 4.0.5' \ No newline at end of file From abd0a7918cf5ed461a51b9e3352c3d5af18d7834 Mon Sep 17 00:00:00 2001 From: Mathias Aichinger Date: Wed, 18 Jan 2017 13:04:29 +0100 Subject: [PATCH 24/29] Add danger-swiftlint --- Gemfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9a939c4..55f6ad2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ source 'https://rubygems.org' -gem 'danger', '~> 4.0', '>= 4.0.5' \ No newline at end of file +gem 'danger', '~> 4.0', '>= 4.0.5' +gem 'danger-swiftlint' \ No newline at end of file From c80a8858c01809230a3a47aa8267c9b633a80fe8 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 19 Jan 2017 14:33:32 +0100 Subject: [PATCH 25/29] Update documentation --- Documentation/JSON schema guide.md | 92 ++++++++++++++++++++++++++++++ README.md | 40 +++++++++++-- Source/Helpers/UIColor+HEX.swift | 2 +- 3 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 Documentation/JSON schema guide.md diff --git a/Documentation/JSON schema guide.md b/Documentation/JSON schema guide.md new file mode 100644 index 0000000..7076962 --- /dev/null +++ b/Documentation/JSON schema guide.md @@ -0,0 +1,92 @@ +# JSON schema guide + +This is a reference for the JSON schema provided by Matrioska, which should be followed in order to register `Component`s and build the provided standard components. + +## JSON schemas for `Component` and `ComponentMeta` + +Below you can find a detailed schema for `Component`s and for each configuration (`ComponentMeta`). + +### Component schema + +| Key | Type | Description | +| --- | ---- | ----------- | +| `type` | `String` | The type of the component. Used for factory registration. | + +### StackConfig schema + +| Key | Type | Description | Maps to | Optional | Default value | +| --- | ---- | ----------- | ------- | -------- | ------------- | +| `title` | `String` | The title of the stack. | `title` | Yes | `nil` | +| `spacing` | `Float` | The spacing of the components inside the stack. | `spacing` | Yes | `10` | +| `axis` | `Int` | The orientation of the stack. Can be either `0`(horizontal) or `1`(vertical). | `axis` | Yes | `1` | +| `preserveParentWidth` | `Bool` | Whether the arranged subviews should preserve the parent width or their own intrinsicContentSize. | `preserveParentWidth` | Yes | `false` | +| `backgroundColor` | `String` | The background color of the stack. Alpha and compact forms are not supported. Valid formats: `0x123456` or `123456`. | `backgroundColor` | Yes | `ffffff`(white) | + +### TabBarConfig schema + +| Key | Type | Description | Maps to | Optional | Default value | +| --- | ---- | ----------- | ------- | -------- | ------------- | +| `selectedIndex` | `Int` | The selected index of the tab bar. | `selectedIndex` | No | . | + +### Tab schema + +| Key | Type | Description | Maps to | Optional | Default value | +| --- | ---- | ----------- | ------- | -------- | ------------- | +| `title` | `String` | The title to display on the tab. | `title` | No | . | +| `iconName` | `Int` | The name of the icon to display on the tab. | `iconName` | No | . | + +## Example JSON + +``` +{ + "structure": { + "type": "tabbar", + "meta": { + "selectedIndex": 1 + }, + "children": [{ + "type": "navigation", + "meta": { + "title": "history_title", + "iconName": "history_tab_icon" + }, + "children": [{ + "type": "stack", + "meta": { + "axis": 1, + "preserveParentWidth": true, + "backgroundColor": "0x123456" + }, + "children": [{ + "type": "table_view" + }] + }] + }, { + "type": "navigation", + "meta": { + "title": "main_tab_title", + "iconName": "main_tab_icon" + }, + "children": [{ + "type": "stack", + "meta": { + "axis": 1, + "title": "Main stack", + "preserveParentWidth": true, + "spacing": "5" + }, + "children": [{ + "type": "label", + "meta": { + } + }, { + "type": "test_feature", + "meta": { + } + } + ] + }] + }] + } +} +``` diff --git a/README.md b/README.md index 65d011a..6269f82 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,10 @@ - [Standard Components](#standard-components) - [Meta](#meta) - [ComponentMeta](#componentmeta) - - [ExpressibleByComponentMeta](#expressiblebycomponentMeta) + - [ExpressibleByComponentMeta](#expressiblebycomponentmeta) - [Creating Components](#creating-components) - [Layout](#layout) + - [Load Components from JSON](#loadcomponentsfromjson) - [Roadmap](#roadmap) - [License](#license) @@ -88,7 +89,7 @@ Example: ```swift public struct MyConfig: ExpressibleByComponentMeta { public let title: String - + public init?(meta: ComponentMeta) { guard let title = meta["title"] as? String else { return nil @@ -148,11 +149,40 @@ window.rootViewController = component.viewController() Views are responsible for defining their `intrinsicContentSize` using AutoLayout, clusters can decide whether to respect their dimensions or not, both vertical and horizontal or also only one of the two. To make sure that a `Component`’s `UIViewController`has a valid `intrinsicContentSize` you need to add appropriate constraints to the view. [To know more about this read the documentation about “Views with Intrinsic Content Size”](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/ViewswithIntrinsicContentSize.html). +### Load Components from JSON + +`Components` can also be loaded from JSON. For this, you are responsible for registering factories (`Component` builders) that will be used when parsing the JSON structure. In order to register factories, usage of `JSONFactory` is needed: + +``` +let jsonFactory = JSONFactory() + +jsonFactory.register(with: "tab_bar", factoryBuilder: { (children, meta) -> Component in + ClusterLayout.tabBar(children: children, meta: meta) +}) + +jsonFactory.register(with: "navigation", factoryBuilder: { (child, meta) -> Component in + Component.wrapper(builder: { _ in UINavigationController() }, child: child, meta: meta) +}) + +jsonFactory.register(with: "table_view", factoryBuilder: { (meta) -> Component in + Component.view(builder: { _ in UITableViewController() }, meta: meta) +}) +``` + +Whenever you register a new factory you should provide the `type` key that will match the JSON. Check the [provided JSON schema](/Documentation/JSON\ schema\ guide.md) for more details on that. + +You can register different factories for `View`, `Wrapper` and `Cluster` `Component` types using the `JSONFactory`. After registration, you can use the factory to get the component out of a JSON: + +``` +let component = try jsonFactory.component(from: json) +``` + +Besides providing `type` on the JSON, `Component`s should also match the JSON schema that the library provides by default whenever using the built-in components (TabBar or Stack) meta configuration. + +Check the [JSON schem guide](/Documentation/JSON\ schema\ guide.md) for more information. + ## Roadmap -- Load Components from JSON [#3](https://github.com/runtastic/Matrioska/issues/3) - - Serialization - - Component Factories - Rulesets to define the visibility of a Component [#4](https://github.com/runtastic/Matrioska/issues/4) - Deep Linking [#5](https://github.com/runtastic/Matrioska/issues/5) diff --git a/Source/Helpers/UIColor+HEX.swift b/Source/Helpers/UIColor+HEX.swift index b6a6764..7d538b2 100644 --- a/Source/Helpers/UIColor+HEX.swift +++ b/Source/Helpers/UIColor+HEX.swift @@ -25,7 +25,7 @@ extension UIColor { /// Initialize a color if the input strings represents an hex color /// - /// - Parameter hexString: A Strign representing an hex color. + /// - Parameter hexString: A String representing an hex color. /// Alpha not supported and compact form not supported. /// Valid format: "0x123456" or "123456" public convenience init?(hexString: String) { From 57b6d0b63640b5d0f7dc591b6f04534ae495bba8 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 19 Jan 2017 15:13:32 +0100 Subject: [PATCH 26/29] Update code and documentation with snake case keys --- Documentation/JSON schema guide.md | 8 ++++---- Source/Components/StackCluster.swift | 4 ++-- Source/Components/TabBarCluster.swift | 4 ++-- Tests/Assets/app_structure.json | 16 +++------------- Tests/JSONFactoryTests.swift | 7 ++++++- Tests/StackClusterTests.swift | 4 ++-- Tests/TabBarClusterTests.swift | 6 +++--- 7 files changed, 22 insertions(+), 27 deletions(-) diff --git a/Documentation/JSON schema guide.md b/Documentation/JSON schema guide.md index 7076962..4c99818 100644 --- a/Documentation/JSON schema guide.md +++ b/Documentation/JSON schema guide.md @@ -19,21 +19,21 @@ Below you can find a detailed schema for `Component`s and for each configuration | `title` | `String` | The title of the stack. | `title` | Yes | `nil` | | `spacing` | `Float` | The spacing of the components inside the stack. | `spacing` | Yes | `10` | | `axis` | `Int` | The orientation of the stack. Can be either `0`(horizontal) or `1`(vertical). | `axis` | Yes | `1` | -| `preserveParentWidth` | `Bool` | Whether the arranged subviews should preserve the parent width or their own intrinsicContentSize. | `preserveParentWidth` | Yes | `false` | -| `backgroundColor` | `String` | The background color of the stack. Alpha and compact forms are not supported. Valid formats: `0x123456` or `123456`. | `backgroundColor` | Yes | `ffffff`(white) | +| `preserve_parent_width` | `Bool` | Whether the arranged subviews should preserve the parent width or their own intrinsicContentSize. | `preserveParentWidth` | Yes | `false` | +| `background_color` | `String` | The background color of the stack. Alpha and compact forms are not supported. Valid formats: `0x123456` or `123456`. | `backgroundColor` | Yes | `ffffff`(white) | ### TabBarConfig schema | Key | Type | Description | Maps to | Optional | Default value | | --- | ---- | ----------- | ------- | -------- | ------------- | -| `selectedIndex` | `Int` | The selected index of the tab bar. | `selectedIndex` | No | . | +| `selected_index` | `Int` | The selected index of the tab bar. | `selectedIndex` | No | . | ### Tab schema | Key | Type | Description | Maps to | Optional | Default value | | --- | ---- | ----------- | ------- | -------- | ------------- | | `title` | `String` | The title to display on the tab. | `title` | No | . | -| `iconName` | `Int` | The name of the icon to display on the tab. | `iconName` | No | . | +| `icon_name` | `Int` | The name of the icon to display on the tab. | `iconName` | No | . | ## Example JSON diff --git a/Source/Components/StackCluster.swift b/Source/Components/StackCluster.swift index 456c5fe..db1daaf 100644 --- a/Source/Components/StackCluster.swift +++ b/Source/Components/StackCluster.swift @@ -34,10 +34,10 @@ extension ClusterLayout { public init?(meta: ComponentMeta) { let title = meta["title"] as? String let spacing = (meta["spacing"] as? NSNumber)?.floatValue - let preserveParentWidth = meta["preserveParentWidth"] as? Bool + let preserveParentWidth = meta["preserve_parent_width"] as? Bool let axisRawValue = meta["axis"] as? Int let axis = axisRawValue.flatMap { UILayoutConstraintAxis(rawValue: $0) } - let hexString = meta["backgroundColor"] as? String + let hexString = meta["background_color"] as? String let backgroundColor = hexString.flatMap { UIColor(hexString: $0) } self.init( diff --git a/Source/Components/TabBarCluster.swift b/Source/Components/TabBarCluster.swift index 10e3bb3..e9eb2f5 100644 --- a/Source/Components/TabBarCluster.swift +++ b/Source/Components/TabBarCluster.swift @@ -27,7 +27,7 @@ extension ClusterLayout { guard let title = meta["title"] as? String else { return nil } - guard let iconName = meta["iconName"] as? String else { + guard let iconName = meta["icon_name"] as? String else { return nil } @@ -58,7 +58,7 @@ extension ClusterLayout { /// /// - Parameter meta: A meta object public init?(meta: ComponentMeta) { - guard let selectedIndex = meta["selectedIndex"] as? Int else { + guard let selectedIndex = meta["selected_index"] as? Int else { return nil } diff --git a/Tests/Assets/app_structure.json b/Tests/Assets/app_structure.json index 13b86ee..6583917 100644 --- a/Tests/Assets/app_structure.json +++ b/Tests/Assets/app_structure.json @@ -8,13 +8,8 @@ { "type": "stack", "meta": { - "tab_config": { - "title": { - "key": "history_title", - "type": "localized_string" - }, + "title": "history_title", "icon_name": "history_tab_icon" - } }, "children": [ { @@ -28,13 +23,8 @@ { "type": "stack", "meta": { - "tab_config": { - "title": { - "key": "main_tab_title", - "type": "localized_string" - }, - "iconName": "main_tab_icon" - } + "title": "main_tab_title", + "icon_name": "main_tab_icon" }, "children": [ { diff --git a/Tests/JSONFactoryTests.swift b/Tests/JSONFactoryTests.swift index 9cbac44..2b780c6 100644 --- a/Tests/JSONFactoryTests.swift +++ b/Tests/JSONFactoryTests.swift @@ -91,7 +91,7 @@ class JSONFactoryTests: QuickSpec { } } - context("when registering all available factories") { + fcontext("when registering all available factories") { let jsonFactory = JSONFactory() jsonFactory.register(with: "tabbar", factoryBuilder: tabBarBuilder) @@ -107,6 +107,11 @@ class JSONFactoryTests: QuickSpec { let firstChildren = component!.children()[0] let secondChildren = component!.children()[1] let thirdChildren = component!.children()[2] + + expect(firstChildren.meta!["icon_name"] as? String).to(equal("history_tab_icon")) + expect(firstChildren.meta!["title"] as? String).to(equal("history_title")) + expect(secondChildren.meta!["icon_name"] as? String).to(equal("main_tab_icon")) + expect(secondChildren.meta!["title"] as? String).to(equal("main_tab_title")) expect(component?.children().count).to(equal(3)) expect(secondChildren.children().count).to(equal(3)) diff --git a/Tests/StackClusterTests.swift b/Tests/StackClusterTests.swift index f0dfcd0..e329e1a 100644 --- a/Tests/StackClusterTests.swift +++ b/Tests/StackClusterTests.swift @@ -94,8 +94,8 @@ class StackClusterTests: QuickSpec { "title": "Foo", "spacing": 150.0, "axis": UILayoutConstraintAxis.vertical.rawValue, - "preserveParentWidth": true, - "backgroundColor": "0xEEEEEE" + "preserve_parent_width": true, + "background_color": "0xEEEEEE" ] let vc = stack(with: children, meta: config) diff --git a/Tests/TabBarClusterTests.swift b/Tests/TabBarClusterTests.swift index b2a4f5b..322815c 100644 --- a/Tests/TabBarClusterTests.swift +++ b/Tests/TabBarClusterTests.swift @@ -66,7 +66,7 @@ class TabBarClusterTests: QuickSpec { } it("should load config from a dictionary") { - let meta = ["selectedIndex": 1] + let meta = ["selected_index": 1] let vc = ClusterLayout.tabBar(children: children, meta: meta).viewController() expect(vc).to(haveValidSnapshot()) } @@ -108,7 +108,7 @@ class TabBarClusterTests: QuickSpec { it("should use config defined as dictionaries") { let bundle = Bundle(for: TabBarClusterTests.self) let children: [Component] = [ - simpleComponent(meta: ["title": "test", "iconName": "checkmark"]), + simpleComponent(meta: ["title": "test", "icon_name": "checkmark"]), validComponent ] let vc = ClusterLayout.tabBar(children: children, @@ -120,7 +120,7 @@ class TabBarClusterTests: QuickSpec { it("should not use config defined as dictionaries when missing the title") { let children: [Component] = [ - simpleComponent(meta: ["iconName": "_"]), + simpleComponent(meta: ["icon_name": "_"]), validComponent ] let vc = ClusterLayout.tabBar(children: children, meta: nil).viewController() From 8119b1befdbb936723319918bd907eb0f8d1a602 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 19 Jan 2017 15:15:12 +0100 Subject: [PATCH 27/29] Remove fast test --- Tests/JSONFactoryTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/JSONFactoryTests.swift b/Tests/JSONFactoryTests.swift index 2b780c6..6815248 100644 --- a/Tests/JSONFactoryTests.swift +++ b/Tests/JSONFactoryTests.swift @@ -91,7 +91,7 @@ class JSONFactoryTests: QuickSpec { } } - fcontext("when registering all available factories") { + context("when registering all available factories") { let jsonFactory = JSONFactory() jsonFactory.register(with: "tabbar", factoryBuilder: tabBarBuilder) From 6a9d36ab291d94a8b2bc16d68726b59642d6e56e Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 19 Jan 2017 15:18:53 +0100 Subject: [PATCH 28/29] Update json example with snake case --- Documentation/JSON schema guide.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/JSON schema guide.md b/Documentation/JSON schema guide.md index 4c99818..5cfae9d 100644 --- a/Documentation/JSON schema guide.md +++ b/Documentation/JSON schema guide.md @@ -42,20 +42,20 @@ Below you can find a detailed schema for `Component`s and for each configuration "structure": { "type": "tabbar", "meta": { - "selectedIndex": 1 + "selected_index": 1 }, "children": [{ "type": "navigation", "meta": { "title": "history_title", - "iconName": "history_tab_icon" + "icon_name": "history_tab_icon" }, "children": [{ "type": "stack", "meta": { "axis": 1, - "preserveParentWidth": true, - "backgroundColor": "0x123456" + "preserve_parent_width": true, + "background_color": "0x123456" }, "children": [{ "type": "table_view" @@ -65,14 +65,14 @@ Below you can find a detailed schema for `Component`s and for each configuration "type": "navigation", "meta": { "title": "main_tab_title", - "iconName": "main_tab_icon" + "icon_name": "main_tab_icon" }, "children": [{ "type": "stack", "meta": { "axis": 1, "title": "Main stack", - "preserveParentWidth": true, + "preserve_parent_width": true, "spacing": "5" }, "children": [{ From 63a84b9e63fcfe0de9c0e2650863aba8e77824a2 Mon Sep 17 00:00:00 2001 From: Joan Romano Date: Thu, 19 Jan 2017 15:21:32 +0100 Subject: [PATCH 29/29] Fix link on Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6269f82..1195088 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ - [ExpressibleByComponentMeta](#expressiblebycomponentmeta) - [Creating Components](#creating-components) - [Layout](#layout) - - [Load Components from JSON](#loadcomponentsfromjson) + - [Load Components from JSON](#load-components-from-json) - [Roadmap](#roadmap) - [License](#license)