From cff910888698a7eac5ac77e3dc120de47402ff2e Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 15 Nov 2022 10:03:09 +1300 Subject: [PATCH 1/3] Use Swift Package Manager's folder structure --- Package.swift | 39 ++---------------- .../BottomSheetAnimationController.swift | 0 .../BottomSheetViewController.swift | 0 .../DrawerPresentationController.swift | 0 .../WordPressUI}/BottomSheet/GripButton.swift | 0 .../Constants/UIKitConstants.swift | 0 .../UIBarButtonItem+BlockEvents.swift | 0 .../BlockEvents/UIControl+BlockEvents.swift | 0 .../UIGestureRecognizer+BlockEvents.swift | 0 .../CGAffineTransform+Helpers.swift | 0 .../Extensions/Gravatar/Gravatar.swift | 0 .../Extensions/NSBundle+ResourceBundle.swift | 0 .../NSMutableAttributedString+Helpers.swift | 0 .../UIAlertController+Helpers.swift | 0 .../Extensions/UIControl+Helpers.swift | 0 .../Extensions/UIDevice+Helpers.swift | 0 .../Extensions/UIImage+Assets.swift | 0 .../Extensions/UIImage+Crop.swift | 0 .../Extensions/UIImage+Rotation.swift | 0 .../Extensions/UIImage+Tint.swift | 0 .../Extensions/UIImageView+Blavatar.swift | 0 .../Extensions/UIImageView+Gravatar.swift | 3 +- .../Extensions/UIImageView+Networking.swift | 2 +- .../Extensions/UITableView+Helpers.swift | 0 .../UITableViewController+Helpers.swift | 0 .../Extensions/UITextField+TextHelper.swift | 0 .../Extensions/UIView+Animations.swift | 0 .../Extensions/UIView+Helpers.swift | 0 ...UIViewController+ChildViewController.swift | 0 .../Extensions/UIViewController+Helpers.swift | 0 .../Extensions/UIWindow+Helpers.swift | 0 .../FancyAlertPresentationController.swift | 0 .../FancyAlert/FancyAlertView.swift | 0 .../FancyAlert/FancyAlertViewController.swift | 0 .../WordPressUI}/FancyAlert/FancyButton.swift | 0 .../FlingableView/FlingableViewHandler.swift | 0 .../WordPressUI}/Ghosts/GhostOptions.swift | 0 .../WordPressUI}/Ghosts/GhostStyle.swift | 0 .../WordPressUI}/Ghosts/GhostableView.swift | 0 .../Ghosts/Internal/GhostAnimation.swift | 0 .../Internal/GhostCollectionViewHandler.swift | 0 .../Ghosts/Internal/GhostLayer.swift | 0 .../Internal/GhostTableViewHandler.swift | 0 .../Ghosts/Internal/UIView+InnerGhost.swift | 0 .../Ghosts/UICollectionView+Ghost.swift | 0 .../Ghosts/UITableView+Ghost.swift | 0 .../WordPressUI}/Ghosts/UIView+Ghost.swift | 0 .../Resources/Assets.xcassets/Contents.json | 0 .../blavatar.imageset/Contents.json | 0 .../blavatar.imageset/blavatar-default.pdf | Bin .../gravatar.imageset/Contents.json | 0 .../gravatar.imageset/gravatar.pdf | Bin .../icon-url-field.imageset/Contents.json | 0 .../icon-url-field.pdf | Bin .../Resources}/FancyAlerts.storyboard | 0 Sources/WordPressUI/Tools/Exports.swift | 3 ++ .../WordPressUI}/Tools/GradientView.swift | 0 ...otationAwareNavigationViewController.swift | 0 .../Categories/UIColor+Helpers.h | 0 .../Categories/UIColor+Helpers.m | 0 .../Categories/UIImage+Resize.h | 0 .../Categories/UIImage+Resize.m | 0 .../Categories/UIImage+Util.h | 0 .../Categories/UIImage+Util.m | 0 .../Categories/UILabel+SuggestSize.h | 0 .../Categories/UILabel+SuggestSize.m | 0 .../Extensions}/NSString+Gravatar.h | 0 .../Extensions}/NSString+Gravatar.m | 0 .../include/NSString+Gravatar.h | 1 + .../WordPressUIObjC/include/UIColor+Helpers.h | 1 + .../WordPressUIObjC/include/UIImage+Resize.h | 1 + .../WordPressUIObjC/include/UIImage+Util.h | 1 + .../include/UILabel+SuggestSize.h | 1 + .../BottomSheetViewControllerTests.swift | 0 .../Extensions/GravatarTest.swift | 0 .../Extensions/ResourcesBundleTests.swift | 0 .../Extensions/UIColorHelpersTests.swift | 0 .../UIView+AutoLayoutHelperTests.swift | 0 .../UIView+ChangeLayoutMarginsTests.swift | 0 .../UIViewControllerHelperTest.swift | 0 .../Ghosts/UITableView+GhostTests.swift | 0 .../Ghosts/UIView+GhostTests.swift | 0 WordPressUI.podspec | 9 ++-- WordPressUI/Info.plist | 24 ----------- WordPressUI/Tools/Exports.swift | 5 --- WordPressUI/WordPressUI.h | 16 ------- WordPressUITests/Info.plist | 22 ---------- 87 files changed, 18 insertions(+), 110 deletions(-) rename {WordPressUI => Sources/WordPressUI}/BottomSheet/BottomSheetAnimationController.swift (100%) rename {WordPressUI => Sources/WordPressUI}/BottomSheet/BottomSheetViewController.swift (100%) rename {WordPressUI => Sources/WordPressUI}/BottomSheet/DrawerPresentationController.swift (100%) rename {WordPressUI => Sources/WordPressUI}/BottomSheet/GripButton.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Constants/UIKitConstants.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/BlockEvents/UIBarButtonItem+BlockEvents.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/BlockEvents/UIControl+BlockEvents.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/BlockEvents/UIGestureRecognizer+BlockEvents.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/CGAffineTransform+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/Gravatar/Gravatar.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/NSBundle+ResourceBundle.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/NSMutableAttributedString+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIAlertController+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIControl+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIDevice+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIImage+Assets.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIImage+Crop.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIImage+Rotation.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIImage+Tint.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIImageView+Blavatar.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIImageView+Gravatar.swift (99%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIImageView+Networking.swift (99%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UITableView+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UITableViewController+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UITextField+TextHelper.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIView+Animations.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIView+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIViewController+ChildViewController.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIViewController+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Extensions/UIWindow+Helpers.swift (100%) rename {WordPressUI => Sources/WordPressUI}/FancyAlert/FancyAlertPresentationController.swift (100%) rename {WordPressUI => Sources/WordPressUI}/FancyAlert/FancyAlertView.swift (100%) rename {WordPressUI => Sources/WordPressUI}/FancyAlert/FancyAlertViewController.swift (100%) rename {WordPressUI => Sources/WordPressUI}/FancyAlert/FancyButton.swift (100%) rename {WordPressUI => Sources/WordPressUI}/FlingableView/FlingableViewHandler.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/GhostOptions.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/GhostStyle.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/GhostableView.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/Internal/GhostAnimation.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/Internal/GhostCollectionViewHandler.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/Internal/GhostLayer.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/Internal/GhostTableViewHandler.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/Internal/UIView+InnerGhost.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/UICollectionView+Ghost.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/UITableView+Ghost.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Ghosts/UIView+Ghost.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Resources/Assets.xcassets/Contents.json (100%) rename {WordPressUI => Sources/WordPressUI}/Resources/Assets.xcassets/blavatar.imageset/Contents.json (100%) rename {WordPressUI => Sources/WordPressUI}/Resources/Assets.xcassets/blavatar.imageset/blavatar-default.pdf (100%) rename {WordPressUI => Sources/WordPressUI}/Resources/Assets.xcassets/gravatar.imageset/Contents.json (100%) rename {WordPressUI => Sources/WordPressUI}/Resources/Assets.xcassets/gravatar.imageset/gravatar.pdf (100%) rename {WordPressUI => Sources/WordPressUI}/Resources/Assets.xcassets/icon-url-field.imageset/Contents.json (100%) rename {WordPressUI => Sources/WordPressUI}/Resources/Assets.xcassets/icon-url-field.imageset/icon-url-field.pdf (100%) rename {WordPressUI/FancyAlert => Sources/WordPressUI/Resources}/FancyAlerts.storyboard (100%) create mode 100644 Sources/WordPressUI/Tools/Exports.swift rename {WordPressUI => Sources/WordPressUI}/Tools/GradientView.swift (100%) rename {WordPressUI => Sources/WordPressUI}/Tools/RotationAwareNavigationViewController.swift (100%) rename {WordPressUI => Sources/WordPressUIObjC}/Categories/UIColor+Helpers.h (100%) rename {WordPressUI => Sources/WordPressUIObjC}/Categories/UIColor+Helpers.m (100%) rename {WordPressUI => Sources/WordPressUIObjC}/Categories/UIImage+Resize.h (100%) rename {WordPressUI => Sources/WordPressUIObjC}/Categories/UIImage+Resize.m (100%) rename {WordPressUI => Sources/WordPressUIObjC}/Categories/UIImage+Util.h (100%) rename {WordPressUI => Sources/WordPressUIObjC}/Categories/UIImage+Util.m (100%) rename {WordPressUI => Sources/WordPressUIObjC}/Categories/UILabel+SuggestSize.h (100%) rename {WordPressUI => Sources/WordPressUIObjC}/Categories/UILabel+SuggestSize.m (100%) rename {WordPressUI/Extensions/Gravatar => Sources/WordPressUIObjC/Extensions}/NSString+Gravatar.h (100%) rename {WordPressUI/Extensions/Gravatar => Sources/WordPressUIObjC/Extensions}/NSString+Gravatar.m (100%) create mode 120000 Sources/WordPressUIObjC/include/NSString+Gravatar.h create mode 120000 Sources/WordPressUIObjC/include/UIColor+Helpers.h create mode 120000 Sources/WordPressUIObjC/include/UIImage+Resize.h create mode 120000 Sources/WordPressUIObjC/include/UIImage+Util.h create mode 120000 Sources/WordPressUIObjC/include/UILabel+SuggestSize.h rename {WordPressUITests => Tests/WordPressUITests}/BottomSheet/BottomSheetViewControllerTests.swift (100%) rename {WordPressUITests => Tests/WordPressUITests}/Extensions/GravatarTest.swift (100%) rename {WordPressUITests => Tests/WordPressUITests}/Extensions/ResourcesBundleTests.swift (100%) rename {WordPressUITests => Tests/WordPressUITests}/Extensions/UIColorHelpersTests.swift (100%) rename {WordPressUITests => Tests/WordPressUITests}/Extensions/UIView+AutoLayoutHelperTests.swift (100%) rename {WordPressUITests => Tests/WordPressUITests}/Extensions/UIView+ChangeLayoutMarginsTests.swift (100%) rename {WordPressUITests => Tests/WordPressUITests}/Extensions/UIViewControllerHelperTest.swift (100%) rename {WordPressUITests => Tests/WordPressUITests}/Ghosts/UITableView+GhostTests.swift (100%) rename {WordPressUITests => Tests/WordPressUITests}/Ghosts/UIView+GhostTests.swift (100%) delete mode 100644 WordPressUI/Info.plist delete mode 100644 WordPressUI/Tools/Exports.swift delete mode 100644 WordPressUI/WordPressUI.h delete mode 100644 WordPressUITests/Info.plist diff --git a/Package.swift b/Package.swift index cc8c5a7..a0f5369 100644 --- a/Package.swift +++ b/Package.swift @@ -9,54 +9,23 @@ let package = Package( .library( name: "WordPressUI", targets: [ - "WordPressUIGravatar", - "WordPressUIGravatarObjC", - "WordPressUIObjCCategories", + "WordPressUIObjC", "WordPressUI", ] ) ], dependencies: [], targets: [ - .target( - name: "WordPressUIGravatar", - path: "WordPressUI/Extensions/Gravatar", - sources: ["Gravatar.swift"] - ), - .target( - name: "WordPressUIGravatarObjC", - path: "WordPressUI/Extensions/Gravatar", - exclude: ["Gravatar.swift"], - publicHeadersPath: "." - ), - .target( - name: "WordPressUIObjCCategories", - path: "WordPressUI/Categories", - publicHeadersPath: "." - ), + .target(name: "WordPressUIObjC"), .target( name: "WordPressUI", dependencies: [ - .target(name: "WordPressUIGravatar"), - .target(name: "WordPressUIGravatarObjC"), - .target(name: "WordPressUIObjCCategories"), - ], - path: "WordPressUI", - exclude: [ - "WordPressUI.h", - "Extensions/Gravatar", - "Categories" - ], - resources: [ - .process("Resources"), - .process("FancyAlert/FancyAlerts.storyboard") + .target(name: "WordPressUIObjC"), ] ), .testTarget( name: "WordPressUITests", - dependencies: [.target(name: "WordPressUI")], - path: "WordPressUITests", - exclude: ["Info.plist"] + dependencies: [.target(name: "WordPressUI")] ), ] ) diff --git a/WordPressUI/BottomSheet/BottomSheetAnimationController.swift b/Sources/WordPressUI/BottomSheet/BottomSheetAnimationController.swift similarity index 100% rename from WordPressUI/BottomSheet/BottomSheetAnimationController.swift rename to Sources/WordPressUI/BottomSheet/BottomSheetAnimationController.swift diff --git a/WordPressUI/BottomSheet/BottomSheetViewController.swift b/Sources/WordPressUI/BottomSheet/BottomSheetViewController.swift similarity index 100% rename from WordPressUI/BottomSheet/BottomSheetViewController.swift rename to Sources/WordPressUI/BottomSheet/BottomSheetViewController.swift diff --git a/WordPressUI/BottomSheet/DrawerPresentationController.swift b/Sources/WordPressUI/BottomSheet/DrawerPresentationController.swift similarity index 100% rename from WordPressUI/BottomSheet/DrawerPresentationController.swift rename to Sources/WordPressUI/BottomSheet/DrawerPresentationController.swift diff --git a/WordPressUI/BottomSheet/GripButton.swift b/Sources/WordPressUI/BottomSheet/GripButton.swift similarity index 100% rename from WordPressUI/BottomSheet/GripButton.swift rename to Sources/WordPressUI/BottomSheet/GripButton.swift diff --git a/WordPressUI/Constants/UIKitConstants.swift b/Sources/WordPressUI/Constants/UIKitConstants.swift similarity index 100% rename from WordPressUI/Constants/UIKitConstants.swift rename to Sources/WordPressUI/Constants/UIKitConstants.swift diff --git a/WordPressUI/Extensions/BlockEvents/UIBarButtonItem+BlockEvents.swift b/Sources/WordPressUI/Extensions/BlockEvents/UIBarButtonItem+BlockEvents.swift similarity index 100% rename from WordPressUI/Extensions/BlockEvents/UIBarButtonItem+BlockEvents.swift rename to Sources/WordPressUI/Extensions/BlockEvents/UIBarButtonItem+BlockEvents.swift diff --git a/WordPressUI/Extensions/BlockEvents/UIControl+BlockEvents.swift b/Sources/WordPressUI/Extensions/BlockEvents/UIControl+BlockEvents.swift similarity index 100% rename from WordPressUI/Extensions/BlockEvents/UIControl+BlockEvents.swift rename to Sources/WordPressUI/Extensions/BlockEvents/UIControl+BlockEvents.swift diff --git a/WordPressUI/Extensions/BlockEvents/UIGestureRecognizer+BlockEvents.swift b/Sources/WordPressUI/Extensions/BlockEvents/UIGestureRecognizer+BlockEvents.swift similarity index 100% rename from WordPressUI/Extensions/BlockEvents/UIGestureRecognizer+BlockEvents.swift rename to Sources/WordPressUI/Extensions/BlockEvents/UIGestureRecognizer+BlockEvents.swift diff --git a/WordPressUI/Extensions/CGAffineTransform+Helpers.swift b/Sources/WordPressUI/Extensions/CGAffineTransform+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/CGAffineTransform+Helpers.swift rename to Sources/WordPressUI/Extensions/CGAffineTransform+Helpers.swift diff --git a/WordPressUI/Extensions/Gravatar/Gravatar.swift b/Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift similarity index 100% rename from WordPressUI/Extensions/Gravatar/Gravatar.swift rename to Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift diff --git a/WordPressUI/Extensions/NSBundle+ResourceBundle.swift b/Sources/WordPressUI/Extensions/NSBundle+ResourceBundle.swift similarity index 100% rename from WordPressUI/Extensions/NSBundle+ResourceBundle.swift rename to Sources/WordPressUI/Extensions/NSBundle+ResourceBundle.swift diff --git a/WordPressUI/Extensions/NSMutableAttributedString+Helpers.swift b/Sources/WordPressUI/Extensions/NSMutableAttributedString+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/NSMutableAttributedString+Helpers.swift rename to Sources/WordPressUI/Extensions/NSMutableAttributedString+Helpers.swift diff --git a/WordPressUI/Extensions/UIAlertController+Helpers.swift b/Sources/WordPressUI/Extensions/UIAlertController+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/UIAlertController+Helpers.swift rename to Sources/WordPressUI/Extensions/UIAlertController+Helpers.swift diff --git a/WordPressUI/Extensions/UIControl+Helpers.swift b/Sources/WordPressUI/Extensions/UIControl+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/UIControl+Helpers.swift rename to Sources/WordPressUI/Extensions/UIControl+Helpers.swift diff --git a/WordPressUI/Extensions/UIDevice+Helpers.swift b/Sources/WordPressUI/Extensions/UIDevice+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/UIDevice+Helpers.swift rename to Sources/WordPressUI/Extensions/UIDevice+Helpers.swift diff --git a/WordPressUI/Extensions/UIImage+Assets.swift b/Sources/WordPressUI/Extensions/UIImage+Assets.swift similarity index 100% rename from WordPressUI/Extensions/UIImage+Assets.swift rename to Sources/WordPressUI/Extensions/UIImage+Assets.swift diff --git a/WordPressUI/Extensions/UIImage+Crop.swift b/Sources/WordPressUI/Extensions/UIImage+Crop.swift similarity index 100% rename from WordPressUI/Extensions/UIImage+Crop.swift rename to Sources/WordPressUI/Extensions/UIImage+Crop.swift diff --git a/WordPressUI/Extensions/UIImage+Rotation.swift b/Sources/WordPressUI/Extensions/UIImage+Rotation.swift similarity index 100% rename from WordPressUI/Extensions/UIImage+Rotation.swift rename to Sources/WordPressUI/Extensions/UIImage+Rotation.swift diff --git a/WordPressUI/Extensions/UIImage+Tint.swift b/Sources/WordPressUI/Extensions/UIImage+Tint.swift similarity index 100% rename from WordPressUI/Extensions/UIImage+Tint.swift rename to Sources/WordPressUI/Extensions/UIImage+Tint.swift diff --git a/WordPressUI/Extensions/UIImageView+Blavatar.swift b/Sources/WordPressUI/Extensions/UIImageView+Blavatar.swift similarity index 100% rename from WordPressUI/Extensions/UIImageView+Blavatar.swift rename to Sources/WordPressUI/Extensions/UIImageView+Blavatar.swift diff --git a/WordPressUI/Extensions/UIImageView+Gravatar.swift b/Sources/WordPressUI/Extensions/UIImageView+Gravatar.swift similarity index 99% rename from WordPressUI/Extensions/UIImageView+Gravatar.swift rename to Sources/WordPressUI/Extensions/UIImageView+Gravatar.swift index 3824145..9f44a86 100644 --- a/WordPressUI/Extensions/UIImageView+Gravatar.swift +++ b/Sources/WordPressUI/Extensions/UIImageView+Gravatar.swift @@ -2,8 +2,7 @@ import Foundation import UIKit #if SWIFT_PACKAGE -import WordPressUIGravatar -import WordPressUIGravatarObjC +import WordPressUIObjC #endif /// Wrapper class used to ensure removeObserver is called diff --git a/WordPressUI/Extensions/UIImageView+Networking.swift b/Sources/WordPressUI/Extensions/UIImageView+Networking.swift similarity index 99% rename from WordPressUI/Extensions/UIImageView+Networking.swift rename to Sources/WordPressUI/Extensions/UIImageView+Networking.swift index 2f7a98f..d76ed5e 100644 --- a/WordPressUI/Extensions/UIImageView+Networking.swift +++ b/Sources/WordPressUI/Extensions/UIImageView+Networking.swift @@ -2,7 +2,7 @@ import Foundation import UIKit #if SWIFT_PACKAGE -import WordPressUIObjCCategories +import WordPressUIObjC #endif public extension UIImageView { diff --git a/WordPressUI/Extensions/UITableView+Helpers.swift b/Sources/WordPressUI/Extensions/UITableView+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/UITableView+Helpers.swift rename to Sources/WordPressUI/Extensions/UITableView+Helpers.swift diff --git a/WordPressUI/Extensions/UITableViewController+Helpers.swift b/Sources/WordPressUI/Extensions/UITableViewController+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/UITableViewController+Helpers.swift rename to Sources/WordPressUI/Extensions/UITableViewController+Helpers.swift diff --git a/WordPressUI/Extensions/UITextField+TextHelper.swift b/Sources/WordPressUI/Extensions/UITextField+TextHelper.swift similarity index 100% rename from WordPressUI/Extensions/UITextField+TextHelper.swift rename to Sources/WordPressUI/Extensions/UITextField+TextHelper.swift diff --git a/WordPressUI/Extensions/UIView+Animations.swift b/Sources/WordPressUI/Extensions/UIView+Animations.swift similarity index 100% rename from WordPressUI/Extensions/UIView+Animations.swift rename to Sources/WordPressUI/Extensions/UIView+Animations.swift diff --git a/WordPressUI/Extensions/UIView+Helpers.swift b/Sources/WordPressUI/Extensions/UIView+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/UIView+Helpers.swift rename to Sources/WordPressUI/Extensions/UIView+Helpers.swift diff --git a/WordPressUI/Extensions/UIViewController+ChildViewController.swift b/Sources/WordPressUI/Extensions/UIViewController+ChildViewController.swift similarity index 100% rename from WordPressUI/Extensions/UIViewController+ChildViewController.swift rename to Sources/WordPressUI/Extensions/UIViewController+ChildViewController.swift diff --git a/WordPressUI/Extensions/UIViewController+Helpers.swift b/Sources/WordPressUI/Extensions/UIViewController+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/UIViewController+Helpers.swift rename to Sources/WordPressUI/Extensions/UIViewController+Helpers.swift diff --git a/WordPressUI/Extensions/UIWindow+Helpers.swift b/Sources/WordPressUI/Extensions/UIWindow+Helpers.swift similarity index 100% rename from WordPressUI/Extensions/UIWindow+Helpers.swift rename to Sources/WordPressUI/Extensions/UIWindow+Helpers.swift diff --git a/WordPressUI/FancyAlert/FancyAlertPresentationController.swift b/Sources/WordPressUI/FancyAlert/FancyAlertPresentationController.swift similarity index 100% rename from WordPressUI/FancyAlert/FancyAlertPresentationController.swift rename to Sources/WordPressUI/FancyAlert/FancyAlertPresentationController.swift diff --git a/WordPressUI/FancyAlert/FancyAlertView.swift b/Sources/WordPressUI/FancyAlert/FancyAlertView.swift similarity index 100% rename from WordPressUI/FancyAlert/FancyAlertView.swift rename to Sources/WordPressUI/FancyAlert/FancyAlertView.swift diff --git a/WordPressUI/FancyAlert/FancyAlertViewController.swift b/Sources/WordPressUI/FancyAlert/FancyAlertViewController.swift similarity index 100% rename from WordPressUI/FancyAlert/FancyAlertViewController.swift rename to Sources/WordPressUI/FancyAlert/FancyAlertViewController.swift diff --git a/WordPressUI/FancyAlert/FancyButton.swift b/Sources/WordPressUI/FancyAlert/FancyButton.swift similarity index 100% rename from WordPressUI/FancyAlert/FancyButton.swift rename to Sources/WordPressUI/FancyAlert/FancyButton.swift diff --git a/WordPressUI/FlingableView/FlingableViewHandler.swift b/Sources/WordPressUI/FlingableView/FlingableViewHandler.swift similarity index 100% rename from WordPressUI/FlingableView/FlingableViewHandler.swift rename to Sources/WordPressUI/FlingableView/FlingableViewHandler.swift diff --git a/WordPressUI/Ghosts/GhostOptions.swift b/Sources/WordPressUI/Ghosts/GhostOptions.swift similarity index 100% rename from WordPressUI/Ghosts/GhostOptions.swift rename to Sources/WordPressUI/Ghosts/GhostOptions.swift diff --git a/WordPressUI/Ghosts/GhostStyle.swift b/Sources/WordPressUI/Ghosts/GhostStyle.swift similarity index 100% rename from WordPressUI/Ghosts/GhostStyle.swift rename to Sources/WordPressUI/Ghosts/GhostStyle.swift diff --git a/WordPressUI/Ghosts/GhostableView.swift b/Sources/WordPressUI/Ghosts/GhostableView.swift similarity index 100% rename from WordPressUI/Ghosts/GhostableView.swift rename to Sources/WordPressUI/Ghosts/GhostableView.swift diff --git a/WordPressUI/Ghosts/Internal/GhostAnimation.swift b/Sources/WordPressUI/Ghosts/Internal/GhostAnimation.swift similarity index 100% rename from WordPressUI/Ghosts/Internal/GhostAnimation.swift rename to Sources/WordPressUI/Ghosts/Internal/GhostAnimation.swift diff --git a/WordPressUI/Ghosts/Internal/GhostCollectionViewHandler.swift b/Sources/WordPressUI/Ghosts/Internal/GhostCollectionViewHandler.swift similarity index 100% rename from WordPressUI/Ghosts/Internal/GhostCollectionViewHandler.swift rename to Sources/WordPressUI/Ghosts/Internal/GhostCollectionViewHandler.swift diff --git a/WordPressUI/Ghosts/Internal/GhostLayer.swift b/Sources/WordPressUI/Ghosts/Internal/GhostLayer.swift similarity index 100% rename from WordPressUI/Ghosts/Internal/GhostLayer.swift rename to Sources/WordPressUI/Ghosts/Internal/GhostLayer.swift diff --git a/WordPressUI/Ghosts/Internal/GhostTableViewHandler.swift b/Sources/WordPressUI/Ghosts/Internal/GhostTableViewHandler.swift similarity index 100% rename from WordPressUI/Ghosts/Internal/GhostTableViewHandler.swift rename to Sources/WordPressUI/Ghosts/Internal/GhostTableViewHandler.swift diff --git a/WordPressUI/Ghosts/Internal/UIView+InnerGhost.swift b/Sources/WordPressUI/Ghosts/Internal/UIView+InnerGhost.swift similarity index 100% rename from WordPressUI/Ghosts/Internal/UIView+InnerGhost.swift rename to Sources/WordPressUI/Ghosts/Internal/UIView+InnerGhost.swift diff --git a/WordPressUI/Ghosts/UICollectionView+Ghost.swift b/Sources/WordPressUI/Ghosts/UICollectionView+Ghost.swift similarity index 100% rename from WordPressUI/Ghosts/UICollectionView+Ghost.swift rename to Sources/WordPressUI/Ghosts/UICollectionView+Ghost.swift diff --git a/WordPressUI/Ghosts/UITableView+Ghost.swift b/Sources/WordPressUI/Ghosts/UITableView+Ghost.swift similarity index 100% rename from WordPressUI/Ghosts/UITableView+Ghost.swift rename to Sources/WordPressUI/Ghosts/UITableView+Ghost.swift diff --git a/WordPressUI/Ghosts/UIView+Ghost.swift b/Sources/WordPressUI/Ghosts/UIView+Ghost.swift similarity index 100% rename from WordPressUI/Ghosts/UIView+Ghost.swift rename to Sources/WordPressUI/Ghosts/UIView+Ghost.swift diff --git a/WordPressUI/Resources/Assets.xcassets/Contents.json b/Sources/WordPressUI/Resources/Assets.xcassets/Contents.json similarity index 100% rename from WordPressUI/Resources/Assets.xcassets/Contents.json rename to Sources/WordPressUI/Resources/Assets.xcassets/Contents.json diff --git a/WordPressUI/Resources/Assets.xcassets/blavatar.imageset/Contents.json b/Sources/WordPressUI/Resources/Assets.xcassets/blavatar.imageset/Contents.json similarity index 100% rename from WordPressUI/Resources/Assets.xcassets/blavatar.imageset/Contents.json rename to Sources/WordPressUI/Resources/Assets.xcassets/blavatar.imageset/Contents.json diff --git a/WordPressUI/Resources/Assets.xcassets/blavatar.imageset/blavatar-default.pdf b/Sources/WordPressUI/Resources/Assets.xcassets/blavatar.imageset/blavatar-default.pdf similarity index 100% rename from WordPressUI/Resources/Assets.xcassets/blavatar.imageset/blavatar-default.pdf rename to Sources/WordPressUI/Resources/Assets.xcassets/blavatar.imageset/blavatar-default.pdf diff --git a/WordPressUI/Resources/Assets.xcassets/gravatar.imageset/Contents.json b/Sources/WordPressUI/Resources/Assets.xcassets/gravatar.imageset/Contents.json similarity index 100% rename from WordPressUI/Resources/Assets.xcassets/gravatar.imageset/Contents.json rename to Sources/WordPressUI/Resources/Assets.xcassets/gravatar.imageset/Contents.json diff --git a/WordPressUI/Resources/Assets.xcassets/gravatar.imageset/gravatar.pdf b/Sources/WordPressUI/Resources/Assets.xcassets/gravatar.imageset/gravatar.pdf similarity index 100% rename from WordPressUI/Resources/Assets.xcassets/gravatar.imageset/gravatar.pdf rename to Sources/WordPressUI/Resources/Assets.xcassets/gravatar.imageset/gravatar.pdf diff --git a/WordPressUI/Resources/Assets.xcassets/icon-url-field.imageset/Contents.json b/Sources/WordPressUI/Resources/Assets.xcassets/icon-url-field.imageset/Contents.json similarity index 100% rename from WordPressUI/Resources/Assets.xcassets/icon-url-field.imageset/Contents.json rename to Sources/WordPressUI/Resources/Assets.xcassets/icon-url-field.imageset/Contents.json diff --git a/WordPressUI/Resources/Assets.xcassets/icon-url-field.imageset/icon-url-field.pdf b/Sources/WordPressUI/Resources/Assets.xcassets/icon-url-field.imageset/icon-url-field.pdf similarity index 100% rename from WordPressUI/Resources/Assets.xcassets/icon-url-field.imageset/icon-url-field.pdf rename to Sources/WordPressUI/Resources/Assets.xcassets/icon-url-field.imageset/icon-url-field.pdf diff --git a/WordPressUI/FancyAlert/FancyAlerts.storyboard b/Sources/WordPressUI/Resources/FancyAlerts.storyboard similarity index 100% rename from WordPressUI/FancyAlert/FancyAlerts.storyboard rename to Sources/WordPressUI/Resources/FancyAlerts.storyboard diff --git a/Sources/WordPressUI/Tools/Exports.swift b/Sources/WordPressUI/Tools/Exports.swift new file mode 100644 index 0000000..a25a5b2 --- /dev/null +++ b/Sources/WordPressUI/Tools/Exports.swift @@ -0,0 +1,3 @@ +#if SWIFT_PACKAGE +@_exported import WordPressUIObjC +#endif diff --git a/WordPressUI/Tools/GradientView.swift b/Sources/WordPressUI/Tools/GradientView.swift similarity index 100% rename from WordPressUI/Tools/GradientView.swift rename to Sources/WordPressUI/Tools/GradientView.swift diff --git a/WordPressUI/Tools/RotationAwareNavigationViewController.swift b/Sources/WordPressUI/Tools/RotationAwareNavigationViewController.swift similarity index 100% rename from WordPressUI/Tools/RotationAwareNavigationViewController.swift rename to Sources/WordPressUI/Tools/RotationAwareNavigationViewController.swift diff --git a/WordPressUI/Categories/UIColor+Helpers.h b/Sources/WordPressUIObjC/Categories/UIColor+Helpers.h similarity index 100% rename from WordPressUI/Categories/UIColor+Helpers.h rename to Sources/WordPressUIObjC/Categories/UIColor+Helpers.h diff --git a/WordPressUI/Categories/UIColor+Helpers.m b/Sources/WordPressUIObjC/Categories/UIColor+Helpers.m similarity index 100% rename from WordPressUI/Categories/UIColor+Helpers.m rename to Sources/WordPressUIObjC/Categories/UIColor+Helpers.m diff --git a/WordPressUI/Categories/UIImage+Resize.h b/Sources/WordPressUIObjC/Categories/UIImage+Resize.h similarity index 100% rename from WordPressUI/Categories/UIImage+Resize.h rename to Sources/WordPressUIObjC/Categories/UIImage+Resize.h diff --git a/WordPressUI/Categories/UIImage+Resize.m b/Sources/WordPressUIObjC/Categories/UIImage+Resize.m similarity index 100% rename from WordPressUI/Categories/UIImage+Resize.m rename to Sources/WordPressUIObjC/Categories/UIImage+Resize.m diff --git a/WordPressUI/Categories/UIImage+Util.h b/Sources/WordPressUIObjC/Categories/UIImage+Util.h similarity index 100% rename from WordPressUI/Categories/UIImage+Util.h rename to Sources/WordPressUIObjC/Categories/UIImage+Util.h diff --git a/WordPressUI/Categories/UIImage+Util.m b/Sources/WordPressUIObjC/Categories/UIImage+Util.m similarity index 100% rename from WordPressUI/Categories/UIImage+Util.m rename to Sources/WordPressUIObjC/Categories/UIImage+Util.m diff --git a/WordPressUI/Categories/UILabel+SuggestSize.h b/Sources/WordPressUIObjC/Categories/UILabel+SuggestSize.h similarity index 100% rename from WordPressUI/Categories/UILabel+SuggestSize.h rename to Sources/WordPressUIObjC/Categories/UILabel+SuggestSize.h diff --git a/WordPressUI/Categories/UILabel+SuggestSize.m b/Sources/WordPressUIObjC/Categories/UILabel+SuggestSize.m similarity index 100% rename from WordPressUI/Categories/UILabel+SuggestSize.m rename to Sources/WordPressUIObjC/Categories/UILabel+SuggestSize.m diff --git a/WordPressUI/Extensions/Gravatar/NSString+Gravatar.h b/Sources/WordPressUIObjC/Extensions/NSString+Gravatar.h similarity index 100% rename from WordPressUI/Extensions/Gravatar/NSString+Gravatar.h rename to Sources/WordPressUIObjC/Extensions/NSString+Gravatar.h diff --git a/WordPressUI/Extensions/Gravatar/NSString+Gravatar.m b/Sources/WordPressUIObjC/Extensions/NSString+Gravatar.m similarity index 100% rename from WordPressUI/Extensions/Gravatar/NSString+Gravatar.m rename to Sources/WordPressUIObjC/Extensions/NSString+Gravatar.m diff --git a/Sources/WordPressUIObjC/include/NSString+Gravatar.h b/Sources/WordPressUIObjC/include/NSString+Gravatar.h new file mode 120000 index 0000000..4518122 --- /dev/null +++ b/Sources/WordPressUIObjC/include/NSString+Gravatar.h @@ -0,0 +1 @@ +../Extensions/NSString+Gravatar.h \ No newline at end of file diff --git a/Sources/WordPressUIObjC/include/UIColor+Helpers.h b/Sources/WordPressUIObjC/include/UIColor+Helpers.h new file mode 120000 index 0000000..55dd6d3 --- /dev/null +++ b/Sources/WordPressUIObjC/include/UIColor+Helpers.h @@ -0,0 +1 @@ +../Categories/UIColor+Helpers.h \ No newline at end of file diff --git a/Sources/WordPressUIObjC/include/UIImage+Resize.h b/Sources/WordPressUIObjC/include/UIImage+Resize.h new file mode 120000 index 0000000..429eb09 --- /dev/null +++ b/Sources/WordPressUIObjC/include/UIImage+Resize.h @@ -0,0 +1 @@ +../Categories/UIImage+Resize.h \ No newline at end of file diff --git a/Sources/WordPressUIObjC/include/UIImage+Util.h b/Sources/WordPressUIObjC/include/UIImage+Util.h new file mode 120000 index 0000000..1760da9 --- /dev/null +++ b/Sources/WordPressUIObjC/include/UIImage+Util.h @@ -0,0 +1 @@ +../Categories/UIImage+Util.h \ No newline at end of file diff --git a/Sources/WordPressUIObjC/include/UILabel+SuggestSize.h b/Sources/WordPressUIObjC/include/UILabel+SuggestSize.h new file mode 120000 index 0000000..e09a083 --- /dev/null +++ b/Sources/WordPressUIObjC/include/UILabel+SuggestSize.h @@ -0,0 +1 @@ +../Categories/UILabel+SuggestSize.h \ No newline at end of file diff --git a/WordPressUITests/BottomSheet/BottomSheetViewControllerTests.swift b/Tests/WordPressUITests/BottomSheet/BottomSheetViewControllerTests.swift similarity index 100% rename from WordPressUITests/BottomSheet/BottomSheetViewControllerTests.swift rename to Tests/WordPressUITests/BottomSheet/BottomSheetViewControllerTests.swift diff --git a/WordPressUITests/Extensions/GravatarTest.swift b/Tests/WordPressUITests/Extensions/GravatarTest.swift similarity index 100% rename from WordPressUITests/Extensions/GravatarTest.swift rename to Tests/WordPressUITests/Extensions/GravatarTest.swift diff --git a/WordPressUITests/Extensions/ResourcesBundleTests.swift b/Tests/WordPressUITests/Extensions/ResourcesBundleTests.swift similarity index 100% rename from WordPressUITests/Extensions/ResourcesBundleTests.swift rename to Tests/WordPressUITests/Extensions/ResourcesBundleTests.swift diff --git a/WordPressUITests/Extensions/UIColorHelpersTests.swift b/Tests/WordPressUITests/Extensions/UIColorHelpersTests.swift similarity index 100% rename from WordPressUITests/Extensions/UIColorHelpersTests.swift rename to Tests/WordPressUITests/Extensions/UIColorHelpersTests.swift diff --git a/WordPressUITests/Extensions/UIView+AutoLayoutHelperTests.swift b/Tests/WordPressUITests/Extensions/UIView+AutoLayoutHelperTests.swift similarity index 100% rename from WordPressUITests/Extensions/UIView+AutoLayoutHelperTests.swift rename to Tests/WordPressUITests/Extensions/UIView+AutoLayoutHelperTests.swift diff --git a/WordPressUITests/Extensions/UIView+ChangeLayoutMarginsTests.swift b/Tests/WordPressUITests/Extensions/UIView+ChangeLayoutMarginsTests.swift similarity index 100% rename from WordPressUITests/Extensions/UIView+ChangeLayoutMarginsTests.swift rename to Tests/WordPressUITests/Extensions/UIView+ChangeLayoutMarginsTests.swift diff --git a/WordPressUITests/Extensions/UIViewControllerHelperTest.swift b/Tests/WordPressUITests/Extensions/UIViewControllerHelperTest.swift similarity index 100% rename from WordPressUITests/Extensions/UIViewControllerHelperTest.swift rename to Tests/WordPressUITests/Extensions/UIViewControllerHelperTest.swift diff --git a/WordPressUITests/Ghosts/UITableView+GhostTests.swift b/Tests/WordPressUITests/Ghosts/UITableView+GhostTests.swift similarity index 100% rename from WordPressUITests/Ghosts/UITableView+GhostTests.swift rename to Tests/WordPressUITests/Ghosts/UITableView+GhostTests.swift diff --git a/WordPressUITests/Ghosts/UIView+GhostTests.swift b/Tests/WordPressUITests/Ghosts/UIView+GhostTests.swift similarity index 100% rename from WordPressUITests/Ghosts/UIView+GhostTests.swift rename to Tests/WordPressUITests/Ghosts/UIView+GhostTests.swift diff --git a/WordPressUI.podspec b/WordPressUI.podspec index 42ab3d9..f305332 100644 --- a/WordPressUI.podspec +++ b/WordPressUI.podspec @@ -17,16 +17,15 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.source = { git: 'https://github.com/wordpress-mobile/WordPressUI-iOS.git', tag: s.version.to_s } - s.source_files = 'WordPressUI/**/*.{h,m,swift}' + s.source_files = 'Sources/WordPressUI/**/*.{h,m,swift}', 'Sources/WordPressUIObjC/**/*.{h,m,swift}' s.resource_bundles = { WordPressUIResources: [ - 'WordPressUI/Resources/*.{xcassets}', - 'WordPressUI/**/*.{storyboard}' + 'Sources/WordPressUI/Resources/*.{xcassets,storyboard}', ] } - s.header_dir = 'WordPressUI' + s.public_header_files = 'Sources/WordPressUIObjC/include' s.test_spec do |test| - test.source_files = ['WordPressUITests/**/*.{swift,h,m}'] + test.source_files = ['Tests/WordPressUITests/**/*.{swift,h,m}'] end end diff --git a/WordPressUI/Info.plist b/WordPressUI/Info.plist deleted file mode 100644 index 1007fd9..0000000 --- a/WordPressUI/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/WordPressUI/Tools/Exports.swift b/WordPressUI/Tools/Exports.swift deleted file mode 100644 index 771ffd9..0000000 --- a/WordPressUI/Tools/Exports.swift +++ /dev/null @@ -1,5 +0,0 @@ -#if SWIFT_PACKAGE -@_exported import WordPressUIGravatar -@_exported import WordPressUIGravatarObjC -@_exported import WordPressUIObjCCategories -#endif diff --git a/WordPressUI/WordPressUI.h b/WordPressUI/WordPressUI.h deleted file mode 100644 index 8d858e6..0000000 --- a/WordPressUI/WordPressUI.h +++ /dev/null @@ -1,16 +0,0 @@ -#import - -//! Project version number for WordPressUI. -FOUNDATION_EXPORT double WordPressUIVersionNumber; - -//! Project version string for WordPressUI. -FOUNDATION_EXPORT const unsigned char WordPressUIVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - -#import -#import -#import -#import -#import diff --git a/WordPressUITests/Info.plist b/WordPressUITests/Info.plist deleted file mode 100644 index 6c40a6c..0000000 --- a/WordPressUITests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - From b86819f8a15512dcfd1a885075b454b8253b7dac Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 15 Nov 2022 10:04:29 +1300 Subject: [PATCH 2/3] Add changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1f8e2c..aac2c28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,7 @@ _None._ ### New Features -_None._ +- Add Swift Package Manager support [#120] ### Bug Fixes From 9de24cb2fc5eaa068d617dd832a0d3c71f1d3f36 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 15 Nov 2022 10:26:28 +1300 Subject: [PATCH 3/3] Fix a rubocop linting issue --- WordPressUI.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressUI.podspec b/WordPressUI.podspec index f305332..ad338db 100644 --- a/WordPressUI.podspec +++ b/WordPressUI.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.source_files = 'Sources/WordPressUI/**/*.{h,m,swift}', 'Sources/WordPressUIObjC/**/*.{h,m,swift}' s.resource_bundles = { WordPressUIResources: [ - 'Sources/WordPressUI/Resources/*.{xcassets,storyboard}', + 'Sources/WordPressUI/Resources/*.{xcassets,storyboard}' ] } s.public_header_files = 'Sources/WordPressUIObjC/include'