Closed kostiakoval closed 9 years ago
One of the solution to merge natalie.swift would be run script before building it. Would be very useful for development.
cat a.swift b.swift > natalie.swift
Two way for Reusable
1 - print all stuff about UICollectionViewController
and UITableViewController
after calling processViewControllers
(which know if reuseIdentifier has been detected)
2 - detect if there is a not empty "reuseIdentifier" attribute with something like that
let noReusable = [Reusable]()
let reusables = storyboards.flatMap{
$0.storyboard?.scenes.flatMap{
$0.viewController?.reusables?.filter{
return $0.reuseIdentifier != nil
} ?? noReusable
} ?? noReusable
}
let hasReusable = !reusables.isEmpty
yes If we want to develop in separate files and want to concatenate all files in natalies.swift we can use a script like this https://github.com/evgenyneu/moa/blob/master/scripts/concatenate_swift_files.sh
In PR #47
@kostiakoval have you seen other codes to not print ? If none, this issue could be closed after PR #47 merge? (maybe we can discuss about split files elsewhere like in #43)
Why the whole "ReusableProtocol" is out in this PR ?
ReusableProtocol describe what is already in UIKit. It's good to have it around with extensions, no matter if Natalie generated something reusable or not.
I think this change is unnecessary.
UICollectionViewController and UITableViewController extension is generated even when they are not used in the application. The code should be generated only when they are used. It would make code cleaner.
Steps :
The files contains 145 lines of code.
I see 2 improvements: