GitHub - flowkey/UIKit-cross-platform: Cross-platform Swift implementation of UI...
source link: https://github.com/flowkey/UIKit-cross-platform
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
UIKit-cross-platform
UIKit-cross-platform is a UI framework for native apps, which enables code targeting iOS UIKit to run on other platforms, particularly on Android.
How does it work
UIKit-cross-platform renders with SDL_gpu which uses OpenGL(ES). On Android Swift Package Manager compiles Swift Code into native binaries, which are called through the NDK.
More detailed information about the architecture can be found here
Try out the demo
This project includes a DemoApp which runs on iOS, Android and Mac.
How to run it on different platforms:
- Clone this project,
cd
into it and rungit submodule update --init --recursive
- Open
./samples/getting-started/DemoApp.xcodeproj
in Xcode- Run
DemoApp
target for the iOS App - Run
DemoAppMac
target for the Mac App
- Run
- Open
./samples/getting-started/android
with Android Studio (install Android SDKs if necessary) - Connect an Android device and press "Run" for the Android App
How to run your iOS Project on Android
- Create new iOS Project or open an existing one
- Prepare your iOS Project
- Add UIKit-cross-platform to your project
- Run
./UIKit/create-android-project
from the root of your iOS project - Open
./android
folder in Android Studio and press "run" button
Additional setup instructions
Adding UIKit-cross-platform
UIKit-cross-platform
has to be added as a dependency to your project including its subdependencies.
The recommended way is to use git submodules
to add it to an UIKit
subdirectory.
In order to do so use the following command:
git submodule add [email protected]:flowkey/UIKit-cross-platform.git UIKit && git submodule update --init --recursive UIKit
Android Studio Setup
- Install Android Studio
- Add SDKs in Android Studio
- Open Preferences in Android Studio
- Go to Appearance & Behavior -> System Settings -> Android SDK
- In SDK Platforms: apply checkboxes for API Levels 26 and 27
- In SDK Tools: apply checkboxes for CMake, NDK, LLDB, Android SDK Build Tools, Android SDK Platform Tools
- Press Apply / OK to install SDKs
API documentation
This framework uses the Apple UIKit API, therefore the official Apple Docs serve as documentation for the already implemented features.
How to contribute
Contributions are very welcome and helpful ?
If you are looking for a feature or find a bug, please create an Issue.
For additional information please refer to our contribution guidelines.
FAQs / Troubleshooting
Our FAQs can be found here (Work In Progress).
Please contact us regarding upcoming issues on Slack or create a new Issue.
License
UIKit-cross-platform is free software; you can redistribute it and/or modify it under the terms of the MIT License.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK