O
O
Oleg2021-09-02 10:38:47
Swift
Oleg, 2021-09-02 10:38:47

Swift connoisseurs, how do you deal with a monolith in an application?

I decided to write an application for macOS, iOS.
Prior to that, I had experience in developing for PHP, JAVA (Android)

Class namespace. Habitual thing (files arranged in folders)

java
package com.example.myapplication;
public class MainActivity extends AppCompatActivity{}

php
namespace Antson\IcqBot;
class Client

Easily folds out for reuse later.
The gradle and composer tools will connect the necessary things to the project, even from external repositories, even from the
folder next to it in the project.

In Swift there is no similar for classes? It is necessary to invent unique names to classes?
And how to put things in order in the project?

I need it in a project. Launch under ios. Run under macOS. core. SDK (what is then used in other projects) It would also be good to divide the SDK into parts.

In general, where to read and about what?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Vorobei, 2021-09-02
@ivanvorobei

Look towards local SPM packages . Partially solves the problem.
There are no spaces or anything like that.

B
briahas, 2021-09-02
@briahas

The quick answer is yes. It is necessary to create unique file names yourself (folders - only for the human convenience of perceiving the project). Because then - all the files will fall into one pile called a bundle. This bundle will then be signed, archived and distributed. If you later open the bundle as an archive, you will see all project files in the same folder, so the file name is unique.
And about the "monolith" - if you want to take out some functionality from the current project, for reuse, then - take it out to subs (libs) and connect it (functionality in the form of a lib) to the project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question