GithubHelp home page GithubHelp logo

freshos / keyboardlayoutguide Goto Github PK

View Code? Open in Web Editor NEW
1.2K 15.0 60.0 5.93 MB

⌨️ KeyboardLayoutGuide, back from when it didn't exist.

License: MIT License

Swift 100.00%
ios swift keyboard keyboard-layout layoutguide layout autolayout

keyboardlayoutguide's Introduction

Try it!

Download our starter iOS Project and see how our tools fit together in a typical iOS App:
Download Starter Project

Our mission

FreshOS is on a mission to provide iOS developers with simple tools to solve problems that 99% of us have. We believe developers should focus on valuable things like app logic, rather than casting the values of a JSON Parsing \o/. We thrive to make apis as simple as possible, yet flexible enough to handle 99% of use-cases. We believe in Unix-style libraries, that do one thing and do it well. Since we have control over those tools, they fit together nicely.

Solutions

AutoLayout - Stevia 🍃 Star

Write expressive autolayout code, readable and maintainable

Networking - ws ☁️ Star

Write concise networking code that leverages the power of Alamofire, promises and JSON Parsing

Async - then 🎬 Star

Make Async code delightful with Promises

Write minimalist JSON Parsing that infers type and doest get in the way of your models

Reduce Stress & Errors

Emit warnings and errors when Localizations are missing or unused

Emit warnings and errors when assets are missing or unused

Integrate Faster

Generate Swift code from Sketch designs

Who we are

<script src="//cdn.jsdelivr.net/github-cards/latest/widget.js"></script>
<script src="//cdn.jsdelivr.net/github-cards/latest/widget.js"></script> Let's not forget the 100+ people that contributed via pull requests, issues or even just talking to them :) This wouldn't be possible without them <3

Production ready

Our libraries have been Downloaded 175k+ times and already more than 3700+ Apps use freshOS tools!

Source : Cocoapods

Testimonials <3

Sketch to Swift is an amazing way to build quick prototypes. Always using to build small samples for my freelancing clients. Also using AssetChecker so I'm never messing up and breaking my code because I deleted or changed the name of an asset. I appreciate the work they put in freshOS and I'm glad AwesomeiOS has all of them
Lucas Farah - Admin @Awesome-iOS

Just want to say I love your different solutions. It's smart clean and easy to use.
Florent Douine - iOS Developer

Man I just wanted to tell you that Stevia, then, Arrow and ws is the most beautiful thing ever made! Really! This is beautiful!
Mauran Muthiah - Developer

This kind of libraries really is perfect. Very focused, obviously simple and useful, no magic, and small. They make development easier one step at a time.
Anonymous - HackerNews

Support/Contact

You can raise a github issue on the project you need support with or contact us at [email protected]

Hosting sponsored with 💚 by Muxu.Muxu

<script async defer src="https://buttons.github.io/buttons.js"></script>

keyboardlayoutguide's People

Contributors

ali312 avatar dstranz avatar efraimb avatar ezisazis avatar maxkonovalov avatar numen31337 avatar s4cha avatar senseiphonex avatar stuartcamerondeakin avatar thomas-sivilay avatar xzeror 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keyboardlayoutguide's Issues

Better API for using safe area

This is a very handy framework!

Currently keyboardLayoutGuide automatically pins to safeAreaLayoutGuide.bottom.
There is a way to disable it getting a pointer to keyboardLayoutGuide and setting its usesSafeArea property to usesSafeArea.

Issue

There are two cases:

  1. Currently you can't pin two existing views to the keyboardLayoutGuide, one taking safeArea into account, the second doesn't — keyboardLayoutGuide is a single instance property.
  2. It's not very comfy. You should write something like:
let keyboardLayoutGuide = view.keyboardLayoutGuide // we don't know about the implementation, so we're holding a reference here
keyboardLayoutGuide.usesSafeArea = false
pinnedView.bottomAnchor.constraint(equalTo: keyboardLayoutGuide.topAnchor).isActive = true

Solution

I prefer one from the following:

  1. having a separate property for keyboardLayoutGuide with usesSafeArea = false
pinnedView.bottomAnchor.constraint(equalTo: keyboardLayoutGuide.topAnchor).isActive = true
pinnedView.bottomAnchor.constraint(equalTo: keyboardLayoutGuideNoSafeArea.topAnchor).isActive = true
  1. having a computed property returning KeyboardLayoutGuide with usesSafeArea turned off
pinnedView.bottomAnchor.constraint(equalTo: keyboardLayoutGuide.topAnchor).isActive = true
pinnedView.bottomAnchor.constraint(equalTo: keyboardLayoutGuide.topAnchor).isActive = true
pinnedView.bottomAnchor.constraint(equalTo: keyboardLayoutGuide.noSafeArea.topAnchor).isActive = true

Achievable via extension like:

public extension KeyboardLayoutGuide {
    var noSafeArea: KeyboardLayoutGuide {
        self.usesSafeArea = false
        return self
    }
}

Weird animation when the first responder is a secured textfield.

Hello,

First of all congrats for the lightweight and great implementation. It's the best i've seen so far.
There is a bug where when switching the first responder from a normal textfield to a secured textfield, a weird animation is performed. This is cause because for some reason the keyboardWillChangeFrame notification is called not once but three times, the first one being a weird value. In order to fix this, we just have to perform the change animated only when the duration specified in the notification is greater than 0.

Here is a screen recording of the bug: https://my.pcloud.com/publink/show?code=XZO6ibkZ92g9nOy76gbtm7VTohGNg0GDcq27

Xcode 13 beta 3 - SwiftPM - Build error: UIApplication.shared not available in iOS App Extension

When building an app with KeyboardLayoutGuide from Swift Package Manager in Xcode 13 beta 3 that does not use app extensions, compiler errors related to API availability in app extensions are emitted.

Reproduction Steps

  • Create a new iOS project in Xcode 13 beta 3
  • Add KeyboardLayoutGuide at latest version (1.7.0) using Swift Package Manager
  • Build the app

Result: multiple errors on UIApplication.shared usage:

'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.

Other Notes

This appears to be expected behavior in Xcode 13 beta 3 with Swift Package Manager, based on this Apple Developer Forums thread and this Swift forums post. The Apple engineer in the second link recommends dealing with this by marking declarations as unavailable to app extensions when they use APIs that are unavailable to app extensions.


Update: It looks like the Swift team is reconsidering how this behaves. I'll update this issue as we hear more from them.

Provide option to use safe area or not

Currently, if the device is running iOS 11 or newer, the keyboardLayoutGuide.bottomAnchor is always equal to the view's safeAreaLayoutGuide.bottomAnchor.

Sometimes it is nice to be able to pin views to the bottom of the screen, instead of the bottom of the safe area. It would be nice if there was a setting or parameter for determining whether or not the keyboardLayoutGuide uses the safe area.

issue with iphone 5s when testing!!

I have issue in height initial the app in the chat

view.inputViewContainer.bottomAnchor.constraint(equalTo: keyboardLayoutGuide.topAnchor).isActive = true

image

Regards!!

Adding safe area to the keyboard layout guide

Great idea for a library.

It works great with the exception that it seems to add an extra safe area to the height of the guide when the keyboard is opened. I think it's because the height in the keyboard notification event takes the safe area into account. Am I understanding safe area wrong?

Extraneous space between view and keyboard

Nice library!

I have an issue though. There is extra space like shown:

Screen Shot 2019-10-22 at 2 10 46 PM

I'm using it like this (inside NSLayoutConstraint.activate([]))
accessoryView.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor)

Bringing back Cocoapods/Carthage support

Hi,
firstly, thanks for great library!
I have one question - is it possible to bring back support for other dependency managers? SPM is great and all, but it is not yet suitable for all use cases (e.g. libraries with mixed Swift/Obj-C or with resources). Because of that, lots of projects can't switch to it yet and potentially having two dependency managers (e.g. Cocoapods + SPM) might do more harm than good (e.g. resolving some subdependencies) and confuse other developers.

If that's not something you want to do, then I think it would be good idea to remove Carthage and Cocoapods badges from README

SnapKit - Animations does not work.

Hi. I have been using this library for every project I have worked on. Never really had a problem. However this last project we decided using SnapKit.

I have set this button to be aligned with the keyboard. Button does change its position when the keyboard is opened or closed but not along with the keyboard. It just changes its frame at a moment.

Does anyone have any suggestions?

Wrong guide position when keyboard doesn't intersect view

There are cases, when keyboard doesn't intersect view controller's view: e.g. view controller is shown modally with modalPresentationStyle == .formSheet on iPad, however keyboardLayoutGuide is shrinked by the height of the keyboard.

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.