Code Monkey home page Code Monkey logo

swiftislikescala's People

Contributors

adamschwartz avatar akorchev avatar damieng avatar delehef avatar diegoleme avatar dustmason avatar eipark avatar etlovett avatar fabricionaweb avatar fhemberger avatar freekh avatar headbandno2 avatar leverich avatar objccodingtogether avatar pborreli avatar rkrupinski avatar rwaldron avatar t3chnoboy avatar vicnicius avatar yukulele avatar zackbloom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

swiftislikescala's Issues

Old / Incorrect Swift Syntax

I really enjoyed reading your article. Here are a few minor changes based on newer versions of Swift.

Ranges

The half-open range operator .. is now ..<.

Empty Collections

Typed arrays are no longer declared and created using String[](); use [String]() instead.

Sort

Your Sort syntax is invalid:

sort([1, 5, 3, 12, 2]) { $0 > $1 }
  1. sort takes an array as inout parameter, which you aren't passing here
  2. you are passing in an immutable array, but the array needs to be mutable
  3. you can just pass the comparison operator.

So this would work:

var numbers = [1, 5, 3, 12, 2]
sort(&numbers)

Or this:

var numbers = [1, 5, 3, 12, 2]
numbers.sort(<)

Or you can return the sorted numbers using sorted instead of sort:

let immutableNumbers = [1, 5, 3, 12, 2]
let immutableSortedNumbers = [1, 5, 3, 12, 2].sorted(<)

Downcasting

This is more of a suggestion than a correction. You might want to cover optional downcasting (let movie = object as? Movie); I don't know if there's a Scala equivalent (I don't know Scala).

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.