Giter VIP home page Giter VIP logo

ios-afternoon-project-astronomy-objc's Introduction

Astronomy - ObjC

Introduction

For this project, you'll build Astronomy, an app for viewing photos taken by NASA's Mars rovers.

You will build the app primarily in Objective-C with some Swift components. The goal of this project is to practice using Swift and Objective-C together, including using features like nullability, lightweight generics, and name customization.

This is a two-day project. The first half of the project is focused on Swift<->Objective-C interoperability, while the second half, you'll do some refactoring and add additional features.

After completing the lesson material and this project, you should be able to:

  • use a bridging header to expose Objective-C to Swift
  • import a Swift module header to use Swift code from Objective-C
  • annotate Objective-C class interfaces for nullability
  • annotate Objective-C class interfaces with lightweight generics
  • call Objective-C methods from Swift
  • call Swift methods from Objective-C

You are welcome and encouraged to use existing Swift solutions to this project as inspiration and help when implementing this project. However, you are asked to write all the code, including the Swift parts, from scratch.

Instructions

Fork and clone this repository. Create your own Xcode project. Commit regularly as you complete the requirements in this project.

The instructions for this project are intentionally sparse. At this point in the course, you are familiar with most of the concepts used in building an app like this, and should be able to implement it with minimal guidance. This also means that you have the freedom to implement most parts of the app as you see fit. However, please make sure you follow the instructions that are here.

Part 1 - Swift <-> Objective-C Interoperability

BREAKING NASA links: the links below may not work, NASA has updated the site, look for Mars Rover or photos API. https://github.com/chrisccerami/mars-photo-api

You do not need to authenticate in order to explore the NASA data at https://api.nasa.gov/mars-photos/. However, if you will be intensively using the APIs to, say, support a mobile application, then you should sign up for a NASA developer key. You can include this API key in a request with a query parameter api_key=<YOUR_KEY>.

For part 1 of the project, implement a client for the NASA Mars rover API. You will find API documentation here: https://api.nasa.gov/ (Mars photos) You'll need an API key, which you can get by signing up here: https://api.nasa.gov/index.html#apply-for-an-api-key

NOTE: Before you begin, make sure you understand what API endpoints you need to call and the data you need to display. Test the Swift version so you understand the behavior you need to create in Objective-C.

Guidelines and Requirements

  1. Implement the app in Objective-C with the exception of the main collection view controller, the detail view controller, and one model type of your choice.
    • The rest of the model, networking, and view components must be written in Objective-C.
  2. Your Objective-C code must be thoroughly annotated for nullability and generics.
  3. You must cache images using a custom cache class written in Objective-C. It should be a generic type so it can be used with any type.

Part 2 - Additional Enhancements

For part 2 of the project, you'll add additional features to continue your practice of Objective-C.

Guidelines and Requirements

  1. If you haven't already done so, use the NSOperation-based image loading system coverred in the Concurrency modules. If you do this, you must write the code in Objective-C.
    • Note that the ConcurrentOperation subclass is not required. Your Objective-C NSOperation subclass should override isAsynchronous to return YES, then directly set the ready, executing and finished properties as appropriate during its execution. These properties are observed by the NSOperationQueue machinery using KVO, and therefore your use of them must be KVO-compliant.
  2. Your app should allow the user to move between sols.

Go Further

If you finish early or want to push yourself, here are a few additional features you can implement:

  • Create a framework for the model and networking code, which is platform-independent (ie. should work fine on macOS and tvOS)
  • Implement UI to allow the user to see all available rovers and select them
  • Modify your Cache class so that it can be configured to evict old entries if its size gets too big. This prevents the app from using too much memory due to a lot of cached data.
  • Investigate and implement the use of the system-provided NSCache API for caching instead of your own cache class. What benefit does this provide? Downsides?
  • Support pinch-to-zoom on the detail view controller.

ios-afternoon-project-astronomy-objc's People

Contributors

gipyok avatar paulsolt avatar

Watchers

James Cloos 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.