Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
ShorthandMaster
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
ShorthandMaster
Commits
1d38dd26
Commit
1d38dd26
authored
Sep 27, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dateModel
parent
310abcf6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
111 deletions
+49
-111
SHInputController.swift
ShorthandMaster/Input/Controller/SHInputController.swift
+1
-1
Record.storyboard
ShorthandMaster/Record/Record.storyboard
+8
-7
SHRecordDetailsVC.swift
ShorthandMaster/Record/SHRecordDetailsVC.swift
+15
-20
SHRecordListViewController.swift
ShorthandMaster/Record/SHRecordListViewController.swift
+1
-1
SHRecordMoveFileVC.swift
ShorthandMaster/Record/SHRecordMoveFileVC.swift
+11
-81
SHRecordDetailsCell.swift
ShorthandMaster/Record/View/SHRecordDetailsCell.swift
+13
-1
No files found.
ShorthandMaster/Input/Controller/SHInputController.swift
View file @
1d38dd26
...
@@ -19,7 +19,7 @@ class SHInputController: SHBaseViewController
...
@@ -19,7 +19,7 @@ class SHInputController: SHBaseViewController
var
saveSuccessCallBack
:((
SHRecordFolderModel
)
->
Void
)?
var
saveSuccessCallBack
:((
SHRecordFolderModel
)
->
Void
)?
/// 存储数据的model
/// 存储数据的model
private
var
dataModel
:
SHRecordModel
=
SHRecordModel
()
var
dataModel
:
SHRecordModel
=
SHRecordModel
()
/// 未填写标题时的默认标题
/// 未填写标题时的默认标题
private
let
defaultTitle
:
String
=
"新建笔记"
private
let
defaultTitle
:
String
=
"新建笔记"
...
...
ShorthandMaster/Record/Record.storyboard
View file @
1d38dd26
...
@@ -365,35 +365,35 @@
...
@@ -365,35 +365,35 @@
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Ace-iU-keq"
>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Ace-iU-keq"
>
<rect
key=
"frame"
x=
"50"
y=
"5"
width=
"344"
height=
"220"
/>
<rect
key=
"frame"
x=
"50"
y=
"5"
width=
"344"
height=
"220"
/>
<subviews>
<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=
"6bV-3V-R81"
>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
numberOfLines=
"2"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"6bV-3V-R81"
>
<rect
key=
"frame"
x=
"18"
y=
"18"
width=
"44"
height=
"21"
/>
<rect
key=
"frame"
x=
"18"
y=
"18"
width=
"44"
height=
"21
.5
"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"18"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"18"
/>
<color
key=
"textColor"
red=
"0.0"
green=
"0.074509803921568626"
blue=
"0.23921568627450979"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<color
key=
"textColor"
red=
"0.0"
green=
"0.074509803921568626"
blue=
"0.23921568627450979"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
numberOfLines=
"3"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"FVv-OG-DwV"
>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
numberOfLines=
"3"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"FVv-OG-DwV"
>
<rect
key=
"frame"
x=
"18"
y=
"80"
width=
"35.5"
height=
"17"
/>
<rect
key=
"frame"
x=
"18"
y=
"80
.5
"
width=
"35.5"
height=
"17"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<nil
key=
"textColor"
/>
<nil
key=
"textColor"
/>
<nil
key=
"highlightedColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</label>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFit"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
image=
"recordDetails_voice"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"6je-jR-opG"
>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFit"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
image=
"recordDetails_voice"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"6je-jR-opG"
>
<rect
key=
"frame"
x=
"18"
y=
"107"
width=
"16"
height=
"16"
/>
<rect
key=
"frame"
x=
"18"
y=
"107
.5
"
width=
"16"
height=
"16"
/>
</imageView>
</imageView>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"XAw-V9-smq"
>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"XAw-V9-smq"
>
<rect
key=
"frame"
x=
"39"
y=
"10
6.5
"
width=
"36"
height=
"17"
/>
<rect
key=
"frame"
x=
"39"
y=
"10
7
"
width=
"36"
height=
"17"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
red=
"0.58431372549019611"
green=
"0.62745098039215685"
blue=
"0.72156862745098038"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<color
key=
"textColor"
red=
"0.58431372549019611"
green=
"0.62745098039215685"
blue=
"0.72156862745098038"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"cAa-wI-k0B"
>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"cAa-wI-k0B"
>
<rect
key=
"frame"
x=
"18"
y=
"49"
width=
"36"
height=
"17"
/>
<rect
key=
"frame"
x=
"18"
y=
"49
.5
"
width=
"36"
height=
"17"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
red=
"0.58431372549019611"
green=
"0.62745098039215685"
blue=
"0.72156862745098038"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<color
key=
"textColor"
red=
"0.58431372549019611"
green=
"0.62745098039215685"
blue=
"0.72156862745098038"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</label>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"SzJ-Gk-Tag"
>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"SzJ-Gk-Tag"
>
<rect
key=
"frame"
x=
"296"
y=
"100"
width=
"30"
height=
"30"
/>
<rect
key=
"frame"
x=
"296"
y=
"100
.5
"
width=
"30"
height=
"30"
/>
<constraints>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"30"
id=
"oaj-sd-4Uh"
/>
<constraint
firstAttribute=
"width"
constant=
"30"
id=
"oaj-sd-4Uh"
/>
<constraint
firstAttribute=
"height"
constant=
"30"
id=
"wkj-jD-iI1"
/>
<constraint
firstAttribute=
"height"
constant=
"30"
id=
"wkj-jD-iI1"
/>
...
@@ -418,6 +418,7 @@
...
@@ -418,6 +418,7 @@
<constraint
firstItem=
"6bV-3V-R81"
firstAttribute=
"top"
secondItem=
"Ace-iU-keq"
secondAttribute=
"top"
constant=
"18"
id=
"Sj5-yA-Hdn"
/>
<constraint
firstItem=
"6bV-3V-R81"
firstAttribute=
"top"
secondItem=
"Ace-iU-keq"
secondAttribute=
"top"
constant=
"18"
id=
"Sj5-yA-Hdn"
/>
<constraint
firstItem=
"FVv-OG-DwV"
firstAttribute=
"leading"
secondItem=
"6bV-3V-R81"
secondAttribute=
"leading"
id=
"k4e-UV-52H"
/>
<constraint
firstItem=
"FVv-OG-DwV"
firstAttribute=
"leading"
secondItem=
"6bV-3V-R81"
secondAttribute=
"leading"
id=
"k4e-UV-52H"
/>
<constraint
firstItem=
"cAa-wI-k0B"
firstAttribute=
"top"
secondItem=
"6bV-3V-R81"
secondAttribute=
"bottom"
constant=
"10"
id=
"mde-3T-2mf"
/>
<constraint
firstItem=
"cAa-wI-k0B"
firstAttribute=
"top"
secondItem=
"6bV-3V-R81"
secondAttribute=
"bottom"
constant=
"10"
id=
"mde-3T-2mf"
/>
<constraint
firstAttribute=
"trailing"
relation=
"greaterThanOrEqual"
secondItem=
"6bV-3V-R81"
secondAttribute=
"trailing"
constant=
"18"
id=
"xug-bT-eC2"
/>
</constraints>
</constraints>
</view>
</view>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"adA-MF-vWU"
>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"adA-MF-vWU"
>
...
...
ShorthandMaster/Record/SHRecordDetailsVC.swift
View file @
1d38dd26
...
@@ -298,22 +298,6 @@ extension SHRecordDetailsVC {
...
@@ -298,22 +298,6 @@ extension SHRecordDetailsVC {
}
}
}
}
// 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
{
if
currentModel
.
dataSources
.
count
==
0
{
self
.
editClick
(
true
)
self
.
editClick
(
true
)
self
.
markAlertViewShow
(
false
)
self
.
markAlertViewShow
(
false
)
...
@@ -409,8 +393,19 @@ extension SHRecordDetailsVC: UITableViewDelegate, UITableViewDataSource{
...
@@ -409,8 +393,19 @@ extension SHRecordDetailsVC: UITableViewDelegate, UITableViewDataSource{
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
show
=
UIStoryboard
.
init
(
name
:
"Record"
,
bundle
:
nil
)
.
instantiateViewController
(
withIdentifier
:
"SHRecordShowViewController"
)
as!
SHRecordShowViewController
// let show = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordShowViewController") as! SHRecordShowViewController
show
.
model
=
currentModel
.
dataSources
[
indexPath
.
row
]
// show.model = currentModel.dataSources[indexPath.row]
self
.
navigationController
?
.
pushViewController
(
show
,
animated
:
true
)
// self.navigationController?.pushViewController(show, animated: true)
let
input
=
SHInputController
.
init
()
input
.
folderModel
=
currentModel
input
.
dataModel
=
currentModel
.
dataSources
[
indexPath
.
row
]
self
.
navigationController
?
.
pushViewController
(
input
,
animated
:
true
)
input
.
saveSuccessCallBack
=
{
model
in
self
.
currentModel
=
model
self
.
updateocloudUI
()
}
}
}
}
}
ShorthandMaster/Record/SHRecordListViewController.swift
View file @
1d38dd26
...
@@ -56,7 +56,7 @@ class SHRecordListViewController: SHBaseViewController {
...
@@ -56,7 +56,7 @@ class SHRecordListViewController: SHBaseViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
SHAVAudioManager
.
shared
.
start
()
//
SHAVAudioManager.shared.start()
let
url
=
FileManager
.
default
.
url
(
forUbiquityContainerIdentifier
:
nil
)
let
url
=
FileManager
.
default
.
url
(
forUbiquityContainerIdentifier
:
nil
)
print
(
url
as
Any
)
print
(
url
as
Any
)
...
...
ShorthandMaster/Record/SHRecordMoveFileVC.swift
View file @
1d38dd26
...
@@ -84,36 +84,6 @@ class SHRecordMoveFileVC: SHBaseViewController {
...
@@ -84,36 +84,6 @@ class SHRecordMoveFileVC: SHBaseViewController {
}
}
}
}
var
list
=
keyValueStore
.
object
(
forKey
:
"Folderlist"
)
as?
[
Dictionary
<
String
,
Any
>
]
if
list
==
nil
{
list
=
keyValueStore
.
object
(
forKey
:
"list"
)
as?
[
Dictionary
<
String
,
Any
>
]
}
list
=
nil
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
{
switch
CRUserDefaults
.
sortType
{
case
0
:
case
0
:
dataSources
.
sort
{
(
model0
,
model1
)
->
Bool
in
dataSources
.
sort
{
(
model0
,
model1
)
->
Bool
in
...
@@ -126,7 +96,7 @@ class SHRecordMoveFileVC: SHBaseViewController {
...
@@ -126,7 +96,7 @@ class SHRecordMoveFileVC: SHBaseViewController {
}
}
break
break
}
}
}
tableView
?
.
reloadData
()
tableView
?
.
reloadData
()
}
}
...
@@ -158,18 +128,6 @@ class SHRecordMoveFileVC: SHBaseViewController {
...
@@ -158,18 +128,6 @@ class SHRecordMoveFileVC: SHBaseViewController {
CRUserDefaults
.
recordList
=
list
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
))
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
.
milliseconds
(
333
))
{
self
.
prepareDataSource
()
self
.
prepareDataSource
()
}
}
...
@@ -253,34 +211,6 @@ class SHRecordMoveFileVC: SHBaseViewController {
...
@@ -253,34 +211,6 @@ class SHRecordMoveFileVC: SHBaseViewController {
}
}
}
}
}
}
// 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()
// }
}
}
}
}
...
...
ShorthandMaster/Record/View/SHRecordDetailsCell.swift
View file @
1d38dd26
...
@@ -30,7 +30,19 @@ class SHRecordDetailsCell: UITableViewCell {
...
@@ -30,7 +30,19 @@ class SHRecordDetailsCell: UITableViewCell {
titleName
?
.
text
=
newValue
.
rename
titleName
?
.
text
=
newValue
.
rename
timeLab
?
.
text
=
Date
.
getShortTimeByStamp_record
(
timestamp
:
Int64
(
newValue
.
modifyDate
.
timeIntervalSince1970
))
timeLab
?
.
text
=
Date
.
getShortTimeByStamp_record
(
timestamp
:
Int64
(
newValue
.
modifyDate
.
timeIntervalSince1970
))
if
model
.
recordingType
==
1
{
let
txts
=
newValue
.
txt
.
components
(
separatedBy
:
"
\n
"
)
let
result
=
txts
.
reduce
(
""
,
{
x
,
y
in
if
x
.
length
==
0
{
return
x
+
y
}
else
{
return
x
+
"
\n
"
+
y
}
})
txtLab
?
.
text
=
result
}
else
{
txtLab
?
.
text
=
newValue
.
txt
txtLab
?
.
text
=
newValue
.
txt
}
duringLab
?
.
text
=
countSecond
(
newValue
.
during
)
duringLab
?
.
text
=
countSecond
(
newValue
.
during
)
selectedBtn
?
.
isSelected
=
model
.
selected
selectedBtn
?
.
isSelected
=
model
.
selected
icloudBtn
?
.
isSelected
=
model
.
icloud
icloudBtn
?
.
isSelected
=
model
.
icloud
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment