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
@frozen public struct Castillo | |
{ | |
/// La propietaria del castillo | |
public var moradora: Princesa | |
/// La superficie (habitable) del castillo | |
public var metrosCuadrados: Int | |
/** | |
Nuevo castillo para la princesa del universo Frozen | |
*/ |
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
let index = Int.random(in: 0 ..< Princesa.allCases.count) | |
switch Princesa.allCases[index] | |
{ | |
case .elsa: | |
print("Elsa") | |
case .anna: | |
print("Anna") | |
} |
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
@frozen public enum Princesa: CaseIterable | |
{ | |
case elsa | |
case anna | |
} |
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
public enum Princesa: CaseIterable | |
{ | |
case elsa | |
case anna | |
case olivia | |
case valeria | |
} |
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
let index = Int.random(in: 0 ..< Princesa.allCases.count) | |
switch Princesa.allCases[index] | |
{ | |
case .elsa: | |
print("Elsa") | |
case .anna: | |
print("Anna") | |
@unknown default: | |
print("Por si hacen Frozen 3 y aparece una nueva princesa") |
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
// | |
// ImageLoader.swift | |
// DubDubKit | |
// | |
// Created by Adolfo Vera Blasco on 27/06/2019. | |
// Copyright © 2019 Adolfo Vera Blasco. All rights reserved. | |
// | |
#if os(macOS) | |
import AppKit |
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
/** | |
URL HTTP request to a server with a | |
3 request per 10 seconds rate limit. | |
Thanks to combine it's super easy detected | |
rate limit and retry after N seconds. | |
This is a *beta* version. | |
Things TO-DO... | |
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
//: A UIKit based Playground for presenting SwiftUI based user interface | |
// by @fitomad | |
import UIKit | |
import SwiftUI | |
import PlaygroundSupport | |
// MARK: - Contenedor Principal - | |
public struct Container: 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
//: A UIKit based Playground for playing with SwiftUI | |
// @fitomad | |
import UIKit | |
import SwiftUI | |
import PlaygroundSupport | |
struct RoundedShadowView: View | |
{ | |
var body: some 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
extension Collection | |
{ | |
/// Ask in a *positive way * | |
/// if a collection is **not** empty | |
var isFilled: Bool | |
{ | |
return !self.isEmpty | |
} | |
} |