Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
WCByrne committed Aug 17, 2017
1 parent ac382ce commit 29e3c0e
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 85 deletions.
25 changes: 15 additions & 10 deletions CollectionView/RelationalResultsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,28 +168,33 @@ fileprivate class RelationalSectionInfo<Section: NSManagedObject, Element: NSMan
In a FetchedResultsController (and NSFetchedResultsController) you would use sectionKeyPath to achieve the following:
"Things"
```
Things
{ sectionKeyPath : "Things" }
{ sectionKeyPath : "Things" }
"Not Things"
Not Things
{ sectionKeyPath : "Not Things" }
{ sectionKeyPath : "Not Things" }
```
While this is great, it does not work well for the common Parent-Child data model. In a Department - Employee model for example we woul want:
Sales
Jim
Samantha
```
Sales {}
Jim {}
Samantha {}
Managment
Sarah
Howard
Managment {}
Sarah {}
Howard {}
Delivery
Delivery {}
<No employees>
```
In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see fetchSections`).
In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see `fetchSections`).
*/
public class RelationalResultsController<Section: NSManagedObject, Element: NSManagedObject> : NSObject, ResultsController {

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ An example project is included in the repo and CollectionView is also used to po
* [Noun Project for macOS](https://thenounproject.com/for-mac/)

## Contributing
No specific process in place yet for contributing but feel free to start a conversation in issues or reach out on [@NounProjectDev](https://twitter.com/NounProjectDev)
No specific process in place yet for contributing but feel free to start a conversation in issues or reach out on twitter [@NounProjectDev](https://twitter.com/NounProjectDev)

### To do
* Write tests (especially for results controllers and cell manupulation)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)"
options: "56ee39a3abb6597cd16d0d8d4db030bb"
build_time: [556247526, 540018000]
build_time: [556247719, 746975000]
inputs:
"/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/Protocols.swift": [9223372036854775807, 0]
"/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/CollectionViewFlowLayout.swift": [9223372036854775807, 0]
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/CollectionView.build/Release/CollectionView.build/dgph
Binary file not shown.
Binary file not shown.
Binary file modified build/Release/CollectionView.framework/Versions/A/CollectionView
Binary file not shown.
Binary file not shown.
33 changes: 17 additions & 16 deletions docs/Classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -555,29 +555,30 @@ <h4>Declaration</h4>
<p>Extending on FetchedResultsController and it&rsquo;s section grouping, this controller allows for sections to be created from a parent ententy.- </p>

<p>In a FetchedResultsController (and NSFetchedResultsController) you would use sectionKeyPath to achieve the following:</p>
<pre class="highlight plaintext"><code>Things
{ sectionKeyPath : "Things" }
{ sectionKeyPath : "Things" }

<p><q>Things</q>
{ sectionKeyPath : <q>Things</q> }
{ sectionKeyPath : <q>Things</q> }</p>

<p><q>Not Things</q>
{ sectionKeyPath : <q>Not Things</q> }
{ sectionKeyPath : <q>Not Things</q> }</p>
Not Things
{ sectionKeyPath : "Not Things" }
{ sectionKeyPath : "Not Things" }
</code></pre>

<p>While this is great, it does not work well for the common Parent-Child data model. In a Department - Employee model for example we woul want:</p>
<pre class="highlight plaintext"><code>Sales {}
Jim {}
Samantha {}

<p>Sales
Jim
Samantha</p>
Managment {}
Sarah {}
Howard {}

<p>Managment
Sarah
Howard</p>

<p>Delivery
<No employees></p>
Delivery {}
&lt;No employees&gt;
</code></pre>

<p>In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see fetchSections`).</p>
<p>In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see <code>fetchSections</code>).</p>

<a href="Classes/RelationalResultsController.html" class="slightly-smaller">See more</a>
</div>
Expand Down
33 changes: 17 additions & 16 deletions docs/Classes/RelationalResultsController.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,29 +231,30 @@ <h1>RelationalResultsController</h1>
<p>Extending on FetchedResultsController and it&rsquo;s section grouping, this controller allows for sections to be created from a parent ententy.- </p>

