This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct AppConfig { | |
static func toggleDebugMode() -> Bool { | |
guard !UserDefaults.standard.isDebuggingEnabled else { | |
return false | |
} | |
enableDebugMode() | |
func enableDebugMode() -> Never { | |
UserDefaults.standard.isDebuggingEnabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Logger+Extensions.swift | |
// SkyWizard | |
// | |
// Created by Hishara Dilshan on 2023-10-10. | |
// | |
import OSLog | |
extension Logger { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DependencyInjector.swift | |
// SkyWizard | |
// | |
// Created by Hishara Dilshan on 2023-10-10. | |
// | |
import Foundation | |
protocol Injectable {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UserDefaults+Wrapper.swift | |
// SkyWizard | |
// | |
// Created by Hishara Dilshan on 2023-10-22. | |
// | |
import Foundation | |
import Combine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
@dynamicMemberLookup | |
struct AppConfig { | |
let weatherApiKey: String = "" | |
private init() {} | |
static subscript<T>(dynamicMember keyPath:KeyPath<AppConfig, T>) -> T { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
///Error enum for CachedImageLoader | |
enum CachedImageLoaderError: Error { | |
case errorLoading(Error) | |
case errorDecording | |
case cancelled | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotificationHandler( | |
private val context: Context, | |
private val channelID: String, | |
channelName: String, | |
channelDescription: String, | |
) { | |
private var notificationManager: NotificationManager = | |
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ItemOffsetDecoration( | |
val context: Context, | |
@DimenRes | |
var top: Int, | |
@DimenRes | |
var bottom: Int, | |
@DimenRes | |
var left: Int, | |
@DimenRes | |
var right: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--make it just appear--> | |
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
<alpha | |
android:interpolator="@android:anim/accelerate_interpolator" | |
android:duration="1" | |
android:fromAlpha="1.0" | |
android:toAlpha="1.0"/> | |
</set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--push_down_in--> | |
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
<translate android:fromYDelta="-100%p" android:toYDelta="0" android:duration="5000"/> | |
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="5000" /> | |
</set> | |
<!--push_down_out--> | |
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android"> |
NewerOlder