Why Swift would be a better choice for the next production app.
- correctness at compile time (besides behavior)
- types as proofs (... illegal is impossible)
- vs. testing
- Examples
git archive --format zip --output /full/path/to/zipfile.zip master |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
Author: Chris Lattner
func testInteractorLocationValueChangedUpdatesCityParamsWithValueFromTexField() { | |
// Arrange | |
mockVC.stubbedViewModel.locationType = .city | |
textField.text = "NEW CITY" | |
// Act | |
interactor.locationValueChanged(sender: textField, viewController: mockVC) | |
//Assert | |
XCTAssert(mockVC.invokedOpenWeatherRequestParamsSetter) |
private func fetchWeatherForZipCode(zipCode: String) -> Promise<OpenWeatherModel> { | |
let zipCodeQuery = URLQueryItem(name: "zip", value: "\(zipCode.trimmingCharacters(in: .whitespacesAndNewlines)),us") | |
return APIManager().sendRequest(queries: [zipCodeQuery]) | |
} |
{"endTimeInSec":5282.862064383,"elementId":"F4B646D2-0DFF-4D37-B4F3-26D8CDFD4419","title":"No Agenda Social Invite","url":"Https:\/\/noagendasocial.com\/invite\/fnBmg2P6 ","startTimeInSec":5281.862064383} | |
{"title":"Tante Neel Art","url":"https:\/\/noagendaartgenerator.com\/artwork\/18211","elementId":"2D935040-27DF-4C43-81EF-9A0A9ED1A77D","startTimeInSec":5384.0217897519997,"endTimeInSec":5385.0217897519997} | |
{"startTimeInSec":5444.5242019810003,"endTimeInSec":5445.5242019810003,"elementId":"94181332-3ABD-4566-A510-49C920CEA2A1","title":"Darren's Cheese cake","url":"https:\/\/noagendaartgenerator.com\/artwork\/18239"} | |
{"url":"https:\/\/noagendaartgenerator.com\/artwork\/18250","title":"Toobin","startTimeInSec":5505.5115713610003,"elementId":"F0424528-BAB0-48B8-82AD-8312349B1DA4","endTimeInSec":5506.5115713610003} | |
{"elementId":"CC3D9F4C-A910-4A18-A307-7C72730EE659","title":"Iranian Proud Boys","url":"https:\/\/noagendaartgenerator.com\/artwork\/18244","startTimeInSec":5510.1063569919997,"endTimeInSec":5511. |
<?xml version="1.0" encoding="UTF-8"?> | |
<rss xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> | |
<channel> | |
<title>Podcasting 2.0 Namespace Example</title> | |
<description>This is a fake show that exists only as an example of the "podcast" namespace tag usage.</description> | |
<link>http://example.com/podcast</link> | |
<docs>http://blogs.law.harvard.edu/tech/rss</docs> | |
<language>en-US</language> | |
<generator>Freedom Controller</generator> | |
<pubDate>Fri, 09 Oct 2020 04:30:38 GMT</pubDate> |
<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:anchor="https://anchor.fm/xmlns"> | |
<channel> | |
<title>HyperCatcher Tutorial - HyperFeed</title> | |
<description>This is a tutorial podcast for the HyperCatcher Podcast App</description> | |
<link>https://www.buzzsprout.com/1027057</link> | |
<image><url>https://d3t3ozftmdmh3i.cloudfront.net/staging/podcast_uploaded_nologo/13998756/d092dfa4735f53e8.jpeg</url> | |
<title>HyperCatcher Tutorial</title><link>https://www.buzzsprout.com/1027057</link></image> | |
<generator>Anchor Podcasts</generator> | |
<lastBuildDate>Sat, 04 Mar 2023 12:30:01 GMT</lastBuildDate> | |
<atom:link href="https://anchor.fm/s/5408fe90/podcast/rss" rel="self" type="application/rss+xml"></atom:link> |
#!/bin/zsh | |
# Download the RSS feed | |
curl -s https://feeds.noagendaassets.com/noagenda.xml > rss.xml | |
# Initialize an empty JSON object | |
json='{}' | |
# Iterate over the items in the feed | |
awk '/<item>/,/<\/item>/' rss.xml | while read -r line; do |