Git Product home page Git Product logo

swiftfall's People

Contributors

bmbowdish avatar naknut avatar saucetray avatar

Stargazers

 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  avatar

swiftfall's Issues

Card type could be a class rather than a struct

Cards are entirely immutable as is, and with like 13,000+ of them potentially in use, it doesn't really make sense to copy them around as much as they're currently forced to be. Consider making Card a class.

Use convertToSnakeCase when Swift 4.1 is released

Swift 4.1 introduces a new property on JSONDecoder called keyEncodingStrategy. This will allow the JSON encoder/decoder to convert property names spelled in camel case like let manaCost: Int? into mana_cost when reading from or writing to JSON. This way you get nice Swifty property names that don't use snake_case, and the decoder automatically reads the snake case versions from the JSON.

https://www.hackingwithswift.com/articles/52/swift-4-1-improves-codable-with-keydecodingstrategy

Card Pricing

Scryfall has recently changed the way prices are fetched.
It is no longer:
public let usd: String?

It is now prices[usd]
How could we write that in swift? I tried many things but with no solution.

The `/cards` API endpoint is deprecated since June 10, 2020

"First and foremost: On June 10, 2020 Scryfall will remove access to the “all cards” /cards API endpoint. This endpoint is now deprecated." (https://scryfall.com/blog/updates-to-bulk-data-and-cards-deprecation-notice-217)

public static func getCardList() throws -> CardList {

and

public static func getCardList(page:Int) throws -> CardList

should be marked as deprecated or should be removed.

Is the card double sided?

I think a boolean for "is double sides" would be helpful. Otherwise it is very hard to know if a card is double sides or not.

Explicit getter methods are unnecessary.

In Swift, you only need to mark a property as public in order to expose its getter. Swift automatically synthesizes getter/setter methods for properties, unlike languages like Java.

The explicit getters such as this:

let name: String?
public func getName() -> String? {
  return self.name
}

...can be replaced with:

public let name: String?

...and used by just referencing card.name.

Cocoa Pods

I really don't understand how to set up a Cocoa Pod.

If anyone sees this and wants to help me out I would appreciate it.

Thanks.

Too Many Optionals

I use optionals because they are the safest way to handle this many things out of my control. However, CardList, RulingList, SetList are made up of optionals which mean they they are an optional that contains an array of optionals.

This is probably a little overly pedantic and I'm sure there are places I could use less Optionals.

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.