UI-based container architecture application methods, devices, and media developed using UIKit

By replacing system components with a custom UI container architecture, the navigation bar is decoupled from business logic, overcoming the limitations of UITabBarController and UINavigationController, achieving flexible UI configuration and simplified interface management, and improving scalability and code readability.

CN117407079BActive Publication Date: 2026-11-17INSPUR SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310802338.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-03
Publication Date
2026-11-17
Estimated Expiration
2043-07-03

AI Technical Summary

Technical Problem

In existing technologies, UITabBarController and UINavigationController have limitations, resulting in strong coupling between UI configuration and business logic, poor scalability, and redundant judgment logic when reading the top of the stack.

Method used

By replacing UITabBarController with XYTabBarController, decoupling the navigation bar from business logic with XYNavigationController, customizing transition animations, using XYNavigationBar to achieve navigation bar diversity, and using XYLaunchManager to uniformly configure different code, the problem of bottom pop-up interfaces not being pushed onto the stack is solved.

Benefits of technology

It decouples UI configuration from business logic, improves scalability, simplifies code reading and writing layers, reduces redundancy in top-level interface logic, and provides flexible navigation bar configuration and unified interface management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117407079B_ABST
    Figure CN117407079B_ABST
Patent Text Reader

Abstract

This invention discloses a UI basic container architecture application method, device, and medium based on UIKit, belonging to the field of UI development technology. The technical problem this invention aims to solve is how to avoid the limitations of UITabBarController and UINavigationController, decouple related UI configurations from business logic, and avoid redundant judgment logic when reading the top-of-stack interface. The technical solution is as follows: A tab bar container class XYTabBarController is used, with API naming and functionality referencing the official documentation. The internal tabBar container is a UIView, and its specific implementation is determined by business logic. A singleton class XYTabBarManager / XYLaunchManager is used to uniformly collect configurations, centralizing different code and improving read / write depth. At runtime, a navigation bar is defined for each interface, decoupling UINavigationController from business logic and increasing the diversity of the navigation bar. The navigation bar uses a delegate protocol to implement business differences. Screen rotation, status bar, and navigation bar background color design are implemented for XYNavigationBar. A custom set of transition animations is used to avoid redundant judgment logic when reading the top-of-stack interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of UI development technology, specifically to a UI basic container architecture application method, device, and medium based on UIKit. Background Technology

[0002] With the rapid development of the internet, various apps affecting people's lives are constantly emerging, and various businesses are intertwined. The templates provided by the system library can no longer cope with the wide range and complexity of business scenarios. Moreover, each time a new app is developed, there is a lot of duplicate code when configuring the UI architecture. In later business development, it is inflexible to use, the configuration code is complex, and it is easy to become coupled with business logic. Currently, the following problems exist:

[0003] ① The UITabBar and UITabBarItem code provided by the system's UITabBarController is not open source, resulting in fixed layout styles. When rewriting or customizing, there is little reference to the official documentation, leading to low extensibility and deep code hierarchies for reading and writing child items. Switching between child tabs easily involves coupling with the in-and-out operations of multiple UINavigationControllers. To achieve specific business interface switching, the configuration code is complex, reducing extensibility.

[0004] ② The system's UINavigationController provides UINavigationBar, UINavigationItem, and stack animations. The code is not open source, and the layout style is fixed. When rewriting or customizing, the size of text and images is limited. When the UINavigationBar is shown or hidden during stack popping, black screen issues can easily occur. Since different interfaces share the same navigation bar, the scalability is extremely poor when different interfaces display navigation bars according to business needs. The code for configuring navigation bars in different interfaces is very prone to coupling and confusion.

[0005] ③ There is no unified standard for configuring UITabBarController, nor is there a unified standard for configuring UINavigationBar events.

[0006] ④ The bottom pop-up interface is not pushed onto the stack, meaning it cannot be managed by UINavigationController. This results in the inability to determine which business interface the user is currently interacting with when network or socket messages arrive.

[0007] Therefore, how to avoid the limitations of UITabBarController and UINavigationController, decouple related UI configurations from business logic, and avoid redundancy in judgment logic when reading the top of the stack is a technical problem that urgently needs to be solved. Summary of the Invention

[0008] The technical objective of this invention is to provide a UI basic container architecture application method, device, and medium based on UIKit to address how to avoid the limitations of UITabBarController and UINavigationController, decouple related UI configurations from business logic, and avoid redundant judgment logic when reading the top of the stack.

[0009] The technical objective of this invention is achieved as follows: a method for applying a UI-based container architecture developed using UIKit, the specific method of which is as follows:

[0010] The system's UITabBarController is replaced by a tab bar container class XYTabBarController. The API naming and functions are based on the official documentation. The tabBar container provided internally is a UIView, and the specific internal implementation is determined by the business logic.

[0011] By using a singleton class XYTabBarManager / XYLaunchManager to uniformly store configurations, the differences in code are centralized, while improving the deep read / write layer problem;

[0012] By defining a navigation bar for each interface at runtime, the UINavigationController is decoupled from the business logic, while also increasing the diversity of the navigation bar.

[0013] The navigation bar (navigationBar) achieves business differentiation through a proxy protocol;

[0014] Design the screen rotation, status bar, and navigation bar background colors through XYNavigationBar;

[0015] By customizing a set of transition animations, the problem of the bottom pop-up interface not being pushed onto the stack is solved, avoiding redundancy in the judgment logic when reading the top of the stack.

[0016] As a preferred option, the custom transition animation is the push / pop, modal / dismiss transition animation of XYNavigationController, which achieves the push / pop, modal / dismiss animation effects; the details are as follows:

[0017] Create a custom XYNavigationController that inherits from UINavigationController and conforms to the transition animation protocol UINavigationControllerDelegate, implements the protocol methods, and configures push, pop, modal, and dismiss animation objects;

[0018] Custom animation objects XYModalTransitionAnimation and XYPushTransitionAnimation inherit from NSObject and conform to the UIViewControllerAnimatedTransitioning protocol. Customize the animation effects, animation duration, and animation transition methods in the corresponding methods.

[0019] The principle of custom transition animations is as follows: when the interface changes direction (push, pop, modal, dismiss), the UINavigationControllerDelegate protocol method implemented by XYNavigationController is called to configure different animation objects for different animations, thereby achieving the effect of transition animation.

[0020] As a preferred option, a navigation bar should be defined for each interface, as follows:

[0021] The system-provided safe zone is used to determine the navigation bar header offset, ensuring that the code can be used without any changes after a new model is released.

[0022] The status bar height is uniformly set to 100 (randomly selected, but always greater than the notch height). By configuring the left and right alignment of the status bar with the left and right sides of the screen respectively, and configuring the dependency relationship between the bottom of the status bar and the top of the safe area, the positioning area of ​​the status bar and the actual part displayed on the screen can be controlled.

[0023] Once the status bar positioning area is fixed, define a container item inside to wrap the user-visible navigation bar sub-items on the navigation bar. Only constrain the height and left and right sides of the container item, and the top constraint depends on the bottom of the status bar to fix the navigation bar area.

[0024] Define layout constraint objects using the third-party library Masonary to simplify code writing and increase code readability;

[0025] The navigation bar items are prioritized as follows: freeView > title > left / nearLeft / right / nearRight. If a value is found in freeView, it is displayed first on the screen, and the subsequent items are displayed in order according to the sub-item array.

[0026] As a preferred option, the screen rotation, status bar, and background color design of the XYNavigationBar are as follows:

[0027] Screen rotation: The XYNavigationBar layout uses the Auto Layout technology introduced in iOS 8.0; when the screen rotates, the system will automatically rotate and lay out the corresponding child items.

