Skip to content

Commit 636d20f

Browse files
author
VishwaiOSDev
committed
feat: removed public modifiers
1 parent ceb8081 commit 636d20f

23 files changed

Lines changed: 112 additions & 113 deletions

Loadify.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@
130130
88DB2C372856F7820065BBF9 /* VideoDetailsResponse.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = VideoDetailsResponse.json; sourceTree = "<group>"; };
131131
88DB2C3A2856FDA60065BBF9 /* ApiServiceTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiServiceTest.swift; sourceTree = "<group>"; };
132132
88EBFF2E284DC33A007EFF97 /* Protocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Protocols.swift; sourceTree = "<group>"; };
133-
88EF20112A81A98F005E3D69 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
134133
88F341832836549000493544 /* LoadifyConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadifyConstants.swift; sourceTree = "<group>"; };
135134
88FDA6DF2862C80D0028DCE9 /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = "<group>"; };
136135
/* End PBXFileReference section */
@@ -307,7 +306,6 @@
307306
88A729AC28264AD100B5FE61 /* Loadify */ = {
308307
isa = PBXGroup;
309308
children = (
310-
88EF20112A81A98F005E3D69 /* Info.plist */,
311309
88B1CFA62826BBA4007B19B4 /* App */,
312310
88A729BD2826506B00B5FE61 /* Model */,
313311
88A729BC2826506300B5FE61 /* View */,

Loadify/Others/Extensions/Task+Extension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
public extension Task where Success == Never, Failure == Never {
10+
extension Task where Success == Never, Failure == Never {
1111

1212
static func sleep(seconds: TimeInterval) async throws {
1313
let duration = UInt64(seconds * 1_000_000_000)

Loadify/Others/Extensions/UIDevice+Extension.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ extension UIDevice {
1111

1212
/// Returns `true` if the device has a notch
1313
var hasNotch: Bool {
14-
guard #available(iOS 11.0, *), let window = UIApplication.shared.windows.filter({$0.isKeyWindow}).first else { return false }
14+
guard #available(iOS 11.0, *),
15+
let window = UIApplication.shared.windows.filter({$0.isKeyWindow}).first else {
16+
return false
17+
}
18+
1519
if UIDevice.current.orientation.isPortrait {
1620
return window.safeAreaInsets.top >= 44
1721
} else {

Loadify/Others/Extensions/View+Extension.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extension View {
4343
/// - title: Title of the loader to be displayed.
4444
/// - showOverlay: Bool property to add black background behind the loader when it is active. By default it is false
4545
/// - isPresented: isPresented is used to toggle the loader's state
46-
public func showLoader(
46+
func showLoader(
4747
_ title: String,
4848
shouldShowOverlay: Bool = false,
4949
isPresented: Binding<Bool>
@@ -61,7 +61,7 @@ extension View {
6161
/// - Parameters:
6262
/// - item: Error item to be displayed.
6363
/// - content: Closure to show `Alert` and display error message
64-
public func showAlert<T: View>(item: Binding<Error?>, for duration: TimeInterval = 2.5, content: (Error) -> T) -> some View {
64+
func showAlert<T: View>(item: Binding<Error?>, for duration: TimeInterval = 2.5, content: (Error) -> T) -> some View {
6565
ZStack {
6666
self.allowsHitTesting(item.wrappedValue != nil ? false : true)
6767
if let error = item.wrappedValue {
@@ -78,7 +78,7 @@ extension View {
7878
/// - Parameters:
7979
/// - isPresented: Bool to indicate to show Alert on the View heriracy
8080
/// - content: Closure to show `Alert` and display alert message
81-
public func showAlert<T: View>(isPresented: Binding<Bool>, for duration: TimeInterval = 2.5, content: () -> T) -> some View {
81+
func showAlert<T: View>(isPresented: Binding<Bool>, for duration: TimeInterval = 2.5, content: () -> T) -> some View {
8282
ZStack {
8383
self.allowsHitTesting(!isPresented.wrappedValue)
8484
if isPresented.wrappedValue {
@@ -90,7 +90,7 @@ extension View {
9090
}
9191
}
9292

93-
internal func dismiss(delay: TimeInterval, completion: @escaping () -> Void) -> some View {
93+
func dismiss(delay: TimeInterval, completion: @escaping () -> Void) -> some View {
9494
self.onAppear {
9595
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
9696
completion()
@@ -105,7 +105,7 @@ extension View {
105105
/// - showOverlay: Bool property to add black background behind the loader when it is active. By default it is false
106106
/// - options: This gives some View of type LoaderView
107107
@available(*, deprecated, message: "use showLoader instead.")
108-
public func addLoaderView(
108+
func addLoaderView(
109109
for loaderAction: LoaderViewAction,
110110
showOverlay: Bool = false,
111111
options: LoaderOptions = LoaderOptions()
@@ -124,7 +124,7 @@ extension View {
124124
}
125125

126126
@available(*, deprecated, message: "use showAlert instead.")
127-
public func addAlertView(
127+
func addAlertView(
128128
for alertAction: AlertViewAction
129129
) -> some View {
130130
ZStack {
@@ -141,12 +141,12 @@ extension View {
141141
}
142142

143143
/// Uses VisualEffectsView to blur the background beneath the views
144-
internal func loaderBackground(colors: [Color]? = nil) -> some View {
144+
func loaderBackground(colors: [Color]? = nil) -> some View {
145145
modifier(LoaderBackground(colors: colors))
146146
}
147147

148148
/// Limits the font size for selected lines
149-
internal func reduceFontSize(for line: Int) -> some View {
149+
func reduceFontSize(for line: Int) -> some View {
150150
modifier(FontReducer(line: line))
151151
}
152152
}

Loadify/Others/LoadifyConstants.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import SwiftUI
99

1010
typealias LoadifyTexts = Loadify.Texts
11-
public typealias LoadifyColors = LoadifyKit.ColorKit
11+
typealias LoadifyColors = LoadifyKit.ColorKit
1212
typealias LoadifyAssets = LoadifyKit.AssetKit
1313

1414
struct Loadify {
@@ -27,27 +27,27 @@ struct Loadify {
2727
}
2828
}
2929

30-
public struct LoadifyKit {
30+
struct LoadifyKit {
3131

32-
public struct AssetKit {
32+
struct AssetKit {
3333
static let loadifyHorizontal = Image("loadify_horizontal")
3434
static let loadifyIcon = Image("loadify_icon")
3535
static let notFound = Image("not_found")
3636
}
3737

38-
public struct ColorKit {
39-
public static let appBackground = Color("app_background")
40-
public static let greyText = Color("grey_text")
41-
public static let textfieldBackground = Color("textfield_background")
42-
public static let blueAccent = Color("blue_accent")
43-
public static let errorRedGradient = Color("error_red_gradient")
44-
public static let errorRed = Color("error_red")
45-
public static let successGreenGradient = Color("success_green_gradient")
46-
public static let successGreen = Color("success_green")
38+
struct ColorKit {
39+
static let appBackground = Color("app_background")
40+
static let greyText = Color("grey_text")
41+
static let textfieldBackground = Color("textfield_background")
42+
static let blueAccent = Color("blue_accent")
43+
static let errorRedGradient = Color("error_red_gradient")
44+
static let errorRed = Color("error_red")
45+
static let successGreenGradient = Color("success_green_gradient")
46+
static let successGreen = Color("success_green")
4747
}
4848
}
4949

5050
struct Constants {
51-
51+
5252
static let iMacURL = "https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/imac-refurb-about-201810?wid=984&hei=859&fmt=jpeg&qlt=90&.v=1541530952135"
5353
}

Loadify/Others/Modifiers/CardView.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,25 @@
77

88
import SwiftUI
99

10-
public struct CardView: ViewModifier {
10+
struct CardView: ViewModifier {
1111

1212
private let color: Color
1313
private let cornerRadius: CGFloat
1414

15-
public init(color: Color, cornerRadius: CGFloat = 10) {
15+
init(color: Color, cornerRadius: CGFloat = 10) {
1616
self.color = color
1717
self.cornerRadius = cornerRadius
1818
}
1919

20-
public func body(content: Content) -> some View {
20+
func body(content: Content) -> some View {
2121
content
2222
.background(color)
2323
.cornerRadius(cornerRadius)
2424
}
2525
}
2626

2727
struct CardView_Previews: PreviewProvider {
28+
2829
static var previews: some View {
2930
VStack {
3031
Text("Card View")

Loadify/Others/Modifiers/CustomButtonStyle.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
import SwiftUI
99

10-
public struct CustomButtonStyle: ButtonStyle {
10+
struct CustomButtonStyle: ButtonStyle {
1111

1212
var buttonColor: Color
1313
var cornerRadius: CGFloat = 10
1414
var isDisabled: Bool = false
1515

16-
public init(
16+
init(
1717
buttonColor: Color = LoadifyColors.blueAccent,
1818
cornerRadius: CGFloat = 10,
1919
isDisabled: Bool = false
@@ -23,7 +23,7 @@ public struct CustomButtonStyle: ButtonStyle {
2323
self.isDisabled = isDisabled
2424
}
2525

26-
public func makeBody(configuration: Configuration) -> some View {
26+
func makeBody(configuration: Configuration) -> some View {
2727
configuration.label
2828
.foregroundColor(isDisabled ? .white.opacity(0.5) : .white)
2929
.frame(maxWidth: .infinity, maxHeight: 56)
@@ -34,6 +34,7 @@ public struct CustomButtonStyle: ButtonStyle {
3434
}
3535

3636
struct CustomButtonStyle_Previews: PreviewProvider {
37+
3738
static var previews: some View {
3839
Button(action: {}) {
3940
Text("Download Now")

Loadify/Services/ImageLoaderService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import UIKit
1010

1111
final class ImageLoaderService: ObservableObject {
1212

13-
public enum ImageStatus {
13+
enum ImageStatus {
1414
case success(uiImage: UIImage)
1515
case failure
1616
case loading

Loadify/Services/ReachablityManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
import SwiftUI
99
import Network
1010

11-
public final class ReachablityManager: ObservableObject {
11+
final class ReachablityManager: ObservableObject {
1212

13-
@Published public var isConnected = true
13+
@Published var isConnected = true
1414

15-
public var connectionDescription: String {
15+
var connectionDescription: String {
1616
isConnected ? "Back online" : "No connection"
1717
}
1818

1919
private let monitor = NWPathMonitor()
2020
private let queue = DispatchQueue(label: "ReachablityManager")
2121

22-
public init() {
22+
init() {
2323
startMonitoring()
2424
}
2525

Loadify/View/Components/ChannelView.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
import SwiftUI
99
import FontKit
1010

11-
public struct ChannelView: View {
11+
struct ChannelView: View {
1212

1313
private var name: String
1414
private var profileImage: String
1515
private var subscriberCount: String
1616

17-
public init(name: String, profileImage: String, subscriberCount: String) {
17+
init(name: String, profileImage: String, subscriberCount: String) {
1818
self.name = name
1919
self.profileImage = profileImage
2020
self.subscriberCount = subscriberCount
2121
}
2222

23-
public var body: some View {
23+
var body: some View {
2424
HStack {
2525
channelImageView
2626
VStack(alignment: .leading) {
@@ -65,6 +65,7 @@ public struct ChannelView: View {
6565
}
6666

6767
struct ChannelView_Previews: PreviewProvider {
68+
6869
static var previews: some View {
6970
ChannelView(name: "Fx Artist", profileImage: "https://yt3.ggpht.com/wzh-BL3_M_uugIXZ_ANSSzzBbi_w5XnNSRl4F5DbLAxKdTfXkjgx-kWM1mChdrrMkADRQyB-nQ=s176-c-k-c0x00ffffff-no-rj", subscriberCount: "5000")
7071
.previewLayout(.sizeThatFits)

0 commit comments

Comments
 (0)