Authorization form in native iOS style
Switch branches/tags
Nothing to show
Clone or download
IvanVorobei Merge pull request #3 from dehlen/patch-1
Fixed name of module in README
Latest commit 123c0f3 Dec 11, 2017
Permalink
Failed to load latest commit information.
example-project Fix Pod Error Dec 2, 2017
resources Add mockup preview Dec 9, 2017
LICENSE Initial commit Dec 2, 2017
README.md Fixed name of module in README Dec 11, 2017

README.md

About

This project simplifies work with forms of authorization and uses native elements that Apple recommends and uses. It may seem that such elements are ready in the system, but as it turned out - no. I did a lot of work to repeat the visual reference

[please, wait loading animated preview]

Requirements

Xcode 9 and Swift 4. Ready for use on iOS 9+

Integration

Drop in Sparrow folder to your Xcode project (make sure to enable "Copy items if needed" and "Create groups").

Or via CocoaPods:

pod 'Sparrow', :git => 'https://github.com/IvanVorobei/Sparrow.git'

How to use

Create new class with name LoginNavigationController and inherit SPNativeLoginNavigationController

class LoginNavigationController: SPNativeLoginNavigationController {}

You must implement in LoginNavigationController the next functions (otherwise get fatal error):

override func login(with login: String, password: String, complection: @escaping (SPOauthState) -> ()) {

}
    
override func login(with code: String, complection: @escaping (SPOauthState) -> ()) {

}

Inside the functions, you should do the work with authorization (for example, http requests) and at the end of authorization call the package. Pass in complection status of authorization

Customize

If you want to customize the content (keyboard type or text) you should ovveride property

class LoginNavigationController: SPNativeLoginNavigationController {

    override var loginContent: SPNativeLoginNavigationController.LoginContent {
        var content = LoginContent()
        content.navigationTitle = "Sign In"
        content.loginTitle = "Login"
        content.loginPlaceholder = "example@icloud.com"
        content.loginKeyboardType = .emailAddress
        content.passwordTitle = "Password"
        content.passwordPlaceholder = "Required"
        content.commentTitle = "Please enter a pair of login and password"
        content.buttonTitle = "Sign In"
        content.errorOauthTitle = "Error"
        content.errorOauthSubtitle = "Invalid login or password"
        content.errorOauthButtonTitle = "Ok"
        return content
    }
}

For CodeController need ovveride loginCodeContent. You do not need to override all values, some you can ignore

Questions and Problems

If you have trouble with porject - contact me via email

You need to develop a UI?

You can contact me and order the development of an application or UI with excellent animations. Contact with me via email: hello@ivanvorobei.by

Apps, using NativeLogin

I like the idea to specify applications that use NativeLogin. Please, contact me via email (you can find it in the section "Contacts") so that I added app here

License

NativeLogin is released under the MIT license. Check LICENSE.md for details

Other

In the project you can find my library Sparrow. It's a library, on which the module is written. Unfortunately, to save time in development, I wrote NativeLogin using this library. Don't worry, within just Swift files and a lot of useful things. Maybe you will like it:)

Contact

https://hello.ivanvorobei.by

https://ivanvorobei.by

hello@ivanvorobei.by

Support

The project is fully free, I do not impose any restrictions on its use. I'm, just like you, want to do useful things. If you have a desire to help, tell friends about the project or donate. Thanks!