dbr-app's People
dbr-app's Issues
Add hardcoded DBR dates/scriptures
Create a Swift struct that has properties for every date where the value of that property is a list of scriptures for that day. I'd like it to be indexable by a date object. Also, remove the old service and code that requests this data from the api and point it at this data source.
See
- https://www.raywenderlich.com/867-building-a-custom-collection-in-swift
- https://developer.apple.com/documentation/swift/collection
Heres some pseudo code...
enum Book {
// TODO: Add all books
case genesis
case exodus
// ... NT...
case matthew
case mark
}
struct Scripture: Hashable {
let book: Book
let chapter: Int
}
struct Reading: Hashable {
// A reading is a list of scriptures. A reading coresponds to a
// single day in the DBR program.
let scriptures: [Scripture]
}
struct Readings: Collection {
// TODO: Possibly move this to a sepearate object so its not inside this
// collection let this collection simply wrap access to that struct which
// could only contain the data
fileprivate let readings: [Date: Reading] = [
// TODO: Complete list and use real dates
Date(): Reading(scriptures: [
Scripture(book: .genesis, chapter: 1),
Scripture(book: .genesis, chapter: 2),
Scripture(book: .matthew, chapter: 1)
]),
Date(): Reading(scriptures: [
Scripture(book: .genesis, chapter: 2),
Scripture(book: .genesis, chapter: 3),
Scripture(book: .matthew, chapter: 2)
])
]
subscript(_ date: Date) -> Reading? {
return self.readings[date]
}
var startIndex: Date {
// TODO: Actually implement this. Start Index would likely be January 1??
return Date()
}
var endIndex: Date {
// TODO: Actually implement this. End index would likely be December 31??
return Date()
}
func index(after: Date) -> Date {
// TODO: Actually implement this. Given March 2nd return March 3rd
return Date()
}
}
HINT: Open up Xcode and create a new Playground and drop this into it and make changes and see how it works.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.