<p>In a FetchedResultsController (and NSFetchedResultsController) you would use sectionKeyPath to achieve the following:</p>
<pre class="highlight plaintext"><code>Things
{ sectionKeyPath : "Things" }
{ sectionKeyPath : "Things" }

<p><q>Things</q>
{ sectionKeyPath : <q>Things</q> }
{ sectionKeyPath : <q>Things</q> }</p>

<p><q>Not Things</q>
{ sectionKeyPath : <q>Not Things</q> }
{ sectionKeyPath : <q>Not Things</q> }</p>
Not Things
{ sectionKeyPath : "Not Things" }
{ sectionKeyPath : "Not Things" }
</code></pre>

<p>While this is great, it does not work well for the common Parent-Child data model. In a Department - Employee model for example we woul want:</p>
<pre class="highlight plaintext"><code>Sales {}
Jim {}
Samantha {}

<p>Sales
Jim
Samantha</p>
Managment {}
Sarah {}
Howard {}

<p>Managment
Sarah
Howard</p>

<p>Delivery
<No employees></p>
Delivery {}
&lt;No employees&gt;
</code></pre>

<p>In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see fetchSections`).</p>
<p>In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see <code>fetchSections</code>).</p>

</div>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,29 +555,30 @@ <h4>Declaration</h4>
<p>Extending on FetchedResultsController and it&rsquo;s section grouping, this controller allows for sections to be created from a parent ententy.- </p>

<p>In a FetchedResultsController (and NSFetchedResultsController) you would use sectionKeyPath to achieve the following:</p>
<pre class="highlight plaintext"><code>Things
{ sectionKeyPath : "Things" }
{ sectionKeyPath : "Things" }

<p><q>Things</q>
{ sectionKeyPath : <q>Things</q> }
{ sectionKeyPath : <q>Things</q> }</p>

<p><q>Not Things</q>
{ sectionKeyPath : <q>Not Things</q> }
{ sectionKeyPath : <q>Not Things</q> }</p>
Not Things
{ sectionKeyPath : "Not Things" }
{ sectionKeyPath : "Not Things" }
</code></pre>

<p>While this is great, it does not work well for the common Parent-Child data model. In a Department - Employee model for example we woul want:</p>
<pre class="highlight plaintext"><code>Sales {}
Jim {}
Samantha {}

<p>Sales
Jim
Samantha</p>
Managment {}
Sarah {}
Howard {}

<p>Managment
Sarah
Howard</p>

<p>Delivery
<No employees></p>
Delivery {}
&lt;No employees&gt;
</code></pre>

<p>In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see fetchSections`).</p>
<p>In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see <code>fetchSections</code>).</p>

<a href="Classes/RelationalResultsController.html" class="slightly-smaller">See more</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,29 +231,30 @@ <h1>RelationalResultsController</h1>
<p>Extending on FetchedResultsController and it&rsquo;s section grouping, this controller allows for sections to be created from a parent ententy.- </p>

<p>In a FetchedResultsController (and NSFetchedResultsController) you would use sectionKeyPath to achieve the following:</p>
<pre class="highlight plaintext"><code>Things
{ sectionKeyPath : "Things" }
{ sectionKeyPath : "Things" }

<p><q>Things</q>
{ sectionKeyPath : <q>Things</q> }
{ sectionKeyPath : <q>Things</q> }</p>

<p><q>Not Things</q>
{ sectionKeyPath : <q>Not Things</q> }
{ sectionKeyPath : <q>Not Things</q> }</p>
Not Things
{ sectionKeyPath : "Not Things" }
{ sectionKeyPath : "Not Things" }
</code></pre>

<p>While this is great, it does not work well for the common Parent-Child data model. In a Department - Employee model for example we woul want:</p>
<pre class="highlight plaintext"><code>Sales {}
Jim {}
Samantha {}

<p>Sales
Jim
Samantha</p>
Managment {}
Sarah {}
Howard {}

<p>Managment
Sarah
Howard</p>

<p>Delivery
<No employees></p>
Delivery {}
&lt;No employees&gt;
</code></pre>

<p>In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see fetchSections`).</p>
<p>In this case, both the parent and child are NSManagedObjects joined by a relationship. Also, notice the Delivery department has no employees. With a standard FetchedResultsController the sections a derived from the available properties in the fetched objects. Here though you can opt to fetch both the sections and object independently (see <code>fetchSections</code>).</p>

</div>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ <h2 id='examples' class='heading'>Examples</h2>
</ul>
<h2 id='contributing' class='heading'>Contributing</h2>

<p>No specific process in place yet for contributing but feel free to start a conversation in issues or reach out on <a href="https://twitter.com/NounProjectDev">@NounProjectDev</a></p>
<p>No specific process in place yet for contributing but feel free to start a conversation in issues or reach out on twitter <a href="https://twitter.com/NounProjectDev">@NounProjectDev</a></p>
<h3 id='to-do' class='heading'>To do</h3>

<ul>
Expand Down
Binary file modified docs/docsets/CollectionView.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ <h2 id='examples' class='heading'>Examples</h2>
</ul>
<h2 id='contributing' class='heading'>Contributing</h2>

<p>No specific process in place yet for contributing but feel free to start a conversation in issues or reach out on <a href="https://twitter.com/NounProjectDev">@NounProjectDev</a></p>
<p>No specific process in place yet for contributing but feel free to start a conversation in issues or reach out on twitter <a href="https://twitter.com/NounProjectDev">@NounProjectDev</a></p>
<h3 id='to-do' class='heading'>To do</h3>

<ul>
Expand Down
14 changes: 7 additions & 7 deletions docs/undocumented.json
Original file line number Diff line number Diff line change
Expand Up @@ -1227,49 +1227,49 @@
},
{
"file": "/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/RelationalResultsController.swift",
"line": 206,
"line": 211,
"symbol": "RelationalResultsController.init(context:request:sectionRequest:sectionKeyPath:)",
"symbol_kind": "source.lang.swift.decl.function.method.instance",
"warning": "undocumented"
},
{
"file": "/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/RelationalResultsController.swift",
"line": 444,
"line": 449,
"symbol": "RelationalResultsController._object(at:)",
"symbol_kind": "source.lang.swift.decl.function.method.instance",
"warning": "undocumented"
},
{
"file": "/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/RelationalResultsController.swift",
"line": 463,
"line": 468,
"symbol": "RelationalResultsController.object(forSectionAt:)",
"symbol_kind": "source.lang.swift.decl.function.method.instance",
"warning": "undocumented"
},
{
"file": "/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/RelationalResultsController.swift",
"line": 467,
"line": 472,
"symbol": "RelationalResultsController._object(forSectionAt:)",
"symbol_kind": "source.lang.swift.decl.function.method.instance",
"warning": "undocumented"
},
{
"file": "/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/RelationalResultsController.swift",
"line": 474,
"line": 479,
"symbol": "RelationalResultsController.indexPath(of:)",
"symbol_kind": "source.lang.swift.decl.function.method.instance",
"warning": "undocumented"
},
{
"file": "/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/RelationalResultsController.swift",
"line": 482,
"line": 487,
"symbol": "RelationalResultsController.indexPath(of:)",
"symbol_kind": "source.lang.swift.decl.function.method.instance",
"warning": "undocumented"
},
{
"file": "/Users/Wes/Documents/NounProject/macOS/Lingo/CollectionView/CollectionView/RelationalResultsController.swift",
"line": 489,
"line": 494,
"symbol": "RelationalResultsController.indexPathOfSection(representing:)",
"symbol_kind": "source.lang.swift.decl.function.method.instance",
"warning": "undocumented"
Expand Down

0 comments on commit 29e3c0e

Please sign in to comment.