Skip to content

Repackage assets and upgrade to Swift 5

Repackage the latest mobile assets from webapp, upgrade to Swift 5 and support larger screens, by upgrading to Xcode 11.1.

Requires https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1610 to be merged.

Swift Migration

  • The migration to Swift 4 was done automatically, using the highest compatibility mode. This minimises risk.
  • The migration to Swift 5 was mostly automatic, but some changes were required to fix up the use of String.characters - largely just removing .characters. There are still some warnings and deprecations, which we should really look into.

Required Changes

The only significant changes that were required:

  • The third-party SlackTextViewController component is abandoned upstream. We have forked this and patched its font handling to work in newer iOS builds, https://github.com/gitterHQ/SlackTextViewController
  • A crash on startup/become active was fixed due to trying to clear out core data entities that didn't exist.

Trivia

  • When building with Xcode 11, the WKWebView did not appear to work - none of the javascript was executed. This appeared to be fixed by upgrading to Xcode 11.1 (which was a relief).
  • I updated the cocoapods to the latest versions matching our version constraints. This was not strictly necessary (other than for SlackTextViewController), but I think it should help. There are other major version updates (check pod outdated), but I didn't attempt that.
  • Dark mode in iOS 13 is new, and does not look good with the current app. Some small changes make it usable, but more styling work is required, so for now, Light mode is forced in the Gitter-Info.plist. I suspect that Apple's patience with this will run out eventually, so we should raise a new issue to support this as some point.
  • I have tested the app builds on my devices (iPhone, iPad), and in a number of simulators, including back to iOS 11. I haven't tested iOS 9 which is the current deployment target. I think we should consider bumping the deployment target to iOS 11, as testing that far back is unlikely to be plausible and empirical data from the internet suggests that more than 95% of iOS users are on iOS 12 or later.

Done:

Run up on devices:

  • iPhone X - iOS 13
  • iPad Pro - iOS 12
  • iOS Simulator - various

Fix https://gitlab.com/gitlab-org/gitter/gitter-ios-app/issues/42, https://gitlab.com/gitlab-org/gitter/gitter-ios-app/issues/45

Edited by Eric Eastwood

Merge request reports