Skip to content

Instantly share code, notes, and snippets.

View amrangry's full-sized avatar
🎯
Focusing

Amr Elghadban amrangry

🎯
Focusing
View GitHub Profile
import Foundation
import UIKit
struct ViewStyle<T> {
let style: (T) -> Void
}
let filled = ViewStyle<UIButton> {
$0.setTitleColor(.white, for: .normal)
$0.backgroundColor = .red
@m25lazi
m25lazi / ReadEnvironmentVariable.swift
Created January 7, 2020 15:18
Snippet for reading environment variables.
var shouldLogTextAnalyzer = false
if ProcessInfo.processInfo.environment["text_analyzer_log"] == "verbose" {
shouldLogTextAnalyzer = true
}
if shouldLogTextAnalyzer {
/// Actual logger code
}
@RichAppz
RichAppz / UICollectionView+Extension.swift
Last active December 7, 2020 11:15
UICollectionView+Extension
import Foundation
import UIKit
public extension UICollectionView {
/**
Register nibs faster by passing the type - if for some reason the `identifier` is different then it can be passed
- Parameter type: UICollectionView.Type
- Parameter identifier: String?
*/
@amrangry
amrangry / UserDefaultsManager.swift
Last active February 5, 2024 17:19
UserDefaultsManager is a manager and wrapper class for UserDefaults
//
// UserDefaultsManager.swift
// Www.ADKATech.com
//
// Created by AmrAngry on 7/30/19.
// Modifyed by AmrAngry on 5/5/20.
// Copyright © 2019 Www.ADKATech.com. All rights reserved.
// Generic use original mestion by (FB)محمود زكى and hamada147(Github)
import Foundation