[0028] The background color of the status bar and navigation bar is set by using two custom private container items to act as the background of the status bar and navigation bar respectively. An API method for configuring the color is provided externally (publicly), and the implementation can be done internally.

[0029] As a preferred method, the model data and actual graphs in XYLaunchManager are used, as follows:

[0030] Define a custom type XYLaunchRootNode, with the following internal properties:

[0031] ① Create a closure for the controller;

[0032] ② Whether to display the controller's closure;

[0033] Initialize each corresponding XYLaunchRootNode object according to the specific business requirements and store them in an array;

[0034] By iterating through the data in the array, the return values ​​of the controller closure created in XYLaunchRootNode (the views to be displayed) are displayed sequentially.

[0035] Call the public method of XYLaunchManager, showNextController(), on the subview; 1) Remove array elements and iterate through the array again to display them in sequence;

[0036] XYLaunchRootNode provides whether to display the controller's closure. Based on the backend interface data configuration, when iterating through the array, it first checks whether the return value of the controller's closure is true.

[0037] For example:

[0038] A:XYLaunchRootNode(1. Create controller closure {return ad page;} 2. Whether to display closure {return true});

[0039] B:XYLaunchRootNode(1. Create controller closure {return bootstrap page;} 2. Whether to display closure {return true});

[0040] C:XYLaunchRootNode(1. Create controller closure {return privacy policy page;} 2. Whether to display closure {return true});

[0041] D:XYLaunchRootNode(1. Create controller closure {return login page;} 2. Whether to display closure {return true});

[0042] E:XYLaunchRootNode(1. Create controller closure {return tabBar page;} 2. Whether to display closure {return true});

[0043] Upon first installation and startup, the screen will display (ABCDE) in sequence.

[0044] Users are displayed in sequence (ACDE) when they are not logged in;

[0045] When a user logs in automatically, (AE) will be displayed sequentially.

[0046] When a user automatically logs in and upgrades the App, the following will be displayed sequentially (AEB);

[0047] Developers can configure the element order of the array List inside XYLaunchManager according to specific business scenarios to control the view display order; and configure the display of closure return value data according to backend data to control whether the interface needs to be displayed for a specific user (solving the problem of personalized customization at startup).

[0048] Preferably, XYTabBar includes two container items, which are used to store tabBarItem sub-items and to display the bottom notch area;

[0049] The layout design of the container that stores tabItems is as follows: the display order of tabItems is controlled by an array List, and the spacing between items is calculated based on the screen width by fixing the width and height of the items and then laying them out in sequence.

[0050] The visible bottom notch container has the following layout design: by configuring the left and right sides to align with the left and right sides of the screen, the height is 100, and the top and bottom of the safe area are dependent on each other to determine the positioning area of ​​the visible notch area. Of course, with the height set to 100, part of it extends beyond the screen and is not visible to the user.

[0051] When the screen rotates, the layout consistently uses the Auto Layout technology introduced in iOS 8. When the screen rotates, the XYTabBar rotates automatically and the item spacing is stretched.

[0052] As a preferred embodiment, the push and pop operations are as follows:

[0053] The UINavigationController stack manages the lifecycle of the UI, while the UINavigationControllerDelegate controls the animation effects when pushing and popping views from the stack. The UINavigationController stack is actually an array of viewControllers (childViewControllers). When a view is pushed onto the stack, it is placed at the last position of the array; when a view is popped from the stack, it is removed from the array.

[0054] More preferably, this method stores the creation number object in an array, thereby switching the root view design scheme, and first wraps each view to be displayed into an XYLaunchRootNode object, and then wraps it with XYLaunchRootNode.

[0055] An electronic device includes: a memory and at least one processor;

[0056] The memory contains computer programs;

[0057] The at least one processor executes the computer program stored in the memory, causing the at least one processor to perform the UI-based container architecture application method described above.

[0058] A computer-readable storage medium storing a computer program that can be executed by a processor to implement the UI-based container architecture application method described above.

[0059] The UI-based container architecture application method, device, and medium developed in this invention have the following advantages:

[0060] (i) Each business interface of the present invention has its own navigationBar property. With simple configuration, the corresponding business can be realized by implementing the corresponding protocol method.

[0061] (ii) The XYNavigationBar of the present invention achieves transparent background and event interception, providing an entry interface for unified processing of certain business functions;

[0062] (iii) The existing sub-item controls of the XYNavigationBar of the present invention cannot meet business needs. XYNavigationBar provides freeView and related layout callbacks, which developers can fully customize.

[0063] (iv) The present invention provides a full-screen push / pop effect, and modal animation is used during push / pop (the interface after the modal is also uniformly managed by the viewControllers of XYNavigationController);

[0064] (v) The AppDelegate of this invention provides class methods / properties to obtain navigationController, tabBarController, topViewController (top stack controller), and visibleController (user visible controller), avoiding traversal search;

[0065] (vi) This invention sets XYTabBarController as the root controller of XYNavigationController, enabling the App to switch between tab indices across deep interfaces. This avoids the need to return to the bottom of the current NavigationController stack before switching tab indices and pushing the tab into the stack. For example, the tab bar has Home, Products, and My Account. The Home page advertisement page leads to product details, and returning leads to the product brand series page, and then back to the product page in the tab bar.

[0066] (vii) This invention provides a set of app development UI architecture to solve and avoid the limitations of UITabBarController and UINavigationController, and decouple related UI configurations from business logic;

[0067] (viii) This invention provides a tab bar container class XYTabBarController to replace the system's UITabBarController. The API naming and functions are based on the official documentation. The tabBar container provided internally is a UIView, and the specific internal implementation is determined by the business logic.

[0068] (ix) Due to the differences in UI of each app, a lot of configuration code is generated. This invention provides a singleton class XYTabBarManager / XYLaunchManager to uniformly collect configurations, centralize the different code, and improve the problem of deep read and write layers.

[0069] (x) This invention decouples UINavigationController from business logic by defining a navigation bar for each interface at runtime, while increasing the diversity of navigationBar.

[0070] (xi) This invention provides a navigation bar (navigationBar) that achieves business differentiation through a proxy protocol;

[0071] (xii) The present invention also provides a set of transition animations to solve the problem of the bottom pop-up interface not being pushed onto the stack, thus avoiding redundancy in the judgment logic when reading the top of the stack interface. Attached Figure Description

[0072] The invention will be further described below with reference to the accompanying drawings.

[0073] Appendix Figure 1 A flowchart illustrating the application method of UI basic container architecture developed based on UIKit;

[0074] Appendix Figure 2 This is a schematic diagram illustrating the design and layout of the navigation bar, navigation items, and freeView.

[0075] Appendix Figure 3 This is a diagram illustrating a push operation.

[0076] Appendix Figure 4 This is a diagram illustrating the file directory of the XYTabBar.

[0077] Appendix Figure 5 This is a diagram illustrating the file directory of XYNavigation. Detailed Implementation

[0078] The following detailed description of the UI basic container architecture application method, device, and medium based on UIKit development of the present invention is provided with reference to the accompanying drawings and specific embodiments.

[0079] Example 1:

[0080] As attached Figure 1 As shown, this embodiment provides a method for developing a UI basic container architecture application based on UIKit. The method is as follows:

[0081] S1. Replace the system's UITabBarController with a tab bar container class XYTabBarController. Refer to the official documentation for API naming and functionality. The tabBar container provided internally is a UI View, and the specific internal implementation is determined by the business logic.

[0082] S2. By using a singleton class XYTabBarManager / XYLaunchManager to uniformly store configurations, the differences in code are centralized, which also improves the problem of deep read and write layers;

[0083] S3. By defining a navigation bar for each interface at runtime, the UINavigationController is decoupled from the business logic, while increasing the diversity of the navigation bar.

[0084] S4, the navigation bar implements business differentiation through a proxy protocol;

[0085] S5 features screen rotation via XYNavigationBar and background color design for the status bar and navigation bar.

[0086] S6. By customizing a set of transition animations, the problem of the bottom pop-up interface not being pushed onto the stack is solved, avoiding redundancy in the judgment logic when reading the top of the stack.

[0087] In this embodiment, the custom transition animation is the push / pop, modal / dismiss transition animation of XYNavigationController, which implements the push / pop, modal / dismiss animation effects; the details are as follows:

[0088] Create a custom XYNavigationController that inherits from UINavigationController and conforms to the transition animation protocol UINavigationControllerDelegate, implements the protocol methods, and configures push, pop, modal, and dismiss animation objects;

[0089] Custom animation objects XYModalTransitionAnimation and XYPushTransitionAnimation inherit from NSObject and conform to the UIViewControllerAnimatedTransitioning protocol. Customize the animation effects, animation duration, and animation transition methods in the corresponding methods.

[0090] The principle of custom transition animations is as follows: when the interface changes direction (push, pop, modal, dismiss), the UINavigationControllerDelegate protocol method implemented by XYNavigationController is called to configure different animation objects for different animations, thereby achieving the effect of transition animation.

[0091] Among them, transition animation related technologies: After iOS 7, the system opened up relevant transition animation interface protocols. The desired effect can be achieved by implementing these protocol methods.

[0092] Relevant agreements:

[0093] ① Transition Delegate, specific protocols include (1. UINavigationControllerDelegate, UITabBarControllerDelegate, UIViewControllerTransitioningDelegate);

[0094] ② Animation Controller, specifically the UIViewControllerAnimatedTransitioning protocol;

[0095] ③ Interaction Controller, specifically the UIViewControllerInteractiveTransitioning protocol;

[0096] ④ Transition Coordinator.

[0097] As attached Figure 2 As shown in this embodiment, a navigation bar is defined for each interface as follows:

[0098] Instead of the traditional approach (i.e., obtaining the device model and returning the corresponding value based on the device model), we use a safe area provided by the system to determine the offset of the navigation bar header, ensuring that the code can be used without any changes after a new device model is released.

[0099] The status bar height is uniformly set to 100 (randomly selected, but always greater than the notch height). By configuring the left and right alignment of the status bar with the left and right sides of the screen respectively, and configuring the dependency relationship between the bottom of the status bar and the top of the safe area, the positioning area of ​​the status bar and the actual part displayed on the screen can be controlled.

[0100] Once the status bar positioning area is fixed, define a container item inside to wrap the user-visible navigation bar sub-items on the navigation bar. Only constrain the height and left and right sides of the container item, and the top constraint depends on the bottom of the status bar to fix the navigation bar area.

[0101] Define layout constraint objects using the third-party library Masonary to simplify code writing and increase code readability;

[0102] The navigation bar items are prioritized as follows: freeView > title > left / nearLeft / right / nearRight. If a value is found in freeView, it is displayed first on the screen, and the subsequent items are displayed in order according to the sub-item array.

[0103] The reasons for the design and layout of the navigation bar, navigation items, and freeView are as follows:

[0104] ① Status bar (display bar for time, battery, network connection, Bluetooth connection, etc.): Starting with the iPhone X model, the status bar has a notch, and the status bar is taller than before (20pt before iPhone X, 34pt on iPhone X);

[0105] ② The status bar height is inconsistent across different models, resulting in inconsistent top offset of the navigation bar.

[0106] In this embodiment, the screen rotation via XYNavigationBar, the status bar, and the background color design are specifically as follows:

[0107] Screen rotation: The XYNavigationBar layout uses the Auto Layout technology introduced in iOS 8.0; when the screen rotates, the system will automatically rotate and lay out the corresponding child items.

