Commit d6dbfaf5 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

UI

parent 970a015a
......@@ -11,6 +11,7 @@
A924A84B251B842C00CB2947 /* SHRecordDetailsBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A924A84A251B842C00CB2947 /* SHRecordDetailsBottomView.swift */; };
A924A853251B845900CB2947 /* SHRecordDetailsBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A924A852251B845900CB2947 /* SHRecordDetailsBottomView.xib */; };
A924A858251B89D000CB2947 /* SHRecordDetailsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A924A857251B89D000CB2947 /* SHRecordDetailsCell.swift */; };
A924A860251C777E00CB2947 /* SHRecordMoveFileVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A924A85F251C777E00CB2947 /* SHRecordMoveFileVC.swift */; };
A94D935224F7502700A886C0 /* SHRecordExportAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A94D935124F7502700A886C0 /* SHRecordExportAlertView.swift */; };
A94D935424F7503E00A886C0 /* SHRecordExportAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A94D935324F7503E00A886C0 /* SHRecordExportAlertView.xib */; };
A94D935724F7958500A886C0 /* SHStoreManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A94D935624F7958500A886C0 /* SHStoreManager.swift */; };
......@@ -153,6 +154,7 @@
A924A84A251B842C00CB2947 /* SHRecordDetailsBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHRecordDetailsBottomView.swift; sourceTree = "<group>"; };
A924A852251B845900CB2947 /* SHRecordDetailsBottomView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SHRecordDetailsBottomView.xib; sourceTree = "<group>"; };
A924A857251B89D000CB2947 /* SHRecordDetailsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHRecordDetailsCell.swift; sourceTree = "<group>"; };
A924A85F251C777E00CB2947 /* SHRecordMoveFileVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHRecordMoveFileVC.swift; sourceTree = "<group>"; };
A94D935124F7502700A886C0 /* SHRecordExportAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHRecordExportAlertView.swift; sourceTree = "<group>"; };
A94D935324F7503E00A886C0 /* SHRecordExportAlertView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SHRecordExportAlertView.xib; sourceTree = "<group>"; };
A94D935624F7958500A886C0 /* SHStoreManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHStoreManager.swift; sourceTree = "<group>"; };
......@@ -729,6 +731,7 @@
A950F5A724F36F55007AB63E /* SHRecordListViewController.swift */,
A950F5AB24F39EC1007AB63E /* SHRecordShowViewController.swift */,
A94EE11C251B7E510066B490 /* SHRecordDetailsVC.swift */,
A924A85F251C777E00CB2947 /* SHRecordMoveFileVC.swift */,
);
path = Record;
sourceTree = "<group>";
......@@ -982,6 +985,7 @@
A95CDFDA24E0EBF10066DAE6 /* CRSnippetCode.swift in Sources */,
A95CE01124E0F42F0066DAE6 /* MBProgressHUD+MJ.m in Sources */,
A95CE00924E0F42F0066DAE6 /* CRContactTools.swift in Sources */,
A924A860251C777E00CB2947 /* SHRecordMoveFileVC.swift in Sources */,
A9A16C672519DD6900DE0FEE /* NSString+PinYin4Cocoa.m in Sources */,
A9A16C702519DD6900DE0FEE /* HCSortString.m in Sources */,
A94DD58124FE37DF00B1B5A2 /* UILabel+FontAppearance.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "编组@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "编组@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "添加@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "添加@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "关闭@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "关闭@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -23,6 +23,7 @@ class SHRecordModel: NSObject{
@objc var delete: Bool = false
@objc var top: Bool = false
@objc var selected: Bool = false
@objc var fileData: Data = Data()
......
......@@ -90,7 +90,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="AvB-gV-Z5N" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="66.666666666666671" y="122.54464285714285"/>
<point key="canvasLocation" x="-10" y="144"/>
</scene>
<!--Record List View Controller-->
<scene sceneID="okg-u3-4cR">
......@@ -240,6 +240,7 @@
<connections>
<outlet property="advertBtn" destination="d2Q-zE-Eh0" id="7fC-x0-0eI"/>
<outlet property="markCountLab" destination="K8n-Fw-lyi" id="jzA-iM-cv4"/>
<outlet property="maskHintImv" destination="1ji-L1-Qj7" id="GYK-2e-UIt"/>
<outlet property="maskHintLab" destination="JlT-EC-bWg" id="vQ9-KM-nah"/>
<outlet property="maskView" destination="eQg-Jj-T12" id="6Xy-ya-q57"/>
<outlet property="tableHeaderView" destination="2Ac-1k-7AF" id="Pef-np-rDb"/>
......@@ -250,6 +251,77 @@
</objects>
<point key="canvasLocation" x="966.66666666666674" y="143.97321428571428"/>
</scene>
<!--Record Move FileVC-->
<scene sceneID="G6R-Ym-rdU">
<objects>
<viewController storyboardIdentifier="SHRecordMoveFileVC" id="uKR-oI-kIk" customClass="SHRecordMoveFileVC" customModule="速记大师" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="W6V-s4-aeL">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Aub-NQ-30h">
<rect key="frame" x="0.0" y="44" width="414" height="56"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="56" id="Q3B-rQ-EmA"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="klx-Km-jed">
<rect key="frame" x="0.0" y="802" width="414" height="60"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b1u-pi-uYx">
<rect key="frame" x="20" y="15" width="117" height="36"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="sza-P2-Uax"/>
</constraints>
<state key="normal" title=" 新笔记本 " image="record_nav_user">
<color key="titleColor" red="0.25490196078431371" green="0.51372549019607838" blue="0.95686274509803915" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="addFolderClick" destination="uKR-oI-kIk" eventType="touchUpInside" id="SR3-eD-bT3"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="b1u-pi-uYx" firstAttribute="top" secondItem="klx-Km-jed" secondAttribute="top" constant="15" id="P9B-qD-GMb"/>
<constraint firstAttribute="height" constant="60" id="fGM-aV-09c"/>
<constraint firstItem="b1u-pi-uYx" firstAttribute="leading" secondItem="klx-Km-jed" secondAttribute="leading" constant="20" id="zX4-P3-Lve"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vsD-wk-nyR">
<rect key="frame" x="0.0" y="100" width="414" height="702"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="uKR-oI-kIk" id="zg2-Gq-dIM"/>
<outlet property="delegate" destination="uKR-oI-kIk" id="qbH-Ff-L91"/>
</connections>
</tableView>
</subviews>
<viewLayoutGuide key="safeArea" id="ezK-T9-S16"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="ezK-T9-S16" firstAttribute="bottom" secondItem="klx-Km-jed" secondAttribute="bottom" id="1HY-Yi-kD0"/>
<constraint firstItem="klx-Km-jed" firstAttribute="top" secondItem="vsD-wk-nyR" secondAttribute="bottom" id="Dmn-tO-eDS"/>
<constraint firstItem="vsD-wk-nyR" firstAttribute="leading" secondItem="ezK-T9-S16" secondAttribute="leading" id="Dmz-H7-qfo"/>
<constraint firstItem="ezK-T9-S16" firstAttribute="trailing" secondItem="Aub-NQ-30h" secondAttribute="trailing" id="MMz-uL-2qA"/>
<constraint firstItem="vsD-wk-nyR" firstAttribute="top" secondItem="Aub-NQ-30h" secondAttribute="bottom" id="P4g-ve-zAA"/>
<constraint firstItem="Aub-NQ-30h" firstAttribute="leading" secondItem="ezK-T9-S16" secondAttribute="leading" id="Qga-kf-5gt"/>
<constraint firstItem="Aub-NQ-30h" firstAttribute="top" secondItem="ezK-T9-S16" secondAttribute="top" id="ak6-CT-9cw"/>
<constraint firstItem="klx-Km-jed" firstAttribute="leading" secondItem="ezK-T9-S16" secondAttribute="leading" id="j5k-vV-c1H"/>
<constraint firstItem="ezK-T9-S16" firstAttribute="trailing" secondItem="klx-Km-jed" secondAttribute="trailing" id="kBi-JX-fnD"/>
<constraint firstItem="ezK-T9-S16" firstAttribute="trailing" secondItem="vsD-wk-nyR" secondAttribute="trailing" id="t5O-iJ-WpY"/>
</constraints>
</view>
<connections>
<outlet property="tableHeaderView" destination="Aub-NQ-30h" id="lsa-rC-tgR"/>
<outlet property="tableView" destination="vsD-wk-nyR" id="zOd-2z-lSi"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="FD5-gy-nre" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1861" y="928"/>
</scene>
<!--Record DetailsVC-->
<scene sceneID="uV8-w3-4ts">
<objects>
......@@ -258,6 +330,27 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5xA-Fr-3XN">
<rect key="frame" x="0.0" y="44" width="414" height="758"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="这个笔记本里还没有笔记" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QYS-Yf-f9g">
<rect key="frame" x="95" y="367" width="224.5" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="0.84705882349999995" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="recordlist_no_data" translatesAutoresizingMaskIntoConstraints="NO" id="QrU-uf-U0R">
<rect key="frame" x="123.5" y="244" width="167" height="103"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="QYS-Yf-f9g" firstAttribute="centerX" secondItem="5xA-Fr-3XN" secondAttribute="centerX" id="UiW-QN-9k7"/>
<constraint firstItem="QYS-Yf-f9g" firstAttribute="centerX" secondItem="QrU-uf-U0R" secondAttribute="centerX" id="Wka-FZ-Qds"/>
<constraint firstItem="QYS-Yf-f9g" firstAttribute="centerY" secondItem="5xA-Fr-3XN" secondAttribute="centerY" id="adF-aM-uaD"/>
<constraint firstItem="QYS-Yf-f9g" firstAttribute="top" secondItem="QrU-uf-U0R" secondAttribute="bottom" constant="20" id="dbW-tE-ucg"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="g4M-gy-ahG">
<rect key="frame" x="0.0" y="44" width="414" height="758"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
......@@ -359,32 +452,106 @@
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P7U-Lp-CaG">
<rect key="frame" x="0.0" y="802" width="414" height="60"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FAw-cA-cIp">
<rect key="frame" x="0.0" y="0.0" width="414" height="60"/>
<subviews>
<button opaque="NO" tag="200" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zY0-bz-sAm">
<rect key="frame" x="18" y="5" width="184" height="50"/>
<color key="backgroundColor" red="0.85882352941176465" green="0.90588235294117647" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="2Sc-NO-FDk"/>
</constraints>
<state key="normal" title="新建笔记">
<color key="titleColor" red="0.25490196079999999" green="0.51372549020000002" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="markAlertBtnClick:" destination="3m5-MZ-3Mk" eventType="touchUpInside" id="veg-O8-Uqi"/>
</connections>
</button>
<button opaque="NO" tag="201" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d2L-Yp-ObA">
<rect key="frame" x="212" y="5" width="184" height="50"/>
<color key="backgroundColor" red="0.98039215686274506" green="0.85882352941176465" blue="0.85882352941176465" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="2vZ-UX-KJh"/>
</constraints>
<state key="normal" title="新建语音笔记">
<color key="titleColor" red="0.95686274509803915" green="0.25490196078431371" blue="0.25490196078431371" alpha="1" colorSpace="calibratedRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="markAlertBtnClick:" destination="3m5-MZ-3Mk" eventType="touchUpInside" id="ReV-fU-umv"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="zY0-bz-sAm" firstAttribute="leading" secondItem="FAw-cA-cIp" secondAttribute="leading" constant="18" id="7nD-uK-0Ab"/>
<constraint firstItem="zY0-bz-sAm" firstAttribute="centerY" secondItem="FAw-cA-cIp" secondAttribute="centerY" id="BzY-3V-K60"/>
<constraint firstItem="d2L-Yp-ObA" firstAttribute="leading" secondItem="zY0-bz-sAm" secondAttribute="trailing" constant="10" id="Ecv-hj-uUF"/>
<constraint firstAttribute="height" constant="60" id="HIT-lw-DWb"/>
<constraint firstAttribute="trailing" secondItem="d2L-Yp-ObA" secondAttribute="trailing" constant="18" id="QhE-yU-Feu"/>
<constraint firstItem="d2L-Yp-ObA" firstAttribute="centerY" secondItem="FAw-cA-cIp" secondAttribute="centerY" id="km9-Z2-VeO"/>
<constraint firstItem="d2L-Yp-ObA" firstAttribute="width" secondItem="zY0-bz-sAm" secondAttribute="width" id="zuy-Yu-8bk"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="maK-EO-jzl">
<rect key="frame" x="0.0" y="0.0" width="414" height="60"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="Y5S-Yj-Prn"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="maK-EO-jzl" secondAttribute="trailing" id="GEe-fV-cmm"/>
<constraint firstItem="maK-EO-jzl" firstAttribute="leading" secondItem="P7U-Lp-CaG" secondAttribute="leading" id="Kdd-7W-yER"/>
<constraint firstAttribute="height" constant="60" id="eTS-UG-WBN"/>
<constraint firstAttribute="bottom" secondItem="maK-EO-jzl" secondAttribute="bottom" id="j7I-GV-Nvx"/>
<constraint firstItem="FAw-cA-cIp" firstAttribute="top" secondItem="P7U-Lp-CaG" secondAttribute="top" id="nOY-xA-WXq"/>
<constraint firstItem="FAw-cA-cIp" firstAttribute="leading" secondItem="P7U-Lp-CaG" secondAttribute="leading" id="nc4-As-Vyq"/>
<constraint firstAttribute="trailing" secondItem="FAw-cA-cIp" secondAttribute="trailing" id="rLJ-ht-0tY"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="oP8-Iu-M5c"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="5xA-Fr-3XN" firstAttribute="top" secondItem="g4M-gy-ahG" secondAttribute="top" id="4I5-Vv-jtd"/>
<constraint firstItem="5xA-Fr-3XN" firstAttribute="bottom" secondItem="g4M-gy-ahG" secondAttribute="bottom" id="Hh9-UX-g3M"/>
<constraint firstItem="P7U-Lp-CaG" firstAttribute="leading" secondItem="oP8-Iu-M5c" secondAttribute="leading" id="IQb-pk-tFL"/>
<constraint firstItem="P7U-Lp-CaG" firstAttribute="top" secondItem="g4M-gy-ahG" secondAttribute="bottom" id="JA3-7Q-eZc"/>
<constraint firstItem="oP8-Iu-M5c" firstAttribute="bottom" secondItem="g4M-gy-ahG" secondAttribute="bottom" constant="60" id="JA3-7Q-eZc"/>
<constraint firstItem="g4M-gy-ahG" firstAttribute="top" secondItem="oP8-Iu-M5c" secondAttribute="top" id="MDz-et-iAP"/>
<constraint firstItem="oP8-Iu-M5c" firstAttribute="trailing" secondItem="g4M-gy-ahG" secondAttribute="trailing" id="NfC-ds-RCi"/>
<constraint firstItem="g4M-gy-ahG" firstAttribute="leading" secondItem="oP8-Iu-M5c" secondAttribute="leading" id="Nu7-yj-aSx"/>
<constraint firstItem="5xA-Fr-3XN" firstAttribute="leading" secondItem="g4M-gy-ahG" secondAttribute="leading" id="PzQ-Sn-Jgf"/>
<constraint firstItem="oP8-Iu-M5c" firstAttribute="trailing" secondItem="P7U-Lp-CaG" secondAttribute="trailing" id="QF4-X5-sbm"/>
<constraint firstItem="5xA-Fr-3XN" firstAttribute="trailing" secondItem="g4M-gy-ahG" secondAttribute="trailing" id="jUP-fQ-Puf"/>
<constraint firstItem="oP8-Iu-M5c" firstAttribute="bottom" secondItem="P7U-Lp-CaG" secondAttribute="bottom" id="n3Q-eA-gCE"/>
</constraints>
</view>
<connections>
<outlet property="bottomHeightConstraint" destination="eTS-UG-WBN" id="Qb5-6r-g4n"/>
<outlet property="markAlertView" destination="FAw-cA-cIp" id="imA-Km-egb"/>
<outlet property="maskView" destination="5xA-Fr-3XN" id="CWa-5p-gr3"/>
<outlet property="tableFooterAlertBgView" destination="maK-EO-jzl" id="4L5-RO-WhR"/>
<outlet property="tableFooterView" destination="P7U-Lp-CaG" id="skh-NE-i3o"/>
<outlet property="tableView" destination="g4M-gy-ahG" id="xMZ-KF-JnO"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="0Ut-X4-hnN" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2195.6521739130435" y="143.97321428571428"/>
<point key="canvasLocation" x="1860.8695652173915" y="143.97321428571428"/>
</scene>
<!--Record Show View Controller-->
<scene sceneID="sKQ-sR-22k">
......@@ -523,6 +690,7 @@
<image name="recordShow_stop" width="50" height="50"/>
<image name="recordShow_transmit" width="28" height="28"/>
<image name="record_bottom_advert" width="264" height="24"/>
<image name="record_nav_user" width="20" height="18"/>
<image name="record_start" width="76" height="76"/>
<image name="record_stop" width="76" height="76"/>
<image name="recordlist_cell_count" width="17" height="16"/>
......
......@@ -12,15 +12,31 @@ class SHRecordDetailsVC: SHBaseViewController {
@IBOutlet weak var tableView: UITableView?
@IBOutlet weak var tableFooterView: UIView?
@IBOutlet weak var tableFooterAlertBgView: UIView?
@IBOutlet weak var maskView: UIView?
@IBOutlet weak var bottomHeightConstraint: NSLayoutConstraint?
@IBOutlet weak var markAlertView: UIView?
let bottomView = SHRecordDetailsBottomView.loadFromNibAndClass(SHRecordDetailsBottomView.self)
var edit: Bool = false
var currentModel = SHRecordFolderModel()
var selectRecordModels:[SHRecordModel] = []
let keyValueStore = NSUbiquitousKeyValueStore.default
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
bottomView?.isHidden = false
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
bottomView?.isHidden = true
}
override func setupUI() {
self.navigationItem.title = currentModel.name
......@@ -33,10 +49,48 @@ class SHRecordDetailsVC: SHBaseViewController {
tableView?.separatorStyle = .none
bottomView?.frame = CGRect.init(x: -tableFooterView!.frame.width, y: 0, width: tableFooterView!.frame.width*2, height: tableFooterView!.frame.height)
tableFooterView?.addSubview(bottomView!)
tableFooterAlertBgView?.addSubview(bottomView!)
bottomView?.selectCallBack = { [self] (index, selected) in
switch index {
case 100:
for (_, model) in currentModel.dataSources.enumerated(){
model.selected = selected
if selected == true {
if selectRecordModels.contains(model) != true{
selectRecordModels.append(model)
}
}else{
if selectRecordModels.contains(model) == true{
if let index = selectRecordModels.firstIndex(of: model) {
selectRecordModels.remove(at: index)
}
}
}
// currentModel.dataSources[index] = model
}
tableView?.reloadData()
break
case 101:
self.moveFile()
break
case 102:
self.deleteFile()
break
case 103:
self.markAlertViewShow(selected)
break
default:
break
}
}
}
@objc func editClick(){
if currentModel.dataSources.count == 0 {
return
}
edit = !edit
if edit {
self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(title: "完成", style: .done, target: self, action: #selector(editClick))
......@@ -51,13 +105,153 @@ class SHRecordDetailsVC: SHBaseViewController {
self.bottomView?.frame = CGRect.init(x: -self.tableFooterView!.frame.width, y: 0, width: self.tableFooterView!.frame.width*2, height: self.tableFooterView!.frame.height)
}
}
self.navigationItem.rightBarButtonItem?.tintColor = UIColor.init(hexStr: "4183F4")
self.tableView?.reloadData()
}
}
//MARK:bottomSelector
extension SHRecordDetailsVC {
//MARK:选中Models
func selectModel(_ index:NSInteger, selected:Bool){
let model = currentModel.dataSources[index]
model.selected = selected
if model.selected == true {
selectRecordModels.append(model)
}else{
if let index = selectRecordModels.firstIndex(where: { $0.pathFile == model.pathFile}) {
selectRecordModels.remove(at: index)
}
}
if selectRecordModels.count == currentModel.dataSources.count {
bottomView?.deleteSelected = true
} else {
bottomView?.deleteSelected = false
}
}
//MARK:转移Models
func moveFile(){
if selectRecordModels.count == 0 {
return
}
let move = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordMoveFileVC") as! SHRecordMoveFileVC
move.currentModel = currentModel
move.moveFiles = selectRecordModels
let nav = SHBaseNavigationController.init(rootViewController: move)
self.navigationController?.present(nav, animated: true, completion: nil)
move.saveSuccessCallBack = { model in
self.currentModel = model
self.tableView?.reloadData()
}
}
//MARK:删除Models
func deleteFile(){
if selectRecordModels.count == 0 {
return
}
let nowDate = Date()
for model in selectRecordModels {
if currentModel.dataSources.contains(model) {
if let index = currentModel.dataSources.firstIndex(where: { $0.pathFile == model.pathFile}) {
currentModel.dataSources.remove(at: index)
}
}
}
var list = CRUserDefaults.recordList
if var recordList = list{
for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == currentModel.id {
subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = currentModel.dataSources
let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic
break
}
}
CRUserDefaults.recordList = recordList
}
list = keyValueStore.object(forKey: "Folderlist") as? [Dictionary<String, Any>]
if var recordList = list{
for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == currentModel.id {
subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = currentModel.dataSources
let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic
break
}
}
keyValueStore.set(recordList, forKey: "Folderlist")
keyValueStore.synchronize()
}
if currentModel.dataSources.count == 0 {
self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(title: "编辑", style: .done, target: self, action: #selector(editClick))
self.navigationItem.rightBarButtonItem?.tintColor = UIColor.init(hexStr: "4183F4")
UIView.animate(withDuration: 0.25) {
self.bottomView?.frame = CGRect.init(x: -self.tableFooterView!.frame.width, y: 0, width: self.tableFooterView!.frame.width*2, height: self.tableFooterView!.frame.height)
}
self.markAlertViewShow(false)
bottomView?.cancel = true
}
selectRecordModels = []
edit = false
tableView?.reloadData()
}
//MARK:笔记弹框
func markAlertViewShow(_ selected:Bool){
self.view.layoutIfNeeded()
if selected == false {
UIView.animate(withDuration: 0.25) {
self.bottomHeightConstraint?.constant = 60
self.view.layoutIfNeeded()
}
}else{
UIView.animate(withDuration: 0.25) {
self.bottomHeightConstraint?.constant = 120
self.view.layoutIfNeeded()
}
}
}
//MARK:笔记弹框入口
@IBAction func markAlertBtnClick(_ sender:UIButton){
self.markAlertViewShow(false)
bottomView?.cancel = true
switch sender.tag {
case 200:
break
default:
let record = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordViewController") as! SHRecordViewController
record.folderModel = currentModel
self.navigationController?.pushViewController(record, animated: true)
record.saveSuccessCallBack = { model in
self.currentModel = model
self.tableView?.reloadData()
}
break
}
}
}
extension SHRecordDetailsVC: UITableViewDelegate, UITableViewDataSource{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if currentModel.dataSources.count == 0 {
self.view.bringSubviewToFront(maskView!)
self.view.bringSubviewToFront(tableFooterView!)
}else {
self.view.sendSubviewToBack(maskView!)
}
bottomView?.recordCount = self.currentModel.dataSources.count
return currentModel.dataSources.count
}
......@@ -71,6 +265,10 @@ extension SHRecordDetailsVC: UITableViewDelegate, UITableViewDataSource{
cell.model = currentModel.dataSources[indexPath.row]
cell.edit = edit
cell.selectCallBack = { selected in
self.selectModel(indexPath.row, selected: selected)
}
cell.selectionStyle = .none
return cell
}
......
......@@ -16,6 +16,7 @@ class SHRecordListViewController: SHBaseViewController {
@IBOutlet weak var maskView: UIView!
@IBOutlet weak var maskHintLab: UILabel?
@IBOutlet weak var maskHintImv: UIImageView?
@IBOutlet weak var markCountLab: UILabel?
@IBOutlet weak var advertBtn: UIButton?
......@@ -23,6 +24,7 @@ class SHRecordListViewController: SHBaseViewController {
let keyValueStore = NSUbiquitousKeyValueStore.default
var dataSources: Array<SHRecordFolderModel> = []
var searchDataSource: Array<SHRecordFolderModel> = []
var topDataSources: Array<SHRecordFolderModel> = []
var searchView: UISearchBar!
lazy var searchBarVC: UISearchController = {
......@@ -80,11 +82,12 @@ class SHRecordListViewController: SHBaseViewController {
self.tableHeaderView?.addSubview(searchView)
tableView?.tableFooterView = UIView.init()
}
func prepareDateSource(){
//TODO:刷新数据
dataSources = []
topDataSources = []
if CRUserDefaults.sortType == nil{
CRUserDefaults.sortType = 0
......@@ -121,7 +124,11 @@ class SHRecordListViewController: SHBaseViewController {
for dict in list.reversed(){
var model = SHRecordFolderModel()
model = getDataDictWith(dict: dict)
dataSources.append(model)
if model.top == true {
topDataSources.append(model)
}else{
dataSources.append(model)
}
}
}
......@@ -164,22 +171,33 @@ class SHRecordListViewController: SHBaseViewController {
for dict in list.reversed(){
var model = SHRecordFolderModel()
model = getDataDictWith(dict: dict)
dataSources.append(model)
if model.top == true {
topDataSources.append(model)
}else{
dataSources.append(model)
}
}
}
dataSources = dataSources.filterDuplicates({$0.id})
topDataSources = topDataSources.filterDuplicates({$0.id})
switch CRUserDefaults.sortType {
case 0:
dataSources.sort { (model0, model1) -> Bool in
return model0.createDate.compare(model1.createDate) == ComparisonResult.orderedDescending
}
topDataSources.sort { (model0, model1) -> Bool in
return model0.createDate.compare(model1.createDate) == ComparisonResult.orderedDescending
}
break
default:
dataSources.sort { (model0, model1) -> Bool in
return model0.modifyDate.compare(model1.modifyDate) == ComparisonResult.orderedDescending
}
topDataSources.sort { (model0, model1) -> Bool in
return model0.modifyDate.compare(model1.modifyDate) == ComparisonResult.orderedDescending
}
break
}
}else{
......@@ -188,18 +206,27 @@ class SHRecordListViewController: SHBaseViewController {
dataSources.sort { (model0, model1) -> Bool in
return model0.createDate.compare(model1.createDate) == ComparisonResult.orderedDescending
}
topDataSources.sort { (model0, model1) -> Bool in
return model0.createDate.compare(model1.createDate) == ComparisonResult.orderedDescending
}
break
default:
dataSources.sort { (model0, model1) -> Bool in
return model0.modifyDate.compare(model1.modifyDate) == ComparisonResult.orderedDescending
}
topDataSources.sort { (model0, model1) -> Bool in
return model0.modifyDate.compare(model1.modifyDate) == ComparisonResult.orderedDescending
}
break
}
}
dataSources = topDataSources+dataSources
tableView?.reloadData()
maskHintLab?.text = "点击上面右上角添加笔记本"
maskHintImv?.image = UIImage.init(named: "recordlist_no_data")
if dataSources.count == 0 {
self.view.bringSubviewToFront(maskView)
}else {
......@@ -210,8 +237,47 @@ class SHRecordListViewController: SHBaseViewController {
}
func removeModel(_ indexPath: IndexPath){
@objc func mineCilck(){
let mine = UIStoryboard.init(name: "Mine", bundle: nil).instantiateViewController(withIdentifier: "SHMineViewController") as! SHMineViewController
self.navigationController?.pushViewController(mine, animated: true)
}
@objc func userCilck(){
// if SHUserAccountManager.shared.isMember == false {
// self.goGoods("home_pop")
// }
addModel()
}
@objc func preposeMember(){
SHUserAccountManager.shared.getNovelInfo { (json) in
if SHUserAccountManager.shared.isMember == false && SHUserAccountManager.shared.isStartFront == true{
self.goGoods("home_pay")
}
}
}
@IBAction func advertBtnClick(){
}
@IBAction func goRecord(){
if CRUserDefaults.isFirstRecord == true{
if SHUserAccountManager.shared.isMember == false{
self.goGoods("home_record")
return
}
}
let record = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordViewController") as! SHRecordViewController
self.navigationController?.pushViewController(record, animated: true)
}
}
//MARK: 删、重命名、置顶、添加 文件夹
extension SHRecordListViewController {
func removeModel(_ indexPath: IndexPath){
AlertControllerTool.alertController(withTitle: "提示", message: "确定要删除此文件夹吗?", cancelTitle: "取消", cancel: {
}, confirmTitle: "删除", confirmTitleColor: UIColor.red, confirmBlock: { message in
......@@ -338,44 +404,54 @@ class SHRecordListViewController: SHBaseViewController {
self.prepareDateSource()
}
}
@objc func mineCilck(){
let mine = UIStoryboard.init(name: "Mine", bundle: nil).instantiateViewController(withIdentifier: "SHMineViewController") as! SHMineViewController
self.navigationController?.pushViewController(mine, animated: true)
}
@objc func userCilck(){
// if SHUserAccountManager.shared.isMember == false {
// self.goGoods("home_pop")
// }
}
@objc func preposeMember(){
SHUserAccountManager.shared.getNovelInfo { (json) in
if SHUserAccountManager.shared.isMember == false && SHUserAccountManager.shared.isStartFront == true{
self.goGoods("home_pay")
@objc func addModel(){
let newFolder = SHRecordRenameAlertView.loadFromNibAndClass(SHRecordRenameAlertView.self)!
newFolder.placeHolder = "这是一个新的笔记本名称"
newFolder.title = "新笔记本"
newFolder.frame = UIApplication.shared.keyWindow!.bounds
UIApplication.shared.keyWindow!.addSubview(newFolder)
newFolder.confirmCallBack = { newFolderStr in
let nowDate = Date()
let folderModel = SHRecordFolderModel()
folderModel.createDate = nowDate
folderModel.modifyDate = nowDate
folderModel.name = newFolderStr;
folderModel.id = nowDate.milliStamp
folderModel.dataSources = []
let modelDict = getDictWith(obj: folderModel)
if var list = CRUserDefaults.recordList {
list.append(modelDict)
CRUserDefaults.recordList = list
}else{
let list = [modelDict]
CRUserDefaults.recordList = list
}
}
}
@IBAction func advertBtnClick(){
}
@IBAction func goRecord(){
if CRUserDefaults.isFirstRecord == true{
if SHUserAccountManager.shared.isMember == false{
self.goGoods("home_record")
return
let list = self.keyValueStore.object(forKey: "Folderlist") as? [Dictionary<String, Any>]
if var list = list {
list.append(modelDict)
self.keyValueStore.set(list, forKey: "Folderlist")
self.keyValueStore.synchronize()
}else{
let list = [modelDict]
self.keyValueStore.set(list, forKey: "Folderlist")
self.keyValueStore.synchronize()
}
}
let record = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordViewController") as! SHRecordViewController
self.navigationController?.pushViewController(record, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(333)) {
self.prepareDateSource()
}
}
}
}
//MARK: tableView delegate
extension SHRecordListViewController: UITableViewDelegate, UITableViewDataSource{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if self.searchBarVC.isActive {
......@@ -397,7 +473,7 @@ extension SHRecordListViewController: UITableViewDelegate, UITableViewDataSource
}else{
cell.model = dataSources[indexPath.row]
}
cell.selectionStyle = .none
return cell
}
......@@ -479,6 +555,7 @@ extension SHRecordListViewController: UITableViewDelegate, UITableViewDataSource
}
}
//MARK: searchBar delegate
extension SHRecordListViewController: UISearchResultsUpdating, UISearchBarDelegate{
func updateSearchResults(for searchController: UISearchController) {
......@@ -495,6 +572,7 @@ extension SHRecordListViewController: UISearchResultsUpdating, UISearchBarDelega
if self.searchBarVC.isActive{
maskHintLab?.text = "没有找到相关的内容"
maskHintImv?.image = UIImage.init(named: "recordlist_no_data_search")
if searchDataSource.count == 0 {
self.view.bringSubviewToFront(maskView)
}else {
......@@ -505,8 +583,8 @@ extension SHRecordListViewController: UISearchResultsUpdating, UISearchBarDelega
}
}
//MARK: searchController delegate
extension SHRecordListViewController: UISearchControllerDelegate{
func willPresentSearchController(_ searchController: UISearchController){
UIView.animate(withDuration: 0.25) {
self.searchView.frame = CGRect(x:0, y: 0, width: SCREEN_WIDTH, height: 56)
......
//
// SHRecordMoveFileVC.swift
// ShorthandMaster
//
// Created by 明津李 on 2020/9/24.
// Copyright © 2020 明津李. All rights reserved.
//
import UIKit
class SHRecordMoveFileVC: SHBaseViewController {
var currentModel = SHRecordFolderModel()
var moveFiles: Array<SHRecordModel> = []
var saveSuccessCallBack:((SHRecordFolderModel)->Void)?
@IBOutlet weak var tableHeaderView: UIView?
@IBOutlet weak var tableView: UITableView?
let keyValueStore = NSUbiquitousKeyValueStore.default
var dataSources: Array<SHRecordFolderModel> = []
var searchDataSource: Array<SHRecordFolderModel> = []
var searchView: UISearchBar!
lazy var searchBarVC: UISearchController = {
let searchBarVC = UISearchController.init(searchResultsController: nil)
searchBarVC.delegate = self
searchBarVC.searchBar.delegate = self
searchBarVC.searchResultsUpdater = self
searchBarVC.dimsBackgroundDuringPresentation = false
searchBarVC.hidesNavigationBarDuringPresentation = false
searchBarVC.searchBar.placeholder = "搜索";
searchBarVC.searchBar.searchBarStyle = .minimal;
UIBarButtonItem.appearance(whenContainedInInstancesOf: [UISearchBar.self]).title = " 取消 "
// self.definesPresentationContext = true
return searchBarVC
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
prepareDataSource()
}
override func setupUI(){
self.navigationItem.title = "移到"
let rightImage = UIImage.init(named: "recordDetails_remove_cancel")?.withRenderingMode(.alwaysOriginal)
self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(image: rightImage, style: .plain, target: self, action: #selector(cancelCilck))
self.navigationItem.leftBarButtonItem = UIBarButtonItem.init()
searchView = searchBarVC.searchBar
searchView.frame = CGRect(x: 8, y: 0, width: SCREEN_WIDTH-16, height: 56)
self.tableHeaderView?.addSubview(searchView)
tableView?.tableFooterView = UIView.init()
}
@objc func cancelCilck(){
self.dismiss(animated: true, completion: nil)
}
@IBAction func addFolderClick(){
addModel()
}
func prepareDataSource(){
dataSources = []
if CRUserDefaults.sortType == nil{
CRUserDefaults.sortType = 0
}
if let folderList = CRUserDefaults.recordList {
for dict in folderList.reversed(){
var model = SHRecordFolderModel()
model = getDataDictWith(dict: dict)
if model.id != currentModel.id {
dataSources.append(model)
}
}
}
var list = keyValueStore.object(forKey: "Folderlist") as? [Dictionary<String, Any>]
if list == nil {
list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
}
if list != nil {
for dict in list!.reversed(){
var model = SHRecordFolderModel()
model = getDataDictWith(dict: dict)
if model.id != currentModel.id {
dataSources.append(model)
}
}
dataSources = dataSources.filterDuplicates({$0.id})
switch CRUserDefaults.sortType {
case 0:
dataSources.sort { (model0, model1) -> Bool in
return model0.createDate.compare(model1.createDate) == ComparisonResult.orderedDescending
}
break
default:
dataSources.sort { (model0, model1) -> Bool in
return model0.modifyDate.compare(model1.modifyDate) == ComparisonResult.orderedDescending
}
break
}
}else{
switch CRUserDefaults.sortType {
case 0:
dataSources.sort { (model0, model1) -> Bool in
return model0.createDate.compare(model1.createDate) == ComparisonResult.orderedDescending
}
break
default:
dataSources.sort { (model0, model1) -> Bool in
return model0.modifyDate.compare(model1.modifyDate) == ComparisonResult.orderedDescending
}
break
}
}
tableView?.reloadData()
}
//MARK:添加新笔记
@objc func addModel(){
let newFolder = SHRecordRenameAlertView.loadFromNibAndClass(SHRecordRenameAlertView.self)!
newFolder.placeHolder = "这是一个新的笔记本名称"
newFolder.title = "新笔记本"
newFolder.frame = UIApplication.shared.keyWindow!.bounds
UIApplication.shared.keyWindow!.addSubview(newFolder)
newFolder.confirmCallBack = { newFolderStr in
let nowDate = Date()
let folderModel = SHRecordFolderModel()
folderModel.createDate = nowDate
folderModel.modifyDate = nowDate
folderModel.name = newFolderStr;
folderModel.id = nowDate.milliStamp
folderModel.dataSources = []
let modelDict = getDictWith(obj: folderModel)
if var list = CRUserDefaults.recordList {
list.append(modelDict)
CRUserDefaults.recordList = list
}else{
let list = [modelDict]
CRUserDefaults.recordList = list
}
let list = self.keyValueStore.object(forKey: "Folderlist") as? [Dictionary<String, Any>]
if var list = list {
list.append(modelDict)
self.keyValueStore.set(list, forKey: "Folderlist")
self.keyValueStore.synchronize()
}else{
let list = [modelDict]
self.keyValueStore.set(list, forKey: "Folderlist")
self.keyValueStore.synchronize()
}
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(333)) {
self.prepareDataSource()
}
}
}
}
//MARK: tableView delegate
extension SHRecordMoveFileVC: UITableViewDelegate, UITableViewDataSource{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if self.searchBarVC.isActive {
return searchDataSource.count
}
return dataSources.count
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 44
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let identifier = "UITableViewCell"
var cell = tableView.dequeueReusableCell(withIdentifier: identifier)
if cell == nil{
cell = UITableViewCell.init(style: .default, reuseIdentifier: identifier)
}
let model: SHRecordFolderModel
if self.searchBarVC.isActive {
model = searchDataSource[indexPath.row]
}else{
model = dataSources[indexPath.row]
}
cell?.textLabel?.text = model.name
cell?.selectionStyle = .none
return cell!
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
//TODO:转移
let targetModel: SHRecordFolderModel
if self.searchBarVC.isActive {
targetModel = searchDataSource[indexPath.row]
}else{
targetModel = dataSources[indexPath.row]
}
let nowDate = Date()
for model in moveFiles {
if currentModel.dataSources.contains(model) {
if let index = currentModel.dataSources.firstIndex(where: { $0.pathFile == model.pathFile}) {
currentModel.dataSources.remove(at: index)
}
}
}
var list = CRUserDefaults.recordList
if var recordList = list{
//增
for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == targetModel.id {
subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = subFolderModel.dataSources+moveFiles
let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic
break
}
}
//删
if var recordList = list{
for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == currentModel.id {
subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = currentModel.dataSources
let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic
break
}
}
}
CRUserDefaults.recordList = recordList
}
list = keyValueStore.object(forKey: "Folderlist") as? [Dictionary<String, Any>]
if var recordList = list{
//增
for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == targetModel.id {
subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = subFolderModel.dataSources+moveFiles
let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic
break
}
}
//删
for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == currentModel.id {
subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = currentModel.dataSources
let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic
break
}
}
keyValueStore.set(recordList, forKey: "Folderlist")
keyValueStore.synchronize()
}
saveSuccessCallBack?(currentModel)
self.navigationController?.dismiss(animated: true, completion: nil)
}
}
//MARK: searchBar delegate
extension SHRecordMoveFileVC: UISearchResultsUpdating, UISearchBarDelegate{
func updateSearchResults(for searchController: UISearchController) {
searchDataSource.removeAll()
var searchArr: Array<SHRecordFolderModel> = []
searchArr = ZYPinYinSearch.search(withOriginalArray: dataSources, andSearchText: searchController.searchBar.text, andSearchByPropertyName: "name") as! Array<SHRecordFolderModel>
if searchController.searchBar.text?.length == 0 {
searchDataSource.append(contentsOf: dataSources)
}else {
searchDataSource.append(contentsOf: searchArr)
}
self.tableView?.reloadData()
}
}
//MARK: searchController delegate
extension SHRecordMoveFileVC: UISearchControllerDelegate{
func willPresentSearchController(_ searchController: UISearchController){
UIView.animate(withDuration: 0.25) {
self.searchView.frame = CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 56)
} completion: { (result) in
}
}
func didPresentSearchController(_ searchController: UISearchController){
self.searchView.frame = CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 56)
}
func willDismissSearchController(_ searchController: UISearchController){
UIView.animate(withDuration: 0.25) {
self.searchView.frame = CGRect(x: 8, y: 0, width: SCREEN_WIDTH-16, height: 56)
} completion: { (result) in
}
}
func didDismissSearchController(_ searchController: UISearchController){
searchView.frame = CGRect(x: 8, y: 0, width: SCREEN_WIDTH-16, height: 56)
}
func presentSearchController(_ searchController: UISearchController){
}
}
......@@ -15,6 +15,9 @@ class SHRecordViewController: SHBaseViewController{
private var waveView: SHRecordWaveView!
var folderModel: SHRecordFolderModel = SHRecordFolderModel()
var saveSuccessCallBack:((SHRecordFolderModel)->Void)?
@IBOutlet var recordTextView: UITextView!
@IBOutlet var waveBgView: UIView!
@IBOutlet var secondsLabel: UILabel!
......@@ -93,6 +96,10 @@ class SHRecordViewController: SHBaseViewController{
}
}
override func goback() {
super.goback()
saveSuccessCallBack?(folderModel)
}
override func setupUI() {
super.setupUI()
......@@ -153,6 +160,8 @@ class SHRecordViewController: SHBaseViewController{
saveContent()
saveSuccessCallBack?(folderModel)
let export = SHRecordExportAlertView.loadFromNibAndClass(SHRecordExportAlertView.self)!
export.frame = UIApplication.shared.keyWindow!.bounds
UIApplication.shared.keyWindow!.addSubview(export)
......@@ -467,8 +476,10 @@ class SHRecordViewController: SHBaseViewController{
return
}
let nowDate = Date()
let model = SHRecordModel()
model.createDate = Date()
model.createDate = nowDate
model.modifyDate = nowDate
model.address = currentAddress ?? ""
model.rename = currentAddress ?? ""
model.txt = recognitionTaskText.first ?? (self.currentTxt ?? "")
......@@ -476,26 +487,41 @@ class SHRecordViewController: SHBaseViewController{
model.pcmPathFile = pcm_file_path!
model.during = seconds
let dic = ["time":model.createDate, "address":model.address, "txt":model.txt, "pathFile":model.pathFile, "during":model.during, "delete":model.delete, "rename":model.rename] as [String : Any]
var list = CRUserDefaults.recordList
if list == nil {
list = [dic]
}else{
var contains = false
for (index, subDic) in list!.enumerated(){
if (subDic["pathFile"] as! String) == model.pathFile {
var contains = false
if folderModel.dataSources.count != 0 {
for (index, subModel) in folderModel.dataSources.enumerated() {
if subModel.pathFile == model.pathFile {
contains = true
list![index] = dic
folderModel.dataSources[index] = model
break
}
}
if contains == false {
list?.append(dic)
if contains == false{
folderModel.dataSources.append(model)
}
}else{
folderModel.dataSources.append(model)
}
CRUserDefaults.recordList = list
let list = CRUserDefaults.recordList
if var recordList = list{
for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == folderModel.id {
contains = true
subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = folderModel.dataSources
let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic
break
}
}
if contains == true {
CRUserDefaults.recordList = recordList
}
}
currentModel = model
do{
......@@ -505,28 +531,37 @@ class SHRecordViewController: SHBaseViewController{
model.fileData = data
let dic = ["time":model.createDate, "address":model.address, "txt":model.txt, "pathFile":model.pathFile, "during":model.during, "delete":model.delete, "fileData":model.fileData, "rename":model.rename] as [String : Any]
if folderModel.dataSources.count != 0 {
for (index, subModel) in folderModel.dataSources.enumerated() {
if subModel.pathFile == model.pathFile {
folderModel.dataSources[index] = model
break
}
}
}else{
folderModel.dataSources.append(model)
}
let keyValueStore = NSUbiquitousKeyValueStore.default
var list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
if list == nil {
list = [dic]
}else{
var contains = false
for (index, subDic) in list!.enumerated(){
if (subDic["pathFile"] as! String) == model.pathFile {
let list = keyValueStore.object(forKey: "Folderlist") as? [Dictionary<String, Any>]
if var recordList = list{
for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == folderModel.id {
contains = true
list![index] = dic
subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = folderModel.dataSources
let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic
break
}
}
if contains == false {
list!.append(dic)
if contains == true {
keyValueStore.set(recordList, forKey: "Folderlist")
keyValueStore.synchronize()
}
}
keyValueStore.set(list, forKey: "list")
keyValueStore.synchronize()
currentModel = model
} catch {
......
......@@ -9,7 +9,76 @@
import UIKit
class SHRecordDetailsBottomView: UIView {
@IBOutlet var countLab: UILabel?
var recordCount: NSInteger = 0 {
didSet{
countLab?.text = "总笔记本数:\(recordCount)"
}
}
var cancel: Bool = false {
didSet{
if cancel == true {
let btn:UIButton = self.viewWithTag(103) as! UIButton
btn.isSelected = false
let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation")
rotationAnimation.fromValue = btn.isSelected ? 0 : Float.pi * 0.25
rotationAnimation.toValue = btn.isSelected ? Float.pi * 0.25 : 0
rotationAnimation.duration = 0.25
rotationAnimation.repeatCount = 0
//保持结束后不还原
rotationAnimation.fillMode = CAMediaTimingFillMode.forwards
rotationAnimation.isRemovedOnCompletion = false
btn.layer.add(rotationAnimation, forKey: nil)
}
}
}
var deleteSelected: Bool = false {
didSet{
let btn:UIButton = self.viewWithTag(100) as! UIButton
if deleteSelected == true {
btn.isSelected = true
}else{
btn.isSelected = false
}
}
}
var selectCallBack: ((NSInteger, Bool)->Void)?
@IBAction func btnClick(_ sender:UIButton!){
switch sender.tag {
case 100:
sender.isSelected = !sender.isSelected
break
case 101:
break
case 102:
break
case 103:
cancel = false
sender.isSelected = !sender.isSelected
let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation")
rotationAnimation.fromValue = sender.isSelected ? 0 : Float.pi * 0.25
rotationAnimation.toValue = sender.isSelected ? Float.pi * 0.25 : 0
rotationAnimation.duration = 0.25
rotationAnimation.repeatCount = 0
//保持结束后不还原
rotationAnimation.fillMode = CAMediaTimingFillMode.forwards
rotationAnimation.isRemovedOnCompletion = false
sender.layer.add(rotationAnimation, forKey: nil)
break
default:
break
}
selectCallBack?(sender.tag, sender.isSelected)
}
}
......@@ -21,21 +21,35 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="y8M-FY-Nf5">
<rect key="frame" x="0.0" y="0.0" width="409.5" height="159"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e2v-Fo-Qp5">
<rect key="frame" x="20" y="64.5" width="75" height="30"/>
<state key="normal" title="全选 "/>
<button opaque="NO" tag="100" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e2v-Fo-Qp5">
<rect key="frame" x="20" y="62.5" width="87" height="34"/>
<state key="normal" title="全选 ">
<color key="titleColor" red="0.25490196079999999" green="0.51372549020000002" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
</state>
<state key="selected" title="取消 "/>
<connections>
<action selector="btnClick:" destination="xFb-3q-Fyi" eventType="touchUpInside" id="K4b-Fq-SL0"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EIy-6f-IqZ">
<rect key="frame" x="173.5" y="64.5" width="63" height="30"/>
<state key="normal" title=" 移动 "/>
<button opaque="NO" tag="101" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EIy-6f-IqZ">
<rect key="frame" x="168" y="62.5" width="74" height="34"/>
<state key="normal" title=" 移动 ">
<color key="titleColor" red="0.25490196079999999" green="0.51372549020000002" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="btnClick:" destination="xFb-3q-Fyi" eventType="touchUpInside" id="bhW-nT-2Pt"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jmd-yJ-G2t">
<button opaque="NO" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jmd-yJ-G2t">
<rect key="frame" x="355.5" y="57.5" width="44" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="2jT-uF-Odm"/>
<constraint firstAttribute="width" constant="44" id="j2N-nd-hDr"/>
</constraints>
<state key="normal" image="recordDetails_bottom_delete"/>
<connections>
<action selector="btnClick:" destination="xFb-3q-Fyi" eventType="touchUpInside" id="YXZ-kj-QuM"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
......@@ -51,15 +65,18 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dzZ-KN-iG7">
<rect key="frame" x="409.5" y="0.0" width="409.5" height="159"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CsG-LQ-Eeb">
<rect key="frame" x="184" y="69.5" width="41.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="笔记本总数:0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CsG-LQ-Eeb">
<rect key="frame" x="157.5" y="71" width="94.5" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.58431372550000005" green="0.62745098040000002" blue="0.72156862749999995" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0yn-aJ-wzE">
<rect key="frame" x="339.5" y="64.5" width="46" height="30"/>
<state key="normal" title="Button"/>
<button opaque="NO" tag="103" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0yn-aJ-wzE">
<rect key="frame" x="344.5" y="59" width="41" height="41"/>
<state key="normal" image="recordDetails_bottom_add"/>
<connections>
<action selector="btnClick:" destination="xFb-3q-Fyi" eventType="touchUpInside" id="XbR-L8-DbQ"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
......@@ -82,10 +99,14 @@
<constraint firstItem="pYr-gn-BWK" firstAttribute="top" secondItem="xFb-3q-Fyi" secondAttribute="top" id="swH-uV-E3R"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="countLab" destination="CsG-LQ-Eeb" id="L71-fF-D7Y"/>
</connections>
<point key="canvasLocation" x="-23.913043478260871" y="-121.54017857142857"/>
</view>
</objects>
<resources>
<image name="recordDetails_bottom_add" width="41" height="41"/>
<image name="recordDetails_bottom_delete" width="18" height="19"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......
......@@ -31,7 +31,7 @@ class SHRecordDetailsCell: UITableViewCell {
timeLab?.text = Date.getShortTimeByStamp_record(timestamp: Int64(newValue.modifyDate.timeIntervalSince1970))
txtLab?.text = newValue.txt
duringLab?.text = countSecond(newValue.during)
selectedBtn?.isSelected = model.selected
}
get{
return _model!
......
......@@ -10,14 +10,21 @@ import UIKit
class SHRecordRenameAlertView: UIView {
@IBOutlet var bgView: UIView!
@IBOutlet var textField: UITextField!
@IBOutlet private var bgView: UIView?
@IBOutlet private var textField: UITextField?
@IBOutlet private var titleLab: UILabel?
var title: String = "重命名" {
didSet{
titleLab?.text = title
}
}
private var _placeHolder: String?
var placeHolder: String {
set{
_placeHolder = newValue
textField.placeholder = newValue
textField?.placeholder = newValue
}
get{
return _placeHolder!
......@@ -37,11 +44,11 @@ class SHRecordRenameAlertView: UIView {
super.awakeFromNib()
self.backgroundColor = UIColor.init(red: 0, green: 0, blue: 0, alpha: 0.3)
bgView.layer.cornerRadius = 8
bgView?.layer.cornerRadius = 8
}
@objc @IBAction func cleanBtnClick(_ sender:UIButton){
self.textField.text = ""
self.textField?.text = ""
}
@objc @IBAction func cancelBtnClick(_ sender:UIButton){
......@@ -50,8 +57,8 @@ class SHRecordRenameAlertView: UIView {
@objc @IBAction func confirmBtnClick(_ sender:UIButton){
if let text = textField.text, text.length > 0{
confirmCallBack?(textField.text ?? "")
if let text = textField?.text, text.length > 0{
confirmCallBack?(textField?.text ?? "")
self.removeFromSuperview()
}
}
......
......@@ -116,6 +116,7 @@
<connections>
<outlet property="bgView" destination="qte-rS-SOz" id="DBx-na-7o1"/>
<outlet property="textField" destination="4On-7k-axI" id="FyQ-l0-gSd"/>
<outlet property="titleLab" destination="2Yi-xr-CGL" id="j2Y-T9-fEJ"/>
</connections>
<point key="canvasLocation" x="47.826086956521742" y="71.651785714285708"/>
</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment