From 37b73582afffbe2f4c59e9f27943a181da44e504 Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Thu, 17 Sep 2020 23:38:15 +1200 Subject: [PATCH 01/16] Add support for swift package manager --- Package.swift | 25 +++++++++++++++++++++++++ Package@swift-5.0.swift | 25 +++++++++++++++++++++++++ Package@swift-5.1.swift | 25 +++++++++++++++++++++++++ Package@swift-5.2.swift | 25 +++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 Package.swift create mode 100644 Package@swift-5.0.swift create mode 100644 Package@swift-5.1.swift create mode 100644 Package@swift-5.2.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..0993783 --- /dev/null +++ b/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "UIAlertControllerBlocks", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "UIAlertControllerBlocks", + targets: ["UIAlertControllerBlocks"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "UIAlertControllerBlocks", + dependencies: []) + ] +) diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift new file mode 100644 index 0000000..0993783 --- /dev/null +++ b/Package@swift-5.0.swift @@ -0,0 +1,25 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "UIAlertControllerBlocks", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "UIAlertControllerBlocks", + targets: ["UIAlertControllerBlocks"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "UIAlertControllerBlocks", + dependencies: []) + ] +) diff --git a/Package@swift-5.1.swift b/Package@swift-5.1.swift new file mode 100644 index 0000000..0993783 --- /dev/null +++ b/Package@swift-5.1.swift @@ -0,0 +1,25 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "UIAlertControllerBlocks", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "UIAlertControllerBlocks", + targets: ["UIAlertControllerBlocks"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "UIAlertControllerBlocks", + dependencies: []) + ] +) diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift new file mode 100644 index 0000000..0993783 --- /dev/null +++ b/Package@swift-5.2.swift @@ -0,0 +1,25 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "UIAlertControllerBlocks", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "UIAlertControllerBlocks", + targets: ["UIAlertControllerBlocks"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "UIAlertControllerBlocks", + dependencies: []) + ] +) From 419236d0dcd2cc870bebd88956d8b29062996c3b Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Thu, 17 Sep 2020 23:41:27 +1200 Subject: [PATCH 02/16] Move source files into Source folder --- Package.swift | 1 + UIAlertController+Blocks.h => Source/UIAlertController+Blocks.h | 0 UIAlertController+Blocks.m => Source/UIAlertController+Blocks.m | 0 3 files changed, 1 insertion(+) rename UIAlertController+Blocks.h => Source/UIAlertController+Blocks.h (100%) rename UIAlertController+Blocks.m => Source/UIAlertController+Blocks.m (100%) diff --git a/Package.swift b/Package.swift index 0993783..234a72c 100644 --- a/Package.swift +++ b/Package.swift @@ -20,6 +20,7 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", + path: "lottie-swift/src", dependencies: []) ] ) diff --git a/UIAlertController+Blocks.h b/Source/UIAlertController+Blocks.h similarity index 100% rename from UIAlertController+Blocks.h rename to Source/UIAlertController+Blocks.h diff --git a/UIAlertController+Blocks.m b/Source/UIAlertController+Blocks.m similarity index 100% rename from UIAlertController+Blocks.m rename to Source/UIAlertController+Blocks.m From 1c3b41a31f6a02f117f0748e664240ca7622e8e7 Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Thu, 17 Sep 2020 23:41:43 +1200 Subject: [PATCH 03/16] Fix source path --- Package.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Package.swift b/Package.swift index 234a72c..0993783 100644 --- a/Package.swift +++ b/Package.swift @@ -20,7 +20,6 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", - path: "lottie-swift/src", dependencies: []) ] ) From 4e7846d63190bb0024673ce70ce454998167e50f Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Thu, 17 Sep 2020 23:43:31 +1200 Subject: [PATCH 04/16] Fix source files location --- Source/{ => UIAlertControllerBlocks}/UIAlertController+Blocks.h | 0 Source/{ => UIAlertControllerBlocks}/UIAlertController+Blocks.m | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Source/{ => UIAlertControllerBlocks}/UIAlertController+Blocks.h (100%) rename Source/{ => UIAlertControllerBlocks}/UIAlertController+Blocks.m (100%) diff --git a/Source/UIAlertController+Blocks.h b/Source/UIAlertControllerBlocks/UIAlertController+Blocks.h similarity index 100% rename from Source/UIAlertController+Blocks.h rename to Source/UIAlertControllerBlocks/UIAlertController+Blocks.h diff --git a/Source/UIAlertController+Blocks.m b/Source/UIAlertControllerBlocks/UIAlertController+Blocks.m similarity index 100% rename from Source/UIAlertController+Blocks.m rename to Source/UIAlertControllerBlocks/UIAlertController+Blocks.m From 4a5960091d2433a432b4bfe0efde20dca2134b67 Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Fri, 18 Sep 2020 06:32:31 +1200 Subject: [PATCH 05/16] Move files to original location --- Package.swift | 1 + Package@swift-5.0.swift | 1 + Package@swift-5.1.swift | 1 + Package@swift-5.2.swift | 1 + .../UIAlertController+Blocks.h => UIAlertController+Blocks.h | 0 .../UIAlertController+Blocks.m => UIAlertController+Blocks.m | 0 6 files changed, 4 insertions(+) rename Source/UIAlertControllerBlocks/UIAlertController+Blocks.h => UIAlertController+Blocks.h (100%) rename Source/UIAlertControllerBlocks/UIAlertController+Blocks.m => UIAlertController+Blocks.m (100%) diff --git a/Package.swift b/Package.swift index 0993783..0bfb705 100644 --- a/Package.swift +++ b/Package.swift @@ -20,6 +20,7 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", + path: ".", dependencies: []) ] ) diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift index 0993783..0bfb705 100644 --- a/Package@swift-5.0.swift +++ b/Package@swift-5.0.swift @@ -20,6 +20,7 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", + path: ".", dependencies: []) ] ) diff --git a/Package@swift-5.1.swift b/Package@swift-5.1.swift index 0993783..0bfb705 100644 --- a/Package@swift-5.1.swift +++ b/Package@swift-5.1.swift @@ -20,6 +20,7 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", + path: ".", dependencies: []) ] ) diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift index 0993783..0bfb705 100644 --- a/Package@swift-5.2.swift +++ b/Package@swift-5.2.swift @@ -20,6 +20,7 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", + path: ".", dependencies: []) ] ) diff --git a/Source/UIAlertControllerBlocks/UIAlertController+Blocks.h b/UIAlertController+Blocks.h similarity index 100% rename from Source/UIAlertControllerBlocks/UIAlertController+Blocks.h rename to UIAlertController+Blocks.h diff --git a/Source/UIAlertControllerBlocks/UIAlertController+Blocks.m b/UIAlertController+Blocks.m similarity index 100% rename from Source/UIAlertControllerBlocks/UIAlertController+Blocks.m rename to UIAlertController+Blocks.m From 6f9bbce4ff02a78ad2e598bcd6725a946b4aac7f Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Fri, 18 Sep 2020 06:44:09 +1200 Subject: [PATCH 06/16] Add header path --- Package.swift | 1 + Package@swift-5.0.swift | 1 + Package@swift-5.1.swift | 1 + Package@swift-5.2.swift | 1 + 4 files changed, 4 insertions(+) diff --git a/Package.swift b/Package.swift index 0bfb705..43ebcf0 100644 --- a/Package.swift +++ b/Package.swift @@ -21,6 +21,7 @@ let package = Package( .target( name: "UIAlertControllerBlocks", path: ".", + publicHeadersPath: ".", dependencies: []) ] ) diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift index 0bfb705..43ebcf0 100644 --- a/Package@swift-5.0.swift +++ b/Package@swift-5.0.swift @@ -21,6 +21,7 @@ let package = Package( .target( name: "UIAlertControllerBlocks", path: ".", + publicHeadersPath: ".", dependencies: []) ] ) diff --git a/Package@swift-5.1.swift b/Package@swift-5.1.swift index 0bfb705..43ebcf0 100644 --- a/Package@swift-5.1.swift +++ b/Package@swift-5.1.swift @@ -21,6 +21,7 @@ let package = Package( .target( name: "UIAlertControllerBlocks", path: ".", + publicHeadersPath: ".", dependencies: []) ] ) diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift index 0bfb705..43ebcf0 100644 --- a/Package@swift-5.2.swift +++ b/Package@swift-5.2.swift @@ -21,6 +21,7 @@ let package = Package( .target( name: "UIAlertControllerBlocks", path: ".", + publicHeadersPath: ".", dependencies: []) ] ) From 19bb94edd121b4d5a31933980e5f38bd192f3180 Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Fri, 18 Sep 2020 06:50:40 +1200 Subject: [PATCH 07/16] Move source files --- Package.swift | 2 -- Package@swift-5.0.swift | 2 -- Package@swift-5.1.swift | 2 -- Package@swift-5.2.swift | 2 -- .../UIAlertControllerBlocks/UIAlertController+Blocks.m | 0 .../include/UIAlertControllerBlocks/UIAlertController+Blocks.h | 0 6 files changed, 8 deletions(-) rename UIAlertController+Blocks.m => Sources/UIAlertControllerBlocks/UIAlertController+Blocks.m (100%) rename UIAlertController+Blocks.h => Sources/UIAlertControllerBlocks/include/UIAlertControllerBlocks/UIAlertController+Blocks.h (100%) diff --git a/Package.swift b/Package.swift index 43ebcf0..0993783 100644 --- a/Package.swift +++ b/Package.swift @@ -20,8 +20,6 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", - path: ".", - publicHeadersPath: ".", dependencies: []) ] ) diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift index 43ebcf0..0993783 100644 --- a/Package@swift-5.0.swift +++ b/Package@swift-5.0.swift @@ -20,8 +20,6 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", - path: ".", - publicHeadersPath: ".", dependencies: []) ] ) diff --git a/Package@swift-5.1.swift b/Package@swift-5.1.swift index 43ebcf0..0993783 100644 --- a/Package@swift-5.1.swift +++ b/Package@swift-5.1.swift @@ -20,8 +20,6 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", - path: ".", - publicHeadersPath: ".", dependencies: []) ] ) diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift index 43ebcf0..0993783 100644 --- a/Package@swift-5.2.swift +++ b/Package@swift-5.2.swift @@ -20,8 +20,6 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertControllerBlocks", - path: ".", - publicHeadersPath: ".", dependencies: []) ] ) diff --git a/UIAlertController+Blocks.m b/Sources/UIAlertControllerBlocks/UIAlertController+Blocks.m similarity index 100% rename from UIAlertController+Blocks.m rename to Sources/UIAlertControllerBlocks/UIAlertController+Blocks.m diff --git a/UIAlertController+Blocks.h b/Sources/UIAlertControllerBlocks/include/UIAlertControllerBlocks/UIAlertController+Blocks.h similarity index 100% rename from UIAlertController+Blocks.h rename to Sources/UIAlertControllerBlocks/include/UIAlertControllerBlocks/UIAlertController+Blocks.h From e4c86da08a4bfa5359f841beaaadb42fea6fac19 Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Fri, 18 Sep 2020 06:59:48 +1200 Subject: [PATCH 08/16] Add header file --- .../UIAlertController+Blocks.h | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Sources/UIAlertControllerBlocks/UIAlertController+Blocks.h diff --git a/Sources/UIAlertControllerBlocks/UIAlertController+Blocks.h b/Sources/UIAlertControllerBlocks/UIAlertController+Blocks.h new file mode 100644 index 0000000..34c6f97 --- /dev/null +++ b/Sources/UIAlertControllerBlocks/UIAlertController+Blocks.h @@ -0,0 +1,76 @@ +// +// UIAlertController+Blocks.h +// UIAlertControllerBlocks +// +// Created by Ryan Maxwell on 11/09/14. +// +// The MIT License (MIT) +// +// Copyright (c) 2014 Ryan Maxwell +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#import + +#if TARGET_OS_IOS +typedef void (^UIAlertControllerPopoverPresentationControllerBlock) (UIPopoverPresentationController * __nonnull popover); +#endif +typedef void (^UIAlertControllerCompletionBlock) (UIAlertController * __nonnull controller, UIAlertAction * __nonnull action, NSInteger buttonIndex); + +@interface UIAlertController (Blocks) + ++ (nonnull instancetype)showInViewController:(nonnull UIViewController *)viewController + withTitle:(nullable NSString *)title + message:(nullable NSString *)message + preferredStyle:(UIAlertControllerStyle)preferredStyle + cancelButtonTitle:(nullable NSString *)cancelButtonTitle + destructiveButtonTitle:(nullable NSString *)destructiveButtonTitle + otherButtonTitles:(nullable NSArray *)otherButtonTitles +#if TARGET_OS_IOS + popoverPresentationControllerBlock:(nullable UIAlertControllerPopoverPresentationControllerBlock)popoverPresentationControllerBlock +#endif + tapBlock:(nullable UIAlertControllerCompletionBlock)tapBlock; + ++ (nonnull instancetype)showAlertInViewController:(nonnull UIViewController *)viewController + withTitle:(nullable NSString *)title + message:(nullable NSString *)message + cancelButtonTitle:(nullable NSString *)cancelButtonTitle + destructiveButtonTitle:(nullable NSString *)destructiveButtonTitle + otherButtonTitles:(nullable NSArray *)otherButtonTitles + tapBlock:(nullable UIAlertControllerCompletionBlock)tapBlock; + + ++ (nonnull instancetype)showActionSheetInViewController:(nonnull UIViewController *)viewController + withTitle:(nullable NSString *)title + message:(nullable NSString *)message + cancelButtonTitle:(nullable NSString *)cancelButtonTitle + destructiveButtonTitle:(nullable NSString *)destructiveButtonTitle + otherButtonTitles:(nullable NSArray *)otherButtonTitles +#if TARGET_OS_IOS + popoverPresentationControllerBlock:(nullable UIAlertControllerPopoverPresentationControllerBlock)popoverPresentationControllerBlock +#endif + tapBlock:(nullable UIAlertControllerCompletionBlock)tapBlock; + + +@property (readonly, nonatomic) BOOL visible; +@property (readonly, nonatomic) NSInteger cancelButtonIndex; +@property (readonly, nonatomic) NSInteger firstOtherButtonIndex; +@property (readonly, nonatomic) NSInteger destructiveButtonIndex; + +@end From abd4c28f17dcce12f5216ebf36f109d61863ea71 Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Fri, 18 Sep 2020 07:06:22 +1200 Subject: [PATCH 09/16] Update target name --- Package.swift | 8 ++++---- Package@swift-5.0.swift | 8 ++++---- Package@swift-5.1.swift | 8 ++++---- Package@swift-5.2.swift | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Package.swift b/Package.swift index 0993783..84fae73 100644 --- a/Package.swift +++ b/Package.swift @@ -4,12 +4,12 @@ import PackageDescription let package = Package( - name: "UIAlertControllerBlocks", + name: "UIAlertController_Blocks", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "UIAlertControllerBlocks", - targets: ["UIAlertControllerBlocks"]), + name: "UIAlertController_Blocks", + targets: ["UIAlertController_Blocks"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,7 +19,7 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "UIAlertControllerBlocks", + name: "UIAlertController_Blocks", dependencies: []) ] ) diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift index 0993783..84fae73 100644 --- a/Package@swift-5.0.swift +++ b/Package@swift-5.0.swift @@ -4,12 +4,12 @@ import PackageDescription let package = Package( - name: "UIAlertControllerBlocks", + name: "UIAlertController_Blocks", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "UIAlertControllerBlocks", - targets: ["UIAlertControllerBlocks"]), + name: "UIAlertController_Blocks", + targets: ["UIAlertController_Blocks"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,7 +19,7 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "UIAlertControllerBlocks", + name: "UIAlertController_Blocks", dependencies: []) ] ) diff --git a/Package@swift-5.1.swift b/Package@swift-5.1.swift index 0993783..84fae73 100644 --- a/Package@swift-5.1.swift +++ b/Package@swift-5.1.swift @@ -4,12 +4,12 @@ import PackageDescription let package = Package( - name: "UIAlertControllerBlocks", + name: "UIAlertController_Blocks", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "UIAlertControllerBlocks", - targets: ["UIAlertControllerBlocks"]), + name: "UIAlertController_Blocks", + targets: ["UIAlertController_Blocks"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,7 +19,7 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "UIAlertControllerBlocks", + name: "UIAlertController_Blocks", dependencies: []) ] ) diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift index 0993783..84fae73 100644 --- a/Package@swift-5.2.swift +++ b/Package@swift-5.2.swift @@ -4,12 +4,12 @@ import PackageDescription let package = Package( - name: "UIAlertControllerBlocks", + name: "UIAlertController_Blocks", products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( - name: "UIAlertControllerBlocks", - targets: ["UIAlertControllerBlocks"]), + name: "UIAlertController_Blocks", + targets: ["UIAlertController_Blocks"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -19,7 +19,7 @@ let package = Package( // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( - name: "UIAlertControllerBlocks", + name: "UIAlertController_Blocks", dependencies: []) ] ) From 9ead2e1a09e3631d7de53143909e2a465c495fe0 Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Fri, 18 Sep 2020 07:14:04 +1200 Subject: [PATCH 10/16] Update folder name --- .../UIAlertController+Blocks.h | 0 .../UIAlertController+Blocks.m | 0 .../include/UIAlertController_Blocks}/UIAlertController+Blocks.h | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Sources/{UIAlertControllerBlocks => UIAlertController_Blocks}/UIAlertController+Blocks.h (100%) rename Sources/{UIAlertControllerBlocks => UIAlertController_Blocks}/UIAlertController+Blocks.m (100%) rename Sources/{UIAlertControllerBlocks/include/UIAlertControllerBlocks => UIAlertController_Blocks/include/UIAlertController_Blocks}/UIAlertController+Blocks.h (100%) diff --git a/Sources/UIAlertControllerBlocks/UIAlertController+Blocks.h b/Sources/UIAlertController_Blocks/UIAlertController+Blocks.h similarity index 100% rename from Sources/UIAlertControllerBlocks/UIAlertController+Blocks.h rename to Sources/UIAlertController_Blocks/UIAlertController+Blocks.h diff --git a/Sources/UIAlertControllerBlocks/UIAlertController+Blocks.m b/Sources/UIAlertController_Blocks/UIAlertController+Blocks.m similarity index 100% rename from Sources/UIAlertControllerBlocks/UIAlertController+Blocks.m rename to Sources/UIAlertController_Blocks/UIAlertController+Blocks.m diff --git a/Sources/UIAlertControllerBlocks/include/UIAlertControllerBlocks/UIAlertController+Blocks.h b/Sources/UIAlertController_Blocks/include/UIAlertController_Blocks/UIAlertController+Blocks.h similarity index 100% rename from Sources/UIAlertControllerBlocks/include/UIAlertControllerBlocks/UIAlertController+Blocks.h rename to Sources/UIAlertController_Blocks/include/UIAlertController_Blocks/UIAlertController+Blocks.h From 470a5ee0d4c9e0d118cba385b2c1fb882c2d6dfa Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Fri, 18 Sep 2020 07:40:51 +1200 Subject: [PATCH 11/16] Update podspec --- UIAlertController+Blocks.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UIAlertController+Blocks.podspec b/UIAlertController+Blocks.podspec index 1b8ff9f..8142075 100644 --- a/UIAlertController+Blocks.podspec +++ b/UIAlertController+Blocks.podspec @@ -5,8 +5,8 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/ryanmaxwell/UIAlertController-Blocks" s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = "Ryan Maxwell" - s.source = { :git => "https://github.com/ryanmaxwell/UIAlertController-Blocks.git", :tag => '0.9.2' } - s.source_files = 'UIAlertController+Blocks.{h,m}' + s.source = { :git => "https://github.com/tc-sgupta/UIAlertController-Blocks.git", :tag => '0.9.2' } + s.source_files = 'Sources/UIAlertController_Blocks/UIAlertController+Blocks.{h,m}' s.requires_arc = true s.ios.deployment_target = '6.0' # 6.0 as this is a dependency for RMUniversalAlert s.tvos.deployment_target = '9.0' From f218ae36b724bcdb791c42d05dfd157926143c5e Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Fri, 18 Sep 2020 07:42:49 +1200 Subject: [PATCH 12/16] Revert git path --- UIAlertController+Blocks.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UIAlertController+Blocks.podspec b/UIAlertController+Blocks.podspec index 8142075..82679a8 100644 --- a/UIAlertController+Blocks.podspec +++ b/UIAlertController+Blocks.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/ryanmaxwell/UIAlertController-Blocks" s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = "Ryan Maxwell" - s.source = { :git => "https://github.com/tc-sgupta/UIAlertController-Blocks.git", :tag => '0.9.2' } + s.source = { :git => "https://github.com/ryanmaxwell/UIAlertController-Blocks.git", :tag => '0.9.2' } s.source_files = 'Sources/UIAlertController_Blocks/UIAlertController+Blocks.{h,m}' s.requires_arc = true s.ios.deployment_target = '6.0' # 6.0 as this is a dependency for RMUniversalAlert From c17772f879a88d780c120458f1de95589598953b Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Sat, 19 Sep 2020 06:41:16 +1200 Subject: [PATCH 13/16] Fix swift tools version --- Package@swift-5.0.swift | 2 +- Package@swift-5.1.swift | 2 +- Package@swift-5.2.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift index 84fae73..fbc50de 100644 --- a/Package@swift-5.0.swift +++ b/Package@swift-5.0.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version:5.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/Package@swift-5.1.swift b/Package@swift-5.1.swift index 84fae73..7654da4 100644 --- a/Package@swift-5.1.swift +++ b/Package@swift-5.1.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version:5.1 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift index 84fae73..f495148 100644 --- a/Package@swift-5.2.swift +++ b/Package@swift-5.2.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version:5.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription From 9c16a75a7281faae47b4734ab5e952381bb04f1f Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Sat, 19 Sep 2020 07:19:35 +1200 Subject: [PATCH 14/16] Remove redundant package.swift --- Package.swift | 2 +- Package@swift-5.0.swift | 25 ------------------------- Package@swift-5.1.swift | 25 ------------------------- Package@swift-5.2.swift | 25 ------------------------- 4 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 Package@swift-5.0.swift delete mode 100644 Package@swift-5.1.swift delete mode 100644 Package@swift-5.2.swift diff --git a/Package.swift b/Package.swift index 84fae73..fbc50de 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version:5.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/Package@swift-5.0.swift b/Package@swift-5.0.swift deleted file mode 100644 index fbc50de..0000000 --- a/Package@swift-5.0.swift +++ /dev/null @@ -1,25 +0,0 @@ -// swift-tools-version:5.0 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "UIAlertController_Blocks", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "UIAlertController_Blocks", - targets: ["UIAlertController_Blocks"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "UIAlertController_Blocks", - dependencies: []) - ] -) diff --git a/Package@swift-5.1.swift b/Package@swift-5.1.swift deleted file mode 100644 index 7654da4..0000000 --- a/Package@swift-5.1.swift +++ /dev/null @@ -1,25 +0,0 @@ -// swift-tools-version:5.1 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "UIAlertController_Blocks", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "UIAlertController_Blocks", - targets: ["UIAlertController_Blocks"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "UIAlertController_Blocks", - dependencies: []) - ] -) diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift deleted file mode 100644 index f495148..0000000 --- a/Package@swift-5.2.swift +++ /dev/null @@ -1,25 +0,0 @@ -// swift-tools-version:5.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "UIAlertController_Blocks", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "UIAlertController_Blocks", - targets: ["UIAlertController_Blocks"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "UIAlertController_Blocks", - dependencies: []) - ] -) From 179fdc03e9d80f144c7aac3ab38fa5b7b4f34c34 Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Sat, 19 Sep 2020 07:22:48 +1200 Subject: [PATCH 15/16] Change source folder to avoid redundant header file --- Package.swift | 10 +-- .../UIAlertController+Blocks.h | 76 ------------------- UIAlertController+Blocks.podspec | 2 +- .../UIAlertController+Blocks.h | 0 .../UIAlertController+Blocks.m | 0 5 files changed, 3 insertions(+), 85 deletions(-) delete mode 100644 Sources/UIAlertController_Blocks/include/UIAlertController_Blocks/UIAlertController+Blocks.h rename {Sources/UIAlertController_Blocks => UIAlertController_Blocks}/UIAlertController+Blocks.h (100%) rename {Sources/UIAlertController_Blocks => UIAlertController_Blocks}/UIAlertController+Blocks.m (100%) diff --git a/Package.swift b/Package.swift index fbc50de..e6ef87f 100644 --- a/Package.swift +++ b/Package.swift @@ -6,20 +6,14 @@ import PackageDescription let package = Package( name: "UIAlertController_Blocks", products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "UIAlertController_Blocks", targets: ["UIAlertController_Blocks"]), ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "UIAlertController_Blocks", - dependencies: []) + path: "UIAlertController_Blocks", + publicHeadersPath: "") ] ) diff --git a/Sources/UIAlertController_Blocks/include/UIAlertController_Blocks/UIAlertController+Blocks.h b/Sources/UIAlertController_Blocks/include/UIAlertController_Blocks/UIAlertController+Blocks.h deleted file mode 100644 index 34c6f97..0000000 --- a/Sources/UIAlertController_Blocks/include/UIAlertController_Blocks/UIAlertController+Blocks.h +++ /dev/null @@ -1,76 +0,0 @@ -// -// UIAlertController+Blocks.h -// UIAlertControllerBlocks -// -// Created by Ryan Maxwell on 11/09/14. -// -// The MIT License (MIT) -// -// Copyright (c) 2014 Ryan Maxwell -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -#if TARGET_OS_IOS -typedef void (^UIAlertControllerPopoverPresentationControllerBlock) (UIPopoverPresentationController * __nonnull popover); -#endif -typedef void (^UIAlertControllerCompletionBlock) (UIAlertController * __nonnull controller, UIAlertAction * __nonnull action, NSInteger buttonIndex); - -@interface UIAlertController (Blocks) - -+ (nonnull instancetype)showInViewController:(nonnull UIViewController *)viewController - withTitle:(nullable NSString *)title - message:(nullable NSString *)message - preferredStyle:(UIAlertControllerStyle)preferredStyle - cancelButtonTitle:(nullable NSString *)cancelButtonTitle - destructiveButtonTitle:(nullable NSString *)destructiveButtonTitle - otherButtonTitles:(nullable NSArray *)otherButtonTitles -#if TARGET_OS_IOS - popoverPresentationControllerBlock:(nullable UIAlertControllerPopoverPresentationControllerBlock)popoverPresentationControllerBlock -#endif - tapBlock:(nullable UIAlertControllerCompletionBlock)tapBlock; - -+ (nonnull instancetype)showAlertInViewController:(nonnull UIViewController *)viewController - withTitle:(nullable NSString *)title - message:(nullable NSString *)message - cancelButtonTitle:(nullable NSString *)cancelButtonTitle - destructiveButtonTitle:(nullable NSString *)destructiveButtonTitle - otherButtonTitles:(nullable NSArray *)otherButtonTitles - tapBlock:(nullable UIAlertControllerCompletionBlock)tapBlock; - - -+ (nonnull instancetype)showActionSheetInViewController:(nonnull UIViewController *)viewController - withTitle:(nullable NSString *)title - message:(nullable NSString *)message - cancelButtonTitle:(nullable NSString *)cancelButtonTitle - destructiveButtonTitle:(nullable NSString *)destructiveButtonTitle - otherButtonTitles:(nullable NSArray *)otherButtonTitles -#if TARGET_OS_IOS - popoverPresentationControllerBlock:(nullable UIAlertControllerPopoverPresentationControllerBlock)popoverPresentationControllerBlock -#endif - tapBlock:(nullable UIAlertControllerCompletionBlock)tapBlock; - - -@property (readonly, nonatomic) BOOL visible; -@property (readonly, nonatomic) NSInteger cancelButtonIndex; -@property (readonly, nonatomic) NSInteger firstOtherButtonIndex; -@property (readonly, nonatomic) NSInteger destructiveButtonIndex; - -@end diff --git a/UIAlertController+Blocks.podspec b/UIAlertController+Blocks.podspec index 82679a8..bd070ce 100644 --- a/UIAlertController+Blocks.podspec +++ b/UIAlertController+Blocks.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = "Ryan Maxwell" s.source = { :git => "https://github.com/ryanmaxwell/UIAlertController-Blocks.git", :tag => '0.9.2' } - s.source_files = 'Sources/UIAlertController_Blocks/UIAlertController+Blocks.{h,m}' + s.source_files = 'UIAlertController_Blocks/UIAlertController+Blocks.{h,m}' s.requires_arc = true s.ios.deployment_target = '6.0' # 6.0 as this is a dependency for RMUniversalAlert s.tvos.deployment_target = '9.0' diff --git a/Sources/UIAlertController_Blocks/UIAlertController+Blocks.h b/UIAlertController_Blocks/UIAlertController+Blocks.h similarity index 100% rename from Sources/UIAlertController_Blocks/UIAlertController+Blocks.h rename to UIAlertController_Blocks/UIAlertController+Blocks.h diff --git a/Sources/UIAlertController_Blocks/UIAlertController+Blocks.m b/UIAlertController_Blocks/UIAlertController+Blocks.m similarity index 100% rename from Sources/UIAlertController_Blocks/UIAlertController+Blocks.m rename to UIAlertController_Blocks/UIAlertController+Blocks.m From 89abd277a578a46bd5abdcea4361b420d47a3bdc Mon Sep 17 00:00:00 2001 From: Sourabh Gupta Date: Tue, 13 Sep 2022 15:14:54 +1200 Subject: [PATCH 16/16] Update swift tools version to 5.7 --- Package.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index e6ef87f..4e10a4c 100644 --- a/Package.swift +++ b/Package.swift @@ -1,10 +1,11 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.7 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "UIAlertController_Blocks", + platforms: [.iOS(.v14)], products: [ .library( name: "UIAlertController_Blocks",