-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Splitting the package into modules #6
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more I think about it, the less likely it seems that someone will want not to include one of these two modules, given that we already use both Foundation and UIKit on most of our apps.
It feels more beneficial to divide the existing package into modules by their purpose, not related libraries. Here is my draft on how files can be grouped:
- CellsHelpers - ReusableCell.swift, UICollectionView+extensions.swift, UITableView+extensions.swift
- CollectionsHelpers - Array+extensions.swift, Collection+indexPath
- LayoutHelpers - NSLayoutConstrain+extensions, UILayoutPriority+extensions.swift, UIView+extensions.swift
- UIHelpers - NibInitializable.swift, CACornerMask+extensions.swift,
roundCornersContinuously
method from UIView+extensions.swift
And don't forget to update the tests as well.
Anyway, huge thanks for this initiative and SwiftUI preparations 💯
I don't think dividing by purpose is a great idea. If package is added without Package.swift file (with Xcode build in Package Dependencies tab inside project settings) only way to change selected target's is to delete and add package again, to my knowledge. So, i think, it is better so have as few modules as possible. Modules based on main framework extended in module is a great idea. |
@scaaales Good point about the number of modules. Indeed, we might end up with a ton of them. @DmitriyHolovnia As for the changes I suggested (TLDL, feel free to ignore them): |
@scaaales you can add targets here: |
Splitting makes it possible to use only the necessary modules in the project. There is a plan to add a module for SwiftUI.