Coder Social home page Coder Social logo

xui's Introduction

XUI

CI Status Cocoapods

// XUI in a single line
[XUIListViewController presentFromTopViewControllerWithDictionary:@{  @"items": { @"default": @YES, @"label": @"Feature", @"cell": @"Switch", @"key": @"switch1" } }];

Make a configuration UITableView in 5 minutes? Let's do it!

XUI is a drop-in replacement for "Settings Application Schema" on iOS. It allows application to show preferences view controller by creating a simple configuration bundle (much like "Settings.bundle").

Features

  • (iOS 14+) Dynamic Fonts Support
  • (iOS 13+) SF Symbols Support
  • (iOS 13+) Dark Mode Support
  • Data Persistence (NSUserDefaults / Custom Adapters)
  • Localized Strings / Image Resources
  • Custom Cells (Runtime)
  • Notifications

Components

XUI provides more components than private framework "Preferences.framework":

  • Group
  • Link (Child Pane)
  • Switch
  • Button (Action)
  • TextField
  • Radio / Checkbox Group
  • Segment Group
  • Single Selection Option List
  • Multiple Selection Option List
  • Ordered Multiple Selection Option List
  • Slider
  • Stepper
  • DateTime Picker
  • TitleValue
  • StaticText
  • Textarea
  • Image
  • Editable List (Strings)

Usage

// to specify the path for Settings.bundle
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];

// to specify the root entry for that bundle
NSString *xuiPath = [[NSBundle bundleWithPath:bundlePath] pathForResource:@"Root" ofType:@"plist"];

// present or push it!
XUIListViewController *xuiController = [[XUIListViewController alloc] initWithPath:xuiPath withBundlePath:bundlePath];
XUINavigationController *navController = [[XUINavigationController alloc] initWithRootViewController:xuiController];
[self presentViewController:navController animated:YES completion:nil];
NSString *xuiPath = [[NSBundle bundleWithPath:bundlePath] pathForResource:@"Root" ofType:@"plist"];

// directly present XUI from the top most view controller
[XUIListViewController presentFromTopViewControllerWithPath:xuiPath];

Configurations

If the key defaults is not set, configuration will be saved to Standard User Defaults.

NSNumber *enabled = [[NSUserDefaults standardUserDefaults] objectForKey:@"enabled"];
[enabled boolValue];

Notification

XUINotificationEventValueChanged: Any

Theme

XUI Theme can be configured in theme dictionary.

Adapter

Create custom adapter to read the interface schema from any format you like: plist, json, or lua. Adapter also handles data persistence and notifications.

Logger

To know if there is any invalid in our interface schema...

Custom Cells

Inherit from XUIBaseCell then have fun with your own cells whether it is xib based layout or not. XUI will automatically load custom cells.

More Documentation

https://github.com/Lessica/XUI/wiki/

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Demo

Requirements

  • Xcode 7 or above
  • iOS 7 or above
  • Objective-C (ARC)
  • iPhone / iPad compatible.

Installation

XUI is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'XUI', :git => "https://github.com/Lessica/XUI.git"

Author

Lessica, [email protected]

License

XUI is available under the MIT license. See the LICENSE file for more info.

Related Projects

xui's People

Contributors

lessica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.