[0108] The background color of the status bar and navigation bar is set by using two custom private container items to act as the background of the status bar and navigation bar respectively. An API method for configuring the color is provided externally (publicly), and the implementation can be done internally.

[0109] In this embodiment, the model data and actual image in XYLaunchManager are used as follows:

[0110] Define a custom type XYLaunchRootNode, with the following internal properties:

[0111] ① Create a closure for the controller;

[0112] ② Whether to display the controller's closure;

[0113] Initialize each corresponding XYLaunchRootNode object according to the specific business requirements and store them in an array;

[0114] By iterating through the data in the array, the return values ​​of the controller closure created in XYLaunchRootNode (the views to be displayed) are displayed sequentially.

[0115] Call the public method of XYLaunchManager, showNextController(), on the subview; 1) Remove array elements and iterate through the array again to display them in sequence;

[0116] XYLaunchRootNode provides whether to display the controller's closure. Based on the backend interface data configuration, when iterating through the array, it first checks whether the return value of the controller's closure is true.

[0117] For example:

[0118] A:XYLaunchRootNode(1. Create controller closure {return ad page;} 2. Whether to display closure {return true});

[0119] B:XYLaunchRootNode(1. Create controller closure {return bootstrap page;} 2. Whether to display closure {return true});

[0120] C:XYLaunchRootNode(1. Create controller closure {return privacy policy page;} 2. Whether to display closure {return true});

[0121] D:XYLaunchRootNode(1. Create controller closure {return login page;} 2. Whether to display closure {return true});

[0122] E:XYLaunchRootNode(1. Create controller closure {return tabBar page;} 2. Whether to display closure {return true});

[0123] Upon first installation and startup, the screen will display (ABCDE) in sequence.

[0124] Users are displayed in sequence (ACDE) when they are not logged in;

[0125] When a user logs in automatically, (AE) will be displayed sequentially.

[0126] When a user automatically logs in and upgrades the App, the following will be displayed sequentially (AEB);

[0127] Developers can configure the element order of the array List inside XYLaunchManager according to specific business scenarios to control the view display order; and configure the display of closure return value data according to backend data to control whether the interface needs to be displayed for a specific user (solving the problem of personalized customization at startup).

[0128] In this embodiment, XYTabBar includes two container items, which are used to store tabBar rItem sub-items and to display the bottom notch area, respectively.

[0129] The layout design of the container that stores tabItems is as follows: the display order of tabItems is controlled by an array List, and the spacing between items is calculated based on the screen width by fixing the width and height of the items and then laying them out in sequence.

[0130] The visible bottom notch container has the following layout design: by configuring the left and right sides to align with the left and right sides of the screen, the height is 100, and the top and bottom of the safe area are dependent on each other to determine the positioning area of ​​the visible notch area. Of course, with the height set to 100, part of it extends beyond the screen and is not visible to the user.

[0131] When the screen rotates, the layout consistently uses the Auto Layout technology introduced in iOS 8. When the screen rotates, the XYTabBar rotates automatically and the item spacing is stretched.

[0132] In this embodiment, the push and pop operations are as follows:

[0133] The UINavigationController stack manages the lifecycle of the UI, while the UINavigationControllerDelegate controls the animation effects when pushing and popping views from the stack. The UINavigationController stack is actually an array of viewControllers (childViewControllers). When a view is pushed onto the stack, it is placed at the last position of the array; when a view is popped from the stack, it is removed from the array.

[0134] As attached Figure 3 As shown, this method stores the creation number object into an array, thereby switching the root view design scheme. Each view to be displayed is first wrapped into an XYLaunchRootNode object, and then wrapped by XYLaunchRootNode.

[0135] The file directory for the XYTabBar in this embodiment is attached. Figure 4 As shown.

[0136] The XYTabBar file directory is used to replace the system's UITabBarController, UITabBar, and UITabBarItem.

[0137] The file directory for XYNavigation in this embodiment is attached. Figure 5 As shown.

[0138] The file directory of XYNavigation is described below:

[0139] ① The Controller includes XYNavigationController and XYViewController, which adopt the integrated system UINavigationController and UIViewController, and can be used as the base class of the project.

[0140] ②Fullpop function: Full-screen transition animation; this part references open-source code.

[0141] ③Modal function: Provides a set of transition animations for bottom pop-up interfaces, enabling unified stack management of bottom pop-up interfaces.

[0142] ④NavBar: This is XYNavigationBar, which replaces the system UINavigationBar navigation bar.

[0143] XYLaunchManager is used to implement the logic for switching the root controller in the APP's main view keyWindow.

[0144] XYTabBarManager is a singleton used to summarize and unify the configuration of XYTabBarController child items.

[0145] Example 3:

[0146] This embodiment also provides an electronic device, including: a memory and at least one processor;

[0147] The memory stores computer-executed instructions;

[0148] The at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to execute the UI basic container architecture application method based on UIKit developed in any embodiment of the present invention.

[0149] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can be a microprocessor or any conventional processor.

[0150] Memory is used to store computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on the use of the terminal, etc. In addition, memory can also include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart memory cards (SMC), secure digital cards (SD cards), flash memory cards, at least one disk storage device, flash memory devices, or other volatile solid-state storage devices.

[0151] Example 4:

[0152] This embodiment also provides a computer-readable storage medium storing multiple instructions, which are loaded by a processor to cause the processor to execute the UI-based container architecture application method developed based on UIKit in any embodiment of the present invention. Specifically, a system or device equipped with a storage medium may be provided, on which software program code implementing the functions of any of the above embodiments is stored, and the computer (or CPU or MPU) of the system or device may read and execute the program code stored in the storage medium.

[0153] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0154] Storage media embodiments for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0155] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0156] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A UI base container architecture application method developed based on UIKit, characterized in that, The method is as follows: The tab bar container class XYTabBarController provides a UIView as its internal tabBar container. By using a singleton class XYTabBarManager / XYLaunchManager to uniformly store configurations, the differences in code are centralized, while improving the deep read / write layer problem; By defining a navigation bar for each interface at runtime, the UINavigationController is decoupled from the business logic, while also increasing the diversity of the navigation bar. The navigation bar (navigationBar) achieves business differentiation through a proxy protocol; Design the screen rotation, status bar, and navigation bar background colors through XYNavigationBar; By customizing a set of transition animations, redundant judgment logic can be avoided when reading the top of the stack. The custom transition animations are the push / pop and modal / dismiss transition animations of XYNavigationController, implementing the push / pop and modal / dismiss animation effects; details are as follows: Create a custom XYNavigationController that inherits from UINavigationController and conforms to the transition animation protocol UINavigationControllerDelegate, implements the protocol methods, and configures push, pop, modal, and dismiss animation objects; Custom animation objects XYModalTransitionAnimation and XYPushTransitionAnimation inherit from NSObject and conform to the UIViewControllerAnimatedTransitioning protocol. Customize the animation effects, animation duration, and animation transition methods in the corresponding methods. The principle of custom transition animations is as follows: when the interface changes direction, the UINavigationControllerDelegate protocol method implemented by XYNavigationController is called to configure different animation objects for different animations, thereby achieving the effect of transition animation. The push and pop operations are as follows: The UINavigationController stack manages the lifecycle of the UI, while the UINavigationControllerDelegate controls the animation effects when pushing and popping views from the stack. The UINavigationController stack is actually an array of viewControllers (childViewControllers). When a view is pushed onto the stack, it is placed at the last position of the array. When a view is popped from the stack, it is removed from the array. 2.The UIKit-based UI base container architecture application method of claim 1, wherein, Assign a navigation bar to each interface as follows: The offset of the navigation bar header is determined using the safe area provided by the system. The status bar height is uniformly set to 100. By configuring the left and right alignment of the status bar with the left and right sides of the screen, and configuring the dependency relationship between the bottom of the status bar and the top of the security area, the positioning area of ​​the status bar and the actual part displayed on the screen can be controlled. Once the status bar positioning area is fixed, define a container item inside to wrap the user-visible navigation bar sub-items on the navigation bar. Only constrain the height and left and right sides of the container item, and the top constraint depends on the bottom of the status bar to fix the navigation bar area. Define layout constraint objects using the third-party library Masonary to simplify code writing and increase code readability; The navigation bar items are designed with the following priority: freeView > title > left / nearLeft / right / nearRight. If a value is found for freeView, it will be displayed first on the screen, and the remaining items will be displayed in order according to the sorting of the sub-item array. 3.The UIKit development-based UI base container architecture application method according to claim 1, wherein, The specific design details regarding screen rotation, status bar, and background color through the XYNavigationBar are as follows: Screen rotation: The XYNavigationBar layout uses the Auto Layout technology introduced in iOS 8.0; when the screen rotates, the system will automatically rotate and lay out the corresponding child items. The background color of the status bar and navigation bar is set by using two custom private container items to act as the background of the status bar and navigation bar respectively. An API method for configuring the color is provided externally, and the implementation can be done internally. 4.The UIKit development-based UI base container architecture application method according to claim 1, wherein, The specific details are as follows, using the model data and actual graphs in XYLaunchManager: Define a custom type XYLaunchRootNode, with the following internal properties: ① Create a closure for the controller; ② Whether to display the controller's closure; Initialize each corresponding XYLaunchRootNode object according to the specific business requirements and store them in an array; By iterating through the data in the array, the return values ​​of the controller closure created in XYLaunchRootNode are displayed sequentially. Call the public method of XYLaunchManager, showNextController(), on the subview to remove array elements and then iterate through the array again to display them in sequence; XYLaunchRootNode provides whether to display the controller's closure. The corresponding data is configured based on the backend interface data. When iterating through the array, it first checks whether the return value of the closure for displaying the controller is true. Developers can configure the element order of the array List inside XYLaunchManager according to specific business scenarios to control the view display order; and configure the display of closure return value data according to backend data to control whether the interface needs to be displayed to a specific user.

5. The UI basic container architecture application method based on UIKit as described in claim 1, characterized in that, XYTabBar includes two container items, one for storing tabBarItem child items and the other for the visible bottom notch area. The layout design of the container that stores tabItems is as follows: the display order of tabBarItems is controlled by an array List, and the spacing between items is calculated based on the screen width by fixing the width and height of the items and then laying them out in sequence. The visible bottom notch container has the following layout design: by configuring the left and right sides to align with the left and right sides of the screen, the height is 100, and the top and bottom of the safe area are dependent on each other to determine the positioning area of ​​the visible notch area. Of course, with the height set to 100, part of it extends beyond the screen and is not visible to the user. When the screen rotates, the layout consistently uses the Auto Layout technology introduced in iOS 8. When the screen rotates, the XYTabBar rotates automatically and the item spacing is stretched.

6. The application method of UI basic container architecture based on UIKit according to any one of claims 1 to 5, characterized in that, This method stores the creation number object into an array, thereby switching the design scheme of the root view. Each view to be displayed is first wrapped into an XYLaunchRootNode object, and then wrapped by XYLaunchRootNode.

7. An electronic device, characterized in that, include: Memory and at least one processor; The memory contains computer programs; The at least one processor executes the computer program stored in the memory, causing the at least one processor to perform the UI-based container architecture application method as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that can be executed by a processor to implement the UI-based container architecture application method developed based on UIKit as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Transition animation realization method and device

    CN107463367A

  • Mobile terminal iOS development view controller interface jump unified management implementation method

    CN115328605A