Support deleting password

This commit is contained in:
Bob Sun 2017-03-21 13:16:25 -07:00
parent 1141e267d9
commit ee9776ab71
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
11 changed files with 91 additions and 53 deletions

View file

@ -23,6 +23,6 @@ class ContentTableViewCell: UITableViewCell {
return nil
}
func setContent(content: String) { }
func setContent(content: String?) { }
}

View file

@ -38,7 +38,7 @@ class FillPasswordTableViewCell: ContentTableViewCell {
return contentTextField.attributedText?.string
}
override func setContent(content: String) {
contentTextField.attributedText = Utils.attributedPassword(plainPassword: content)
override func setContent(content: String?) {
contentTextField.attributedText = Utils.attributedPassword(plainPassword: content ?? "")
}
}

View file

@ -23,7 +23,7 @@ class TextFieldTableViewCell: ContentTableViewCell {
override func getContent() -> String? {
return contentTextField.text
}
override func setContent(content: String) {
override func setContent(content: String?) {
contentTextField.text = content
}
}

View file

@ -22,7 +22,7 @@ class TextViewTableViewCell: ContentTableViewCell {
return contentTextView.text
}
override func setContent(content: String) {
override func setContent(content: String?) {
contentTextView.text = content
}
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12106.1" systemVersion="16E154a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12106.1" systemVersion="16E189a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
@ -20,10 +20,10 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xHX-Sh-1pR">
<rect key="frame" x="15" y="8" width="297" height="200.5"/>
<rect key="frame" x="15" y="15" width="297" height="186.5"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="160" id="Tvq-j8-Nvh"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="120" id="Tvq-j8-Nvh"/>
</constraints>
<fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences" autocorrectionType="no"/>
@ -32,8 +32,8 @@
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="xHX-Sh-1pR" secondAttribute="trailing" id="LWS-JW-9dS"/>
<constraint firstItem="xHX-Sh-1pR" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="7" id="SRq-7t-Gyr"/>
<constraint firstAttribute="bottomMargin" secondItem="xHX-Sh-1pR" secondAttribute="bottom" id="UPQ-jk-QJR"/>
<constraint firstItem="xHX-Sh-1pR" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" id="gwb-2C-4wp"/>
<constraint firstAttribute="bottomMargin" secondItem="xHX-Sh-1pR" secondAttribute="bottom" constant="7" id="UPQ-jk-QJR"/>
<constraint firstItem="xHX-Sh-1pR" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="7" id="gwb-2C-4wp"/>
</constraints>
</tableViewCellContentView>
<connections>