Skip to content

Instantly share code, notes, and snippets.

View marquavious's full-sized avatar
🎯
Focusing

marquavious

🎯
Focusing
View GitHub Profile
@marquavious
marquavious / swiftuiheaderview.swift
Last active October 13, 2024 02:49
Swift-UI-Stretchy-Header-View
// https://alladinian.hashnode.dev/stretchy-views-in-swiftui
import SwiftUI
struct ContehntView: View {
let overlay: some View =
Text("❊ Stretchy")
.font(.title)
.fontWeight(.bold)
@marquavious
marquavious / movekeyboardup.swift
Created May 17, 2017 04:55
A simple way to move the screen up when the keyboard is apparent
// Make sure you add the observer.
func addObserverToKeyboard(){
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(notification:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(notification:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
}
func keyboardWillShow(notification: NSNotification) {