CN107656729B - List view updating apparatus, method and computer-readable storage medium - Google Patents

List view updating apparatus, method and computer-readable storage medium Download PDF

Info

Publication number
CN107656729B
CN107656729B CN201710774990.8A CN201710774990A CN107656729B CN 107656729 B CN107656729 B CN 107656729B CN 201710774990 A CN201710774990 A CN 201710774990A CN 107656729 B CN107656729 B CN 107656729B
Authority
CN
China
Prior art keywords
class
section
cell
protocol
data model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710774990.8A
Other languages
Chinese (zh)
Other versions
CN107656729A (en
Inventor
宫健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201710774990.8A priority Critical patent/CN107656729B/en
Priority to PCT/CN2017/105015 priority patent/WO2019041441A1/en
Publication of CN107656729A publication Critical patent/CN107656729A/en
Application granted granted Critical
Publication of CN107656729B publication Critical patent/CN107656729B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Abstract

The invention discloses a device for updating a list view in an IOS (input/output system), which comprises a memory and a processor, wherein a list view updating program which can run on the processor is stored in the memory, and the program realizes the following steps when being executed by the processor: when a view updating instruction is received, acquiring class name fields of a cell class and a section class; searching a cell class and a section class corresponding to a class name field from a collection of the cell class and a collection of the section class, wherein the cell class realizes a predefined cell protocol, the section realizes a predefined section protocol, the cell protocol comprises a cell interface in a data source protocol and a cell interface in an agent protocol, and the section protocol comprises a section interface in the data source protocol and a section interface in the agent protocol; and updating the list view according to the found cell class and section class. The invention also provides a method for dynamically updating the list view in the IOS system and a computer readable storage medium. The invention realizes the updating of the interface effect of the list view under the condition of not releasing the client of the new version.

Description

List view updating apparatus, method and computer-readable storage medium
Technical Field
The present invention relates to the field of terminal technologies, and in particular, to a device and a method for updating a list view, and a computer-readable storage medium.
Background
The creation and updating of the list view are often involved in the development of application software of the IOS, when the list view is realized, the list view is realized through a native control UITableView or UICollectionView provided by the IOS system, and after data source information and delete information are provided for the UITableView or the UICollectionView, a corresponding list effect can be realized.
Since the content display unit cell for displaying the list content is provided by a data source (data) and processes the corresponding logic of the corresponding cell in the corresponding agent (delete), in the IOS system, many judgments need to be made in the callback data and delete information to provide different cells for different styles and process the corresponding logic. If the types of the cells related in the list view are many, a large number of logic judgments need to be processed, so that not only is readability and maintainability low, but also all interface implementation methods in the protocol need to be changed after a user changes the requirement to ensure the correctness of the logic, and therefore, if the style of the list view needs to be updated, a new software version needs to be issued to be implemented.
Disclosure of Invention
The invention provides a device and a method for updating a list view and a computer readable storage medium, and mainly aims to update the interface effect of the list view under the condition that a new version of a client is not released.
To achieve the above object, the present invention provides an apparatus for updating a list view in an IOS system, the apparatus including a memory and a processor, the memory storing a list view updating program operable on the processor, the list view updating program when executed by the processor implementing the steps of:
when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, and acquiring class name fields of a cell class and a section class from the data model;
searching a cell class and a section class corresponding to the class name field from a pre-established set of the cell class and a pre-established set of the section class, wherein the cell class realizes a pre-defined cell protocol, the section realizes the pre-defined section protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of the UITableView, and the section protocol comprises the section interface in the data source protocol and the section interface in the proxy protocol;
and updating the list view according to the data model and the cell class and the section class corresponding to the class name field.
Optionally, a cell class and a section class created based on the UITableView are received, where the cell class implements a predefined cell protocol and the section class implements a predefined section protocol;
acquiring a preset general class of a data source and a preset general class of an agent, wherein the general class of the data source comprises an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model;
initializing the cell class and the section class, and assigning the universal class of the data source and the universal class object of the agent to the data source and the agent of the UITableView;
and adding the created cell classes and the created section classes to the collection of the cell classes and the collection of the section classes respectively.
Optionally, the step of updating the list view according to the data model and the cell class and the section class corresponding to the class name field includes:
assembling the data model to obtain a two-dimensional array of the cell data model and a one-dimensional array of the section data model;
and assigning the obtained two-dimensional array of the cell data model and the one-dimensional array of the section data model to the general class of the data source so as to update the list view according to the cell class and the section class corresponding to the class name field.
Optionally, the cell interface includes a cell data source, a location corresponding to the cell, and a list view object; the section interface comprises a section data source, a position corresponding to the section and a list view object.
Optionally, the number of the one-dimensional arrays of the section data model represents the number of sections, the number of the two-dimensional arrays of the cell data model represents the number of sections, and the number of the one-dimensional arrays in each two-dimensional array is equal to the number of cells under the section corresponding to the two-dimensional array.
In addition, to achieve the above object, the present invention further provides a method for dynamically updating a list view in an IOS system, where the method includes:
when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, and acquiring class name fields of a cell class and a section class from the data model;
searching a cell class and a section class corresponding to the class name field from a pre-established set of the cell class and a pre-established set of the section class, wherein the cell class realizes a pre-defined cell protocol, the section realizes the pre-defined section protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of the UITableView, and the section protocol comprises the section interface in the data source protocol and the section interface in the proxy protocol;
and updating the list view according to the data model and the cell class and the section class corresponding to the class name field.
Optionally, the method further comprises:
receiving a cell class and a section class created based on the UITableView, wherein the cell class realizes a predefined cell protocol, and the section class realizes the predefined section protocol;
acquiring a preset general class of a data source and a preset general class of an agent, wherein the general class of the data source comprises an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model;
initializing the cell class and the section class, and assigning the universal class of the data source and the universal class object of the agent to the data source and the agent of the UITableView;
and adding the created cell classes and the created section classes to the collection of the cell classes and the collection of the section classes respectively.
Optionally, the step of updating the list view according to the data model and the cell class and the section class corresponding to the class name field includes:
assembling the data model to obtain a two-dimensional array of the cell data model and a one-dimensional array of the section data model;
and assigning the obtained two-dimensional array of the cell data model and the one-dimensional array of the section data model to the general class of the data source so as to update the list view according to the cell class and the section class corresponding to the class name field.
Optionally, the cell interface includes a cell data source, a location corresponding to the cell, and a list view object; the section interface comprises a section data source, a position corresponding to the section and a list view object.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having a list view update program stored thereon, where the list view update program is executable by at least one processor to implement the steps of the method for dynamically updating a list view in an IOS system as described above.
The device, the method and the computer readable storage medium for updating the list view provided by the invention are characterized in that a set of cell classes and a set of section classes are created in advance, a predefined cell protocol can be realized for the cell classes in the sets, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of UITableView, the section protocol comprises a section interface in the data source protocol and a section interface in the proxy protocol, the interfaces of a data source and a proxy of UITableView are realized in each cell class and section class in the sets, when a view updating instruction is received, a data model corresponding to the view updating instruction is obtained, class name fields of the cell classes and the section classes are obtained from the data model, the cell classes and the section classes corresponding to the class name fields are searched from the sets, and the list view is updated according to the data model and the cell classes and the section classes corresponding to the searched class, the dynamic updating of the interface effect of the list view can be realized without reissuing a new version of the client.
Drawings
FIG. 1 is a diagram of an apparatus for updating a list view in an IOS system according to a preferred embodiment of the present invention;
FIG. 2 is a functional block diagram of a list view update procedure in an embodiment of a device for updating a list view in an IOS system according to the present invention;
FIG. 3 is a flowchart illustrating a method for dynamically updating a list view in an IOS system according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a device for updating a list view in an IOS system. Referring to fig. 1, a schematic diagram of an apparatus for updating a list view in an IOS system according to a preferred embodiment of the present invention is shown.
In this embodiment, the device for updating the list view in the IOS system may be a PC (Personal Computer), or may be a terminal device having a display function, such as a smart phone, a tablet Computer, or a portable Computer.
The updating device of the list view in the IOS system comprises a memory 11, a processor 12, a communication bus 13 and a network interface 14.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the updating means of the list view in the IOS system, for example a hard disk of the updating means of the list view in the IOS system. The memory 11 may also be an external storage device of the update apparatus of the list view in the IOS system in other embodiments, such as a plug-in hard disk provided on the update apparatus of the list view in the IOS system, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 11 may also include both an internal storage unit of the update apparatus of the list view in the IOS system and an external storage device. The memory 11 may be used not only to store application software of a device for updating a list view installed in the IOS system and various kinds of data, such as a code of a list view update program, etc., but also to temporarily store data that has been output or will be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip for executing program codes stored in the memory 11 or Processing data, such as executing a list view update program.
The communication bus 13 is used to realize connection communication between these components.
The network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), typically used to establish a communication link between the apparatus and other electronic devices.
FIG. 1 shows only the means for updating the list view in an IOS system having components 11-14 and a list view update program, but it is to be understood that not all of the shown components are required and that more or fewer components may alternatively be implemented.
Optionally, the device may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is used to display information processed in the updating means of the list view in the IOS system and to display a visualized user interface, among other things.
In the embodiment of the apparatus shown in fig. 1, the memory 11 stores therein a list view update program; the processor 12, when executing the list view update program stored in the memory 11, implements the following steps:
when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, and acquiring class name fields of a cell class and a section class from the data model;
searching a cell class and a section class corresponding to the class name field from a pre-established set of the cell class and a pre-established set of the section class, wherein the cell class realizes a pre-defined cell protocol, the section realizes the pre-defined section protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of the UITableView, and the section protocol comprises the section interface in the data source protocol and the section interface in the proxy protocol;
and updating the list view according to the data model and the cell class and the section class corresponding to the class name field.
The embodiment provides a scheme for realizing the update of the list view in the client without releasing a new client version in the IOS system. In this embodiment, in order to simplify the logical judgment in the list view and implement dynamic update of the list view, a developer defines a cell protocol and a section protocol in advance when developing software, and the cell protocol and the section protocol are used as a predefined cell protocol and a predefined section protocol to be implemented by a subsequently created cell class and a section class.
In this embodiment, a cell protocol is predefined, and includes defining all new interfaces related to a cell in a data source (data) and a proxy (delete) of a list view, where the new interfaces include a cell data source, a location corresponding to the cell, and a list view object; all cell classes implement the protocol. Predefining a section protocol, including defining a data source of a list view and all new interfaces related to the section in an agent, wherein the new interfaces comprise a section data source, a position corresponding to the section and a tableview object; all sections implement the protocol.
A common class (CommonDataSource) of data sources of the UITableView is pre-established. The CommonDataSource contains an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model, and can realize all interfaces of a data source protocol of UITableView. The number of the one-dimensional arrays of the section data model represents the number of sections, the number of the two-dimensional arrays of the cell data model represents the number of sections, and the number of the one-dimensional arrays in each two-dimensional array is equal to the number of cells under the section corresponding to the two-dimensional array.
A common class (CommonDelegate) of the UITableView's proxy is pre-established, which is capable of implementing all interfaces of the UITableView's proxy protocol.
And the user creates a new cell class and a section class according to the required cell style and section style, and the created cell class and section class realize the predefined cell protocol and section protocol.
According to the method, a user can create cell classes and section classes capable of realizing different cell styles and section styles according to needs and add the cell classes and the section classes to a preset set of cell classes and a preset set of section classes.
Optionally, in an embodiment, the method further includes the following steps:
receiving a cell class and a section class created based on the UITableView, wherein the cell class realizes a predefined cell protocol, and the section class realizes the predefined section protocol;
acquiring a preset general class of a data source and a preset general class of an agent, wherein the general class of the data source comprises an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model;
initializing the cell class and the section class, and assigning the universal class of the data source and the universal class object of the agent to the data source and the agent of the UITableView;
and adding the created cell classes and the created section classes to the collection of the cell classes and the collection of the section classes respectively.
The user creates a new cell class and a section class, inherits UITableView, correspondingly assigns common DataSource and common Delegate objects to a data source and a proxy of the UITableView in the initialization of the cell class and the section class, and names each created cell class and section class.
If a user needs to create a new list view, a data model of the list view to be created is obtained, the data model is assembled, a two-dimensional array of the data model of the cell and a one-dimensional array of the section data model are obtained, a proper cell class and a section class are selected from the set according to the cell style and the section style to be displayed, the data model and a class name field of the selected class are bound, the two-dimensional array of the data model of the cell and the one-dimensional array of the section data model are respectively and correspondingly assigned to an initial two-dimensional array and an initial one-dimensional array in the established general class of the data source, the creation of the list view is achieved, and the created list view is the achieved style of the cell class and the section class corresponding to the class name field in the data model.
The method for realizing the cell-related interface in the data source protocol of the UITableView comprises the following steps: the data model of the corresponding cell can be obtained through the two-dimensional array of the cell data model, the corresponding cell class is found through the class name field contained in the data model or the cell object is found through the tablevew object and the indexpath (index path), and then the predefined cell protocol is called. The manner of implementing the section-related interface in the data source protocol of UITableView is as follows: and acquiring a corresponding section data model through the one-dimensional array of the section data model, finding a corresponding section class through a class name field in the data model, and calling a predefined section protocol. In this way, the data source and agent interface of the UITableView is implemented in each cell class and section class in the set. The container containing the list does not need to realize a specific implementation method, so that the problem that a plurality of logic judgments are written in one interface implementation method to process different sections and cells does not occur, and the list view can be updated without releasing a version.
Regarding the manner of implementing the interface related to the cell and the interface related to the section in the proxy protocol of the UITableView, the manner is the same as the manner of implementing the interface related to the cell and the interface related to the section in the data source protocol of the UITableView, and details are not repeated herein.
In this embodiment, if a user wants to modify the style of the list view, if there is no required cell class and section class in the set, it is only necessary to create a new cell class and section class according to the required view style and store the new cell class and section class in the set of cell classes and section class, and remove the originally bound class name field in the data model, bind the newly created class name field of cell class and section class to the data model, and trigger a view update instruction. Or, if the set has the required cell class and section class, only the required cell class and section class are selected, and the class name field is updated and bound to the data model, so as to trigger the view updating instruction.
The device obtains a data model corresponding to a view updating instruction when receiving the view updating instruction, obtains a bound class name field from the data model, searches a cell class and a section corresponding to the class name field from a pre-created set of cell classes and a pre-created set of section classes, and updates a list view according to the data model and the cell class and the section class corresponding to the class name field.
As an embodiment, the step of updating the list view according to the data model and the cell class and the section class corresponding to the class name field includes:
assembling the data model to obtain a two-dimensional array of the cell data model and a one-dimensional array of the section data model;
and assigning the obtained two-dimensional array of the cell data model and the one-dimensional array of the section data model to the general class of the data source so as to update the list view according to the cell class and the section class corresponding to the class name field.
Since the common DataSource and common Delegate objects are correspondingly assigned to the data source and the agent of UITableView in the initialization of the cell class and the section class in the set, the two-dimensional array of the acquired cell data model and the one-dimensional array of the section data model are assigned to the general class of the data source during updating.
The updating device of the list view, which is provided by the invention, is pre-established with a set of cell classes and a set of section classes, the cell classes in the sets can realize a predefined cell protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView, and a cell interface in a proxy protocol of the UITableView, wherein the section protocol comprises a section interface in the data source protocol and a section interface in the proxy protocol, the interfaces of the data source and the proxy of the UITableView are realized in each cell class and section class in the set, when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, acquiring class name fields of a cell class and a section class from the data model, searching the cell class and the section class corresponding to the class name fields from the set, and updating the list view according to the data model and the found cell class and section class, and dynamically updating the interface effect of the list view without re-releasing the client of the new version.
Alternatively, in other embodiments, the list view update program may be divided into one or more modules, and one or more modules are stored in the memory 11 and executed by one or more processors (in this embodiment, the processor 12) to implement the present invention.
Referring to fig. 2, which is a schematic diagram illustrating functional modules of a list view update program in an embodiment of the device for updating a list view according to the present invention, the list view update program may be divided into an obtaining module 10, a searching module 20, and an updating module 30, where:
the acquisition module 10 is configured to: when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, and acquiring class name fields of a cell class and a section class from the data model;
the lookup module 20 is configured to: searching a cell class and a section class corresponding to the class name field from a pre-established set of the cell class and a pre-established set of the section class, wherein the cell class realizes a pre-defined cell protocol, the section realizes the pre-defined section protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of the UITableView, and the section protocol comprises the section interface in the data source protocol and the section interface in the proxy protocol;
the update module 30 is configured to: and updating the list view according to the data model and the cell class and the section class corresponding to the class name field.
In addition, the invention also provides a method for dynamically updating the list view in the IOS system. Referring to fig. 3, a flowchart of a first embodiment of a method for dynamically updating a list view in an IOS system according to the present invention is shown. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the method for dynamically updating a list view in an IOS system includes:
step S10, when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, and acquiring the class name fields of the cell class and the section class from the data model;
step S20, searching a cell class and a section class corresponding to the class name field from a pre-created set of cell classes and a pre-created set of section classes, wherein the cell class realizes a pre-defined cell protocol, the section realizes a pre-defined section protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of UITableView, and the section protocol comprises a section interface in the data source protocol and a section interface in the proxy protocol;
and step S30, updating the list view according to the data model and the cell class and the section class corresponding to the class name field.
The embodiment provides a scheme for realizing the update of the list view in the client without releasing a new client version in the IOS system. In this embodiment, in order to simplify the logical judgment in the list view and implement dynamic update of the list view, a developer defines a cell protocol and a section protocol in advance when developing software, and the cell protocol and the section protocol are used as a predefined cell protocol and a predefined section protocol to be implemented by a subsequently created cell class and a section class.
In this embodiment, a cell protocol is predefined, and includes defining all new interfaces related to a cell in a data source (data) and a proxy (delete) of a list view, where the new interfaces include a cell data source, a location corresponding to the cell, and a list view object; all cell classes implement the protocol. Predefining a section protocol, including defining a data source of a list view and all new interfaces related to the section in an agent, wherein the new interfaces comprise a section data source, a position corresponding to the section and a tableview object; all sections implement the protocol.
A common class (CommonDataSource) of data sources of the UITableView is pre-established. The CommonDataSource contains an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model, and can realize all interfaces of a data source protocol of UITableView. The number of the one-dimensional arrays of the section data model represents the number of sections, the number of the two-dimensional arrays of the cell data model represents the number of sections, and the number of the one-dimensional arrays in each two-dimensional array is equal to the number of cells under the section corresponding to the two-dimensional array.
A common class (CommonDelegate) of the UITableView's proxy is pre-established, which is capable of implementing all interfaces of the UITableView's proxy protocol.
And the user creates a new cell class and a section class according to the required cell style and section style, and the created cell class and section class realize the predefined cell protocol and section protocol.
According to the method, a user can create cell classes and section classes capable of realizing different cell styles and section styles according to needs and add the cell classes and the section classes to a preset set of cell classes and a preset set of section classes.
Optionally, in an embodiment, the processor 12 is further configured to execute the list view updating program to implement the following steps:
receiving a cell class and a section class created based on the UITableView, wherein the cell class realizes a predefined cell protocol, and the section class realizes the predefined section protocol;
acquiring a preset general class of a data source and a preset general class of an agent, wherein the general class of the data source comprises an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model;
initializing the cell class and the section class, and assigning the universal class of the data source and the universal class object of the agent to the data source and the agent of the UITableView;
and adding the created cell classes and the created section classes to the collection of the cell classes and the collection of the section classes respectively.
The user creates a new cell class and a section class, inherits UITableView, correspondingly assigns common DataSource and common Delegate objects to a data source and a proxy of the UITableView in the initialization of the cell class and the section class, and names each created cell class and section class.
If a user needs to create a new list view, a data model of the list view to be created is obtained, the data model is assembled, a two-dimensional array of the data model of the cell and a one-dimensional array of the section data model are obtained, a proper cell class and a section class are selected from the set according to the cell style and the section style to be displayed, the data model and a class name field of the selected class are bound, the two-dimensional array of the data model of the cell and the one-dimensional array of the section data model are respectively and correspondingly assigned to an initial two-dimensional array and an initial one-dimensional array in the established general class of the data source, the creation of the list view is achieved, and the created list view is the achieved style of the cell class and the section class corresponding to the class name field in the data model.
The method for realizing the cell-related interface in the data source protocol of the UITableView comprises the following steps: the data model of the corresponding cell can be obtained through the two-dimensional array of the cell data model, the corresponding cell class is found through the class name field contained in the data model or the cell object is found through the tablevew object and the indexpath (index path), and then the predefined cell protocol is called. The manner of implementing the section-related interface in the data source protocol of UITableView is as follows: and acquiring a corresponding section data model through the one-dimensional array of the section data model, finding a corresponding section class through a class name field in the data model, and calling a predefined section protocol. In this way, the data source and agent interface of the UITableView is implemented in each cell class and section class in the set. The container containing the list does not need to realize a specific implementation method, so that the problem that a plurality of logic judgments are written in one interface implementation method to process different sections and cells does not occur, and the list view can be updated without releasing a version.
Regarding the manner of implementing the interface related to the cell and the interface related to the section in the proxy protocol of the UITableView, the manner is the same as the manner of implementing the interface related to the cell and the interface related to the section in the data source protocol of the UITableView, and details are not repeated herein.
In this embodiment, if a user wants to modify the style of the list view, if there is no required cell class and section class in the set, it is only necessary to create a new cell class and section class according to the required view style and store the new cell class and section class in the set of cell classes and section class, and remove the originally bound class name field in the data model, bind the newly created class name field of cell class and section class to the data model, and trigger a view update instruction. Or, if the set has the required cell class and section class, only the required cell class and section class are selected, and the class name field is updated and bound to the data model, so as to trigger the view updating instruction.
The method comprises the steps that when a view updating instruction is received by a server, a data model corresponding to the view updating instruction is obtained, a bound class name field is obtained from the data model, a cell class and a section corresponding to the class name field are searched from a pre-established set of cell classes and a set of the section class, and a list view is updated according to the data model and the cell class and the section class corresponding to the class name field.
As an embodiment, the step of updating the list view according to the data model and the cell class and the section class corresponding to the class name field includes:
assembling the data model to obtain a two-dimensional array of the cell data model and a one-dimensional array of the section data model;
and assigning the obtained two-dimensional array of the cell data model and the one-dimensional array of the section data model to the general class of the data source so as to update the list view according to the cell class and the section class corresponding to the class name field.
Since the common DataSource and common Delegate objects are correspondingly assigned to the data source and the agent of UITableView in the initialization of the cell class and the section class in the set, the two-dimensional array of the acquired cell data model and the one-dimensional array of the section data model are assigned to the general class of the data source during updating.
The updating method of the list view, which is provided by the invention, is characterized in that a set of cell classes and a set of section classes are created in advance, the cell classes in the sets can realize a predefined cell protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView, and a cell interface in a proxy protocol of the UITableView, wherein the section protocol comprises a section interface in the data source protocol and a section interface in the proxy protocol, the interfaces of the data source and the proxy of the UITableView are realized in each cell class and section class in the set, when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, acquiring class name fields of a cell class and a section class from the data model, searching the cell class and the section class corresponding to the class name fields from the set, and updating the list view according to the data model and the found cell class and section class, and dynamically updating the interface effect of the list view without re-releasing the client of the new version.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a list view update program is stored on the computer-readable storage medium, where the list view update program is executable by at least one processor to implement the following operations:
when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, and acquiring class name fields of a cell class and a section class from the data model;
searching a cell class and a section class corresponding to the class name field from a pre-established set of the cell class and a pre-established set of the section class, wherein the cell class realizes a pre-defined cell protocol, the section realizes the pre-defined section protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of the UITableView, and the section protocol comprises the section interface in the data source protocol and the section interface in the proxy protocol;
and updating the list view according to the data model and the cell class and the section class corresponding to the class name field.
Further, the list view update program when executed by the processor further performs the following operations:
receiving a cell class and a section class created based on the UITableView, wherein the cell class realizes a predefined cell protocol, and the section class realizes the predefined section protocol;
acquiring a preset general class of a data source and a preset general class of an agent, wherein the general class of the data source comprises an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model;
initializing the cell class and the section class, and assigning the universal class of the data source and the universal class object of the agent to the data source and the agent of the UITableView;
and adding the created cell classes and the created section classes to the collection of the cell classes and the collection of the section classes respectively.
Further, the list view update program when executed by the processor further performs the following operations:
assembling the data model to obtain a two-dimensional array of the cell data model and a one-dimensional array of the section data model;
and assigning the obtained two-dimensional array of the cell data model and the one-dimensional array of the section data model to the general class of the data source so as to update the list view according to the cell class and the section class corresponding to the class name field.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (6)

