|
|
|
|
|
by Pulcinella
1833 days ago
|
|
Yeah you would never want to write Swift code professionally like this (at least where I work we don’t). I believe the developer of this said this was intentional (each file encapsulates an entire “app”). A lot of this would be broken out into it’s own file (e.g. extensions on basic types like Arrays would go in Array+Extensions.swift).
Each view would go in its own file.
You would break out code into separate functions instead of inlining it inside closures in the view body. SwiftUI (though not usually Swift in general) does have a problem with over-indentation IMO. You barely have to go more than 3 levels deep in the view hierarchy you are producing before your code feels like more white space than code. |
|