Skip to content

Instantly share code, notes, and snippets.

View dabodamjan's full-sized avatar

Damjan Dabo dabodamjan

View GitHub Profile
@dabodamjan
dabodamjan / MailComposeViewController.swift
Last active April 24, 2024 07:31
Sending a contact us email on iOS 14 (can be also used with SwiftUI)
//
// Feel free to use this code in your project.
// Inspired by SO answer https://stackoverflow.com/a/65743126
// Uses DeviceKit as a dependency https://github.com/devicekit/DeviceKit
//
import Foundation
import MessageUI
import DeviceKit
@dabodamjan
dabodamjan / FullScreenBackground.swift
Last active June 7, 2022 08:58
SwiftUI background which covers the full-screen and ignores the safe area
struct FullScreenBackground<BackgroundView: View>: ViewModifier {
@ViewBuilder var backgroundView: () -> BackgroundView
func body(content: Content) -> some View {
ZStack() {
backgroundView().ignoresSafeArea()
content
}
}
@dabodamjan
dabodamjan / Query+Combine.swift
Last active June 16, 2022 08:49
Firebase Firestore snapshot publisher that maps snapshot documents to an array of your model data type
import Foundation
import Firebase
import FirebaseFirestore
import FirebaseFirestoreCombineSwift
import Combine
extension Query {
func snapshotArrayPublisher<T: Decodable>(
as type: T.Type,
@dabodamjan
dabodamjan / KeywordsMinifier.swift
Last active December 24, 2022 12:02
KeywordsMinifier used for Minify ASO app
//
// KeywordsMinifier.swift
// MinifyASO
//
// Created by Damjan Dabo on 19.12.22.
//
import Foundation
/// Used for Minify ASO app https://apps.apple.com/us/app/minify-aso-duplicate-keywords/id1660632226