StreetComplete 在 iOS 上现已进入公开测试阶段
StreetComplete on iOS is now in public beta

原始链接: https://github.com/streetcomplete/StreetComplete/issues/5421

该主工单用于协调 StreetComplete 的 iOS 移植,并取代此前的研究与讨论。目标是通过 Kotlin Multiplatform 和 Compose Multiplatform 尽可能复用现有代码,避免使用 Swift 或 Dart 进行完全重写。 迁移采用渐进式策略: - 将平台特定代码与应用逻辑分离。 - 使用 Kotlin Multiplatform 库替换核心逻辑中对 Android/Java 依赖项的使用。 - 使用 ViewModel 重构数据访问和 UI 状态管理。 - 从底层开始,将 Android XML 界面迁移到 Jetpack Compose。 - 将 Jetpack Compose 界面迁移到适用于 iOS 的 Compose Multiplatform。 相关工作会在项目看板上跟踪,任务通常对社区贡献者开放;贡献者可以在评论区认领任务。大家也可以参与剩余任务、学习 Jetpack Compose 和 Compose Multiplatform、资助开发,或协助维护项目和分类处理问题。 完整移植最初预计需要约一年的工作量。在 2024 年初投入大量全职开发后,目前迁移进度约为 50%。 State of the Map Europe 2024 的相关演示幻灯片中附有演讲者备注,对这一方法作了说明。

StreetComplete 已通过 TestFlight 启动 iOS 公测,将这款面向初学者的 OpenStreetMap 编辑器带到 Apple 设备上。该应用通过简单的位置相关问题收集信息,并将答案上传为有意义的修改集,同时支持离线问卷调查。开发工作得到了 NLnet 和德国联邦教育与研究部的支持。 用户普遍称赞 Android 应用无需了解标签即可参与 OSM 贡献。iOS 版本采用 Kotlin Multiplatform 和 Compose Multiplatform;参与开发的开发者表示迁移过程顺利,只有很小一部分代码与特定平台有关。 测试版反馈指出,导航容易让人困惑;应用依赖不易被发现的滑动返回手势;当答案不足时,用户很难取消问题;此外还缺少 Apple 原生登录功能,并且用户要求更清晰地展示贡献历史。有些任务说明不清楚,或无法表达混合情况,但应用也提供了拆分道路等选项。 更广泛的争论集中在道路的步行可达性上:贡献者对于没有行人道的道路是否应标记为法律上不可步行存在分歧。维护者承认该任务的措辞与实际生成的标签不一致后,删除了这项有争议的任务。讨论还涵盖了 OSM 许可、政府数据兼容性、其他 iOS 编辑器,以及利用 AI 辅助进行照片或语音标注的可能性。
相关文章

原文

This ticket is something like the master ticket to coordinate development on an iOS port of StreetComplete. It replaces #1892 which also included a lot of discussion and research / observation work.

TLDR: Have a look at the Project Board for a list of tasks. Contributions are welcome!

Also have a look at the Slides from SotM Europe 2024 talk (I added speaker notes to make this understandable when flipping through).

The code base of this app is written in 100% Kotlin, a modern programming language that is quite similar to Swift. Kotlin code can be transpiled to JavaScript and also to machine code, just like Swift. Furthermore, many dependencies of this app by now are pure Kotlin libraries.

An iOS version of this app hence can be done with Kotlin Multiplatform.

The UI code can be shared using Compose Multiplatform, which is currently in alpha beta for iOS. It is a fork/extension of Jetpack Compose with largely the same API. Jetpack Compose is a reactive UI framework in which developers define the UI completely in code (similar idea as SwiftUI, Flutter, ...). We'll have to re-create the entire UI (incrementally) in Compose, though.

This will keep the amount of code that needs to be platform dependent (Android / iOS) to a minimum.

This approach has the big advantage over others in that further maintenance of this project will not increase significantly, as there will continue to be just one code base. In comparison to using the framework Flutter for multiplatform (as used by Every Door), it allows us to largely not touch the Kotlin codebase. When using Flutter, we'd need to rewrite it all in Dart.

  • Separate all platform specific code from application logic. Replace Android/Java dependencies for application logic with Kotlin multiplatform dependencies

  • Incrementally migrate the UI code to Compose Multiplatform:

    1. Separate data access and UI state code from pure UI code (use view models: Use ViewModels #5070 )

    2. Migrate the UI code that currently uses Android XML layouts to Android Jetpack Compose. This can be done incrementally when done bottom-up (see migration strategy guide)

    3. Then, migrate from Jetpack Compose to Compose Multiplatform. This is a small step compared with the first one.

This section will be updated continuously.

The steps necessary are described in detail in a Kanban-style Project Board. (Some tasks have not been created yet because they 100% depend on other tasks completed first and some research). Unless stated otherwise, they are explicitly up for the taking by people who read this and (I hope 😊) want to contribute to the development towards an iOS port. If you would like to implement one of the tasks described, comment in that ticket.

We very roughly estimated some time ago that developing a full port to iOS would take one man-year of work. So, the scope of this remains very large. We will only realistically achieve it together with lots of contributions from the community. Luckily, this is exactly what has been happening in the last years.
In the first half of 2024, I have been able to work on this full-time. The migration is now about 50% complete.

So, let's shift gears!

  • You could take over a task from the project board! Or, you could familiarize yourself with the mentioned technologies / frameworks to make meaningful contributions later. In particular: Jetpack Compose / Compose Multiplatform. This is very new to me too, so I have to find my feet here, too

  • You can sponsor development! See the title "Sponsor this project" in the sidebar on the main page. More money allows me to devote more time to development on this app in general. If you know any eligible sources for larger scale funding, talk to me!

  • You can help with maintenance and issue triage in general. Time saved on that is time I can put into furthering development on this!

联系我们 contact @ memedata.com