restarone / violet_rails_ios_client

0 stars 3 forks source link

dynamically set tab navbar (based on API Namespace data from server) #1

Open donrestarone opened 2 years ago

donrestarone commented 2 years ago

when the app loads it should make a call to Violet Rails API Namespace (based on the app root) to the VioletRailsAppContext namespace which returns an object that describes how to set the navigation in the app (currently it is hard-coded).

donrestarone commented 1 year ago
Screen Shot 2023-02-15 at 5 32 03 PM
{"data":{"id":"23","type":"api_namespace","attributes":{"id":23,"created_at":"2023-02-15T22:31:07.801Z","updated_at":"2023-02-15T22:31:07.801Z","properties":{"tab_navigation":[{"path":"/blog","label":"blog"},{"path":"/forum","label":"forum"}]},"version":1,"slug":"mobile_client_configuration","name":"mobile_client_configuration","namespace_type":"create-read-update-delete","requires_authentication":false,"non_primitive_properties":[]}}}
donrestarone commented 1 year ago

Research

  1. app lifecycle: https://levelup.gitconnected.com/what-are-ios-app-lifecycle-methods-cc1c8c4dcb7f
  2. making HTTP requests: https://stackoverflow.com/questions/24016142/how-to-make-http-request-in-swift
  3. parsing JSON in swift: https://johncodeos.com/how-to-parse-json-in-ios-using-swift/
  4. parsing JSON in swift with codable: https://www.hackingwithswift.com/read/7/3/parsing-json-using-the-codable-protocol
  5. swift codable protocol: https://itnext.io/swift-codable-json-parser-8661bb57bea7
  6. JSON pretty formatter: https://jsonformatter.org/json-pretty-print
  7. type generation for encoding/decoding: https://app.quicktype.io
  8. how to pass variable from appDelegate to controllers: https://stackoverflow.com/questions/43769751/how-to-pass-data-from-appdelegate-to-a-viewcontroller
  9. VIDEO, displaying data from an API in a UIKit app: https://www.youtube.com/watch?v=XPq3YKAANBY