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
#!/bin/sh | |
# ------- | |
# Usage sh unusedImages.sh (jpg|png|gif) | |
# ------- | |
# Caveat | |
# 1 - | |
# NSString *imageName = [NSString stringWithFormat:@"image_%d.png", 1]; | |
# This script would incorrectly list these images as unreferenced. For example, you might have | |
# This script will incorrectly think image_1.png is unreferenced. | |
# 2 - If you have a method, or variable with the same name as the image it won't pick it up |
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
// | |
// UKPostcodeValidator.swift | |
// Medio | |
// | |
// Created by Daniel Tavares on 20/03/2016. | |
// Copyright © 2016 Daniel Tavares. All rights reserved. | |
// References: http://stackoverflow.com/questions/164979/uk-postcode-regex-comprehensive | |
// References: http://benscheirman.com/2014/06/regex-in-swift/ | |
// Usage: UKPostcodeValidator.validate("W1D 5LH") | |
// |
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
extension NSUserDefaults { | |
static func getSavedValue<T>(key: String) -> T? { | |
return NSUserDefaults.standardUserDefaults().objectForKey(key) as? T | |
} | |
static func setSavedValue<T>(value: T, key: String) { | |
NSUserDefaults.standardUserDefaults().setObject(value as? AnyObject, forKey: key) | |
} | |
} | |
/* |
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
// | |
// Created by Dan Tavares on 10/07/2020. | |
// | |
import SwiftUI | |
struct WindowKey: EnvironmentKey { | |
static let defaultValue: UIWindow? = { | |
guard | |
let firstScene = UIApplication.shared.connectedScenes.first, |
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
// | |
// main.swift | |
// PreviewDeviceExporter | |
// | |
// Created by Dan Tavares on 13/05/2021. | |
// https://github.com/JohnSundell/Files | |
// https://github.com/JohnSundell/ShellOut.git | |
// Packages used |
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 ToggledExampleView_Previews: PreviewProvider { | |
static var previews: some View { | |
DebuggingToggledExampleView() | |
} | |
} | |
// MARK: - Toggled Source | |
protocol ToggleInterface { | |
associatedtype ValueType |
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
// | |
// HelloAnimationView.swift | |
// SwiftUIBiteSize | |
// | |
// Created by Dan Tavares on 29/06/2022. | |
// | |
import SwiftUI | |
struct HelloAnimationView: View { |
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 UIKit | |
import Combine | |
// MADE UP CODE | |
typealias Package = Int | |
struct Offerings { | |
var monthtly: Package? | |
var annual: Package? | |
var lifetime: Package? |
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
// | |
// TilingTabView.swift | |
// | |
// | |
// Created by Dan Tavares on 12/07/2020. | |
// | |
import SwiftUI | |
class State: ObservableObject { |
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
// | |
// ContentView.swift | |
// Shared | |
// | |
// Created by Dan Tavares on 01/07/2022. | |
// More Info: https://nilcoalescing.com/blog/EncodeAndDecodeSwiftUIColor/ | |
import SwiftUI | |
#if os(iOS) |