E
E
Emil2020-09-06 17:31:19
Swift
Emil, 2020-09-06 17:31:19

How to create a "draft" of an object in SWIFT?

Good evening everyone.
Please tell me if it is possible to create a blank object, for its further copying, and let's change the text on each of them.
I'm learning about Scroll View, and experimenting with "shaping" its objects. I want to understand how you can create a 1-in object, with all the necessary elements (a picture, a button is allowed on it and a description), and just copy it through the code, changing the text, and its frame.origin.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Cherny, 2020-09-06
@DyadyaEmil

It is necessary for you, most likely, to read the general bases of OOP. The class is your " drawing " of the object. When in another class you create an instance of this class, for example
let myScrollView = MyScrolView()
, now the myScrollView variable points to the actually already created object of the MyScrollView class, you can change the parameters of this variable.

P
Peter Bishop, 2020-09-07
@Peter_Bishop

So create a view in xib, what's the problem. In general, the table view is best suited for lists.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question