Dynamic Subclassing for CSS-Based Mobile UI Styling
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for styling user interfaces in mobile and web applications require developers to subclass original classes and use appearance proxy objects, leading to increased development burden, code complexity, and reduced portability across platforms.
Innovation Solution
The method employs Objective-C's runtime APIs for dynamic subclassing of user interface elements, allowing for static and dynamic styling and theming without altering original code, using a declarative language like CSS to style elements automatically, regardless of their class hierarchy.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If developers subclass original classes and use appearance proxy objects to style user interface elements, then visual customization capability is improved, but device complexity increases
Solution Approach 1:
The patent introduces a style sheet system as an intermediary layer between visual elements and their styling. Style sheets contain style rules that define visual properties, acting as a mediator that separates style definition from element implementation. This allows visual customization without requiring developers to subclass elements or use complex appearance proxies, thereby reducing code complexity while maintaining customization capability.
2Adaptability or versatility
If developers subclass original classes to apply styling, then visual customization capability is improved, but ease of manufacture deteriorates
Solution Approach 1:
The style sheet system enables visual elements to self-apply styling through automatic style rule matching. Elements are automatically styled by matching their type and attributes against style rules in the style sheet, eliminating the need for developers to manually subclass elements or configure appearance proxies. This self-service mechanism significantly reduces development burden while maintaining full visual customization capability.
3Adaptability or versatility
If appearance proxy objects are used to set properties, then visual customization capability is improved, but ease of operation deteriorates
Solution Approach 1:
The patent extracts style definitions from element implementation code into separate style sheet files. This separation allows styling to be defined independently and applied automatically, eliminating the need for appearance proxy objects and complex property configuration. The extraction of style information into a dedicated system improves code maintainability while preserving visual customization capabilities.
4Adaptability or versatility
If manual subclassing is performed for styling, then visual customization capability is improved, but productivity deteriorates
Solution Approach 1:
The style sheet system automatically matches visual elements with appropriate style rules based on element type and attributes, eliminating the need for manual subclassing operations. This automated style application process significantly increases designer and developer productivity by removing repetitive subclassing tasks while maintaining full visual customization capability through the style rule system.
Data Source
AI summary
A method and system for the dynamic extension (e.g. subclassing) of objects to enable visual styling of on-screen elements is disclosed herein. The present invention allows designers and developers alike to conceive, implement, and modify native mobile interfaces effortlessly and in real time through a familiar CSS-based syntax. The technique of dynamic subclassing for the purpose of styling greatly simplifies the development process by no longer requiring the developer to directly configure visual element's properties or to subclass objects in code.


