-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
157 changed files
with
3,444 additions
and
2,878 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// AutoHidingLabel.swift | ||
// Cryptomator | ||
// | ||
// Created by Philipp Schmid on 07.03.22. | ||
// Copyright © 2022 Skymatic GmbH. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class AutoHidingLabel: UILabel { | ||
override var text: String? { | ||
didSet { | ||
isHidden = text == nil && attributedText == nil | ||
} | ||
} | ||
|
||
override var attributedText: NSAttributedString? { | ||
didSet { | ||
isHidden = text == nil && attributedText == nil | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// NSAttributedString+Extension.swift | ||
// Cryptomator | ||
// | ||
// Created by Philipp Schmid on 09.03.22. | ||
// Copyright © 2022 Skymatic GmbH. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension NSAttributedString { | ||
static func textWithLeadingSystemImage(_ imageName: String, text: String, font: UIFont, color: UIColor) -> NSAttributedString { | ||
let configuration = UIImage.SymbolConfiguration(font: font) | ||
let imageAttachment = NSTextAttachment() | ||
imageAttachment.image = UIImage(systemName: imageName, withConfiguration: configuration)?.withTintColor(color) | ||
let attributedString = NSMutableAttributedString(attachment: imageAttachment) | ||
attributedString.append(NSAttributedString(string: " \(text)")) | ||
attributedString.addAttribute(.foregroundColor, | ||
value: color, | ||
range: NSRange(location: 0, length: attributedString.length)) | ||
attributedString.addAttribute(.font, | ||
value: font, | ||
range: NSRange(location: 0, length: attributedString.length)) | ||
return attributedString | ||
} | ||
} |
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
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
Oops, something went wrong.