-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #840 from novasamatech/develop
v7.1.0
- Loading branch information
Showing
155 changed files
with
2,346 additions
and
690 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
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
19 changes: 19 additions & 0 deletions
19
novawallet/Common/Extension/Foundation/NSAttributedString+Helpers.swift
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,19 @@ | ||
import Foundation | ||
|
||
extension NSAttributedString { | ||
func truncate(maxLength: Int) -> NSAttributedString { | ||
if length > maxLength, maxLength > 0 { | ||
let range = NSRange(location: 0, length: maxLength) | ||
let mutableString = NSMutableAttributedString(attributedString: attributedSubstring(from: range)) | ||
|
||
let attributes = mutableString.attributes(at: maxLength - 1, effectiveRange: nil) | ||
let truncation = NSAttributedString(string: String.readMore, attributes: attributes) | ||
|
||
mutableString.append(truncation) | ||
|
||
return mutableString | ||
} else { | ||
return self | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions
28
novawallet/Common/Extension/Foundation/Predicate/NSPredicate+StakingDashboardItem.swift
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,28 @@ | ||
import Foundation | ||
|
||
extension NSPredicate { | ||
static func stakingDashboardItem( | ||
for chainAssetId: ChainAssetId, | ||
walletId: MetaAccountModel.Id | ||
) -> NSPredicate { | ||
let chainPredicate = NSPredicate( | ||
format: "%K == %@", | ||
#keyPath(CDStakingDashboardItem.chainId), | ||
chainAssetId.chainId | ||
) | ||
|
||
let assetPredicate = NSPredicate( | ||
format: "%K == %d", | ||
#keyPath(CDStakingDashboardItem.assetId), | ||
chainAssetId.assetId | ||
) | ||
|
||
let accountPredicate = NSPredicate( | ||
format: "%K == %@", | ||
#keyPath(CDStakingDashboardItem.walletId), | ||
walletId | ||
) | ||
|
||
return NSCompoundPredicate(andPredicateWithSubpredicates: [chainPredicate, assetPredicate, accountPredicate]) | ||
} | ||
} |
File renamed without changes.
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
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,14 @@ | ||
import Foundation | ||
|
||
extension String { | ||
private static let htmlSpecificTags: Set<String> = [ | ||
"</p>", "</div>", "</body>", "</br>", "</h1>", "</h2>", "</h3>", "</h4>", "</h5>", "</h6>", | ||
"</header>", "</ul>" | ||
] | ||
|
||
func isHtml() -> Bool { | ||
Self.htmlSpecificTags.contains { tag in | ||
range(of: tag) != 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Foundation | ||
|
||
enum SharedOperationStatus { | ||
case composing | ||
case sent | ||
} | ||
|
||
protocol SharedOperationStatusProtocol: AnyObject { | ||
var isComposing: Bool { get } | ||
} | ||
|
||
protocol SharedOperationProtocol: SharedOperationStatusProtocol { | ||
var status: SharedOperationStatus { get set } | ||
} | ||
|
||
extension SharedOperationProtocol { | ||
var isComposing: Bool { | ||
status == .composing | ||
} | ||
|
||
func markSent() { | ||
status = .sent | ||
} | ||
|
||
func markComposing() { | ||
status = .composing | ||
} | ||
} | ||
|
||
final class SharedOperation { | ||
var status: SharedOperationStatus = .composing | ||
} | ||
|
||
extension SharedOperation: SharedOperationProtocol {} |
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
2 changes: 1 addition & 1 deletion
2
novawallet/Common/Model/MarkdownText.swift → ...t/Common/Model/MarkupAttributedText.swift
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.