2023-05-03 11:06:20 +02:00
== Why is this an issue?
2020-06-30 12:47:33 +02:00
A file that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. This is doubly true for a file with multiple independent classes, extensions, protocols, enumerations or structures. It is strongly advised to define each individual type in separate source file.
2023-05-03 11:06:20 +02:00
=== Exceptions
2020-06-30 12:47:33 +02:00
The case when file contains only class and its extensions is ignored.
2020-06-30 14:49:38 +02:00
2020-06-30 12:47:33 +02:00
----
class MyViewController: UIViewController {
// class stuff here
}
extension MyViewController: UITableViewDataSource {
// table view data source methods
}
extension MyViewController: UIScrollViewDelegate {
// scroll view delegate methods
}
----
2021-06-02 20:44:38 +02:00
2021-06-03 09:05:38 +02:00
ifdef::env-github,rspecator-view[]
2021-09-20 15:38:42 +02:00
'''
== Implementation Specification
(visible only on this page)
2023-05-25 14:18:12 +02:00
=== Message
There are N independent types in this file; move all but one of them to other files.
2021-09-20 15:38:42 +02:00
2021-06-08 15:52:13 +02:00
'''
2021-06-02 20:44:38 +02:00
== Comments And Links
(visible only on this page)
2023-05-25 14:18:12 +02:00
=== on 15 May 2015, 12:38:41 Ann Campbell wrote:
looks good [~elena.vilchik]
2021-06-03 09:05:38 +02:00
endif::env-github,rspecator-view[]