Coder Social home page Coder Social logo

swift-locationtrivia-objects-wdc01-seng-ft-071320's Introduction

#Location Trivia Objects

An app to share the different trivia items of life around you. As users walk around NYC they are notified of nearby trivia items. Users are also able to add trivia facts and tag them to any location nearby. Through this app, we can all be a little bit smarter.

Instructions

Before getting started - key thing - for this lab, you do not need to know / use / understand optionals. If you get messages suggesting you need to add a ? or ! to your code though, you do need to know that the compiler / linter thinks you are trying to assign a variable to nil. For this lab, we will not allow any of our objects to ever be nil! (Either initialize a variable when declared or in an initializer.)

  1. First create a new FISLocation class, add in the following properties:
	let name : String
	var latitude : Double
	var longitude : Double
  1. Create an initializer that takes in the three properties and assigns them correctly.

  2. Create a shortenLocationName method in your FISLocation class.

  3. Create a getLocationNamesWithLocations method that takes an Array of FISLocation objects and just return their names. This should be a class function.

  4. Create a verifyLocation method to be an instance method for FISLocation that ensures the location name is not blank (i.e. ""), and the location latitude and longitude are both possible (remember there are limits on the range of latitude and longitude!)

  5. Create a searchForLocationName:inLocations: method to search an Array of FISLocation objects.

  6. Create a new class called FISTrivia. This class should have the following properties:

    var content : String
    var likes : Int
  7. Create an initializer for FISTrivia that takes an argument for all of the properties and sets them appropriately

  8. Add an Array property to FISLocation to hold trivia items

  9. Write a method called topTrivia that returns the trivia item with the most likes.Assume this method will always return something, even if there are no trivia items for a location. (i.e. a placeholder trivia with placeholder content and zero likes.)

View Location Trivia Objects on Learn.co and start learning to code for free.

swift-locationtrivia-objects-wdc01-seng-ft-071320's People

Contributors

fislabstest avatar fs-lms-test-bot avatar ipc103 avatar jmburges avatar misterfifths avatar sarogers avatar susanlovaglio avatar zdrossman avatar

Watchers

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