-
Notifications
You must be signed in to change notification settings - Fork 442
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
Add Storyboard Support #109
Conversation
This duplicates some of the existing activity test, using the defaultStore for the care plan store instead.
Instead of duplicating the same steps, "creating the symptom tracker" links to "creating the care card". Also fix the alt text for care card images.
This was changed in carekit-apple#14, but it turns out appledoc doesn't support fenced codeblocks, so it's switched it back to the indented form. Links and some grammatical errors were fixed. I ran the "CareKit-docs" build target to make sure everything looks good.
Updates to finish off the year... Xcode 8 Class PropertyXcode 8 came with the ability to create class properties in Objective-C to better interoperate with Swift. I converted the default store to a class property named
Everything else related to the singleton remained the same. Swift 3 OCKTest UpdateThe storyboard files were updated to Swift 3 and the default store property. I also noticed that there are quite a few crash bugs in OCKTest that should be fixed. Removed Documentation ChangesTo narrow the scope of this PR, I removed the changes in documentation. They can be put back in (with the power of git) if need be. |
@umerkhan-apple Any updates on this PR? |
@tktsubota Putting this PR on hold for now. Will test internally with the rest of the team and get back to you. |
Reopening later. |
Updated 12/31/16: See Comment Below
This adds support for issue #108.
The Two Features
There are two major features in this: the default care plan store (
OCKCarePlanStore.defaultStore()
) andinitWithCoder:
implementations to support storyboard usage.Implementation
I essentially followed what I outlined in #108.
Actual Source
OCKCarePlanStore.defaultStore()
is the big one here. I added it as a class method, internally callinginitWithPersistenceDirectoryURL:
with a directory named "CarePlanStore" in the user's document directory.initWithCoder:
in the view controllers essentially duplicates the existing initializers, without the parameter passed in.Most of the public properties of the view controllers were made
IBInspectable
so we can modify those properties in interface builder without needing to subclass.initWithPersistenceDirectoryURL:
in OCKCarePlanStore andinitWithCarePlanStore:
in the care card and symptom tracker were left to be, so these changes wouldn't be source-breaking and we can still use a custom care plan store if we want.init
of the view controllers was made available, using the default store.Documentation
With these two major features came with a huge change in the programming guides. I switched to using the default store for everything, while still providing an option to create a custom store if need be. The view controller creation in the storyboard was centralized in "Creating The Care Card".
I also had to revert #14's changes to the code-blocks, because when I ran the "CareKit-docs" build target to generate the appledoc, I found out appledoc didn't support the fenced code-blocks and it didn't look good at all. I also fixed broken links.
Test Apps
I wasn't sure if I should have used the singleton throughout the entire OCKTest (and even OCKSample), so I left it be and made a separate "Storyboard" test in OCKTest, where every view controller there is instantiated in the storyboard and uses the default store.
Unit Test
I also added a unit test that duplicates some of the existing care plan store test, just to make sure the default care plan store was working.
Bugs I found
Future Improvements
I expect a lot of changes from code review, as this is a major feature (and lots of changes in the programming guides).