From 84dac2cb6c06d52f6c898f9b72e72b2ac3dc5d29 Mon Sep 17 00:00:00 2001 From: Robert McGovern Date: Tue, 6 Jul 2021 01:59:50 +0100 Subject: [PATCH] Added public to extensions to make them visible to other packages. --- Sources/SwiftExtensions/AnyTransition+scaleAndFade.swift | 2 +- Sources/SwiftExtensions/Array+removeDuplicates.swift | 2 +- Sources/SwiftExtensions/Binding+didSet.swift | 2 +- Sources/SwiftExtensions/Color+fromString+ToString.swift | 2 +- Sources/SwiftExtensions/Color+random.swift | 2 +- Sources/SwiftExtensions/Directories.swift | 2 +- Sources/SwiftExtensions/String+subscript.swift | 2 +- Sources/SwiftExtensions/UIHostingController+capture.swift | 2 +- Sources/SwiftExtensions/UIImage+scaleImage.swift | 2 +- Sources/SwiftExtensions/View+glow.swift | 2 +- Sources/SwiftExtensions/View+hideKeyboard.swift | 2 +- Sources/SwiftExtensions/View+multicolorGlow.swift | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Sources/SwiftExtensions/AnyTransition+scaleAndFade.swift b/Sources/SwiftExtensions/AnyTransition+scaleAndFade.swift index c61bd10..39ad826 100644 --- a/Sources/SwiftExtensions/AnyTransition+scaleAndFade.swift +++ b/Sources/SwiftExtensions/AnyTransition+scaleAndFade.swift @@ -7,7 +7,7 @@ import SwiftUI -extension AnyTransition { +public extension AnyTransition { static var scaleAndFade: AnyTransition { let insertion = AnyTransition.scale .combined(with: .opacity) diff --git a/Sources/SwiftExtensions/Array+removeDuplicates.swift b/Sources/SwiftExtensions/Array+removeDuplicates.swift index 3e8a672..7ddbf68 100644 --- a/Sources/SwiftExtensions/Array+removeDuplicates.swift +++ b/Sources/SwiftExtensions/Array+removeDuplicates.swift @@ -12,7 +12,7 @@ import Foundation provides two methods: one called removingDuplicates() that returns an array with duplicates removed, and one called removeDuplicates() that changes the array in place. */ -extension Array where Element: Hashable { +public extension Array where Element: Hashable { func removingDuplicates() -> [Element] { var addedDict = [Element: Bool]() diff --git a/Sources/SwiftExtensions/Binding+didSet.swift b/Sources/SwiftExtensions/Binding+didSet.swift index 0c91916..688c37c 100644 --- a/Sources/SwiftExtensions/Binding+didSet.swift +++ b/Sources/SwiftExtensions/Binding+didSet.swift @@ -7,7 +7,7 @@ import SwiftUI -extension Binding { +public extension Binding { func didSet(execute: @escaping (Value) -> Void) -> Binding { return Binding( get: { diff --git a/Sources/SwiftExtensions/Color+fromString+ToString.swift b/Sources/SwiftExtensions/Color+fromString+ToString.swift index 6e45bac..2d3354b 100644 --- a/Sources/SwiftExtensions/Color+fromString+ToString.swift +++ b/Sources/SwiftExtensions/Color+fromString+ToString.swift @@ -7,7 +7,7 @@ import SwiftUI -extension Color { +public extension Color { func toString() -> String { let uiColor = UIColor(self) var red: CGFloat = 0 diff --git a/Sources/SwiftExtensions/Color+random.swift b/Sources/SwiftExtensions/Color+random.swift index fa6077e..8af25a7 100644 --- a/Sources/SwiftExtensions/Color+random.swift +++ b/Sources/SwiftExtensions/Color+random.swift @@ -7,7 +7,7 @@ import SwiftUI -extension Color { +public extension Color { static var random: Color { [Color.red, Color.orange, Color.yellow, Color.blue, Color.purple, Color.pink, Color.green].randomElement()! } diff --git a/Sources/SwiftExtensions/Directories.swift b/Sources/SwiftExtensions/Directories.swift index ea5c891..49d0197 100644 --- a/Sources/SwiftExtensions/Directories.swift +++ b/Sources/SwiftExtensions/Directories.swift @@ -7,7 +7,7 @@ import SwiftUI -class Directories { +public class Directories { // Get user's documents directory path static func getDocumentsDirectoryPath() -> URL { diff --git a/Sources/SwiftExtensions/String+subscript.swift b/Sources/SwiftExtensions/String+subscript.swift index 1cf3ba5..c67b58e 100644 --- a/Sources/SwiftExtensions/String+subscript.swift +++ b/Sources/SwiftExtensions/String+subscript.swift @@ -7,7 +7,7 @@ import Foundation -extension String { +public extension String { subscript(idx: Int) -> String { String(self[index(startIndex, offsetBy: idx)]) } diff --git a/Sources/SwiftExtensions/UIHostingController+capture.swift b/Sources/SwiftExtensions/UIHostingController+capture.swift index 963e280..0eb1bb8 100644 --- a/Sources/SwiftExtensions/UIHostingController+capture.swift +++ b/Sources/SwiftExtensions/UIHostingController+capture.swift @@ -7,7 +7,7 @@ import SwiftUI -extension UIHostingController { +public extension UIHostingController { func capture(transparentBackground: Bool = true) -> UIImage { let size = sizeThatFits(in: UIScreen.main.bounds.size) diff --git a/Sources/SwiftExtensions/UIImage+scaleImage.swift b/Sources/SwiftExtensions/UIImage+scaleImage.swift index 232b5d6..b29a1ef 100644 --- a/Sources/SwiftExtensions/UIImage+scaleImage.swift +++ b/Sources/SwiftExtensions/UIImage+scaleImage.swift @@ -7,7 +7,7 @@ import UIKit -extension UIImage { +public extension UIImage { func resizeImage(newWidth: CGFloat) -> UIImage? { let scale = newWidth / self.size.width diff --git a/Sources/SwiftExtensions/View+glow.swift b/Sources/SwiftExtensions/View+glow.swift index 8b0d3aa..9090ad0 100644 --- a/Sources/SwiftExtensions/View+glow.swift +++ b/Sources/SwiftExtensions/View+glow.swift @@ -7,7 +7,7 @@ import SwiftUI -extension View { +public extension View { func glow(color: Color = .red, radius: CGFloat = 20) -> some View { self .overlay(self.blur(radius: radius / 6)) diff --git a/Sources/SwiftExtensions/View+hideKeyboard.swift b/Sources/SwiftExtensions/View+hideKeyboard.swift index 8dbfb03..8537421 100644 --- a/Sources/SwiftExtensions/View+hideKeyboard.swift +++ b/Sources/SwiftExtensions/View+hideKeyboard.swift @@ -7,7 +7,7 @@ import SwiftUI -extension View { +public extension View { func hideKeyboard() { UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) } diff --git a/Sources/SwiftExtensions/View+multicolorGlow.swift b/Sources/SwiftExtensions/View+multicolorGlow.swift index f8baadf..4b8fe35 100644 --- a/Sources/SwiftExtensions/View+multicolorGlow.swift +++ b/Sources/SwiftExtensions/View+multicolorGlow.swift @@ -7,7 +7,7 @@ import SwiftUI -extension View { +public extension View { func multicolorGlow() -> some View { ForEach(0..<2) { i in Rectangle()