Coder Social home page Coder Social logo

nickffox / keyboardobserving Goto Github PK

View Code? Open in Web Editor NEW
479.0 6.0 36.0 354 KB

⌨️A Combine-based way to observe and adjust for Keyboard notifications in SwiftUI

License: MIT License

Swift 93.48% Ruby 6.52%
swiftui keyboard combine swiftpackage swiftpm swift ios

keyboardobserving's People

Contributors

daisuke-t-jp avatar jaywardell avatar juliankahnert avatar ldiqual avatar macbellingrath avatar maxdesiatov avatar mkj-is avatar nickffox avatar ryu0118 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

keyboardobserving's Issues

Add Sample Project

It would be nice to have a sample project demonstrating this framework's use in a variety of contexts.

Add Carthage Support

Since we have SPM and CocoaPods, we should round it out with Carthage support too.

How to manually show/dismiss the keyboard?

I found a way to hide the keyboard through the window hierarchy:

extension View {
    func endEditing(_ force: Bool) {
        UIApplication.shared.windows.forEach { $0.endEditing(force)}
    }
}

But this is clearly not the best solution.
I have not looked at all the code, but it will be sufficient to make this initializer public:

//Keyboard.swift
    public init(animationDuration: TimeInterval, height: CGFloat) {
      self.animationDuration = animationDuration
      self.height = height
    }
    var body: some View {
        KeyboardObservingView {
            NavigationView {
            }
            .onTapGesture {
                self.keyboard.state = Keyboard.State(animationDuration: 0,25, height: 0)
            }
       }
   }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.