Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 831 Bytes

README.md

File metadata and controls

31 lines (26 loc) · 831 Bytes

ScreenTimeout

demo.mp4

Installation

ScreenTimeout can be installed with the Swift Package Manager:

https://github.com/SNQ-2001/ScreenTimeout

You can also clone the repository and build the library locally.

Usage

import SwiftUI
import ScreenTimeout

struct ContentView: View {
    @State var states: ScreenStates = .active
    var body: some View {
        VStack {
            Text(states == .active ? "User is active" : "User is inactive")
        }
        .onTimeout(seconds: 5) { status in
            self.states = status
        }
    }
}

License

ScreenTimeout is available under the MIT license. See the LICENSE file for more info.