Skip to content

Commit 3b0144a

Browse files
committed
Merge branch 'Release-1.4.0' of https://github.com/PermanentOrg/permanent-ios into main
2 parents d82ae53 + 83d42f2 commit 3b0144a

File tree

68 files changed

+2794
-1063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2794
-1063
lines changed

Permanent.xcodeproj/project.pbxproj

Lines changed: 238 additions & 24 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "LeaveShare.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 3 additions & 0 deletions
Loading

Permanent/Constants/Colors.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extension UIColor {
3030
static var dustyGray = UIColor(red: 96 / 255, green: 96 / 255, blue: 96 / 255, alpha: 1)
3131
static var mainPurple = UIColor(red: 141 / 255, green: 0 / 255, blue: 133 / 255, alpha: 1)
3232
static var paleYellow = UIColor(red: 254 / 255, green: 235 / 255, blue: 214 / 255, alpha: 1)
33+
static var temporaryRed = UIColor(red: 255 / 255, green: 61 / 255, blue: 61 / 255, alpha: 1)
3334
}
3435

3536
extension UIColor {

Permanent/Constants/Constants.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ struct Text {
4040
static let style31 = TextStyle(UIFont(name: "OpenSans-Bold", size: 10)!, TextStyle.calculateSpacing(fontSize: CGFloat(10), lineHeight: CGFloat(12)), NSTextAlignment.center)
4141
static let style32 = TextStyle(UIFont(name: "OpenSans-Bold", size: 16)!, TextStyle.calculateSpacing(fontSize: CGFloat(16), lineHeight: CGFloat(22)), NSTextAlignment.natural)
4242
static let style33 = TextStyle(UIFont(name: "OpenSans-Bold", size: 24)!, TextStyle.calculateSpacing(fontSize: CGFloat(24), lineHeight: CGFloat(27)), NSTextAlignment.center)
43+
static let style34 = TextStyle(UIFont(name: "OpenSans-Regular", size: 15)!, TextStyle.calculateSpacing(fontSize: CGFloat(15), lineHeight: CGFloat(20)), NSTextAlignment.natural)
44+
static let style35 = TextStyle(UIFont(name: "OpenSans-SemiBold", size: 15)!, TextStyle.calculateSpacing(fontSize: CGFloat(15), lineHeight: CGFloat(20)), NSTextAlignment.natural)
45+
static let style36 = TextStyle(UIFont(name: "OpenSans-Regular", size: 8)!, TextStyle.calculateSpacing(fontSize: CGFloat(8), lineHeight: CGFloat(12)), NSTextAlignment.center)
4346
}
4447

4548
struct Constants {

Permanent/Constants/TableViewData.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ struct StaticData {
3939
static let accessRoles = AccessRole.allCases
4040
.filter { $0 != .owner }
4141
.map { $0.groupName }
42-
43-
static let archiveTypes = ArchiveType.allCases
44-
.map { $0.archiveName }
4542
}
4643

4744
enum DrawerSection: Int {

Permanent/Extensions/UILabelExtension.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,15 @@ extension UILabel {
1919
self.text = text
2020
}
2121

22+
func setTextSpacingBy(value: Double) {
23+
if let attributedText = attributedText {
24+
let text = NSMutableAttributedString(attributedString: attributedText)
25+
text.addAttribute(NSAttributedString.Key.kern, value: value, range: NSRange(location: 0, length: attributedText.length - 1))
26+
self.attributedText = text
27+
} else if let text = text {
28+
let attributedString = NSMutableAttributedString(string: text)
29+
attributedString.addAttribute(NSAttributedString.Key.kern, value: value, range: NSRange(location: 0, length: attributedString.length - 1))
30+
attributedText = attributedString
31+
}
32+
}
2233
}

Permanent/Helpers/CodableHelper.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class JSONHelper {
3030
let decodedModel = try JSONDecoder().decode(T.self, from: data)
3131
return (decodedModel)
3232
} catch {
33+
print(error)
3334
return nil
3435
}
3536
}

Permanent/Managers/AuthenticationManager.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ class AuthenticationManager {
2020
}
2121

2222
var currentAuthorizationFlow: OIDExternalUserAgentSession?
23-
var session: PermSession?
23+
var session: PermSession? {
24+
didSet {
25+
PermSession.currentSession = session
26+
}
27+
}
2428

2529
init() {
2630
NotificationCenter.default.addObserver(forName: APIRequestDispatcher.sessionExpiredNotificationName, object: nil, queue: nil) { [self] notification in

Permanent/Managers/Upload/ExtensionUploadManager.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,16 @@ class ExtensionUploadManager {
3838
func clearSavedFiles() {
3939
PreferencesManager().removeValue(forKey: Self.savedFilesKey)
4040
}
41+
42+
func clearSavedFiles(_ files: [FileInfo]) throws {
43+
var savedFiles: [FileInfo] = []
44+
45+
if let nsFiles: NSArray = try PreferencesManager().getNonPlistObject(forKey: Self.savedFilesKey) {
46+
savedFiles = (nsFiles as? [FileInfo]) ?? []
47+
}
48+
49+
savedFiles.removeAll(where: { files.contains($0) })
50+
51+
try save(files: savedFiles)
52+
}
4153
}

0 commit comments

Comments
 (0)