Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #26 from kinecosystem/restoring-restore-and-backup
Browse files Browse the repository at this point in the history
Restoring restore and backup
  • Loading branch information
beeman authored Jul 15, 2021
2 parents 74851c9 + 5fffa36 commit 7df69dc
Show file tree
Hide file tree
Showing 66 changed files with 3,347 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ignore:
- "KinSampleApp"
- "KinBaseCompat"
- "KinBase/KinBase/Src/KinBackupRestoreModule"
- "KinBase/KinBase/Src/Vendor/gen"
- "KinBase/KinBase/Src/Storage/Gen"
- "KinBase/KinBase/Src/Tools/ListObservable.swift"
Expand Down
4 changes: 3 additions & 1 deletion KinBase.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
Pod::Spec.new do |s|
s.name = 'KinBase'
s.version = '1.0.2'
s.version = '1.0.3'
s.summary = 'Kin SDK for iOS'

s.description = <<-DESC
Expand All @@ -25,11 +25,13 @@ Pod::Spec.new do |s|

non_arc_files = 'KinBase/KinBase/Src/Storage/Gen/*.{h,m}', 'KinBase/KinBase/Src/Vendor/gen/**/*.{h,m}'
s.source_files = 'KinBase/KinBase/**/*.{h,c,swift}'
s.resources = 'KinBase/KinBase/Src/KinBackupRestoreModule/*.{strings,xcassets}'

s.dependency 'PromisesSwift', '~> 1.2.8'
s.dependency '!ProtoCompiler-gRPCPlugin', '~> 1.28.0'
s.dependency 'Protobuf', '~> 3.11.4'
s.dependency 'gRPC-ProtoRPC', '~> 1.28.0'
s.dependency 'Sodium', '~> 0.8.0'

s.subspec 'no-arc' do |sna|
sna.requires_arc = false
Expand Down
277 changes: 265 additions & 12 deletions KinBase/KinBase.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Checkmark.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Eye.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "QRCode.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Safe.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Bundle+BackupRestore.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 04/02/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import Foundation

extension Bundle {
static let backupRestore = Bundle(for: KinBackupRestoreManager.self)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// CGGeometry+Appearance.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 14/04/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import UIKit

extension CGFloat {
static let cornerRadius: CGFloat = 4
static let borderWidth: CGFloat = UIScreen.main.scale >= 2 ? 0.5 : 1

static let minTapSurface: CGFloat = 44
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// NSAttributedString+AttributedStrings.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 14/04/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import Foundation

extension NSAttributedString {
convenience init(attributedStrings: [NSAttributedString], separator: String = "\n") {
let attributedString = NSMutableAttributedString()

for i in 0..<attributedStrings.count {
attributedString.append(attributedStrings[i])

if i < attributedStrings.count - 1 {
attributedString.append(NSAttributedString(string: separator))
}
}

self.init(attributedString: attributedString)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// Notification+Convenience.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 21/02/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import UIKit

extension Notification {
var endFrame: CGRect {
if let value = userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect {
return value
}
else {
return .null
}
}

var duration: TimeInterval {
if let value = userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? TimeInterval {
return value
}
else {
return 0.25
}
}

var animationOptions: UIView.AnimationOptions {
if let value = userInfo?[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber {
return UIView.AnimationOptions(rawValue: UInt(value.uintValue << 16))
}
else {
return []
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// String+Localization.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 05/02/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import Foundation

extension String {
func localized(_ args: CVarArg...) -> String {
return String(format: NSLocalizedString(self, tableName: nil, bundle: .backupRestore, value: "", comment: ""), arguments: args)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// UIColor+Appearance.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 05/02/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import UIKit

extension UIColor {
static let kinPrimary = UIColor(red: 111/255, green: 65/255, blue: 232/255, alpha: 1)
static let kinWarning = UIColor(red: 219/255, green: 73/255, blue: 123/255, alpha: 1)

static let kinLightGray = UIColor(white: 231/255, alpha: 1)
static let kinGray = UIColor(white: 166/255, alpha: 1)
static let kinDarkGray = UIColor(white: 31/255, alpha: 1)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// UIFont+PreferredFont.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 17/02/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import UIKit

extension UIFont {
class func preferredFont(forTextStyle style: TextStyle, symbolicTraits: [UIFontDescriptor.SymbolicTraits]) -> UIFont {
let font = UIFont.preferredFont(forTextStyle: style)
var traits = font.fontDescriptor.symbolicTraits

for symbolicTrait in symbolicTraits {
traits.insert(symbolicTrait)
}

if let fontDescriptor = font.fontDescriptor.withSymbolicTraits(traits) {
return UIFont(descriptor: fontDescriptor, size: 0)
}
else {
return font
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// KinBackupRestoreBI.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 06/02/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import Foundation

final class KinBackupRestoreBI {
static let shared = KinBackupRestoreBI()
weak var delegate: KinBackupRestoreBIDelegate?
}

public protocol KinBackupRestoreBIDelegate: NSObjectProtocol {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// KinBackupRestoreError.swift
// KinBackupRestoreModule
//
// Created by Corey Werner on 24/02/2019.
// Copyright © 2019 Kin Foundation. All rights reserved.
//

import Foundation

public enum KinBackupRestoreError: Error {
case cantOpenImagePicker
case internalInconsistency
}

extension KinBackupRestoreError: LocalizedError {
public var errorDescription: String? {
switch self {
case .cantOpenImagePicker:
return "Can't open the image picker."
case .internalInconsistency:
return "Internal inconsistency."
}
}
}
Loading

0 comments on commit 7df69dc

Please sign in to comment.