Making Wikipedia More Accessible: iOS Widgets


As part of my Outreachy internship with the Wikipedia iOS team, the features I am working on revolves around making Wikipedia more accessible and engaging for iPhone users. The goal? Improve app retention ensuring that users not only install the app but keep coming back to it. To achieve this, I worked on features such as integrating App Intents, Spotlight search, and new Home Screen and Lock Screen widgets into the Wikipedia iOS app. I will be splitting this blog post into two parts for easy comprehension for anyone new to the wikipedia iOS codebase or community. in this blog post I will be walking you through on how you can apply to the Wikipedia iOS team and how you can record contributions to the repository as a junior iOS Developer.
The Wikipedia codebase has a strong sea of legacy code written in Objective-C and UIKit but do not be frightened. The community has been making moves to transition the codebase into a modern and user friendly codebase written with a modern programming language and framework. (Swift and SwiftUI). The iOS search widget feature built for both Home screen and Lock screen discussed in the blog post is a testament to this transition.
Prerequisites
Basic knowledge of Swift and SwiftUI: As a new contributor, you should be able to write basic swift code and develop intuitive user interfaces with SwiftUI.
Have basic tools like a Mac, Xcode and command line tools to meet the requirements of the development team.
iOS Widget
Widget Size | iPhone | IPad |
System small | Home Screen and LockScreen | Home Screen and LockScreen |
Why the Widget Was Implemented?
The decision to build a search widget for the Wikipedia iOS app stemmed from a clear data backed goal: improve app retention by making search faster, more private, and more accessible for users.
The Android version of the app already featured both an article and a search widget, and internal analysis showed that users with the search widget had higher average pageviews than those using the Article of the Day widget. This insight hinted at an important behavior pattern that users often come to Wikipedia with a specific question in mind, not just to browse.
With that in mind, The team hypothesized that introducing a search widget into the iOS app could drive a 3% increase in overall app retention, particularly by making it easier for users to quickly open Wikipedia directly from the home or lock screen.
The widget was also designed to respect user privacy. Many users prefer to bypass traditional search engines like Google when looking for reliable information, as expressed in one user story:
"As someone who searches for information and prefers to get results from Wikipedia, I would like to avoid the Google search app and search Wikipedia through a widget, so that I can get results faster, and avoid being tracked by Google."
For quick, on-the-go questions, especially in casual settings like hanging out with friends, the lock screen widget makes it possible to access Wikipedia in seconds, without needing to unlock the phone or open the app manually.
By tapping on the widget, the app launches with the search field and keyboard active, allowing users to immediately type their query.
Building the iOS Search Widget
To bring this idea to life, I implemented a small system widget that launches the Wikipedia app directly into the search tab, with the keyboard already active just as users requested.
The widget was built using SwiftUI and is powered by WidgetKit
, Apple’s framework for developing widgets in iOS. At the heart of the widget is a SearchWidgetView
, which renders a simple yet recognizable interface, Wikipedia globe logo and a magnifying glass icon to search.
To make the widget feel native and responsive, I used the system’s current ColorScheme
to dynamically switch between light and dark themes, ensuring the widget looks clean and consistent across all user settings.
A few technical highlights from my implementation:
I created a
SearchEntry
timeline entry that includes a URL (wikipedia://search
) so that tapping the widget opens the app's search tab immediately.The widget configuration is managed through
SearchWidgetConfiguration
, which reads from a shared cache to determine the user's preferred language and site URL.I used
StaticConfiguration
fromWidgetKit
since the widget doesn’t need to change dynamically over time.I also implemented a dark/light mode preview using
SearchWidget_Previews
, so other developers and contributors can visualize how the widget will appear in different themes.
This was a great introduction to building widgets using modern Apple APIs, and more importantly, it increases retention by making Wikipedia search more accessible than ever.
Thank you for reading the first part of this blog post, stay tuned for the next part where I will walk you through how I created an app intent that exposed the search functionality to system experiences like Siri, Spotlight and shortcuts.
Subscribe to my newsletter
Read articles from Temiloluwa Yusuf directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
