support edit password
This commit is contained in:
parent
41d45bfbf9
commit
b2ee8c429f
14 changed files with 459 additions and 72 deletions
28
pass/Views/ContentTableViewCell.swift
Normal file
28
pass/Views/ContentTableViewCell.swift
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// ContentTableViewCell.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Mingshen Sun on 12/2/2017.
|
||||
// Copyright © 2017 Bob Sun. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ContentTableViewCell: UITableViewCell {
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
}
|
||||
|
||||
func getContent() -> String? {
|
||||
return nil
|
||||
}
|
||||
|
||||
func setContent(content: String) { }
|
||||
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
class FillPasswordTableViewCell: UITableViewCell {
|
||||
class FillPasswordTableViewCell: ContentTableViewCell {
|
||||
|
||||
@IBOutlet weak var contentTextField: UITextField!
|
||||
override func awakeFromNib() {
|
||||
|
|
@ -25,4 +25,12 @@ class FillPasswordTableViewCell: UITableViewCell {
|
|||
@IBAction func generatePassword(_ sender: UIButton) {
|
||||
contentTextField.text = Utils.randomString(length: 16)
|
||||
}
|
||||
|
||||
override func getContent() -> String? {
|
||||
return contentTextField.text
|
||||
}
|
||||
|
||||
override func setContent(content: String) {
|
||||
contentTextField.text = content
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
class TextFieldTableViewCell: UITableViewCell {
|
||||
class TextFieldTableViewCell: ContentTableViewCell {
|
||||
|
||||
@IBOutlet weak var contentTextField: UITextField!
|
||||
|
||||
|
|
@ -20,4 +20,10 @@ class TextFieldTableViewCell: UITableViewCell {
|
|||
super.setSelected(selected, animated: animated)
|
||||
}
|
||||
|
||||
override func getContent() -> String? {
|
||||
return contentTextField.text
|
||||
}
|
||||
override func setContent(content: String) {
|
||||
contentTextField.text = content
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import UIKit
|
||||
|
||||
class TextViewTableViewCell: UITableViewCell {
|
||||
class TextViewTableViewCell: ContentTableViewCell {
|
||||
|
||||
@IBOutlet weak var contentTextView: UITextView!
|
||||
override func awakeFromNib() {
|
||||
|
|
@ -18,4 +18,11 @@ class TextViewTableViewCell: UITableViewCell {
|
|||
super.setSelected(selected, animated: animated)
|
||||
}
|
||||
|
||||
override func getContent() -> String? {
|
||||
return contentTextView.text
|
||||
}
|
||||
|
||||
override func setContent(content: String) {
|
||||
contentTextView.text = content
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,20 +12,19 @@
|
|||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="145" id="KGk-i7-Jjw" customClass="TextViewTableViewCell" customModule="pass" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="145"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="217" id="KGk-i7-Jjw" customClass="TextViewTableViewCell" customModule="pass" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="217"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="144"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="216.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="xHX-Sh-1pR">
|
||||
<rect key="frame" x="15" y="8" width="297" height="128.5"/>
|
||||
<rect key="frame" x="15" y="8" width="297" height="200.5"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="120" id="OY2-uq-PPw"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="160" id="OY2-uq-PPw"/>
|
||||
</constraints>
|
||||
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences" autocorrectionType="no"/>
|
||||
</textView>
|
||||
|
|
@ -40,7 +39,7 @@
|
|||
<connections>
|
||||
<outlet property="contentTextView" destination="xHX-Sh-1pR" id="grB-ki-nyo"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="34" y="66.5"/>
|
||||
<point key="canvasLocation" x="34" y="102.5"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue