The official Wikipedia iOS app
Wikipedia iOS
The official Wikipedia iOS app.
Building and Running
In the directory, run ./scripts/setup
. Note: going to scripts
directory and running setup
will not work due to relative paths.
Running scripts/setup
will setup your computer to build and run the app. The script assumes you have Xcode installed already. It will install homebrew and ClangFormat. It will also create a pre-commit hook that uses ClangFormat for linting.
After running scripts/setup
, you should be able to open Wikipedia.xcodeproj
and run the app on the iOS Simulator (using the Wikipedia scheme and target). If you encounter any issues, please don't hesitate to let us know via a bug report or messaging us on IRC in #wikimedia-mobile on Freenode.
Required Dependencies
If you'd rather install the development prerequisites yourself without our script:
- Xcode - The easiest way to get Xcode is from the App Store, but you can also download it from developer.apple.com if you have an Apple ID registered with an Apple Developer account.
- ClangFormat - We use this for linting.
Contributing
Covered in the contributing document.
Development Guidelines
These are general guidelines rather than hard rules.
Coding Guidelines
- Objective-C - Apple's Coding Guidelines for Cocoa
- Swift - swift.org API Design Guidelines
Formatting
We use Xcode's default 4 space indentation and our .clang-format
file with the pre-commit hook setup by scripts/setup
. Currently, this does not enforce Swift formatting.
Process and Code Review Norms
Covered in the process document.
Logging
When reading logs, note that the log levels are shortened to emoji.
- ![speaking_head](https://github.githubassets.com/images/icons/emoji/unicode/1f5e3.png =20x20) Verbose
- ![speech_balloon](https://github.githubassets.com/images/icons/emoji/unicode/1f4ac.png =20x20) Debug
- ![information_source](https://github.githubassets.com/images/icons/emoji/unicode/2139.png =20x20) Info
- ![warning](https://github.githubassets.com/images/icons/emoji/unicode/26a0.png =20x20) Warning
- ![rotating_light](https://github.githubassets.com/images/icons/emoji/unicode/1f6a8.png =20x20) Error
Testing
The Wikipedia scheme is configured to execute the project's iOS unit tests, which can be run using the Cmd+U
hotkey or the Product → Test menu bar action. In order for the tests to pass, the test device's language and region must be set to en-US
in Settings → General → Language & Region. There is a ticket filed to update the tests to pass regardless of language and region.
Schemes and Targets
- Wikipedia - Points to production servers.
- Staging - Pushed to TestFlight as a separate app bundle, and has the ability to toggle different staging environments within the
current
property ofConfiguration
:- An option of
appsLabsForPCS
will point to the Apps team's staging environment for page content. This is selected by default. - An option of
deploymentLabsForEventLogging
will point to the Event Logging staging environment. It is for testing analytics events that the app sends to Event Logging. It is not selected by default. - All other endpoints will point to production.
- An option of
- Local Page Content Service and Announcements - used in Debug mode only, has the ability to toggle different local environments within the
current
property ofConfiguration
:- An option of
localPCS
will point to a locally running mobileapps repository for page content. This is selected by default. - An option of
localAnnouncements
will point to a locally running wikifeeds repository for the announcements endpoint. This is selected by default. - All other endpoints will point to production.
- An option of
- RTL - Launches the app in an RTL locale using the
-AppleLocale
argument. - Experimental - For one off builds. Can point to whatever is needed for the given experiment. Pushed to TestFlight as a separate app bundle.
- User Testing - For user testing. Has an alternate configuration so that it can be delivered ad hoc. Pushed to TestFlight as a separate app bundle.
- WMF - Bundles up the app logic shared between the main app and the extensions (widgets, notifications).
- Update Localizations - Covered in the localization document.
- Update Languages - For adding new Wikipedia languages or updating language configurations. Covered in the languages document.
- {{name}}Widget, {{name}}Notification, {{name}}Stickers - Extensions for widgets, notifications, and stickers.
Continuous Integration
Covered in the CI document.
Event Logging
Covered in the event logging document.
Web Development
The article view and several other components of the app rely on web components. Instructions for working on these components is covered in the web development document.