/luftballons99

Hybrid iOS - Simple Game

Primary LanguageSwift

99 Luftballons (iOS game)

This small Swift 4 application demonstrates the fundamental concepts of hybrid iOS Apps.

The source code serves as a demo application in a seminar (advanced level of a high school) at Willi-Graf-Gymnasium, Munich. For this purpose everything is reduced to a minimal complexity. It is essential to understand the fundamentals before starting with frameworks like Xamarin, PhoneGap, Framework7, Mobile Angular UI.

It answers the questions:

  • How to setup WKWebView for interaction between native iOS code and JavaScript?
  • How to call JavaScript from Swift 4 code?
  • How to call Swift 4 code from JavaScript with parameter in JSON text format?
  • How to dynamically insert code into the HTML?
  • How to use basic internationalisation for the user interface?

Code is based on:

  • Xcode 9 project
  • Swift 4
  • HTML (incl. SVG and JavaScript)

You may find the running application in the AppStore (https://itunes.apple.com/developer/markus-sprunck/id1141912893).

In the main.html and main.js you will read mainly German comments, because this code was written together with my son Korbinian when he was a fifth-grader (the game is based on his ideas).