Skip to content

Instantly share code, notes, and snippets.

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

Agus Cahyono balitax

🏠
Working from home
View GitHub Profile
@michaelhenry
michaelhenry / HasRootNavigationController.swift
Last active June 7, 2025 07:12
UINavigationController in swiftUI.
import SwiftUI
import UIKit
protocol HasRootNavigationController {
var rootVC:UINavigationController? { get }
func push<Content:View>(view: Content, animated:Bool)
func setRootNavigation<Content:View>(views:[Content], animated:Bool)
func pop(animated: Bool)
func popToRoot(animated: Bool)
@balitax
balitax / fibonacci.swift
Created October 18, 2019 14:37
Fibonacci Swift
import Foundation
func fibonacci(_ number: Int) -> [Int] {
var fibonacci = [Int]()
for n in 0...number {
if n == 0 {
fibonacci.append(0)