Skip to content

Instantly share code, notes, and snippets.

@rodydavis
Created November 15, 2017 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodydavis/18ca6f633d58a8180b5ba5d482619ab3 to your computer and use it in GitHub Desktop.
Save rodydavis/18ca6f633d58a8180b5ba5d482619ab3 to your computer and use it in GitHub Desktop.
Scroll the Background so that the text fields are always visible (Swift 4)
/*
https://github.com/hackiftekhar/IQKeyboardManager
Extremely easy to install Swift or Objective-C.
Here how it works:
IQKeyboardManager (Swift):- IQKeyboardManagerSwift is available through CocoaPods, to install it simply add the following line to your Podfile: (#236)
*/
// pod 'IQKeyboardManagerSwift'
//In AppDelegate.swift, just import IQKeyboardManagerSwift framework and enable IQKeyboardManager.
import IQKeyboardManagerSwift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
IQKeyboardManager.sharedManager().enable = true
return true
}
}
//Now Reopen the project and Build and Run!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment