{"id":15038967,"url":"https://github.com/1caxz/weathersama","last_synced_at":"2025-04-10T00:05:57.308Z","repository":{"id":56927354,"uuid":"105778114","full_name":"1Caxz/Weathersama","owner":"1Caxz","description":"Clone of apple weather app with data from openweathermap.org.","archived":false,"fork":false,"pushed_at":"2018-01-11T09:24:55.000Z","size":29306,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T00:05:57.130Z","etag":null,"topics":["access-weather","apple","clone","geocode","google","openweathermap","swift4","weather-app"],"latest_commit_sha":null,"homepage":"https://github.com/icaksama/Weathersama","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1Caxz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-04T14:26:17.000Z","updated_at":"2024-02-17T08:17:02.000Z","dependencies_parsed_at":"2022-08-21T05:50:46.760Z","dependency_job_id":null,"html_url":"https://github.com/1Caxz/Weathersama","commit_stats":null,"previous_names":["icaksama/weathersama"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Caxz%2FWeathersama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Caxz%2FWeathersama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Caxz%2FWeathersama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Caxz%2FWeathersama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1Caxz","download_url":"https://codeload.github.com/1Caxz/Weathersama/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131319,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["access-weather","apple","clone","geocode","google","openweathermap","swift4","weather-app"],"created_at":"2024-09-24T20:41:00.904Z","updated_at":"2025-04-10T00:05:57.287Z","avatar_url":"https://github.com/1Caxz.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weathersama\n[![Creator](https://img.shields.io/badge/creator-icaksama-green.svg)](https://www.linkedin.com/in/icaksama/)\n[![Travis](https://img.shields.io/travis/icaksama/Weathersama.svg)](https://travis-ci.org/icaksama/Weathersama)\n[![GitHub license](https://img.shields.io/github/license/icaksama/Weathersama.svg)](https://raw.githubusercontent.com/icaksama/Weathersama/master/LICENSE)\n[![Code Size](https://img.shields.io/github/languages/code-size/icaksama/Weathersama.svg)](https://cocoapods.org/pods/Weathersama)\n[![Pod Version](https://img.shields.io/cocoapods/v/Weathersama.svg)](https://cocoapods.org/pods/Weathersama)\n[![Platform](https://img.shields.io/cocoapods/p/Weathersama.svg)](https://cocoapods.org/pods/Weathersama)\n[![Download Total](https://img.shields.io/cocoapods/dt/Weathersama.svg)](https://cocoapods.org/pods/Weathersama)\n\u003cbr\u003e\nWeathersama is library for access weather data on openweathermap.org.\nYou can find clone apple weather app in WeatersamaDemo project.\n\nThis is simple library with class model inside. You can make code short and faster. This library integrated with google geocode. So, its simple to find location and send that to get weather data.\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"350\" src=\"https://github.com/icaksama/Weathersama/blob/master/WeathersamaDemo.gif?raw=true\"\u003e\n\u003c/p\u003e\n\n# Add to Podfile\nAdd Weathersama library to your Podfile and install\n```Swift\npod 'Weathersama', '~\u003e 1.1.3'\n```\n\n# Install Demo Project\nThe demo project is a clone of apple weather app. The demo project have weather backgrounds moves like apple weather app. But, that is videos, not animations. Let's contribute to change them with animations.\n```Swift\n1. Download the project\n2. Open WeathersamaDemo.xcworkspace\n2. No need to change appId or googleKey\n3. Library already uploaded on CocoaPods repository with version 1.1.2\n3. Just change Bundle indentifier \u0026 Run\n```\n\n# Import Library\nYou need to import library before use the library in your class.\n```Swift\nimport Weathersama\n```\n\n# Weathersama with Delegete\nAdd \u003cb\u003eWeathersamaDelegete\u003c/b\u003e to your class. You can get data response from openweathermap.org with delegete. Actually, this is the optional technique to handle some conditional on your programs but for other technique, you can use \u003cb\u003eWeathersama with Completion Method\u003c/b\u003e for more simple programs.\n```Swift\nclass ViewController: UIViewController, WeathersamaDelegete {\n    fileprivate var weatherSama: Weathersama!\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        weatherSama = Weathersama(appId: \"YOUR_APP_ID\", temperature: TEMPERATURE_TYPES.Celcius, language: LANGUAGES.French, dataResponse: DATA_RESPONSE.JSON)\n        weatherSama.delegete = self\n\n        // You can set nil if use Weathersama library with delegete\n        weatherSama.weatherByCityId(cityId: 12345, requestType: .dailyForecast, completion: nil)\n    }\n}\n```\n\n\u003cb\u003e And add the method delegete for response\u003c/b\u003e\n```Swift\npublic func didStartRequestResponder() {\n    print(\"Request start!\")\n}\n\npublic func didEndRequestResponder(result: Bool, description: String, requestType: REQUEST_TYPE) {\n    if result {\n        if requestType == .dailyForecast {\n            print(\"response json : \\(description)\")\n        } else if requestType == .Forecast {\n            print(\"response json : \\(description)\")\n        } else if requestType == .Weather {\n            print(\"response json : \\(description)\")\n        }\n    } else {\n        print(\"response error: \\(description)\")\n    }\n}\n```\n\n# Weathersama with Completion Method\nYou can get the data response from openweathermap.org with class model and without delegete. This is very easy to use data with class model.\n```Swift\nclass ViewController: UIViewController {\n    fileprivate var weatherSama: Weathersama!\n    fileprivate var dailyForecastModel: DailyForecastModel!\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        weatherSama = Weathersama(appId: \"YOUR_APP_ID\", temperature: TEMPERATURE_TYPES.Celcius, language: LANGUAGES.French, dataResponse: DATA_RESPONSE.JSON)\n\n        weatherSama.weatherByCityId(cityId: 12345, requestType: .dailyForecast) { (isSuccess, description, classModel) -\u003e () in\n            if isSuccess {\n                // you can user response json or class model\n                print(\"response json : \\(description)\")\n                self.dailyForecastModel = classModel as! DailyForecastModel\n            } else {\n                print(\"response error : \\(description)\")\n            }\n        }\n    }\n}\n```\n\n# Weathersama for Google\nWeathersama library integrated with google geocode. So, you can be looking for the location more accurate.\n```Swift\nfileprivate var weathersamaForGoogle: WeathersamaForGoogle!\nfileprivate var data = [String]()\nfileprivate var placeId = [String]()\noverride func viewDidLoad() {\n    super.viewDidLoad()\n\n    weathersamaForGoogle = WeathersamaForGoogle(apiKey: \"YOUR_GOOGLE_KEY\")\n    weathersamaForGoogle.lookingForLocationBy(input: searchBar.text!) { (isSuccess, classModel) in\n        if isSuccess {\n            for prediction in classModel.predictions {\n                self.data.append(prediction.description)\n                self.placeId.append(prediction.placeId)\n            }\n        } else {\n            print(\"Cannot get data fromm google\")\n        }\n    }\n}\n```\n\n\n# List of Request Types\n```Swift\npublic enum REQUEST_TYPE: String {\n    case Weather = \"weather\"\n    case Forecast = \"forecast\"\n    case dailyForecast = \"forecast/daily\"\n}\n```\n\n# List of Class Model\nEvery request type have different class model. So, you need to casting the classModel from response such as request type.\u003cbr\u003e\n\u003cb\u003eClass model for request type Weather\u003c/b\u003e\n```Swift\nlet weatherModel: WeatherModel = WeatherModel()\n```\n\n\u003cb\u003eClass model for request type Forecast\u003c/b\u003e\n```Swift\nlet forecastModel: ForecastModel = ForecastModel()\n```\n\n\u003cb\u003eClass model for request type Daily Forecast\u003c/b\u003e\n```Swift\nlet dailyForecastModel: DailyForecastModel = DailyForecastModel()\n```\n\n# List of Temperature Types\n```Swift\npublic enum TEMPERATURE_TYPES: String {\n    case Kelvin = \"\"\n    case Celcius = \"\u0026units=metric\"\n    case Fahrenheit = \"\u0026units=imperial\"\n}\n```\n# List of Languages Supported\n```Swift\npublic enum LANGUAGES: String {\n    case Ukrainian = \"\u0026lang=uk\"\n    case Italian = \"\u0026lang=it\"\n    case German = \"\u0026lang=de\"\n    case Portuguese = \"\u0026lang=pt\"\n    case English = \"\u0026lang=en\"\n    case Romanian = \"\u0026lang=ro\"\n    case Russian = \"\u0026lang=ru\"\n    case ChineseSimplified = \"\u0026lang=zh_cn\"\n    case Spanish = \"\u0026lang=es\"\n    case French = \"\u0026lang=fr\"\n    case Bulgarian = \"\u0026lang=bg\"\n    case Polish = \"\u0026lang=pl\"\n    case Turkish = \"\u0026lang=tr\"\n    case Catalan = \"\u0026lang=ca\"\n    case Croatian = \"\u0026lang=hr\"\n    case Finnish = \"\u0026lang=fi\"\n    case Dutch = \"\u0026lang=nl\"\n    case Swedish = \"\u0026lang=sv\"\n    case ChineseTraditional = \"zh_tw\"\n}\n```\n\n# List of Response Types\n```Swift\npublic enum DATA_RESPONSE: String {\n    case JSON = \"\"\n    case XML = \"\u0026mode=xml\"\n}\n```\n\n# MIT License\n\nCopyright (c) 2017 Saiful Irham Wicaksana\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1caxz%2Fweathersama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1caxz%2Fweathersama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1caxz%2Fweathersama/lists"}