1. An apparatus for updating a list view in an IOS system, the apparatus comprising a memory and a processor, the memory having stored thereon a list view update program operable on the processor, the list view update program when executed by the processor implementing the steps of:
when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, and acquiring class name fields of a cell class and a section class from the data model;
searching a cell class and a section class corresponding to the class name field from a pre-established set of the cell class and a pre-established set of the section class, wherein the cell class realizes a pre-defined cell protocol, the section realizes the pre-defined section protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of the UITableView, and the section protocol comprises the section interface in the data source protocol and the section interface in the proxy protocol;
updating a list view according to the data model and the cell class and the section class corresponding to the class name field;
the processor is further configured to execute the list view update program to implement the steps of:
receiving a cell class and a section class created based on the UITableView, wherein the cell class realizes a predefined cell protocol, and the section class realizes the predefined section protocol;
acquiring a preset general class of a data source and a preset general class of an agent, wherein the general class of the data source comprises an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model;
initializing the cell class and the section class, and assigning the universal class of the data source and the universal class object of the agent to the data source and the agent of the UITableView;
respectively adding the created cell classes and the created section classes into a collection of the cell classes and a collection of the section classes;
the step of updating the list view according to the data model and the cell class and the section class corresponding to the class name field comprises the following steps:
assembling the data model to obtain a two-dimensional array of the cell data model and a one-dimensional array of the section data model;
and assigning the obtained two-dimensional array of the cell data model and the one-dimensional array of the section data model to the general class of the data source so as to update the list view according to the cell class and the section class corresponding to the class name field.
2. The apparatus of claim 1, wherein the cell interface comprises a cell data source, a location corresponding to a cell, and a list view object; the section interface comprises a section data source, a position corresponding to the section and a list view object.
3. The apparatus of claim 1, wherein the number of one-dimensional arrays of the section data model represents the number of sections, the number of two-dimensional arrays of the cell data model represents the number of sections, and the number of one-dimensional arrays in each two-dimensional array is equal to the number of cells under the section corresponding to the two-dimensional array.
4. A method for dynamically updating a list view in an IOS system, the method comprising:
when a view updating instruction is received, acquiring a data model corresponding to the view updating instruction, and acquiring class name fields of a cell class and a section class from the data model;
searching a cell class and a section class corresponding to the class name field from a pre-established set of the cell class and a pre-established set of the section class, wherein the cell class realizes a pre-defined cell protocol, the section realizes the pre-defined section protocol, the cell protocol comprises a cell interface in a data source protocol of UITableView and a cell interface in a proxy protocol of the UITableView, and the section protocol comprises the section interface in the data source protocol and the section interface in the proxy protocol;
updating a list view according to the data model and the cell class and the section class corresponding to the class name field;
the method further comprises the following steps:
receiving a cell class and a section class created based on the UITableView, wherein the cell class realizes a predefined cell protocol, and the section class realizes the predefined section protocol;
acquiring a preset general class of a data source and a preset general class of an agent, wherein the general class of the data source comprises an initial two-dimensional array of a cell data model and an initial one-dimensional array of a section data model;
initializing the cell class and the section class, and assigning the universal class of the data source and the universal class object of the agent to the data source and the agent of the UITableView;
respectively adding the created cell classes and the created section classes into a collection of the cell classes and a collection of the section classes;
the step of updating the list view according to the data model and the cell class and the section class corresponding to the class name field comprises the following steps:
assembling the data model to obtain a two-dimensional array of the cell data model and a one-dimensional array of the section data model;
and assigning the obtained two-dimensional array of the cell data model and the one-dimensional array of the section data model to the general class of the data source so as to update the list view according to the cell class and the section class corresponding to the class name field.
5. The method of claim 4, wherein the cell interface comprises a cell data source, a location corresponding to a cell, and a list view object; the section interface comprises a section data source, a position corresponding to the section and a list view object.
6. A computer-readable storage medium having stored thereon a list view update program executable by at least one processor to perform the steps of the method for dynamic update of a list view in an IOS system of any of claims 4 to 5.
CN201710774990.8A 2017-08-31 2017-08-31 List view updating apparatus, method and computer-readable storage medium Active CN107656729B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710774990.8A CN107656729B (en) 2017-08-31 2017-08-31 List view updating apparatus, method and computer-readable storage medium
PCT/CN2017/105015 WO2019041441A1 (en) 2017-08-31 2017-09-30 Updating device and method for list view and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710774990.8A CN107656729B (en) 2017-08-31 2017-08-31 List view updating apparatus, method and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN107656729A CN107656729A (en) 2018-02-02
CN107656729B true CN107656729B (en) 2020-04-28

Family

ID=61128940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710774990.8A Active CN107656729B (en) 2017-08-31 2017-08-31 List view updating apparatus, method and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN107656729B (en)
WO (1) WO2019041441A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108845803B (en) * 2018-05-23 2022-11-08 北京五八信息技术有限公司 Method, device and equipment for updating list view and storage medium
CN111046206A (en) * 2018-10-12 2020-04-21 武汉斗鱼网络科技有限公司 Head portrait list display method and device, electronic equipment and storage medium
CN109582193B (en) * 2018-11-30 2021-01-29 北京微播视界科技有限公司 Control display method of item cells in list management group and electronic equipment
CN109829124B (en) * 2018-12-28 2021-09-21 浙江口碑网络技术有限公司 Display method and device for list page of client
CN109977164A (en) * 2019-04-01 2019-07-05 时代数媒科技股份有限公司 A kind of mobile terminal list development approach based on data-driven
CN110457084B (en) * 2019-07-10 2021-11-30 五八有限公司 Loading method and device
CN112328255A (en) * 2020-10-26 2021-02-05 成都商通时代数字科技有限公司 Page turning refreshing method and refreshing system for universal integrated list based on IOS (input/output system)
CN113778401A (en) * 2021-01-05 2021-12-10 北京沃东天骏信息技术有限公司 Page generation method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677366A (en) * 2016-02-26 2016-06-15 四川长虹电器股份有限公司 Method for achieving infinite circulating rolling selection based on UITableView in iOS
CN106302008A (en) * 2016-08-05 2017-01-04 腾讯科技(深圳)有限公司 Data-updating method and device
CN106502674A (en) * 2016-10-21 2017-03-15 武汉斗鱼网络科技有限公司 Grid display packing and device in a kind of List View
CN106502656A (en) * 2016-10-09 2017-03-15 武汉斗鱼网络科技有限公司 List View construction method and system in a kind of IOS systems
CN106855794A (en) * 2015-12-08 2017-06-16 平安科技(深圳)有限公司 The data sharing method and system being applied between many objects of IOS

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10291729B2 (en) * 2014-01-21 2019-05-14 Apptimize, Inc. User interface modification and usage tracking
US9721041B2 (en) * 2015-01-21 2017-08-01 Sap Se Configurable data analysis using a configuration model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106855794A (en) * 2015-12-08 2017-06-16 平安科技(深圳)有限公司 The data sharing method and system being applied between many objects of IOS
CN105677366A (en) * 2016-02-26 2016-06-15 四川长虹电器股份有限公司 Method for achieving infinite circulating rolling selection based on UITableView in iOS
CN106302008A (en) * 2016-08-05 2017-01-04 腾讯科技(深圳)有限公司 Data-updating method and device
CN106502656A (en) * 2016-10-09 2017-03-15 武汉斗鱼网络科技有限公司 List View construction method and system in a kind of IOS systems
CN106502674A (en) * 2016-10-21 2017-03-15 武汉斗鱼网络科技有限公司 Grid display packing and device in a kind of List View

Also Published As

Publication number Publication date
WO2019041441A1 (en) 2019-03-07
CN107656729A (en) 2018-02-02

Similar Documents

Publication Publication Date Title
CN107656729B (en) List view updating apparatus, method and computer-readable storage medium
AU2016382741B2 (en) Interface data displaying method and device
CN109358851B (en) Chart component creating method and device and computer-readable storage medium
CN111090437B (en) Application deployment method and device and computer readable storage medium
US9934007B2 (en) Method for operating tool in working environment and machine using such method
CN108762767B (en) Application publishing method, device and computer readable storage medium
CN108874464B (en) Automatic scanning assembly method and device for middleware and storage medium
US20130132422A1 (en) System and method for creating and controlling an application operating on a plurality of computer platform types
CN109669692B (en) Source code sharing method, server, computer readable storage medium and system
WO2020015170A1 (en) Interface invoking method and apparatus, and computer-readable storage medium
CN107679056B (en) Method for generating SQL (structured query language) statement, electronic device and readable storage medium
CN111068328A (en) Game advertisement configuration table generation method, terminal device and medium
CN110941614A (en) Form generation method and device, electronic equipment and computer readable storage medium
US20220237254A1 (en) Page displaying method and device, computer-readable storage medium and electronic device
CN110941779A (en) Page loading method and device, storage medium and electronic equipment
CN108733370B (en) Stylized display method, device, terminal and storage medium of native APP
WO2019071898A1 (en) Electronic device, database query script generation method and storage medium
CN111367518B (en) Page layout method, page layout device, computing equipment and computer storage medium
CN111986553B (en) Method, device and storage medium for map association based on semantic label
CN112083925A (en) Data acquisition method, device, equipment and storage medium based on H5 page development
CN111857881A (en) Repo-based manifest warehouse loading method and device and storage medium
CN104063277A (en) Information processing method and electronic equipment
CN109240660B (en) Access method of advertisement data, storage medium, electronic device and system
CN105119944A (en) Application starting method and related device
CN112104544B (en) Method and device for sending dynamic mail based on Freemarker

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180601

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant after: Shenzhen one ledger Intelligent Technology Co., Ltd.

Address before: 200030 Xuhui District, Shanghai Kai Bin Road 166, 9, 10 level.

Applicant before: Shanghai Financial Technologies Ltd

REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1246880

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant