Coder Social home page Coder Social logo

libcsweather's Introduction

libCSWeather

A simple little library for fetching the current weather information.

keys

  • kCurrentConditionImageName (name of the current condition image)
  • kCurrentConditionImage (a UIImage representation of the current condition image)
  • kCurrentConditionImage_nc-variant (the NC varient is a larger representation of the current condition image)
  • kCurrentConditionImage_white-variant (the white varient is a smaller representation of the current condition image)
  • kCurrentConditionImage_black-variant (the black varient is a black outline representation of the current condition image)
  • kCurrentDescription (the today summary)
  • kCurrentTemperatureFahrenheit (current temp)
  • kCurrentTemperatureCelsius (current temp)
  • kCurrentHighFahrenheit (current high temp)
  • kCurrentHighCelsius (current high temp)
  • kCurrentLowFahrenheit (current low temp)
  • kCurrentLowCelsius (current low temp)
  • kCurrentFeelsLikefahrenheit (current feels like temp)
  • kCurrentFeelsLikeCelsius (current feels like temp)
  • kCurrentCityName (name of the current city, or default city if location services are disabled)
  • kCurrentConditionString (current condition i.e. rainy | sunny | cloudy)
  • kCurrentTemperatureForLocale (current temp in either Fahrenheit or Celsius based on the device locale)
  • kCurrentLowForLocale (low temp in either Fahrenheit or Celsius based on the device locale)
  • kCurrentHighForLocale (high temp in either Fahrenheit or Celsius based on the device locale)
  • kCSWLastUpdate (the time in which weather information was last updated)
  • kCSWCityDidChange (notification of city change)

usage

#include <CSWeatherInformationProvider.h>

[[CSWeatherInformationProvider sharedProvider] updatedWeatherWithCompletion:^(NSDictionary *weather) {
    NSString *condition = weather[@"kCurrentConditionImage"];
    NSString *temp = weather[@"kCurrentTemperatureForLocale"];
    UIImage *icon = weather[@"kCurrentConditionImage"];

    // blah blah blah
}];

weather information will only update if the time since last update has been more than 15 minutes, or the city has changed. using this method more than once in a 15 minute interval will return cached results from the last update.

libcsweather's People

Contributors

creaturesurvive avatar

Watchers

 avatar  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.