Added public to extensions to make them visible to other packages.
This commit is contained in:
parent
a16a62b365
commit
84dac2cb6c
|
@ -7,7 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
extension AnyTransition {
|
||||
public extension AnyTransition {
|
||||
static var scaleAndFade: AnyTransition {
|
||||
let insertion = AnyTransition.scale
|
||||
.combined(with: .opacity)
|
||||
|
|
|
@ -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]()
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
extension Binding {
|
||||
public extension Binding {
|
||||
func didSet(execute: @escaping (Value) -> Void) -> Binding {
|
||||
return Binding(
|
||||
get: {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
extension Color {
|
||||
public extension Color {
|
||||
func toString() -> String {
|
||||
let uiColor = UIColor(self)
|
||||
var red: CGFloat = 0
|
||||
|
|
|
@ -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()!
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
class Directories {
|
||||
public class Directories {
|
||||
|
||||
// Get user's documents directory path
|
||||
static func getDocumentsDirectoryPath() -> URL {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
extension String {
|
||||
public extension String {
|
||||
subscript(idx: Int) -> String {
|
||||
String(self[index(startIndex, offsetBy: idx)])
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
extension UIImage {
|
||||
public extension UIImage {
|
||||
func resizeImage(newWidth: CGFloat) -> UIImage? {
|
||||
|
||||
let scale = newWidth / self.size.width
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
|
||||
extension View {
|
||||
public extension View {
|
||||
func multicolorGlow() -> some View {
|
||||
ForEach(0..<2) { i in
|
||||
Rectangle()
|
||||
|
|
Loading…
Reference in New Issue