Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First commit.

  • Loading branch information...
commit 3196a44708a895ba6407652e96242a1d5cef59ac 0 parents
@yatsu authored
Showing with 3,887 additions and 0 deletions.
  1. +20 −0 LICENSE.txt
  2. +63 −0 README.md
  3. +11 −0 ios/.gitignore
  4. +1 −0  ios/.rvmrc
  5. +447 −0 ios/Bestmix.xcodeproj/project.pbxproj
  6. +7 −0 ios/Bestmix.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  7. +7 −0 ios/Bestmix/AppDelegate.h
  8. +55 −0 ios/Bestmix/AppDelegate.m
  9. +49 −0 ios/Bestmix/Bestmix-Info.plist
  10. +14 −0 ios/Bestmix/Bestmix-Prefix.pch
  11. +6 −0 ios/Bestmix/Config.h.example
  12. +6 −0 ios/Bestmix/PrivateTasksViewController.h
  13. +105 −0 ios/Bestmix/PrivateTasksViewController.m
  14. +6 −0 ios/Bestmix/PublicTasksViewController.h
  15. +82 −0 ios/Bestmix/PublicTasksViewController.m
  16. +7 −0 ios/Bestmix/TasksApiClient.h
  17. +27 −0 ios/Bestmix/TasksApiClient.m
  18. +26 −0 ios/Bestmix/TasksViewController.h
  19. +176 −0 ios/Bestmix/TasksViewController.m
  20. +2 −0  ios/Bestmix/en.lproj/InfoPlist.strings
  21. +134 −0 ios/Bestmix/en.lproj/MainStoryboard_iPad.storyboard
  22. +147 −0 ios/Bestmix/en.lproj/MainStoryboard_iPhone.storyboard
  23. BIN  ios/Bestmix/first.png
  24. BIN  ios/Bestmix/first@2x.png
  25. +10 −0 ios/Bestmix/main.m
  26. BIN  ios/Bestmix/second.png
  27. BIN  ios/Bestmix/second@2x.png
  28. +5 −0 ios/Categories/NSDictionary+ObjectForKeyOrNil.h
  29. +14 −0 ios/Categories/NSDictionary+ObjectForKeyOrNil.m
  30. +5 −0 ios/Categories/UIColor+Hex.h
  31. +13 −0 ios/Categories/UIColor+Hex.m
  32. +8 −0 ios/DataModel/Bestmix.xcdatamodeld/.xccurrentversion
  33. +13 −0 ios/DataModel/Bestmix.xcdatamodeld/Bestmix.xcdatamodel/contents
  34. +16 −0 ios/DataModel/BestmixDataModel.h
  35. +104 −0 ios/DataModel/BestmixDataModel.m
  36. +7 −0 ios/DataModel/Task.h
  37. +29 −0 ios/DataModel/Task.m
  38. +135 −0 ios/DataModel/_Task.h
  39. +139 −0 ios/DataModel/_Task.m
  40. +12 −0 ios/Podfile
  41. +23 −0 ios/Podfile.lock
  42. +21 −0 server/.gitignore
  43. +1 −0  server/.rvmrc
  44. +57 −0 server/Gemfile
  45. +206 −0 server/Gemfile.lock
  46. +7 −0 server/Rakefile
  47. +3 −0  server/app/admin/access_grants.rb
  48. +3 −0  server/app/admin/access_tokens.rb
  49. +44 −0 server/app/admin/dashboards.rb
  50. +3 −0  server/app/admin/tasks.rb
  51. +3 −0  server/app/admin/users.rb
  52. BIN  server/app/assets/images/rails.png
  53. +1 −0  server/app/assets/javascripts/active_admin.js
  54. +3 −0  server/app/assets/javascripts/api/tasks.js.coffee
  55. +14 −0 server/app/assets/javascripts/application.js
  56. +3 −0  server/app/assets/javascripts/main.js.coffee
  57. +3 −0  server/app/assets/javascripts/tasks.js.coffee
  58. +6 −0 server/app/assets/stylesheets/active_admin.css.scss
  59. +3 −0  server/app/assets/stylesheets/api/tasks.css.scss
  60. +14 −0 server/app/assets/stylesheets/application.css.scss
  61. +3 −0  server/app/assets/stylesheets/main.css.scss
  62. +56 −0 server/app/assets/stylesheets/scaffolds.css.scss
  63. +15 −0 server/app/assets/stylesheets/tasks.css.scss
  64. +11 −0 server/app/controllers/api/api_controller.rb
  65. +18 −0 server/app/controllers/api/v1/tasks_controller.rb
  66. +3 −0  server/app/controllers/application_controller.rb
  67. +10 −0 server/app/controllers/main_controller.rb
  68. +13 −0 server/app/controllers/tasks_controller.rb
  69. +2 −0  server/app/helpers/api/tasks_helper.rb
  70. +2 −0  server/app/helpers/application_helper.rb
  71. +2 −0  server/app/helpers/main_helper.rb
  72. +2 −0  server/app/helpers/tasks_helper.rb
  73. 0  server/app/mailers/.gitkeep
  74. 0  server/app/models/.gitkeep
  75. +10 −0 server/app/models/admin_user.rb
  76. +13 −0 server/app/models/task.rb
  77. +15 −0 server/app/models/user.rb
  78. +9 −0 server/app/views/api/v1/tasks/my.json.rabl
  79. +9 −0 server/app/views/api/v1/tasks/public.json.rabl
  80. +10 −0 server/app/views/api/v1/tasks/show.json.rabl
  81. +3 −0  server/app/views/api/v1/users/show.json.rabl
  82. +21 −0 server/app/views/layouts/application.html.haml
  83. +19 −0 server/app/views/main/index.html.haml
  84. +22 −0 server/app/views/tasks/_form.html.haml
  85. +4 −0 server/app/views/tasks/_task.html.haml
  86. +7 −0 server/app/views/tasks/edit.html.haml
  87. +21 −0 server/app/views/tasks/index.html.haml
  88. +5 −0 server/app/views/tasks/new.html.haml
  89. +13 −0 server/app/views/tasks/show.html.haml
  90. +33 −0 server/client/client.thor
  91. +4 −0 server/config.ru
  92. +65 −0 server/config/application.rb
  93. +6 −0 server/config/boot.rb
  94. +42 −0 server/config/database.yml.example
  95. +5 −0 server/config/environment.rb
  96. +37 −0 server/config/environments/development.rb
  97. +67 −0 server/config/environments/production.rb
  98. +37 −0 server/config/environments/test.rb
  99. +129 −0 server/config/initializers/active_admin.rb
  100. +7 −0 server/config/initializers/backtrace_silencers.rb
  101. +223 −0 server/config/initializers/devise.rb.example
  102. +42 −0 server/config/initializers/doorkeeper.rb
  103. +5 −0 server/config/initializers/fablication.rb
  104. +15 −0 server/config/initializers/inflections.rb
  105. +5 −0 server/config/initializers/mime_types.rb
  106. +19 −0 server/config/initializers/rabl_init.rb
  107. +7 −0 server/config/initializers/secret_token.rb
  108. +8 −0 server/config/initializers/session_store.rb
  109. +14 −0 server/config/initializers/wrap_parameters.rb
  110. +57 −0 server/config/locales/devise.en.yml
  111. +23 −0 server/config/locales/doorkeeper.en.yml
  112. +5 −0 server/config/locales/en.yml
  113. +80 −0 server/config/routes.rb
  114. +7 −0 server/data/fabricators/task_fabricator.rb
  115. +9 −0 server/db/migrate/20120525135258_create_tasks.rb
  116. +42 −0 server/db/migrate/20120526055304_create_doorkeeper_tables.rb
  117. +52 −0 server/db/migrate/20120526061155_devise_create_admin_users.rb
  118. +17 −0 server/db/migrate/20120526151202_create_admin_notes.rb
  119. +25 −0 server/db/migrate/20120526151203_move_admin_notes_to_comments.rb
  120. +49 −0 server/db/migrate/20120526151204_devise_create_users.rb
  121. +9 −0 server/db/migrate/20120527051437_add_user_id_to_tasks.rb
  122. +7 −0 server/db/seeds.rb
  123. 0  server/lib/assets/.gitkeep
  124. 0  server/lib/tasks/.gitkeep
  125. +26 −0 server/public/404.html
  126. +26 −0 server/public/422.html
  127. +25 −0 server/public/500.html
  128. 0  server/public/favicon.ico
  129. +5 −0 server/public/robots.txt
  130. +3 −0  server/script/generate_tasks.rb
  131. +6 −0 server/script/rails
  132. 0  server/vendor/assets/javascripts/.gitkeep
  133. 0  server/vendor/assets/stylesheets/.gitkeep
  134. 0  server/vendor/plugins/.gitkeep
20 LICENSE.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Masaki Yatsu
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
63 README.md
@@ -0,0 +1,63 @@
+Bestmix
+=======
+
+__NOTE: Bestmix is under development. It works currently without authentication and caching.__
+
+Bestmix is a set of boilerplate to build both Rails-based web app and iOS app integrated with each other.
+They are connected with JSON REST API supporting authentication, pagination and caching.
+You can build your own server-side and client-side quickly by extending it.
+
+Libraries
+---------
+
+Bestmix uses following libraries and frameworks.
+
+### Server-side
+
+* [Ruby on Rails](http://rubyonrails.org/ ) - Web Framework
+* [Devise](https://github.com/plataformatec/devise ) - Authentication
+* [RABL](https://github.com/nesquena/rabl ) - JSON Generation
+* [Doorkeeper](https://github.com/applicake/doorkeeper ) - OAuth2 Provider
+* [versionist](https://github.com/bploetz/versionist ) - API Versioning
+* [Kaminari](https://github.com/amatsuda/kaminari ) - Pagination
+* [Active Admin](http://activeadmin.info/) - Admin Interface
+
+See [Gemfile](http://github.com/yatsu/bestmix/blob/master/server/Gemfile ) for more details
+
+### iOS App
+
+* [CocoaPods](http://cocoapods.org/ ) - Library Management
+* [AFNetworking](https://github.com/AFNetworking/AFNetworking ) - Networking Framework
+* [JSONKit](https://github.com/johnezang/JSONKit ) - JSON Parser
+* [MBProgressHUD](https://github.com/jdg/MBProgressHUD ) - Progress HUD
+* [SVPullToRefresh](https://github.com/samvermette/SVPullToRefresh ) - Pull-to-Refresh
+* [Reachability](https://github.com/tonymillion/Reachability ) - Network Reachability
+
+See [Podfile](http://github.com/yatsu/bestmix/blob/master/ios/Podfile ) for more details.
+
+Setup
+-----
+
+### Server-side
+
+1. Install [Ruby on Rails](http://rubyonrails.org/ ) and [RVM](https://rvm.io/ ) if you don't have them.
+2. Copy server/config/database.yml.example to server/config/database.yml and modify it.
+3. Copy server/config/initializers/devise.rb.example to server/config/initializers/devise.rb and modify it (See [Devise](https://github.com/plataformatec/devise ) for details).
+4. cd server; rails db:setup
+5. rails s (or you can setup your web server like Apache, nginx, etc.)
+
+### iOS App
+
+1. Install [CocoaPods](http://cocoapods.org/ ) if you don't have it.
+2. Copy ios/Bestmix/Config.h.example to ios/Bestmix/Config.h and modify it.
+3. cd ios; pod install Bestmix.xcodeproj
+4. Open Bestmix.xcworkspace and build the app
+
+License
+-------
+
+Bestmix itself is provided under
+[MIT License](http://github.com/yatsu/bestmix/blob/master/LICENSE.txt )
+and it uses many other libraries.
+See [Gemfile](http://github.com/yatsu/bestmix/blob/master/server/Gemfile ) and
+[Podfile](http://github.com/yatsu/bestmix/blob/master/ios/Podfile ).
11 ios/.gitignore
@@ -0,0 +1,11 @@
+*.xcodeproj/project.xcworkspace/xcuserdata/*.xcuserdatad
+*.xcodeproj/xcuserdata/*.xcuserdatad/
+*.xcodeproj/*.pbxuser
+*.xcodeproj/*.mode*
+build/Debug-*
+build/Release-*
+build/*.build
+DerivedData
+Bestmix.xcworkspace
+Pods
+/Bestmix/Config.h
1  ios/.rvmrc
@@ -0,0 +1 @@
+rvm 1.9.3
447 ios/Bestmix.xcodeproj/project.pbxproj
@@ -0,0 +1,447 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 008735F20059421B97C66099 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 828B90085EA242E88A9E748D /* libPods.a */; };
+ 1C1E5069157C988600D62584 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C1E5068157C988600D62584 /* CoreData.framework */; };
+ 1C1E506E157C9ADC00D62584 /* NSDictionary+ObjectForKeyOrNil.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1E506D157C9ADC00D62584 /* NSDictionary+ObjectForKeyOrNil.m */; };
+ 1C1E5071157C9C8700D62584 /* BestmixDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1E5070157C9C8700D62584 /* BestmixDataModel.m */; };
+ 1C1E5077157CCC1300D62584 /* TasksApiClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1E5076157CCC1300D62584 /* TasksApiClient.m */; };
+ 1C7ABC8915775C6700327DEB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C7ABC8815775C6700327DEB /* UIKit.framework */; };
+ 1C7ABC8B15775C6700327DEB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C7ABC8A15775C6700327DEB /* Foundation.framework */; };
+ 1C7ABC8D15775C6700327DEB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C7ABC8C15775C6700327DEB /* CoreGraphics.framework */; };
+ 1C7ABC9315775C6700327DEB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1C7ABC9115775C6700327DEB /* InfoPlist.strings */; };
+ 1C7ABC9515775C6700327DEB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C7ABC9415775C6700327DEB /* main.m */; };
+ 1C7ABC9915775C6700327DEB /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C7ABC9815775C6700327DEB /* AppDelegate.m */; };
+ 1C7ABC9C15775C6700327DEB /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1C7ABC9A15775C6700327DEB /* MainStoryboard_iPhone.storyboard */; };
+ 1C7ABC9F15775C6700327DEB /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1C7ABC9D15775C6700327DEB /* MainStoryboard_iPad.storyboard */; };
+ 1C7ABCA415775C6700327DEB /* first.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C7ABCA315775C6700327DEB /* first.png */; };
+ 1C7ABCA615775C6700327DEB /* first@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C7ABCA515775C6700327DEB /* first@2x.png */; };
+ 1C7ABCAB15775C6700327DEB /* second.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C7ABCAA15775C6700327DEB /* second.png */; };
+ 1C7ABCAD15775C6700327DEB /* second@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C7ABCAC15775C6700327DEB /* second@2x.png */; };
+ 1CA74BF815836BC900DDE84D /* TasksViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CA74BF715836BC900DDE84D /* TasksViewController.m */; };
+ 1CA74BFB15837C5900DDE84D /* UIColor+Hex.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CA74BFA15837C5900DDE84D /* UIColor+Hex.m */; };
+ 1CA8E73E1579FDD50062C93F /* PublicTasksViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8E73D1579FDD50062C93F /* PublicTasksViewController.m */; };
+ 1CA8E7441579FFFC0062C93F /* PrivateTasksViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8E7431579FFFC0062C93F /* PrivateTasksViewController.m */; };
+ 1CA8E748157A2A670062C93F /* Bestmix.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8E746157A2A670062C93F /* Bestmix.xcdatamodeld */; };
+ 1CA8E74D157A2CCC0062C93F /* _Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8E74A157A2CCC0062C93F /* _Task.m */; };
+ 1CA8E74E157A2CCC0062C93F /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8E74C157A2CCC0062C93F /* Task.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 1C1E5068157C988600D62584 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+ 1C1E506C157C9ADC00D62584 /* NSDictionary+ObjectForKeyOrNil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+ObjectForKeyOrNil.h"; sourceTree = "<group>"; };
+ 1C1E506D157C9ADC00D62584 /* NSDictionary+ObjectForKeyOrNil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+ObjectForKeyOrNil.m"; sourceTree = "<group>"; };
+ 1C1E506F157C9C8700D62584 /* BestmixDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BestmixDataModel.h; sourceTree = "<group>"; };
+ 1C1E5070157C9C8700D62584 /* BestmixDataModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BestmixDataModel.m; sourceTree = "<group>"; };
+ 1C1E5075157CCC1300D62584 /* TasksApiClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TasksApiClient.h; sourceTree = "<group>"; };
+ 1C1E5076157CCC1300D62584 /* TasksApiClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TasksApiClient.m; sourceTree = "<group>"; };
+ 1C7ABC8415775C6700327DEB /* Bestmix.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Bestmix.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1C7ABC8815775C6700327DEB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 1C7ABC8A15775C6700327DEB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 1C7ABC8C15775C6700327DEB /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 1C7ABC9015775C6700327DEB /* Bestmix-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Bestmix-Info.plist"; sourceTree = "<group>"; };
+ 1C7ABC9215775C6700327DEB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1C7ABC9415775C6700327DEB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 1C7ABC9615775C6700327DEB /* Bestmix-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bestmix-Prefix.pch"; sourceTree = "<group>"; };
+ 1C7ABC9715775C6700327DEB /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 1C7ABC9815775C6700327DEB /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 1C7ABC9B15775C6700327DEB /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
+ 1C7ABC9E15775C6700327DEB /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
+ 1C7ABCA315775C6700327DEB /* first.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = first.png; sourceTree = "<group>"; };
+ 1C7ABCA515775C6700327DEB /* first@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "first@2x.png"; sourceTree = "<group>"; };
+ 1C7ABCAA15775C6700327DEB /* second.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = second.png; sourceTree = "<group>"; };
+ 1C7ABCAC15775C6700327DEB /* second@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "second@2x.png"; sourceTree = "<group>"; };
+ 1C7ABCC515776A3C00327DEB /* PublicTasksViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PublicTasksViewController.h; sourceTree = "<group>"; };
+ 1C7ABCC915776BAE00327DEB /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Config.h; sourceTree = "<group>"; };
+ 1CA74BF615836BC900DDE84D /* TasksViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TasksViewController.h; sourceTree = "<group>"; };
+ 1CA74BF715836BC900DDE84D /* TasksViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TasksViewController.m; sourceTree = "<group>"; };
+ 1CA74BF915837C5900DDE84D /* UIColor+Hex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Hex.h"; sourceTree = "<group>"; };
+ 1CA74BFA15837C5900DDE84D /* UIColor+Hex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Hex.m"; sourceTree = "<group>"; };
+ 1CA8E73D1579FDD50062C93F /* PublicTasksViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PublicTasksViewController.m; sourceTree = "<group>"; };
+ 1CA8E7421579FFFC0062C93F /* PrivateTasksViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrivateTasksViewController.h; sourceTree = "<group>"; };
+ 1CA8E7431579FFFC0062C93F /* PrivateTasksViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrivateTasksViewController.m; sourceTree = "<group>"; };
+ 1CA8E747157A2A670062C93F /* Bestmix.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Bestmix.xcdatamodel; sourceTree = "<group>"; };
+ 1CA8E749157A2CCC0062C93F /* _Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _Task.h; sourceTree = "<group>"; };
+ 1CA8E74A157A2CCC0062C93F /* _Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _Task.m; sourceTree = "<group>"; };
+ 1CA8E74B157A2CCC0062C93F /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task.h; sourceTree = "<group>"; };
+ 1CA8E74C157A2CCC0062C93F /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task.m; sourceTree = "<group>"; };
+ 828B90085EA242E88A9E748D /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ BD4A8059D94C425B85738933 /* Pods.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = SOURCE_ROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 1C7ABC8115775C6700327DEB /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1C1E5069157C988600D62584 /* CoreData.framework in Frameworks */,
+ 1C7ABC8915775C6700327DEB /* UIKit.framework in Frameworks */,
+ 1C7ABC8B15775C6700327DEB /* Foundation.framework in Frameworks */,
+ 1C7ABC8D15775C6700327DEB /* CoreGraphics.framework in Frameworks */,
+ 008735F20059421B97C66099 /* libPods.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 1C7ABC7915775C6700327DEB = {
+ isa = PBXGroup;
+ children = (
+ 1CA8E745157A2A2E0062C93F /* DataModel */,
+ 1CA8E7381579FD320062C93F /* Categories */,
+ 1C7ABC8E15775C6700327DEB /* Bestmix */,
+ 1C7ABC8715775C6700327DEB /* Frameworks */,
+ 1C7ABC8515775C6700327DEB /* Products */,
+ BD4A8059D94C425B85738933 /* Pods.xcconfig */,
+ );
+ sourceTree = "<group>";
+ };
+ 1C7ABC8515775C6700327DEB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 1C7ABC8415775C6700327DEB /* Bestmix.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 1C7ABC8715775C6700327DEB /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1C7ABC8815775C6700327DEB /* UIKit.framework */,
+ 1C7ABC8A15775C6700327DEB /* Foundation.framework */,
+ 1C7ABC8C15775C6700327DEB /* CoreGraphics.framework */,
+ 1C1E5068157C988600D62584 /* CoreData.framework */,
+ 828B90085EA242E88A9E748D /* libPods.a */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 1C7ABC8E15775C6700327DEB /* Bestmix */ = {
+ isa = PBXGroup;
+ children = (
+ 1C7ABCC915776BAE00327DEB /* Config.h */,
+ 1C7ABC9715775C6700327DEB /* AppDelegate.h */,
+ 1C7ABC9815775C6700327DEB /* AppDelegate.m */,
+ 1C7ABC9A15775C6700327DEB /* MainStoryboard_iPhone.storyboard */,
+ 1C7ABC9D15775C6700327DEB /* MainStoryboard_iPad.storyboard */,
+ 1C7ABCA315775C6700327DEB /* first.png */,
+ 1C7ABCA515775C6700327DEB /* first@2x.png */,
+ 1C7ABCAA15775C6700327DEB /* second.png */,
+ 1C7ABCAC15775C6700327DEB /* second@2x.png */,
+ 1CA8E7421579FFFC0062C93F /* PrivateTasksViewController.h */,
+ 1CA8E7431579FFFC0062C93F /* PrivateTasksViewController.m */,
+ 1C7ABCC515776A3C00327DEB /* PublicTasksViewController.h */,
+ 1CA8E73D1579FDD50062C93F /* PublicTasksViewController.m */,
+ 1C1E5075157CCC1300D62584 /* TasksApiClient.h */,
+ 1C1E5076157CCC1300D62584 /* TasksApiClient.m */,
+ 1CA74BF615836BC900DDE84D /* TasksViewController.h */,
+ 1CA74BF715836BC900DDE84D /* TasksViewController.m */,
+ 1C7ABC8F15775C6700327DEB /* Supporting Files */,
+ );
+ path = Bestmix;
+ sourceTree = "<group>";
+ };
+ 1C7ABC8F15775C6700327DEB /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 1C7ABC9015775C6700327DEB /* Bestmix-Info.plist */,
+ 1C7ABC9115775C6700327DEB /* InfoPlist.strings */,
+ 1C7ABC9415775C6700327DEB /* main.m */,
+ 1C7ABC9615775C6700327DEB /* Bestmix-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 1CA8E7381579FD320062C93F /* Categories */ = {
+ isa = PBXGroup;
+ children = (
+ 1CA74BF915837C5900DDE84D /* UIColor+Hex.h */,
+ 1CA74BFA15837C5900DDE84D /* UIColor+Hex.m */,
+ 1C1E506C157C9ADC00D62584 /* NSDictionary+ObjectForKeyOrNil.h */,
+ 1C1E506D157C9ADC00D62584 /* NSDictionary+ObjectForKeyOrNil.m */,
+ );
+ path = Categories;
+ sourceTree = "<group>";
+ };
+ 1CA8E745157A2A2E0062C93F /* DataModel */ = {
+ isa = PBXGroup;
+ children = (
+ 1CA8E746157A2A670062C93F /* Bestmix.xcdatamodeld */,
+ 1C1E506F157C9C8700D62584 /* BestmixDataModel.h */,
+ 1C1E5070157C9C8700D62584 /* BestmixDataModel.m */,
+ 1CA8E749157A2CCC0062C93F /* _Task.h */,
+ 1CA8E74A157A2CCC0062C93F /* _Task.m */,
+ 1CA8E74B157A2CCC0062C93F /* Task.h */,
+ 1CA8E74C157A2CCC0062C93F /* Task.m */,
+ );
+ path = DataModel;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 1C7ABC8315775C6700327DEB /* Bestmix */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1C7ABCB015775C6700327DEB /* Build configuration list for PBXNativeTarget "Bestmix" */;
+ buildPhases = (
+ 1C1E506B157C992B00D62584 /* Mogenerator */,
+ 1C7ABC8015775C6700327DEB /* Sources */,
+ 1C7ABC8115775C6700327DEB /* Frameworks */,
+ 1C7ABC8215775C6700327DEB /* Resources */,
+ A2CB01C8E8F942EAAD67FAA5 /* Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Bestmix;
+ productName = Bestmix;
+ productReference = 1C7ABC8415775C6700327DEB /* Bestmix.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 1C7ABC7B15775C6700327DEB /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0430;
+ };
+ buildConfigurationList = 1C7ABC7E15775C6700327DEB /* Build configuration list for PBXProject "Bestmix" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 1C7ABC7915775C6700327DEB;
+ productRefGroup = 1C7ABC8515775C6700327DEB /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 1C7ABC8315775C6700327DEB /* Bestmix */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 1C7ABC8215775C6700327DEB /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1C7ABC9315775C6700327DEB /* InfoPlist.strings in Resources */,
+ 1C7ABC9C15775C6700327DEB /* MainStoryboard_iPhone.storyboard in Resources */,
+ 1C7ABC9F15775C6700327DEB /* MainStoryboard_iPad.storyboard in Resources */,
+ 1C7ABCA415775C6700327DEB /* first.png in Resources */,
+ 1C7ABCA615775C6700327DEB /* first@2x.png in Resources */,
+ 1C7ABCAB15775C6700327DEB /* second.png in Resources */,
+ 1C7ABCAD15775C6700327DEB /* second@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 1C1E506B157C992B00D62584 /* Mogenerator */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(SRCROOT)/DataModel/Bestmix.xcdataModeld/Bestmix.xcdatamodel",
+ );
+ name = Mogenerator;
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "cd ${SRCROOT}/DataModel\nmogenerator --template-var arc=true -m Bestmix.xcdatamodeld/Bestmix.xcdatamodel";
+ };
+ A2CB01C8E8F942EAAD67FAA5 /* Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 1C7ABC8015775C6700327DEB /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1C7ABC9515775C6700327DEB /* main.m in Sources */,
+ 1C7ABC9915775C6700327DEB /* AppDelegate.m in Sources */,
+ 1CA8E73E1579FDD50062C93F /* PublicTasksViewController.m in Sources */,
+ 1CA8E7441579FFFC0062C93F /* PrivateTasksViewController.m in Sources */,
+ 1CA8E748157A2A670062C93F /* Bestmix.xcdatamodeld in Sources */,
+ 1CA8E74D157A2CCC0062C93F /* _Task.m in Sources */,
+ 1CA8E74E157A2CCC0062C93F /* Task.m in Sources */,
+ 1C1E506E157C9ADC00D62584 /* NSDictionary+ObjectForKeyOrNil.m in Sources */,
+ 1C1E5071157C9C8700D62584 /* BestmixDataModel.m in Sources */,
+ 1C1E5077157CCC1300D62584 /* TasksApiClient.m in Sources */,
+ 1CA74BF815836BC900DDE84D /* TasksViewController.m in Sources */,
+ 1CA74BFB15837C5900DDE84D /* UIColor+Hex.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 1C7ABC9115775C6700327DEB /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1C7ABC9215775C6700327DEB /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 1C7ABC9A15775C6700327DEB /* MainStoryboard_iPhone.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1C7ABC9B15775C6700327DEB /* en */,
+ );
+ name = MainStoryboard_iPhone.storyboard;
+ sourceTree = "<group>";
+ };
+ 1C7ABC9D15775C6700327DEB /* MainStoryboard_iPad.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1C7ABC9E15775C6700327DEB /* en */,
+ );
+ name = MainStoryboard_iPad.storyboard;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 1C7ABCAE15775C6700327DEB /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 1C7ABCAF15775C6700327DEB /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 1C7ABCB115775C6700327DEB /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BD4A8059D94C425B85738933 /* Pods.xcconfig */;
+ buildSettings = {
+ DSTROOT = /tmp/xcodeproj.dst;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "Bestmix/Bestmix-Prefix.pch";
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ INFOPLIST_FILE = "Bestmix/Bestmix-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 1C7ABCB215775C6700327DEB /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BD4A8059D94C425B85738933 /* Pods.xcconfig */;
+ buildSettings = {
+ DSTROOT = /tmp/xcodeproj.dst;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "Bestmix/Bestmix-Prefix.pch";
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ INFOPLIST_FILE = "Bestmix/Bestmix-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1C7ABC7E15775C6700327DEB /* Build configuration list for PBXProject "Bestmix" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1C7ABCAE15775C6700327DEB /* Debug */,
+ 1C7ABCAF15775C6700327DEB /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1C7ABCB015775C6700327DEB /* Build configuration list for PBXNativeTarget "Bestmix" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1C7ABCB115775C6700327DEB /* Debug */,
+ 1C7ABCB215775C6700327DEB /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+
+/* Begin XCVersionGroup section */
+ 1CA8E746157A2A670062C93F /* Bestmix.xcdatamodeld */ = {
+ isa = XCVersionGroup;
+ children = (
+ 1CA8E747157A2A670062C93F /* Bestmix.xcdatamodel */,
+ );
+ currentVersion = 1CA8E747157A2A670062C93F /* Bestmix.xcdatamodel */;
+ path = Bestmix.xcdatamodeld;
+ sourceTree = "<group>";
+ versionGroupType = wrapper.xcdatamodel;
+ };
+/* End XCVersionGroup section */
+ };
+ rootObject = 1C7ABC7B15775C6700327DEB /* Project object */;
+}
7 ios/Bestmix.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:Bestmix.xcodeproj">
+ </FileRef>
+</Workspace>
7 ios/Bestmix/AppDelegate.h
@@ -0,0 +1,7 @@
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
55 ios/Bestmix/AppDelegate.m
@@ -0,0 +1,55 @@
+#import <CoreData/CoreData.h>
+#import "AppDelegate.h"
+#import "Config.h"
+#import "BestmixDataModel.h"
+#import "Task.h"
+
+@implementation AppDelegate
+
+@synthesize window = _window;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ /*
+ NSManagedObjectContext *context = [[BestmixDataModel sharedDataModel] mainContext];
+ if (context) {
+ NSLog(@"context: %@", context);
+ Task *task = [Task insertInManagedObjectContext:context];
+ task.name = @"test a";
+ NSLog(@"task: %@", task);
+ [context save:nil];
+ }
+ */
+ [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
+
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
49 ios/Bestmix/Bestmix-Info.plist
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.valleyport.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIMainStoryboardFile</key>
+ <string>MainStoryboard_iPhone</string>
+ <key>UIMainStoryboardFile~ipad</key>
+ <string>MainStoryboard_iPad</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
14 ios/Bestmix/Bestmix-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'Bestmix' target in the 'Bestmix' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_5_0
+#warning "This project uses features only available in iOS SDK 5.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
6 ios/Bestmix/Config.h.example
@@ -0,0 +1,6 @@
+#define WebApiUrl @"http://localhost:3000/api/v1/"
+
+#define AuthBaseURL @"http://localhost:3000/"
+#define ClientID @"---client id---""
+#define ClientSecret @"---client secret---""
+#define RedirectURL @"bestmix://auth"
6 ios/Bestmix/PrivateTasksViewController.h
@@ -0,0 +1,6 @@
+#import <UIKit/UIKit.h>
+#import "TasksViewController.h"
+
+@interface PrivateTasksViewController : TasksViewController
+
+@end
105 ios/Bestmix/PrivateTasksViewController.m
@@ -0,0 +1,105 @@
+#import <CoreData/CoreData.h>
+#import "PrivateTasksViewController.h"
+#import "Config.h"
+#import "Task.h"
+#import "UIColor+Hex.h"
+#import "MBProgressHUD.h"
+#import "TasksApiClient.h"
+#import "SVPullToRefresh.h"
+#import "AFOAuth2Client.h"
+
+@interface PrivateTasksViewController ()
+{
+ BOOL _loggedIn;
+}
+
+- (void)fetchTasks;
+- (void)login;
+
+@end
+
+@implementation PrivateTasksViewController
+
+#pragma mark TaskViewController
+
+- (void)fetch
+{
+ if (!_loggedIn) {
+ [self login];
+ } else {
+ [self fetchTasks];
+ }
+}
+
+- (void)becomeReachable
+{
+ NSLog(@"reachable");
+ [self fetch];
+}
+
+- (void)becomeUnreachable
+{
+ NSLog(@"unreachable");
+}
+
+#pragma mark Local Methods
+
+- (void)fetchTasks
+{
+ if (!_reachable) {
+ NSLog(@"unable to fetch");
+ return;
+ }
+
+ if (_tasks.count == 0) {
+ MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+ hud.labelText = @"Loading...";
+ }
+
+ TasksApiClient *client = [TasksApiClient sharedClient];
+
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
+ [params setObject:[NSNumber numberWithInteger:_currentPage] forKey:@"page"];
+
+ [client getPath:@"tasks/public"
+ parameters:params
+ success:^(AFHTTPRequestOperation *operation, id response) {
+ NSLog(@"response: %@", response);
+ id elem = [response objectForKey:@"num_pages"];
+ if (elem && [elem isKindOfClass:[NSNumber class]])
+ _totalPages = [elem integerValue];
+ elem = [response objectForKey:@"total_count"];
+ if (elem && [elem isKindOfClass:[NSNumber class]])
+ _totalCount = [elem integerValue];
+ NSLog(@"currentPage: %d totalPages: %d totalCount: %d", _currentPage, _totalPages, _totalCount);
+
+ elem = [response objectForKey:@"tasks"];
+ if (elem && [elem isKindOfClass:[NSArray class]]) {
+ for (id dict in elem) {
+ if (dict && [dict isKindOfClass:[NSDictionary class]]) {
+ Task *task = [Task taskWithDictionary:dict];
+ // NSLog(@"task: %@", task);
+ [_tasks addObject:task];
+ }
+ }
+ }
+
+ [self.tableView reloadData];
+
+ [MBProgressHUD hideHUDForView:self.view animated:YES];
+
+ [self.tableView.pullToRefreshView stopAnimating];
+ }
+ failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ NSLog(@"error %@", error);
+
+ [MBProgressHUD hideHUDForView:self.view animated:YES];
+ }];
+}
+
+- (void)login
+{
+ [self getAccessToken];
+}
+
+@end
6 ios/Bestmix/PublicTasksViewController.h
@@ -0,0 +1,6 @@
+#import <UIKit/UIKit.h>
+#import "TasksViewController.h"
+
+@interface PublicTasksViewController : TasksViewController
+
+@end
82 ios/Bestmix/PublicTasksViewController.m
@@ -0,0 +1,82 @@
+#import <CoreData/CoreData.h>
+#import "PublicTasksViewController.h"
+#import "Config.h"
+#import "Task.h"
+#import "UIColor+Hex.h"
+#import "MBProgressHUD.h"
+#import "TasksApiClient.h"
+#import "SVPullToRefresh.h"
+
+@interface PublicTasksViewController ()
+
+@end
+
+@implementation PublicTasksViewController
+
+#pragma mark TaskViewController
+
+- (void)fetch
+{
+ if (!_reachable) {
+ NSLog(@"unable to fetch");
+ return;
+ }
+
+ if (_tasks.count == 0) {
+ MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+ hud.labelText = @"Loading...";
+ }
+
+ TasksApiClient *client = [TasksApiClient sharedClient];
+
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
+ [params setObject:[NSNumber numberWithInteger:_currentPage] forKey:@"page"];
+
+ [client getPath:@"tasks/public"
+ parameters:params
+ success:^(AFHTTPRequestOperation *operation, id response) {
+ NSLog(@"response: %@", response);
+ id elem = [response objectForKey:@"num_pages"];
+ if (elem && [elem isKindOfClass:[NSNumber class]])
+ _totalPages = [elem integerValue];
+ elem = [response objectForKey:@"total_count"];
+ if (elem && [elem isKindOfClass:[NSNumber class]])
+ _totalCount = [elem integerValue];
+ NSLog(@"currentPage: %d totalPages: %d totalCount: %d", _currentPage, _totalPages, _totalCount);
+
+ elem = [response objectForKey:@"tasks"];
+ if (elem && [elem isKindOfClass:[NSArray class]]) {
+ for (id dict in elem) {
+ if (dict && [dict isKindOfClass:[NSDictionary class]]) {
+ Task *task = [Task taskWithDictionary:dict];
+ // NSLog(@"task: %@", task);
+ [_tasks addObject:task];
+ }
+ }
+ }
+
+ [self.tableView reloadData];
+
+ [MBProgressHUD hideHUDForView:self.view animated:YES];
+
+ [self.tableView.pullToRefreshView stopAnimating];
+ }
+ failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ NSLog(@"error %@", error);
+
+ [MBProgressHUD hideHUDForView:self.view animated:YES];
+ }];
+}
+
+- (void)becomeReachable
+{
+ NSLog(@"reachable");
+ [self fetch];
+}
+
+- (void)becomeUnreachable
+{
+ NSLog(@"unreachable");
+}
+
+@end
7 ios/Bestmix/TasksApiClient.h
@@ -0,0 +1,7 @@
+#import <AFNetworking/AFNetworking.h>
+
+@interface TasksApiClient : AFHTTPClient
+
++ (id)sharedClient;
+
+@end
27 ios/Bestmix/TasksApiClient.m
@@ -0,0 +1,27 @@
+#import "TasksApiClient.h"
+#import "Task.h"
+#import "Config.h"
+
+@implementation TasksApiClient
+
++ (TasksApiClient *)sharedClient
+{
+ static TasksApiClient *client;
+ static dispatch_once_t done;
+ dispatch_once(&done, ^{
+ client = [[TasksApiClient alloc] initWithBaseURL:[NSURL URLWithString:WebApiUrl]];
+ });
+ return client;
+}
+
+- (id)initWithBaseURL:(NSURL *)url
+{
+ self = [super initWithBaseURL:url];
+ if (self) {
+ [self registerHTTPOperationClass:[AFJSONRequestOperation class]];
+ }
+
+ return self;
+}
+
+@end
26 ios/Bestmix/TasksViewController.h
@@ -0,0 +1,26 @@
+#import <UIKit/UIKit.h>
+#import "Reachability.h"
+
+@interface TasksViewController : UITableViewController
+{
+@protected
+ Reachability *_reach;
+ BOOL _reachable;
+
+ NSMutableArray *_tasks;
+ NSUInteger _currentPage;
+ NSUInteger _totalPages;
+ NSUInteger _totalCount;
+}
+
+@property (nonatomic) BOOL reachable;
+
+- (void)becomeReachable;
+- (void)becomeUnreachable;
+
+- (UITableViewCell *)taskCellForIndexPath:(NSIndexPath *)indexPath;
+- (UITableViewCell *)loadingCell;
+
+- (void)fetch;
+
+@end
176 ios/Bestmix/TasksViewController.m
@@ -0,0 +1,176 @@
+#import "TasksViewController.h"
+#import "Reachability.h"
+#import "SVPullToRefresh.h"
+#import "Task.h"
+#import "UIColor+Hex.h"
+
+const NSInteger kLoadingCellTag = 9999;
+
+@interface TasksViewController ()
+{
+ UIView *_statusBarOverlay;
+}
+
+@end
+
+@implementation TasksViewController
+
+@synthesize reachable = _reachable;
+
+#pragma mark NSObject
+
+- (id)initWithStyle:(UITableViewStyle)style
+{
+ self = [super initWithStyle:style];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+#pragma mark UIViewController
+
+- (void)loadView
+{
+ [super loadView];
+
+ _statusBarOverlay = [[UIView alloc] init];
+ _statusBarOverlay.frame = [UIApplication sharedApplication].statusBarFrame;
+ _statusBarOverlay.backgroundColor = [UIColor clearColor];
+ [[self navigationController].view addSubview:_statusBarOverlay];
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.clearsSelectionOnViewWillAppear = NO;
+
+ __block typeof(self) bself = self; // avoid retain cycle
+
+ _reach = [Reachability reachabilityWithHostname:@"www.google.com"];
+ _reach.reachableBlock = ^(Reachability *reach) {
+ dispatch_async(dispatch_get_main_queue(), ^() {
+ bself.reachable = YES;
+ _statusBarOverlay.backgroundColor = [UIColor greenColor];
+ [bself becomeReachable];
+ });
+ };
+ _reach.unreachableBlock = ^(Reachability *reach) {
+ dispatch_async(dispatch_get_main_queue(), ^() {
+ bself.reachable = NO;
+ _statusBarOverlay.backgroundColor = [UIColor redColor];
+ [bself becomeUnreachable];
+ });
+ };
+ [_reach startNotifier];
+
+ _currentPage = 1;
+ _totalPages = 1;
+ _tasks = [NSMutableArray array];
+
+ [self.tableView addPullToRefreshWithActionHandler:^{
+ [bself fetch];
+ }];
+
+ // [self fetch];
+ // [self.tableView.pullToRefreshView triggerRefresh];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+#pragma mark UITableViewDataSource
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ if (_currentPage < _totalPages)
+ return _tasks.count + 1;
+
+ return _tasks.count;
+}
+
+- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell
+forRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ if (cell.tag == kLoadingCellTag) {
+ _currentPage += 1;
+ [self fetch];
+ }
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ if (indexPath.row == _tasks.count)
+ return [self loadingCell];
+
+ return [self taskCellForIndexPath:indexPath];
+}
+
+- (void)becomeReachable
+{
+}
+
+- (void)becomeUnreachable
+{
+}
+
+- (UITableViewCell *)taskCellForIndexPath:(NSIndexPath *)indexPath
+{
+ static NSString *CellIdentifier = @"TaskCell";
+ UITableViewCell *cell;
+ cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
+ if (cell == nil) {
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
+ reuseIdentifier:CellIdentifier];
+ }
+
+ Task *task = [_tasks objectAtIndex:indexPath.row];
+ cell.textLabel.text = task.name;
+ if (task.pub)
+ cell.textLabel.textColor = [UIColor colorWithHex:0x008000];
+ else
+ cell.textLabel.textColor = [UIColor colorWithHex:0xff0000];
+
+ NSString *date;
+ date = [NSDateFormatter localizedStringFromDate:task.updatedAt
+ dateStyle:NSDateFormatterShortStyle
+ timeStyle:NSDateFormatterShortStyle];
+
+ cell.detailTextLabel.text = [NSString stringWithFormat:@"%@", date];
+ cell.detailTextLabel.textColor = [UIColor grayColor];
+
+ return cell;
+}
+
+- (UITableViewCell *)loadingCell
+{
+ UITableViewCell *cell;
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
+ reuseIdentifier:nil];
+
+ UIActivityIndicatorView *indicator;
+ indicator = [[UIActivityIndicatorView alloc]
+ initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
+ indicator.center = cell.center;
+ [cell addSubview:indicator];
+
+ [indicator startAnimating];
+
+ cell.tag = kLoadingCellTag;
+
+ return cell;
+}
+
+- (void)fetch
+{
+}
+
+@end
2  ios/Bestmix/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
134 ios/Bestmix/en.lproj/MainStoryboard_iPad.storyboard
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.1" toolsVersion="2182" systemVersion="11E53" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="4">
+ <dependencies>
+ <deployment defaultVersion="1296" identifier="iOS"/>
+ <development defaultVersion="4200" identifier="xcode"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1181"/>
+ </dependencies>
+ <scenes>
+ <!--Tab Bar Controller-->
+ <scene sceneID="15">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="14" sceneMemberID="firstResponder"/>
+ <tabBarController id="4" sceneMemberID="viewController">
+ <nil key="simulatedBottomBarMetrics"/>
+ <tabBar key="tabBar" contentMode="scaleToFill" id="5">
+ <rect key="frame" x="0.0" y="975" width="768" height="49"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </tabBar>
+ <connections>
+ <segue destination="Amb-6R-0Qi" kind="relationship" relationship="viewControllers" id="AVO-Uo-CHN"/>
+ <segue destination="7gC-D0-3N5" kind="relationship" relationship="viewControllers" id="qBK-x3-CpO"/>
+ </connections>
+ </tabBarController>
+ </objects>
+ <point key="canvasLocation" x="-1277" y="158"/>
+ </scene>
+ <!--Public Tasks View Controller - Public Tasks-->
+ <scene sceneID="i3D-Cb-wqW">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="f7V-bK-r2N" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <tableViewController id="Jp8-M4-W1F" customClass="PublicTasksViewController" sceneMemberID="viewController">
+ <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="p1z-pC-GEs">
+ <rect key="frame" x="0.0" y="64" width="768" height="911"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="QWK-z7-Par">
+ <rect key="frame" x="0.0" y="22" width="768" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+ <rect key="frame" x="0.0" y="0.0" width="768" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </view>
+ </tableViewCell>
+ </prototypes>
+ </tableView>
+ <tabBarItem key="tabBarItem" title="Public Tasks" image="first" id="wKm-3I-FUK"/>
+ <navigationItem key="navigationItem" title="Public Tasks" id="Mll-HO-SZy"/>
+ <simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
+ </tableViewController>
+ </objects>
+ <point key="canvasLocation" x="817" y="-542"/>
+ </scene>
+ <!--Private Tasks View Controller - Private Tasks-->
+ <scene sceneID="4pq-Cz-G3r">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="IDX-Do-nJy" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <tableViewController id="0gn-0C-6DP" customClass="PrivateTasksViewController" sceneMemberID="viewController">
+ <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Mca-l4-i8u">
+ <rect key="frame" x="0.0" y="64" width="768" height="911"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="mCm-DD-dXD">
+ <rect key="frame" x="0.0" y="22" width="768" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+ <rect key="frame" x="0.0" y="0.0" width="768" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </view>
+ </tableViewCell>
+ </prototypes>
+ </tableView>
+ <tabBarItem key="tabBarItem" title="Private Tasks" image="second" id="70L-t3-YCx"/>
+ <navigationItem key="navigationItem" title="Private Tasks" id="KSY-9Z-SCH"/>
+ <simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
+ </tableViewController>
+ </objects>
+ <point key="canvasLocation" x="817" y="799"/>
+ </scene>
+ <!--Navigation Controller - Private Tasks-->
+ <scene sceneID="KKH-J6-p4e">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="3cu-iZ-FcN" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <navigationController definesPresentationContext="YES" id="7gC-D0-3N5" sceneMemberID="viewController">
+ <tabBarItem key="tabBarItem" title="Private Tasks" image="second" id="wTl-YS-Ggd"/>
+ <navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="1sk-89-a6Q">
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <connections>
+ <segue destination="0gn-0C-6DP" kind="relationship" relationship="rootViewController" id="qjX-R8-Fsn"/>
+ </connections>
+ </navigationController>
+ </objects>
+ <point key="canvasLocation" x="-165" y="799"/>
+ </scene>
+ <!--Navigation Controller - Public Tasks-->
+ <scene sceneID="IRy-4o-tqC">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="fIu-nm-iAC" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <navigationController definesPresentationContext="YES" id="Amb-6R-0Qi" sceneMemberID="viewController">
+ <tabBarItem key="tabBarItem" title="Public Tasks" image="first" id="Dy0-lN-TBY"/>
+ <navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="4tG-I4-Kg2">
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <connections>
+ <segue destination="Jp8-M4-W1F" kind="relationship" relationship="rootViewController" id="oc5-1G-aCe"/>
+ </connections>
+ </navigationController>
+ </objects>
+ <point key="canvasLocation" x="-165" y="-542"/>
+ </scene>
+ </scenes>
+ <resources>
+ <image name="first" width="16" height="16"/>
+ <image name="second" width="16" height="16"/>
+ </resources>
+ <classes>
+ <class className="PrivateTasksViewController" superclassName="UITableViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/PrivateTasksViewController.h"/>
+ </class>
+ <class className="PublicTasksViewController" superclassName="UITableViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/PublicTasksViewController.h"/>
+ </class>
+ </classes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination"/>
+ </simulatedMetricsContainer>
+</document>
147 ios/Bestmix/en.lproj/MainStoryboard_iPhone.storyboard
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.1" toolsVersion="2182" systemVersion="11E53" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="4">
+ <dependencies>
+ <deployment defaultVersion="1296" identifier="iOS"/>
+ <development defaultVersion="4200" identifier="xcode"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1181"/>
+ </dependencies>
+ <scenes>
+ <!--Navigation Controller - Public-->
+ <scene sceneID="Xio-Sj-KNJ">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="Gms-T4-VY1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <navigationController title="Public" definesPresentationContext="YES" id="7oV-3R-m4C" sceneMemberID="viewController">
+ <tabBarItem key="tabBarItem" title="Public Tasks" id="S85-0N-reY"/>
+ <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" barStyle="blackOpaque" prompted="NO"/>
+ <navigationBar key="navigationBar" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" barStyle="blackOpaque" id="l6K-V0-AtP">
+ <rect key="frame" x="0.0" y="-44" width="0.0" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <connections>
+ <segue destination="ZVQ-Bf-IqI" kind="relationship" relationship="rootViewController" id="8gf-bP-ef3"/>
+ </connections>
+ </navigationController>
+ </objects>
+ <point key="canvasLocation" x="561" y="-231"/>
+ </scene>
+ <!--Public Tasks View Controller - Public Tasks-->
+ <scene sceneID="zVh-wK-TPo">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="hoa-xn-sp0" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <tableViewController id="ZVQ-Bf-IqI" customClass="PublicTasksViewController" sceneMemberID="viewController">
+ <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="8oO-c3-acG">
+ <rect key="frame" x="0.0" y="64" width="320" height="367"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="wLg-jl-try">
+ <rect key="frame" x="0.0" y="22" width="320" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </view>
+ </tableViewCell>
+ </prototypes>
+ <connections>
+ <outlet property="dataSource" destination="ZVQ-Bf-IqI" id="cmc-Na-Zl0"/>
+ <outlet property="delegate" destination="ZVQ-Bf-IqI" id="jp9-ar-hyZ"/>
+ </connections>
+ </tableView>
+ <tabBarItem key="tabBarItem" title="Public Tasks" image="first" id="h0B-LX-N34"/>
+ <navigationItem key="navigationItem" title="Public Tasks" id="U92-bH-Xp3"/>
+ <simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
+ </tableViewController>
+ </objects>
+ <point key="canvasLocation" x="1038" y="-231"/>
+ </scene>
+ <!--Navigation Controller - My Tasks-->
+ <scene sceneID="tQv-JD-gE0">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="dKg-bU-rGy" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <navigationController definesPresentationContext="YES" id="sRd-5j-Z40" sceneMemberID="viewController">
+ <tabBarItem key="tabBarItem" title="My Tasks" id="b2E-CK-Ja4"/>
+ <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" barStyle="blackOpaque" prompted="NO"/>
+ <navigationBar key="navigationBar" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" barStyle="blackOpaque" id="JIC-yf-hYY">
+ <rect key="frame" x="0.0" y="-44" width="0.0" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <connections>
+ <segue destination="FG6-tS-TCS" kind="relationship" relationship="rootViewController" id="PbI-vL-dRk"/>
+ </connections>
+ </navigationController>
+ </objects>
+ <point key="canvasLocation" x="561" y="558"/>
+ </scene>
+ <!--Private Tasks View Controller - Private Tasks-->
+ <scene sceneID="dtK-ER-66p">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="tOb-Yh-10o" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <tableViewController id="FG6-tS-TCS" customClass="PrivateTasksViewController" sceneMemberID="viewController">
+ <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="2gR-Jh-gB3">
+ <rect key="frame" x="0.0" y="64" width="320" height="367"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="HYF-GB-dn5">
+ <rect key="frame" x="0.0" y="22" width="320" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </view>
+ </tableViewCell>
+ </prototypes>
+ <connections>
+ <outlet property="dataSource" destination="FG6-tS-TCS" id="rfg-7i-CA4"/>
+ <outlet property="delegate" destination="FG6-tS-TCS" id="mVe-V2-tiN"/>
+ </connections>
+ </tableView>
+ <tabBarItem key="tabBarItem" title="Private Tasks" image="second" id="b9h-bA-2mY"/>
+ <navigationItem key="navigationItem" title="Private Tasks" id="kjU-dd-rh2"/>
+ <simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
+ </tableViewController>
+ </objects>
+ <point key="canvasLocation" x="1038" y="558"/>
+ </scene>
+ <!--Tab Bar Controller-->
+ <scene sceneID="15">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="14" sceneMemberID="firstResponder"/>
+ <tabBarController id="4" sceneMemberID="viewController">
+ <simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="blackOpaque"/>
+ <nil key="simulatedBottomBarMetrics"/>
+ <tabBar key="tabBar" contentMode="scaleToFill" id="5">
+ <rect key="frame" x="0.0" y="431" width="320" height="49"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </tabBar>
+ <connections>
+ <segue destination="7oV-3R-m4C" kind="relationship" relationship="viewControllers" id="EUz-jF-ubv"/>
+ <segue destination="sRd-5j-Z40" kind="relationship" relationship="viewControllers" id="W9A-2v-Bbo"/>
+ </connections>
+ </tabBarController>
+ </objects>
+ <point key="canvasLocation" x="132" y="180"/>
+ </scene>
+ </scenes>
+ <resources>
+ <image name="first" width="16" height="16"/>
+ <image name="second" width="16" height="16"/>
+ </resources>
+ <classes>
+ <class className="PrivateTasksViewController" superclassName="UITableViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/PrivateTasksViewController.h"/>
+ </class>
+ <class className="PublicTasksViewController" superclassName="UITableViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/PublicTasksViewController.h"/>
+ </class>
+ </classes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination"/>
+ </simulatedMetricsContainer>
+</document>
BIN  ios/Bestmix/first.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  ios/Bestmix/first@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 ios/Bestmix/main.m
@@ -0,0 +1,10 @@
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
BIN  ios/Bestmix/second.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  ios/Bestmix/second@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 ios/Categories/NSDictionary+ObjectForKeyOrNil.h
@@ -0,0 +1,5 @@
+@interface NSDictionary (ObjectForKeyOrNil)
+
+- (id)objectForKeyOrNil:(id)key;
+
+@end
14 ios/Categories/NSDictionary+ObjectForKeyOrNil.m
@@ -0,0 +1,14 @@
+#import "NSDictionary+ObjectForKeyOrNil.h"
+
+@implementation NSDictionary (ObjectForKeyOrNil)
+
+- (id)objectForKeyOrNil:(id)key
+{
+ id val = [self objectForKey:key];
+ if ([val isEqual:[NSNull null]]) {
+ return nil;
+ }
+ return val;
+}
+
+@end
5 ios/Categories/UIColor+Hex.h
@@ -0,0 +1,5 @@
+@interface UIColor (Hex)
+
++ (UIColor *)colorWithHex:(NSInteger)hex;
+
+@end
13 ios/Categories/UIColor+Hex.m
@@ -0,0 +1,13 @@
+#import "UIColor+Hex.h"
+
+@implementation UIColor (Hex)
+
++ (UIColor *)colorWithHex:(NSInteger)hex {
+ return [UIColor colorWithRed:((NSInteger)((hex & 0xFF0000) >> 16)) / 255.0
+ green:((NSInteger)((hex & 0xFF00) >> 8)) / 255.0
+ blue:((NSInteger)(hex & 0xFF)) / 255.0
+ alpha:1.0];
+}
+
+@end
+
8 ios/DataModel/Bestmix.xcdatamodeld/.xccurrentversion
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>_XCCurrentVersionName</key>
+ <string>Bestmix.xcdatamodel</string>
+</dict>
+</plist>
13 ios/DataModel/Bestmix.xcdatamodeld/Bestmix.xcdatamodel/contents
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1171" systemVersion="11E53" minimumToolsVersion="Xcode 4.1" macOSVersion="Automatic" iOSVersion="Automatic">
+ <entity name="Task" representedClassName="Task" syncable="YES">
+ <attribute name="createdAt" optional="YES" attributeType="Date" indexed="YES" syncable="YES"/>
+ <attribute name="name" attributeType="String" indexed="YES" syncable="YES"/>
+ <attribute name="pub" attributeType="Boolean" defaultValueString="NO" indexed="YES" syncable="YES"/>
+ <attribute name="taskID" optional="YES" attributeType="Integer 32" indexed="YES" syncable="YES"/>
+ <attribute name="updatedAt" optional="YES" attributeType="Date" indexed="YES" syncable="YES"/>
+ </entity>
+ <elements>
+ <element name="Task" positionX="-4133" positionY="-2313" width="128" height="120"/>
+ </elements>
+</model>
16 ios/DataModel/BestmixDataModel.h
@@ -0,0 +1,16 @@
+#import <UIKit/UIKit.h>
+#import <CoreData/CoreData.h>
+
+@interface BestmixDataModel : NSObject
+
+@property (nonatomic, readonly) NSManagedObjectContext *mainContext;
+@property (nonatomic, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
+
++ (BestmixDataModel *)sharedDataModel;
+
+- (NSString *)modelName;
+- (NSString *)pathToModel;
+- (NSString *)storeFilename;
+- (NSString *)pathToLocalStore;
+
+@end
104 ios/DataModel/BestmixDataModel.m
@@ -0,0 +1,104 @@
+#import "BestmixDataModel.h"
+
+@interface BestmixDataModel ()
+
+@property (nonatomic, readonly) NSManagedObjectModel *managedObjectModel;
+
+- (NSString *)documentsDirectory;
+
+@end
+
+@implementation BestmixDataModel
+
+@synthesize managedObjectModel = _managedObjectModel;
+@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;
+@synthesize mainContext = _mainContext;
+
++ (BestmixDataModel *)sharedDataModel
+{
+ static BestmixDataModel *dm;
+ static dispatch_once_t done;
+ dispatch_once(&done, ^{ dm = [BestmixDataModel new]; });
+ return dm;
+}
+
+- (NSString *)modelName
+{
+ return @"Bestmix";
+}
+
+- (NSString *)pathToModel
+{
+ return [[NSBundle mainBundle] pathForResource:[self modelName]
+ ofType:@"momd"];
+}
+
+- (NSString *)storeFilename
+{
+ return [[self modelName] stringByAppendingPathExtension:@"sqlite"];
+}
+
+- (NSString *)pathToLocalStore
+{
+ return [[self documentsDirectory] stringByAppendingPathComponent:[self storeFilename]];
+}
+
+- (NSString *)documentsDirectory
+{
+ NSString *documentsDirectory = nil;
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ documentsDirectory = [paths objectAtIndex:0];
+ return documentsDirectory;
+}
+
+- (NSManagedObjectContext *)mainContext
+{
+ if (_mainContext == nil) {
+ _mainContext = [[NSManagedObjectContext alloc] init];
+ _mainContext.persistentStoreCoordinator = [self persistentStoreCoordinator];
+ }
+
+ return _mainContext;
+}
+
+- (NSManagedObjectModel *)managedObjectModel
+{
+ if (_managedObjectModel == nil) {
+ NSURL *storeURL = [NSURL fileURLWithPath:[self pathToModel]];
+ _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:storeURL];
+ }
+
+ return _managedObjectModel;
+}
+
+- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
+{
+ if (_persistentStoreCoordinator == nil) {
+ NSLog(@"sqlite path: %@", [self pathToLocalStore]);
+ NSURL *storeURL = [NSURL fileURLWithPath:[self pathToLocalStore]];
+ NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc]
+ initWithManagedObjectModel:[self managedObjectModel]];
+ NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
+ [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
+ NSError *e = nil;
+ if (![psc addPersistentStoreWithType:NSSQLiteStoreType
+ configuration:nil
+ URL:storeURL
+ options:options
+ error:&e]) {
+ NSDictionary *userInfo = [NSDictionary dictionaryWithObject:e forKey:NSUnderlyingErrorKey];
+ NSString *reason = @"Could not create persistent store.";
+ NSException *exc = [NSException exceptionWithName:NSInternalInconsistencyException
+ reason:reason
+ userInfo:userInfo];
+ @throw exc;
+ }
+
+ _persistentStoreCoordinator = psc;
+ }
+
+ return _persistentStoreCoordinator;
+}
+
+@end
7 ios/DataModel/Task.h
@@ -0,0 +1,7 @@
+#import "_Task.h"
+
+@interface Task : _Task {}
+
++ (id)taskWithDictionary:(NSDictionary *)dictionary;
+
+@end
29 ios/DataModel/Task.m
@@ -0,0 +1,29 @@
+#import "Task.h"
+#import "ISO8601DateFormatter.h"
+#import "BestmixDataModel.h"
+
+@implementation Task
+
++ (id)taskWithDictionary:(NSDictionary *)dictionary
+{
+ NSManagedObjectContext *context = [[BestmixDataModel sharedDataModel] mainContext];
+ Task *task = [Task insertInManagedObjectContext:context];
+ if (task) {
+ ISO8601DateFormatter *formatter = [[ISO8601DateFormatter alloc] init];
+
+ task.taskID = [dictionary objectForKey:@"id"];
+ task.name = [dictionary objectForKey:@"name"];
+ task.pub = [dictionary objectForKey:@"public"];
+ task.createdAt = [formatter dateFromString:[dictionary objectForKey:@"created_at"]];
+ task.updatedAt = [formatter dateFromString:[dictionary objectForKey:@"updated_at"]];
+ }
+
+ return task;
+}
+
+// - (NSString *)description
+// { return [NSString stringWithFormat:@"{ objectID: %d name: %@ pub: %@ createdAt: %@ updatedAt: %@ }",
+// self.objectID, self.name, self.pub ? @"YES" : @"NO", self.createdAt, self.updatedAt];
+// }
+
+@end
135 ios/DataModel/_Task.h
@@ -0,0 +1,135 @@
+// DO NOT EDIT. This file is machine-generated and constantly overwritten.
+// Make changes to Task.h instead.
+
+#import <CoreData/CoreData.h>
+
+
+extern const struct TaskAttributes {
+ __unsafe_unretained NSString *createdAt;
+ __unsafe_unretained NSString *name;
+ __unsafe_unretained NSString *pub;
+ __unsafe_unretained NSString *taskID;
+ __unsafe_unretained NSString *updatedAt;
+} TaskAttributes;
+
+extern const struct TaskRelationships {
+} TaskRelationships;
+
+extern const struct TaskFetchedProperties {
+} TaskFetchedProperties;
+
+
+
+
+
+
+
+
+@interface TaskID : NSManagedObjectID {}
+@end
+
+@interface _Task : NSManagedObject {}
++ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
++ (NSString*)entityName;
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
+- (TaskID*)objectID;
+
+
+
+
+@property (nonatomic, strong) NSDate* createdAt;
+
+
+//- (BOOL)validateCreatedAt:(id*)value_ error:(NSError**)error_;
+
+
+
+
+@property (nonatomic, strong) NSString* name;
+
+
+//- (BOOL)validateName:(id*)value_ error:(NSError**)error_;
+
+
+
+
+@property (nonatomic, strong) NSNumber* pub;
+
+
+@property BOOL pubValue;
+- (BOOL)pubValue;
+- (void)setPubValue:(BOOL)value_;
+
+//- (BOOL)validatePub:(id*)value_ error:(NSError**)error_;
+
+
+
+
+@property (nonatomic, strong) NSNumber* taskID;
+
+
+@property int32_t taskIDValue;
+- (int32_t)taskIDValue;
+- (void)setTaskIDValue:(int32_t)value_;
+
+//- (BOOL)validateTaskID:(id*)value_ error:(NSError**)error_;
+
+
+
+
+@property (nonatomic, strong) NSDate* updatedAt;
+
+
+//- (BOOL)validateUpdatedAt:(id*)value_ error:(NSError**)error_;
+
+
+
+
+
+
+@end
+
+@interface _Task (CoreDataGeneratedAccessors)
+
+@end
+
+@interface _Task (CoreDataGeneratedPrimitiveAccessors)
+
+
+- (NSDate*)primitiveCreatedAt;
+- (void)setPrimitiveCreatedAt:(NSDate*)value;
+
+
+
+
+- (NSString*)primitiveName;
+- (void)setPrimitiveName:(NSString*)value;
+
+
+
+
+- (NSNumber*)primitivePub;
+- (void)setPrimitivePub:(NSNumber*)value;
+
+- (BOOL)primitivePubValue;
+- (void)setPrimitivePubValue:(BOOL)value_;
+
+
+
+
+- (NSNumber*)primitiveTaskID;
+- (void)setPrimitiveTaskID:(NSNumber*)value;
+
+- (int32_t)primitiveTaskIDValue;
+- (void)setPrimitiveTaskIDValue:(int32_t)value_;
+
+
+
+
+- (NSDate*)primitiveUpdatedAt;
+- (void)setPrimitiveUpdatedAt:(NSDate*)value;
+
+
+
+
+@end
139 ios/DataModel/_Task.m
@@ -0,0 +1,139 @@
+// DO NOT EDIT. This file is machine-generated and constantly overwritten.
+// Make changes to Task.m instead.
+
+#import "_Task.h"
+
+const struct TaskAttributes TaskAttributes = {
+ .createdAt = @"createdAt",
+ .name = @"name",
+ .pub = @"pub",
+ .taskID = @"taskID",
+ .updatedAt = @"updatedAt",
+};
+
+const struct TaskRelationships TaskRelationships = {
+};
+
+const struct TaskFetchedProperties TaskFetchedProperties = {
+};
+
+@implementation TaskID
+@end
+
+@implementation _Task
+
++ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+ NSParameterAssert(moc_);
+ return [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:moc_];
+}
+
++ (NSString*)entityName {
+ return @"Task";
+}
+
++ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
+ NSParameterAssert(moc_);
+ return [NSEntityDescription entityForName:@"Task" inManagedObjectContext:moc_];
+}
+
+- (TaskID*)objectID {
+ return (TaskID*)[super objectID];
+}
+
++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
+ NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
+
+ if ([key isEqualToString:@"pubValue"]) {
+ NSSet *affectingKey = [NSSet setWithObject:@"pub"];
+ keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
+ }
+ if ([key isEqualToString:@"taskIDValue"]) {
+ NSSet *affectingKey = [NSSet setWithObject:@"taskID"];
+ keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
+ }
+
+ return keyPaths;
+}
+
+
+
+
+@dynamic createdAt;
+
+
+
+
+
+
+@dynamic name;
+
+
+
+
+
+
+@dynamic pub;
+
+
+
+- (BOOL)pubValue {
+ NSNumber *result = [self pub];
+ return [result boolValue];
+}
+
+- (void)setPubValue:(BOOL)value_ {
+ [self setPub:[NSNumber numberWithBool:value_]];
+}
+
+- (BOOL)primitivePubValue {
+ NSNumber *result = [self primitivePub];
+ return [result boolValue];
+}
+
+- (void)setPrimitivePubValue:(BOOL)value_ {
+ [self setPrimitivePub:[NSNumber numberWithBool:value_]];
+}
+
+
+
+
+
+@dynamic taskID;
+
+
+
+- (int32_t)taskIDValue {
+ NSNumber *result = [self taskID];
+ return [result intValue];
+}
+
+- (void)setTaskIDValue:(int32_t)value_ {
+ [self setTaskID:[NSNumber numberWithInt:value_]];
+}
+
+- (int32_t)primitiveTaskIDValue {
+ NSNumber *result = [self primitiveTaskID];
+ return [result intValue];
+}
+
+- (void)setPrimitiveTaskIDValue:(int32_t)value_ {
+ [self setPrimitiveTaskID:[NSNumber numberWithInt:value_]];
+}
+
+
+
+
+
+@dynamic updatedAt;
+
+
+
+
+
+
+
+
+
+
+
+@end
12 ios/Podfile
@@ -0,0 +1,12 @@
+platform :ios
+
+dependency 'AFNetworking', '~> 1.0RC1'
+dependency 'SDURLCache', '~> 1.2'
+dependency 'JSONKit', '~> 1.4'
+dependency 'AFOAuth2Client', '~> 0.0.1'
+dependency 'MBProgressHUD', '~> 0.5'
+dependency 'TestFlightSDK', '~> 1.0'
+dependency 'MessagePack', '~> 1.0.0'
+dependency 'ISO8601DateFormatter', '~> 0.6'
+dependency 'SVPullToRefresh', '~> 0.1'
+dependency 'Reachability', '~> 3.0.0'
23 ios/Podfile.lock
@@ -0,0 +1,23 @@
+PODS:
+ - AFNetworking (1.0RC1)
+ - AFOAuth2Client (0.0.1)
+ - ISO8601DateFormatter (0.6)
+ - JSONKit (1.5pre)
+ - MBProgressHUD (0.5)
+ - MessagePack (1.0.0)
+ - Reachability (3.0.0)
+ - SDURLCache (1.2)
+ - SVPullToRefresh (0.1)
+ - TestFlightSDK (1.0)
+
+DEPENDENCIES:
+ - AFNetworking (~> 1.0RC1)
+ - AFOAuth2Client (~> 0.0.1)
+ - ISO8601DateFormatter (~> 0.6)
+ - JSONKit (~> 1.4)
+ - MBProgressHUD (~> 0.5)
+ - MessagePack (~> 1.0.0)
+ - Reachability (~> 3.0.0)
+ - SDURLCache (~> 1.2)
+ - SVPullToRefresh (~> 0.1)
+ - TestFlightSDK (~> 1.0)
21 server/.gitignore
@@ -0,0 +1,21 @@
+*.rbc
+*.sassc
+.sass-cache
+capybara-*.html
+.rspec
+/.bundle
+/vendor/bundle
+/log/*
+/tmp/*
+/db/*.sqlite3
+/db/schema.rb
+/public/system/*
+/coverage/
+/spec/tmp/*
+**.orig
+rerun.txt
+pickle-email-*.html
+/config/database.yml
+/config/initializers/devise.rb
+/config/deploy.rb
+Capfile
1  server/.rvmrc
@@ -0,0 +1 @@
+rvm 1.9.3
57 server/Gemfile
@@ -0,0 +1,57 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.3'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'mysql2'
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer', :platform => :ruby
+
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# To use Jbuilder templates for JSON
+# gem 'jbuilder'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
+
+gem 'doorkeeper', '~> 0.4.0'
+gem 'versionist', '~> 0.2.0'
+gem 'rabl', '~> 0.6.12'
+gem 'msgpack', '~> 0.4.7'
+gem "meta_search"
+gem 'haml'
+gem 'kaminari'
+gem 'activeadmin'
+gem 'formtastic', '~> 2.1.1' # Active Admin requires 2.1.1
+gem 'thor'
+gem 'oauth2'
+gem 'capistrano'
+gem 'capistrano_colors'
+
+group :development, :test do
+ gem 'fabrication'
+ gem 'faker'
+end
206 server/Gemfile.lock
@@ -0,0 +1,206 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.3)
+ actionpack (= 3.2.3)
+ mail (~> 2.4.4)
+ actionpack (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activeadmin (0.4.3)
+ bourbon (>= 1.0.0)
+ devise (>= 1.1.2)
+ fastercsv
+ formtastic (>= 2.0.0)
+ inherited_resources (> 0)
+ jquery-rails (>= 1.0.0)
+ kaminari (>= 0.13.0)
+ meta_search (>= 0.9.2)
+ rails (>= 3.0.0)
+ sass (>= 3.1.0)
+ activemodel (3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ activerecord (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ bcrypt-ruby (3.0.1)
+ bourbon (1.4.0)
+ sass (>= 3.1)
+ builder (3.0.0)
+ capistrano (2.12.0)
+ highline
+ net-scp (>= 1.0.0)
+ net-sftp (>= 2.0.0)
+ net-ssh (>= 2.0.14)
+ net-ssh-gateway (>= 1.1.0)
+ capistrano_colors (0.5.5)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.3.3)
+ devise (2.0.4)
+ bcrypt-ruby (~> 3.0)
+ orm_adapter (~> 0.0.3)
+ railties (~> 3.1)
+ warden (~> 1.1.1)
+ doorkeeper (0.4.0)
+ railties (~> 3.1)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ fabrication (1.4.1)
+ faker (1.0.1)
+ i18n (~> 0.4)
+ faraday (0.8.0)
+ multipart-post (~> 1.1)
+ fastercsv (1.5.4)
+ formtastic (2.1.1)
+ actionpack (~> 3.0)
+ haml (3.1.4)
+ has_scope (0.5.1)
+ highline (1.6.12)
+ hike (1.2.1)
+ httpauth (0.1)
+ i18n (0.6.0)
+ inherited_resources (1.3.1)
+ has_scope (~> 0.5.0)
+ responders (~> 0.6)
+ journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
+ json (1.7.3)
+ kaminari (0.13.0)
+ actionpack (>= 3.0.0)
+ activesupport (>= 3.0.0)
+ railties (>= 3.0.0)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ meta_search (1.1.3)
+ actionpack (~> 3.1)
+ activerecord (~> 3.1)
+ activesupport (~> 3.1)
+ polyamorous (~> 0.5.0)
+ mime-types (1.18)
+ msgpack (0.4.7)
+ multi_json (1.3.5)
+ multipart-post (1.1.5)
+ mysql2 (0.3.11)
+ net-scp (1.0.4)