1 Star 0 Fork 0

liudayin / login-screen-swift

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

iOS Login Screen in Swift

This project has been updated to Swift 5 and Xcode 11.2

About

This is a simple iOS login screen written in Swift 5. It has support for signing in with Facebook, Google and specially Apple, as well as the classic email & password form.

The template uses FacebookLogin and GoogleSignin frameworks, installed with Cocoapods.

Installation and configuration

First, you need to clone this repository, in order to fetch the code

$ git clone https://github.com/mrcflorian/login-screen-swift.git

In order to compile your code, you need to install the dependencies first (in our case, the frameworks from Twitter and Facebook). You can simply do this by running the following command in the root folder of the project (where the Pods file lives):

$ pod update

If you're not familiar with Cocoapods, checkout their website, to see how you can install it.

Once the pods were installed properly, open LoginScreen.xcworkspace with Xcode and run the project.

Everything should be working fine. There's one more thing to do though, since the code is using some default Facebook & Google applications. You need to update the code so that it uses your apps.

Open the Info.plist file (as source code) and update the following piece of code with your correct API keys:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb285315185217069</string>
        </array>
    </dict>
</array>
<key>FacebookAppID</key>
<string>285315185217069</string>
<key>FacebookDisplayName</key>
<string>iOSAppTemplates</string>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fb-messenger-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
    <string>twitter</string>
    <string>twitterauth</string>
</array>

For Sign in with apple, you need to configure something on Certificates, Identifiers and Profiles. https://www.iosapptemplates.com/blog/ios-development/sign-in-with-apple-swift Check out the link above and do step 1 and step 2.

Documentation

The interface of the login screen can be found in Interface/LoginScreen.storyboard. The template uses auto layout contraints, to display the UI elements.

The core class is LoginViewController, which contains all the logic for the three different types of authentication. The code is pretty short and easy to understand.

If you want even more details on the project, please visit iOS App Templates.

MIT License Copyright (c) 2017 mrcflorian Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

iOS Login Screen written in Swift 5 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/liudayin/login-screen-swift.git
git@gitee.com:liudayin/login-screen-swift.git
liudayin
login-screen-swift
login-screen-swift
master

搜索帮助