Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playground examples #134

Merged
merged 2 commits into from
Jun 8, 2017
Merged

Playground examples #134

merged 2 commits into from
Jun 8, 2017

Conversation

jay18001
Copy link
Contributor

@jay18001 jay18001 commented May 30, 2017

[skip ci]

Closes #133

@jay18001 jay18001 requested a review from rubencagnie May 30, 2017 14:40
@codecov-io
Copy link

codecov-io commented May 30, 2017

Codecov Report

Merging #134 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #134   +/-   ##
=======================================
  Coverage   93.25%   93.25%           
=======================================
  Files          38       38           
  Lines        3097     3097           
=======================================
  Hits         2888     2888           
  Misses        209      209

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e299f3e...4f3d187. Read the comment docs.

@@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<Group
location = "group:Example/Playgrounds"
name = "Playgrounds">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this group to the bottom in the workspace


let name: String

init(name: String) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a struct, you won't need a dedicated init

import PlaygroundSupport


struct Fruit {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can "hide" structs and classes in a playground, so you don't really clutter the code

}

class RepeatCount: BrickRepeatCountDataSource {
func repeatCount(for identifier: String, with collectionIndex: Int, collectionIdentifier: String) -> Int {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also set repeatCount directly on the brick to make it simpler

}
}

let brickViewContoller = BrickViewController()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use BrickCollectionView, so the frame can be set

LabelBrick("FRUIT", dataSource: labelDataSource)
], inset: 8, edgeInsets: UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16))

section.repeatCountDataSource = repeatCount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use repeatCount directly on the Brick

let repeatCount = RepeatCount()

let section = BrickSection(backgroundColor: .lightGray, bricks: [
LabelBrick("FRUIT", dataSource: labelDataSource)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use GenericBrick<UILabel> as this is the preferred method from now on

@jay18001 jay18001 merged commit 87040bc into master Jun 8, 2017
@jay18001 jay18001 deleted the playground-examples branch June 8, 2017 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants