-
Notifications
You must be signed in to change notification settings - Fork 4
Added json example to the example application #11
base: master
Are you sure you want to change the base?
Conversation
Used open-source icons for the example (https://github.com/iconic/open-iconic). Should it be mentioned somewhere? |
SwiftLint found issuesWarnings
Generated by 🚫 danger |
Codecov Report
@@ Coverage Diff @@
## master #11 +/- ##
=======================================
Coverage 99.01% 99.01%
=======================================
Files 9 9
Lines 306 306
=======================================
Hits 303 303
Misses 3 3 Continue to review full report at Codecov.
|
@joanromano did you use your account as danger bot? ahaha da |
Apparently we can't configure with a bot since it's from buddybuild. Also seems like they have an old swiftlint version installed, either we add the default value on our swiftlint file or we add a pre build phase http://docs.buddybuild.com/docs/custom-prebuild-and-postbuild-steps @mathiasAichinger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add a README.md explaining what this example is trying to show, e.g loading the main component from a JSON which is a component of type X and one of the childs, of type Y, is loaded directly from code... also you can mention here about the open source icons.
factory.register(with: "matrioska", factoryBuilder: matrioskaCodeBuilder) | ||
|
||
do { | ||
if let json = try JSONReader.jsonObject(from: "app_structure"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSONFactory should take care of app_structure
I guess, will update that with the schema documentation.
|
||
let stackBuilder: JSONFactory.ClusterFactoryBuilder = { (children, meta) in | ||
ClusterLayout.stack(children: children, meta: meta) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or let stackBuilder: JSONFactory.ClusterFactoryBuilder = ClusterLayout.stack
- Pods | ||
- Example | ||
|
||
reporter: "xcode" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the main .swiftlint file?
@testable import Matrioska | ||
|
||
/// A JSONReader used to convert to JSONObject | ||
final class JSONReader { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't duplicate this file here, will add structure
to the JSONFactory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah too bad we cannot use the one from the project.
axis: .vertical, | ||
preserveParentWidth: true, | ||
backgroundColor: .blue) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not returning this component when declaring the matrioskaCodeBuilder
on AppDelegate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wanted to separate it from the AppDelegate to show that you can always use Matrioska in own ViewControllers
|
||
required init?(meta: ComponentMeta?) { | ||
super.init(nibName: nil, bundle: nil) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this init?
|
||
let hexColor = meta["color"] as? String | ||
let color = UIColor(hexString: hexColor ?? "") | ||
self.color = color |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just color = UIColor(hexString: hexColor ?? "")
yep @mathiasAichinger needs attribution https://github.com/iconic/open-iconic/blob/master/ICON-LICENSE |
@mathiasAichinger what's the state of this? |
@ChristianOrgler from my side it's ready for review. Removed the icons from the iconic project and replaced with 2 self drawn. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think travis is using an old version of Swiftlint because it's complaining about a 100 line length (which is the previous default value, now is 120). @mathiasAichinger could you have a look before merging (it's also not passing the checks somehow).
Also, please add a README.md file in the root folder of the Example explaining what this example is trying to show, e.g loading the main component from a JSON which is a component of type X and one of the child components, of type Y, is loaded directly from code...
No description provided.