Skip to content

Instantly share code, notes, and snippets.

View advienncurtiz's full-sized avatar
🏠
Working from home

advienncurtiz

🏠
Working from home
View GitHub Profile
//
// HalfSheetWithUIKitForSwiftUI.swift
// TestAppForNewThinks
//
// Created by Hasan Ali Şişeci on 23.12.2023.
//
import SwiftUI
extension View {
@advienncurtiz
advienncurtiz / SheetNavigationView.swift
Last active April 8, 2022 00:29
Simple Navigaton bar for Sheet
struct SheetNavigationView<Content>: View where Content: View {
var views: Content
var closeButtonTapped: () -> Void
var barHeight: CGFloat = 64
init(@ViewBuilder content: () -> Content, closeButtonTapped: @escaping () -> Void) {
self.views = content()
@advienncurtiz
advienncurtiz / Array+Extension.swift
Last active May 12, 2022 11:16
How to split an array into chunks
extension Array {
func chunked(into size: Int) -> [[Element]] {
return stride(from: 0, to: count, by: size).map {
Array(self[$0 ..< Swift.min($0 + size, count)])
}
}
}