Coder Social home page Coder Social logo

scsunchen / typhoon-swift-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appsquickly/typhoon-swift-example

0.0 2.0 0.0 9.16 MB

Swift example application for Typhoon

License: Apache License 2.0

Swift 98.88% Objective-C 0.56% Ruby 0.56%

typhoon-swift-example's Introduction

Pocket Forecast (Swift)

An example application built with Typhoon.

  • Looking for an Objective-C sample application? We have one here.

###Features:

  • Returns weather reports from a remote cloud service
  • Caches weather reports locally, for later off-line use.
  • Stores (creates, reads, updates deletes) the cities that the user is interested in receiving reports for.
  • Can use metric or imperial units.
  • Displays a different theme (background image, colors, etc) on each run.

NB: The free weather API that we were using no longer includes forecast information, so this won't be displayed in the app until we find an alternative. The concepts remain the same.

###Running the sample:

  • Clone this repository, open the Xcode project in your favorite IDE, and run it. It'll say you need an API key.
  • Get an API key from http://developer.worldweatheronline.com.
  • Using your API key, set the application configuration.
  • Run the App in the simulator or on your device. Look up the weather in your town, and put a jacket on, if you need to (Ha!). Now, proceed to the exercises below.

Exercises

  1. Study the core components, view controllers and themes. Notice how the framework allows you to group related components together. Notice how dependency injection allows for centralized configuration, at the same time as using aggressive memory management. (With default prototype-scope, components will go away whenever they're not being used).
  2. Study the test cases. Imagine that you needed to use one service URL for integration tests and another for production. How would you do it?
  3. Imagine that you decided to save the list of cities that the user wants to get reports for to iCloud, instead of locally on the device. Notice how you'd only need to change one line of code to supply your new implementation in place of the old one. And you'd be able to reuse the existing test cases.
  4. Imagine that you'd like to integrate with other weather data providers, and let the user choose at runtime. How would you do it?
  5. Try writing the same Application without dependency injection. What would the code look like?

The App

Weather Report Weather Report Weather Report

I'm blown away!

Typhoon is a non-profit, community driven project. We only ask that if you've found it useful to star us on Github or send a tweet mentioning us (@appsquickly). If you've written Typhoon related blog or tutorial, or published a new Typhoon powered app, we'd certainly be happy to hear about that too.

Typhoon is sponsored and lead by AppsQuick.ly with contributions from around the world.

***Thanks @hongcheng for the excellent Paperfold animation, and @michaeljbishop for the parallax effect. ***

typhoon-swift-example's People

Contributors

jasperblues avatar

Watchers

James Cloos avatar scc 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.