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
// | |
// CoreDataHelper.swift | |
// | |
// Created by Andres Rojas on 14/11/19. | |
// Copyright © 2019 Andres Rojas. All rights reserved. | |
// | |
// MIT License | |
// | |
// Copyright (c) 2019 Andres Rojas | |
// |
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
// | |
// Coordinator.swift | |
// CoordinatorPatternDemo | |
// | |
// Created by Andres Rojas on 18/11/19. | |
// Copyright © 2019 Andres Rojas. All rights reserved. | |
// | |
import UIKit |
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
// | |
// AnimatedRing.swift | |
// AnimatedRing | |
// | |
// Created by Andres Rojas on 21/11/19. | |
// Copyright © 2019 Andres Rojas. All rights reserved. | |
// | |
import SwiftUI |
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
protocol Builder { | |
typealias Handler = (inout Self) -> Void | |
} | |
extension NSObject: Builder {} | |
extension Builder { | |
public func with(_ configure: Handler) -> Self { | |
var this = self | |
configure(&this) |
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 Contact: Decodable, CustomStringConvertible { | |
var id: String | |
@NestedKey | |
var firstname: String | |
@NestedKey | |
var lastname: String | |
@NestedKey | |
var address: String | |
enum CodingKeys: String, NestableCodingKey { |
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 | |
@propertyWrapper | |
struct UserDefaultsWrapper<Value: Codable> { | |
let key: String | |
let defaultValue: Value | |
let userDefaults = UserDefaults(suiteName: Constants.kGroupIdentifier) | |
var wrappedValue: Value { | |
get { |
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 | |
struct Task: Codable { | |
var title: String | |
var isDone: Bool | |
} | |
enum Errors: Error { | |
case encodeError | |
case decodeError |
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
# Type a script or drag a script file from your workspace to insert its path. | |
environment=${ASSET_PREFIX} | |
# Name and path of the resource we're copying | |
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist | |
GOOGLESERVICE_INFO_FILE=${PROJECT_DIR}/Google/${environment}/${GOOGLESERVICE_INFO_PLIST} | |
# Make sure GoogleService-Info.plist exists | |
echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_FILE}" |
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
{ | |
"triple_a_test": { | |
"prefix": "aaa", | |
"description": "AAA test", | |
"body": [ | |
"test(", | |
"\t'should $1',", | |
"\t() async {", | |
"\t\t// arrange", | |
"\t\t$2", |
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
void main() async { | |
//Dynamic List | |
var list = []; | |
list.add(1); | |
list.add('2'); | |
print(list); | |
// Callbacks | |
void downloadImage(Function(int) callback) { | |
int progress = 0; |
OlderNewer