Skip to content

Instantly share code, notes, and snippets.

View goergisn's full-sized avatar
🦦

Alex Guretzki goergisn

🦦
View GitHub Profile
/*
Put that Line of code somewhere before you initialize the javascript application
You can read a Blogpost about that topic here:
https://medium.com/shopgate-mobile-commerce/hacking-tvml-4387e65a9b94#.o2onhfgo4
*/
[TVInterfaceFactory sharedInterfaceFactory].extendedInterfaceCreator = [CustomInterfaceCreator new];
@goergisn
goergisn / SimpleSectionsViewController.swift
Created August 24, 2018 11:23
Using enums to build a reliable section model
import UIKit
import MessageUI
class SimpleSectionsViewController: UITableViewController {
enum UserInfoRow {
case name
}
enum ContactInfoRow {
case email
class SimpleStackView: UIView {
var padding:CGFloat = 0 {
didSet {
setNeedsLayout()
}
}
var spacing:CGFloat = 0 {
didSet {
@goergisn
goergisn / FittingSheet.swift
Last active December 19, 2022 22:08
A SwiftUI sheet that sizes itself based on the height needed by the contained view
extension View {
func fittingSheet<Content: View>(
isPresented: Binding<Bool>,
backgroundColor: Color? = nil,
additionalDetents: Set<PresentationDetent> = [],
shouldShowDragIndicator: Bool = true,
onDismiss: (() -> Void)? = nil,
content: @escaping () -> Content
) -> some View {