Skip to content

Instantly share code, notes, and snippets.

View davideme's full-sized avatar

Davide Mendolia davideme

  • Karumi
  • Madrid
  • 11:55 (UTC +02:00)
View GitHub Profile
@davideme
davideme / ViewController.swift
Created January 30, 2018 15:42
LifecycleObserver with Notification
//
// ViewController.swift
// LifeCycleDelegate
//
// Created by Davide Mendolia on 30/01/2018.
// Copyright © 2018 Karumi. All rights reserved.
//
import UIKit
//
// ViewController.swift
// LifeCycleDelegate
//
// Created by Davide Mendolia on 30/01/2018.
// Copyright © 2018 Karumi. All rights reserved.
//
import UIKit
struct List : View {
var body: some View {
NavigationView {
List(viewModel.superHeroes.identified(by: \.name)) { value in
SwitchValue(value) {
CaseType(is: SuperHero.self) { superHero in
Text(superHero.name)
}
CaseType(is: Avenger.self) { avenger in
@davideme
davideme / State of the Apps 2019 (macOS).md
Last active December 28, 2018 08:52
State of the Apps 2019 (macOS)

As I’m setting up my new laptop, I will use few minutes to write down my list of apps, you will maybe find some useful stuff in it.

Browser

Password Manager

Cloud storage

Keybase proof

I hereby claim:

  • I am davideme on github.
  • I am davideme (https://keybase.io/davideme) on keybase.
  • I have a public key ASDnkkom9QjmbOGfsiIALJLSzQM14-f0uyExBvQmaCZa3wo

To claim this, I am signing this object:

class MealTableViewController: UITableViewController {
// MARK: Properties
var meals = [Meal]()
override func viewDidLoad() {
super.viewDidLoad()
// Use the edit button item provided by the table view controller.
@davideme
davideme / AWSCognitoDataset.swift
Last active May 3, 2016 13:18
Add square brackets syntax to AWSCognitoDataset
extension AWSCognitoDataset {
subscript(index: String) -> String {
get {
return self.stringForKey(index)
}
set(newValue) {
self.setString(newValue, forKey: index)
}
}
}
// This protocol cannot be implemented by a enum.
// Because enums may not contain stored properties
protocol SomeProtocol {
var mustBeSettable: Bool { get set }
}
struct SomeStruct: SomeProtocol {
var mustBeSettable:Bool
}