Skip to content

Instantly share code, notes, and snippets.

View fgroeger's full-sized avatar
🚀

Fabian Gröger fgroeger

🚀
View GitHub Profile
@fgroeger
fgroeger / ContentView.swift
Created July 31, 2021 18:03
SwiftUI onAppear
import SwiftUI
class ContentViewStateObject: ObservableObject {
var titles = ["Hello", "World", "Test", "ABC"]
@Published var primaryTitle: String
init() {
self.primaryTitle = titles.randomElement()!
}
@fgroeger
fgroeger / Mojave.xccolortheme
Created June 4, 2018 21:09
The dark Xcode theme from the Xcode 10 beta running on macOS 10.14 Mojave.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 12.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>

SOLID

I - Interface Segregation

An Interface should have one purpose and one purpose only. If a class wants to implement a functionality from an interface, it shouldn't have to implement methods it doesn't need.

Example from Apple's UIKit: