Skip to content

About

A Swift + WidgetKit learning project exploring and building customizable Apple home-screen widgets. | Swift + WidgetKit 小组件学习与实现

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

KittyWidgetV2

Learn Apple WidgetKit by building a customizable iOS home-screen widget.

KittyWidgetV2 (app name: PicWidgets) is a hands-on Swift project for exploring Apple's early home-screen widget system through a working implementation.

English · 简体中文

Platform Language Framework

WidgetKit in action

The app provides configurable small and medium home-screen widgets. Each widget can be set up independently in PicWidgets and selected from the iOS widget editor.

Small widget
PicWidgets small iOS home-screen widget
Medium widget
PicWidgets medium iOS home-screen widget

Why explore KittyWidgetV2?

This repository is both a study of WidgetKit and a practical implementation. Follow how SwiftUI views, widget configuration, timelines, and shared app data come together in an iOS app.

Personalize each widget

Choose a background photo or color, add or hide a foreground illustration, and adjust fonts, colors, blur, or custom text. Widgets can be added, renamed, edited, and removed individually.

Put useful details on the Home Screen

Show the time and date, choose 12-hour or 24-hour time, and optionally display a calendar in the medium widget. The app also offers light, dark, and system appearance settings.

Connect a widget to an app action

Assign a supported URL scheme to a widget so tapping it can open a chosen action in another app.

Learn the WidgetKit building blocks

  • Widget configuration: an intent lets each Home Screen instance select a saved widget design.
  • Timeline rendering: the WidgetKit extension creates dated entries for the system to display.
  • Shared data: the app and widget extension exchange saved settings through an App Group.
  • SwiftUI layouts: small and medium widget families use dedicated views.
PicWidgets app screen 1 PicWidgets app screen 2 PicWidgets app screen 3
PicWidgets app screen 4 PicWidgets app screen 5

Build and run

You need a Mac with Xcode to build and run this iOS project.

  1. Clone this repository.
  2. Open KittyWidgetV2.xcodeproj in Xcode.
  3. Select the KittyWidgetV2 app scheme and an iOS simulator. For a physical device, choose your own signing team in Signing & Capabilities.
  4. Run the app, then add PicWidgets from the iOS Home Screen widget gallery.

The project uses iOS 14-era WidgetKit APIs. Deployment settings are configured for iOS 14.x across its targets.

Project map

  • KittyWidgetV2/ContentView.swift — app tabs and widget collection management.
  • KittyWidgetV2/SmallSetting.swift — per-widget customization.
  • kittyWidgetExtension/kittyWidgetExtension.swift — WidgetKit configuration and timeline provider.
  • Models/MyData.swift — widget models and shared persistence.

Notes

KittyWidgetV2 is a learning and research project focused on the original iOS 14-era WidgetKit experience. WidgetKit has evolved since then, so check Apple's current documentation before applying these patterns to a new app. The in-app interface currently uses Chinese labels; this README is available in English and Simplified Chinese.

If this project helps you understand WidgetKit, consider giving it a star.

Resources

About

A Swift + WidgetKit learning project exploring and building customizable Apple home-screen widgets. | Swift + WidgetKit 小组件学习与实现

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages