Skip to content

About

UIKit Gallery in Objective-C: 14 UIKit demos (UIButton configurations, compositional layout, diffable data source, Core Animation, UIKit Dynamics, Core Graphics, gestures). Build and run on iPhone from Windows, Linux or macOS with KXBuild.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

UIKit Gallery (Objective-C)

English · 简体中文

14 UIKit demos written in Objective-C: buttons and menus, value controls, pickers, text, progress, compositional collection views, table view features, alerts and sheets, UIView animation, Core Animation layers, UIKit Dynamics, Core Graphics, blur and SF Symbols, and gestures.
No storyboards for the screens and no third-party code: every view is built in code, so each demo reads top to bottom.
Builds and runs on iPhone from Windows, Linux or macOS with KXBuild.

UIKit Gallery on iPhone

What's inside

Section Demo Shows
Controls Buttons UIButtonConfiguration styles, subtitles, activity indicator, selection, pull-down menus, pop-up buttons
Switches, Sliders & More UISwitch, UISlider, UIStepper, UISegmentedControl with text and images, UIColorWell
Pickers UIDatePicker compact / inline / countdown, UIPickerView with three components, UIPageControl
Text UITextField keyboards and icons, UITextView with data detectors, NSAttributedString, Dynamic Type
Progress UIActivityIndicatorView, UIProgressView styles, UIRefreshControl
Collections & Presentation Collection View UICollectionViewCompositionalLayout with orthogonal paging and an adaptive grid, diffable data source, add / shuffle / delete
Table View Leading and trailing swipe actions, context menus, reordering
Alerts & Sheets UIAlertController alert, text field and action sheet, UISheetPresentationController detents, UIActivityViewController
Graphics & Motion UIView Animation Spring animations, view transitions, scrubbing a UIViewPropertyAnimator
Core Animation CAShapeLayer stroke, animated CAGradientLayer, CAReplicatorLayer spinner, CAEmitterLayer confetti
UIKit Dynamics Gravity, collisions and elasticity; tap to drop, drag to throw with an attachment behavior
Core Graphics drawRect: with paths and a clipped gradient, UIGraphicsImageRenderer images, finger painting
Blur & Symbols UIVisualEffectView materials with vibrancy, SF Symbol rendering modes, weights and scales
Gestures Tap, double tap, long press with haptics, pan, simultaneous pinch and rotate, two-finger swipe

The home screen has search and the app follows the system light / dark mode.

Demo screens

Run it on an iPhone

You need KXBuild installed (install guide) and signing set up.

git clone https://github.com/kxbuild/objc-gallery.git
cd objc-gallery

# Build, install on the USB-connected iPhone and launch it
kxbuild run ObjCGallery.xcodeproj

The bundle identifier is com.kxbuild.objcgallery. If your provisioning profile does not cover it, switch to one of yours:

kxbuild project add-setting --project ObjCGallery.xcodeproj --target ObjCGallery --key PRODUCT_BUNDLE_IDENTIFIER --value com.yourcompany.objcgallery

To open one demo right away, pass its id as a launch argument, for example --args "-demo layers". The ids are in GalleryViewController.m.

In VS Code

Install the KXBuild extension, open this folder, pick the iPhone in the KXBuild view and press F5 to build, install and debug with breakpoints. Code completion for Objective-C works before the first build.

Project layout

ObjCGallery/
  SceneDelegate.m             creates the window and navigation controller
  GalleryViewController.m     the demo list, search and -demo launch argument
  DemoKit.h / .m              DemoViewController (scrolling cards) and small helpers
  ControlsDemos.m             buttons, value controls, pickers, text, progress
  CollectionsDemos.m          collection view, table view, alerts and sheets
  MotionDemos.m               animation, Core Animation, dynamics, drawing, effects, gestures

The ObjCGallery folder is a synchronized group, so new source files in it are part of the app without editing the project file. To add a demo, write a UIViewController subclass and add a GalleryDemo entry with its class name in GalleryViewController.m.

Related repositories

  • KXBuild: build, run and publish iOS apps from Windows, Linux or macOS, on the command line or in VS Code
  • SwiftUI Gallery: 15 SwiftUI demos: controls, lists, animation, gestures, Swift Charts, MapKit, SwiftData
  • Flutter Gallery: Material and Cupertino widgets plus four complete sample apps
  • React Native Gallery: 16 demos of React Native's built-in components and APIs
  • Expo Gallery: 22 Expo SDK modules: camera, sensors, location, SQLite and more
  • Godot Gallery: 10 Godot 4 demos exported to iOS
  • Unity Gallery: 10 Unity 6 demos exported to iOS
  • KXBuild App Templates: Project and target templates for kxbuild project create and add-target

License

Apache 2.0. See LICENSE. UIKit and SF Symbols are trademarks of Apple Inc.

About

UIKit Gallery in Objective-C: 14 UIKit demos (UIButton configurations, compositional layout, diffable data source, Core Animation, UIKit Dynamics, Core Graphics, gestures). Build and run on iPhone from Windows, Linux or macOS with KXBuild.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages