Giter Site home page Giter Site logo

leewarnock / openstreetamenities Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samkhawase/loolocator

0.0 2.0 0.0 188 KB

A simple iOS app that fetches the crowd-sourced data from OpenStreetMaps, and shows toilets within walking distance.

License: MIT License

Swift 100.00%

openstreetamenities's Introduction

OpenStreetAmenities

Find Amenities (like toilets) near you! The simple iOS fetches the crowd-sourced data from OpenStreetMaps, and shows toilets within walking distance. User can then use AppleMaps to find walking directions to the amenity.

Design Rationale

The following series of bite-sized posts explain the design rationale behind creating the app:

  1. Part 1: Introduction - Writing a modular, and testable iOS App in Swift using MVVM pattern
  2. Part 2: Defining the Data Model
  3. Part 3: The Location provider
  4. Part 4: Defining the networking layer
  5. Part 5: The ViewModel
  6. Part 6: The Final App - Putting it all together

Getting Started

Here are the steps to get started with the project on your local machine:

  1. Clone the git repositiory
  2. Run carthage update --platform iOS --cache-builds --no-use-binaries to fetch the dependencies.
  3. If running on the simulator, you can edit the scheme and set the simulated location in Xcode. (E.g. Hongkong)
  4. Run the project via Xcode.

Prerequisites

What things you need to install the software and how to install them

  1. Mac OS X
  2. Xcode 9
  3. Carthage
  4. Optional: xcpretty

Running the tests

The app uses BDD style tests using Quick and Nimble. There are unit tests written to test the LocationManager, APIClient (with Network mocks), and ViewModel behaviors. To run the test, enter the command on the command line.

xcodebuild -scheme 'OpenStreetAmenities' \
			-sdk iphonesimulator \
			-configuration Debug \
			-destination 'platform=iOS Simulator,name=iPhone 6s,OS=latest' \
			test | xcpretty

The output will be similar to

Test Suite OpenStreetAmenitiesTests.xctest started
ApiClientTests
    ✓ Amenity_Request_tests__should_fetch_amenities (0.027 seconds)
LocationProviderTests
    ✓ Given_a_LocationProvider__When_it_s_started_with_LocationManager__then_starts_location_updates (1.547 seconds)
    ✓ Given_a_LocationProvider__When_it_s_started_with_LocationManager__then_provides_current_location (0.001 seconds)
MapViewModelTests
    ✓ Given_a_MapViewModel__get_current_location (0.002 seconds)
    ✓ Given_a_MapViewModel__should_get_all_amenities_in_range (0.004 seconds)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

openstreetamenities's People

Contributors

samkhawase avatar

Watchers

James Cloos avatar Lee Warnock avatar

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.