Skip to content

Instantly share code, notes, and snippets.

View julianschiavo's full-sized avatar

Julian Schiavo julianschiavo

View GitHub Profile
@jstheoriginal
jstheoriginal / SearchBar.swift
Created June 20, 2019 00:42
A simple SwiftUI search bar
struct SearchBar : View {
@Binding var searchText: String
var body: some View {
HStack {
Image(systemName: "magnifyingglass").foregroundColor(.secondary)
TextField(
$searchText,
placeholder: Text("Search")) {
UIApplication.shared.keyWindow?.endEditing(true)
@4np
4np / ImageCaptureManager.swift
Created August 1, 2016 11:37
Example code to grab a still image (photo) from a mac's FaceTime camera
//
// ImageCaptureManager.swift
// ImageCapture
//
// Created by Jeroen Wesbeek on 29/07/16.
// Copyright © 2016 Jeroen Wesbeek. All rights reserved.
//
import Foundation
import AVFoundation
@samuelbeek
samuelbeek / VerticalCenteredTextView.swift
Last active January 6, 2019 23:37
Vertically aligned text in textview
class VerticalCenteredTextView: UITextView {
override init(frame: CGRect) {
super.init(frame: frame)
addContentSizeObserver()
}
override init(frame: CGRect, textContainer: NSTextContainer?) {
super.init(frame: frame, textContainer: textContainer)
}