-
Notifications
You must be signed in to change notification settings - Fork 12
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
Safety plan view controller swift conversion #18
Safety plan view controller swift conversion #18
Conversation
Refactor CrisisViewController, sync with original repo master branch
…ViewController components, Add SafetyPlanItem for data management.
…eld and Button Cells, Update UserDefaults save method
…Plan view controllers, update edit vc and user default gateway for personal contacts
Updating Local master with original master
@eddielement While refactoring into Swift, I had updated some of the views to be more consistent with iOS app UI. Namely, I made the entire rows tappable on instead of just a button on the SafetyPlanViewController. I also updated the look and functionality of the text fields used to update and edit all of the plan items (Warning Signs, Coping Strategies, etc). They now look and behave more consistently with what is expected from other iOS applications. Feel free to comment and let me know what you like and dont like. I will update anything changes you deem not wanted. |
Wow! This all looks amazing!!! I love the changes you made to make it more consistent with iOS app UI - it feels much smoother and more natural. Only two things I found - Minor bug: Upon updating from an old version when I had two contacts entered, the app thought I had all 10 contacts filled when I actually only had two. (It showed 8 empty bullet points). This was easily fixed just by entering the edit contacts page and closing it again. Crisis page & iPads: The third tab was typically hidden for users on iPads (since they don't have calling or texting functionality). There are lots of potential solutions here - we could make it visible, but we should probably hide the Call and Text buttons. (Or maybe just the Text button, the Call button actually does work if they also have an iPhone). |
@eddielement Regarding Crisis Page and iPads, I like the option of keeping it visible but hiding the call/text options if those actions are not available. I think it would be a helpful page to have available for all users. Not sure if there is a way to detect if the action is available, but I can look into it |
@shayneptorres Sounds good! When those changes are in, happy to merge it in then push out an update (unless you want to wait for the Realm change is in before shipping this to real users, either way works for me). |
@eddielement Since I can actually include the Realm changes in with my next push. Since I will be dealing with how we show these saved items, it might just make sense to include it all with this PR. |
…lts to persist data
Finished adding the changes to migrate the data persistence layer from User defaults to RealmDB. There are a couple things to note. 1.) Getting Saved data from RealmDB
2.) Saving data to Realm DB
3.) Moving from UserDefaults to RealmDB.
4.) Realm Migrations
If you have any more questions, please do reach out. Im sure there is something important I am forgetting |
@shayneptorres Wow awesome job, I'm super impressed! Overall, this codebase is SO much better than the old one!!! I went through the code and tested the app thoroughly, and the only thing I could find that causes an error is Plan -> Contacts -> Save causes the app to crash with the error "Property ‘safetyPlanItemTypeId’ not found in object of type RLMPersonalContact". I'm excited to get this out there! :) |
Nice catch, it looks like I messed up with my refactor. Pushed up another commit that should fix that problem. I also found one spot on the CrisisViewController where I hadn't migrated from UserDefaults to Realm. This should do the trick |
@shayneptorres Just submitted the update to Apple, thanks for your work on this! :) I put a little shoutout for you in the update notes. |
@shayneptorres By the way, the update was accepted and we just got a new positive review. "Way better than paper! I had & have outstanding mental health care by the VA. However, a safety plan on a sheet of paper, upon leaving the hospital or in the course of outpatient treatment, is not practical. It’ll get lost, destroyed in the laundry, the dog will eat it, it might be shredded accidentally, or just plain wear out. Most people carry around their cell phone. This app is easy to use, wise to have, has a great layout, & was thoughtfully designed. I recommend you review your plan every 3 months & write down what changes you think your plan needs then review with your psychotherapist before updating it. If you don’t have the energy to devote to updating it (yes, depression can do that), talk it out every 3 months with your psychotherapist (you are worth it, darn it!). I would give this app 10 stars if that were possible." |
That is so cool! Good job @eddielement ! It is awesome to work on a project like this that will provide a real service to people. Thank you for allowing me to contribute. |
Closes #15
Refactor Plan ViewControllers from objc into Swift.
Closes #19
Implement RealmDB for the data persistence layer