Added public to extensions to make them visible to other packages.

This commit is contained in:
Robert McGovern 2021-07-06 01:59:50 +01:00
parent a16a62b365
commit 84dac2cb6c
12 changed files with 12 additions and 12 deletions

View File

@ -7,7 +7,7 @@
import SwiftUI
extension AnyTransition {
public extension AnyTransition {
static var scaleAndFade: AnyTransition {
let insertion = AnyTransition.scale
.combined(with: .opacity)

View File

@ -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]()

View File

@ -7,7 +7,7 @@
import SwiftUI
extension Binding {
public extension Binding {
func didSet(execute: @escaping (Value) -> Void) -> Binding {
return Binding(
get: {

View File

@ -7,7 +7,7 @@
import SwiftUI
extension Color {
public extension Color {
func toString() -> String {
let uiColor = UIColor(self)
var red: CGFloat = 0

View File

@ -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()!
}

View File

@ -7,7 +7,7 @@
import SwiftUI
class Directories {
public class Directories {
// Get user's documents directory path
static func getDocumentsDirectoryPath() -> URL {

View File

@ -7,7 +7,7 @@
import Foundation
extension String {
public extension String {
subscript(idx: Int) -> String {
String(self[index(startIndex, offsetBy: idx)])
}

View File

@ -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)

View File

@ -7,7 +7,7 @@
import UIKit
extension UIImage {
public extension UIImage {
func resizeImage(newWidth: CGFloat) -> UIImage? {
let scale = newWidth / self.size.width

View File

@ -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))

View File

@ -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)
}

View File

@ -7,7 +7,7 @@
import SwiftUI
extension View {
public extension View {
func multicolorGlow() -> some View {
ForEach(0..<2) { i in
Rectangle()