Coder Social home page Coder Social logo

defmethodinc / dm-ios-swift-ui-combine-template Goto Github PK

View Code? Open in Web Editor NEW
7.0 9.0 1.0 330 KB

An iOS starter project template built around SwiftUI and Combine. Holds basic list view action and images and retrieval of resources from network.

Swift 100.00%

dm-ios-swift-ui-combine-template's Introduction

iOS SwiftUI Combine Template

A template repo for getting setup quickly with an iOS project using the SwiftUI and Combine frameworks.

This template repo was built off of the original DM-iOS-Template

This project is managed through a Github project board. The board for this project is: here.

This project has been built along side a backend repo. It is a Rails6Api. Both are built around the concept of "Creations", a generic or duck-type model in the vein of "todos" or "widgets". It is to hold and show things that people "create".

We have added some basic structure to this application we deem useful such as:

  • NavigationViews, NavigationLinks, and Lists in SwiftUI
  • use of publisher/observer pattern in SwiftUI
  • MVVM as an ObserverableObject
  • Testing of MVVM publishing
  • Wrapping networking layer publisher with json decoding of generics

Configuration - How to add environment variables?

  1. Add the vairable in the .xcconfig files, found in the Configs/ folder.
API_URL = http:/$()/localhost:3000
  1. Add the variable in Info.plist.
<key>API_URL</key>
<string>$(API_URL)</string>
  1. Add the variable in Config.swift.
  • Add it to the Keys.Plist enum
enum Keys {
    enum Plist {
      static let apiURL = "API_URL"
    }
  }
  • Add the getter
static let apiUrl: URL = {
    guard let apiUrlstring = Config.infoDictionary[Keys.Plist.apiURL] as? String else {
      fatalError("\(Keys.Plist.apiURL) not set in plist for this environment")
    }
    guard let url = URL(string: apiUrlstring) else {
      fatalError("\(Keys.Plist.apiURL) is invalid")
    }
    return url
}()

Configuration - Secure your environment variables

Use the examples to set up your environments, but don't add them to your version control system. Since they might contain secrets, you want to keep them in a secure location (like 1Password). They can then be shared securely amongst developers.

See article: https://thoughtbot.com/blog/let-s-setup-your-ios-environments

Architecture

  • Application currently makes use of SwiftUI NavigationView and NavigationLink for navigation (A coordinator pattern may be added back in)
  • Configuration is set up for Development, Staging and Production.
  • MVVM is implemented as an example.

Renaming the project

https://stackoverflow.com/questions/33370175/how-do-i-completely-rename-an-xcode-project-i-e-inclusive-of-folders

Resources/Links

License (MIT)

Copyright © 2020 Def Method

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.

dm-ios-swift-ui-combine-template's People

Contributors

boovius avatar yisselda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

azuredark

dm-ios-swift-ui-combine-template's Issues

👮‍♀️**Add Password Auth SignIn Flow** 👮

Scenario: Happy Path

Given I am a User,
And my name is "Bob Mercedes",
And I have previously created an account,
When I advance past the launch screen,
Then I see a SignIn screen with an TextField for email and TextField for password (this begins the SignInFlow for the app)
When I fill in an email of an already existing account,
And I fill in the correct associated password,
Then I am logged in to the app, brought to the CreationsList screen,
And I am presented with an alert that says "Welcome back Bob Mercedes" (this seems like the simplest way to provide demonstrable feedback to the user that they have actually logged in with the correct account)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.