-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds ability to scan and insert documents / photos just in editor
- Loading branch information
1 parent
4a43c25
commit e8d300b
Showing
4 changed files
with
65 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// Data+.swift | ||
// FSNotes | ||
// | ||
// Created by Александр on 03.04.2022. | ||
// Copyright © 2022 Oleksandr Glushchenko. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Data { | ||
var isPDF: Bool { | ||
guard self.count >= 1024 else { return false } | ||
let pdfHeader = Data(bytes: "%PDF", count: 4) | ||
return self.range(of: pdfHeader, options: [], in: Range(NSRange(location: 0, length: 1024))) != nil | ||
} | ||
} |