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
1a421bdd
Commit
1a421bdd
authored
Sep 27, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
3f786966
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
19 deletions
+12
-19
SHRecordShowViewController.swift
ShorthandMaster/Record/SHRecordShowViewController.swift
+6
-14
SHCloudManager.swift
ShorthandMaster/Share/Managers/SHCloudManager.swift
+6
-5
No files found.
ShorthandMaster/Record/SHRecordShowViewController.swift
View file @
1a421bdd
...
@@ -52,20 +52,12 @@ class SHRecordShowViewController: SHBaseViewController {
...
@@ -52,20 +52,12 @@ class SHRecordShowViewController: SHBaseViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
// AVAudioSession.sharedInstance().requestRecordPermission { (allowed) in
for
path
in
model
!.
imagesPath
{
// if !allowed {
let
s
=
DocumentPath
+
path
// return
if
let
image
=
UIImage
.
init
(
contentsOfFile
:
s
){
// }
// }
}
// let session:AVAudioSession = AVAudioSession.sharedInstance()
}
// do {
// try session.setCategory(AVAudioSession.Category.playAndRecord, options: .defaultToSpeaker)
// }catch{
// print("session config failed")
// }
//
// do { try AVAudioSession.sharedInstance().setActive(true) }
// catch { print("session active failed") }
setupUI
()
setupUI
()
play
()
play
()
...
...
ShorthandMaster/Share/Managers/SHCloudManager.swift
View file @
1a421bdd
...
@@ -152,15 +152,16 @@ class SHCloudManager: NSObject {
...
@@ -152,15 +152,16 @@ class SHCloudManager: NSObject {
if
index
>
recordModel
.
imagesPath
.
count
-
1
{
if
index
>
recordModel
.
imagesPath
.
count
-
1
{
break
break
}
}
var
path
=
recordModel
.
imagesPath
[
index
]
let
path
=
recordModel
.
imagesPath
[
index
]
path
=
DocumentPath
+
path
var
filePath
=
path
.
components
(
separatedBy
:
"/"
)[
1
]
filePath
=
DocumentPath
+
"/"
+
filePath
// if let image = UIImage.init(contentsOfFile: asset.fileURL!.path){
// if let image = UIImage.init(contentsOfFile: asset.fileURL!.path){
// recordModel.images.append(image)
// recordModel.images.append(image)
// }
// }
if
FileManager
.
default
.
fileExists
(
atPath
:
p
ath
)
==
false
{
if
FileManager
.
default
.
fileExists
(
atPath
:
fileP
ath
)
==
false
{
if
let
imageData
=
try
?
Data
(
contentsOf
:
asset
.
fileURL
!
){
if
let
imageData
=
try
?
Data
(
contentsOf
:
asset
.
fileURL
!
){
try!
FileManager
.
default
.
createDirectory
(
atPath
:
p
ath
,
withIntermediateDirectories
:
true
,
attributes
:
nil
)
try!
FileManager
.
default
.
createDirectory
(
atPath
:
fileP
ath
,
withIntermediateDirectories
:
true
,
attributes
:
nil
)
try
?
imageData
.
write
(
to
:
URL
(
fileURLWithPath
:
path
))
try
?
imageData
.
write
(
to
:
URL
(
fileURLWithPath
:
DocumentPath
+
path
))
}
}
}
}
}
}
...
...
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