Giter Site home page Giter Site logo

pure-kotlin-ios's Introduction

Pure Kotlin/Native iOS App

This example app is 100% written in Kotlin and does not contain any code in Objective-C or Swift. Furthermore, the app binary itself is build by Gradle and does not depend on Xcode to generate the app.

In fact an iOS-App is just a folder with some special files. Namely the binary itself (build by Gradle) and a Info.plist file, that describes the app and where to find the binary, app icon, supported features, requirements, etc.

Usage

To build the one of the apps (direct-uikit) the included Makefile can be used by executing:

make simulator.app

This will create the app/directory direct-uikit/build/bin/iosSimulatorArm64/simulator.app

This app can then be installed on a simulator. To simplify this, the Makefile includes other targets, that require a running simulator. It is easiest to start the simulator either from the GUI or using the Makefile:

make sim

Afterward not further manual action required. Simply execute the following command to run the app:

make run

Alternatively the app can also just be installed using:

make install

UI Building Examples

This repo contains a few examples of how UI could be build in an app, that's 100% written in Kotlin.

Example: direct-uikit

The first and easiest example, is using UIKit directly. It can be build using the following make command:

make simulator.app PROJ=direct-uikit

Example: compose-jb

This example utilizes the compose-multiplatform implementation by JetBrains to build UI. Additionally it relies on the implementation of UI-components using Skiko, which draws on a canvas. It can be build using the following make command:

make simulator.app PROJ=compose-jb

Example: compose-uikit (via compose-ui-uikit)

This example replaces the implementation of UI-components with a custom implementation that relies on UIKit. Therefore no canvas is needed and all native features would be theoretically usable. The example app can be build using the following make command:

make simulator.app PROJ=compose-uikit

Caveats

  • Currently signing the app is not included in this example. This means, it can only be installed in simulators for now. Technically it would be possible to support signing though, this is no limitation of the chosen method to create the app.
  • Different solutions for building UI could be used that are currently not shown, e.g. CashApp's Reedwood, Swift UI ...

pure-kotlin-ios's People

Contributors

molikuner avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.