Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansemannn/iOS11-PasswordFill-Example
Example showing how to use the PasswordFill API in iOS 11.
https://github.com/hansemannn/iOS11-PasswordFill-Example
example ios11 passwordfill
Last synced: 3 months ago
JSON representation
Example showing how to use the PasswordFill API in iOS 11.
- Host: GitHub
- URL: https://github.com/hansemannn/iOS11-PasswordFill-Example
- Owner: hansemannn
- Created: 2017-07-04T04:20:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-18T14:03:36.000Z (almost 6 years ago)
- Last Synced: 2024-05-01T20:22:51.208Z (7 months ago)
- Topics: example, ios11, passwordfill
- Language: Swift
- Size: 20.5 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π iOS 11 PasswordFill Example
A quick example showing how to use the PasswordFill API in iOS 11 and Swift 4.
## Prerequisites
* Xcode 9+
* "Associated Domains" capability added to your project's `.entitlements` file (when using own domains)
```xml
com.apple.developer.associated-domainswebcredentials:your-domain.com
```
## Getting Started
In order to make the PasswordFill API work, you need to set the `textContentType` property of
your `UITextField` or `UITextView` to `.username` and `.password`:
```swift
let textField = UITextField(frame: CGRect(x: 20, y: 30, width: 300, height: 40))
textField.backgroundColor = UIColor.lightGray
textField.textContentType = .username
textField.placeholder = "Enter Username ..."let textField2 = UITextField(frame: CGRect(x: 20, y: 70, width: 300, height: 40))
textField2.backgroundColor = UIColor.lightGray
textField2.textContentType = .password
textField2.placeholder = "Enter Password ..."
textField2.isSecureTextEntry = true
```
Then, create a file called `apple-app-site-association` with the following contents:
```json
{
"webcredentials" : {
"apps" : ["."]
}
}
```
Finally, upload the file to your server and place it into the sub-directory `.well-known`.That's it!
## Author
Hans KnΓΆchel ([@hansemannnn](https://twitter.com/hansemannnn))