Skip to content

Instantly share code, notes, and snippets.

View urmaj3's full-sized avatar

U J urmaj3

  • Bishkek, Kyrgyzstan
View GitHub Profile
@urmaj3
urmaj3 / TabViewRotationFix.swift
Last active September 20, 2022 05:18
SwiftUI TabView Orientation change fix
import SwiftUI
struct TabViewRotationFix: View {
@State
private var selectedTab = Int.zero
@State
private var isLandscape = false
var body: some View {
GeometryReader { proxy in
ScrollView {
import android.content.Context
import android.net.ConnectivityManager
import android.net.Network
import android.net.NetworkCapabilities
import android.net.NetworkRequest
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
interface ConnectivityObserver {