O3(OzoneWalletIOS)项目
卡哇伊嘉人
发表于 2022-12-18 19:47:49
435
0
0
OzoneWalletIOS:https://github.com/CityOfZion/OzoneWalletIOS
neo-swift:https://github.com/CityOfZion/neo-swift
neo-wallet-address-go:https://github.com/apisit/neo-wallet-address-go8 |' a! o/ ` E- ~4 ]- `
* n3 n# `( |4 k0 x
下载 OzoneWalletIOS 项目% {4 f' _3 E9 O9 ?2 {: N) p
下载 OzoneWalletIOS 项目到本地:
下载 OzoneWalletIOS 项目# c! @0 F% B. J
用 Xcode 打开项目并运行:+ X, w1 d0 ]* R1 V Z
运行出错9 \$ U- ~4 _9 f: h7 ]* L/ [
, {. |7 Z B0 o7 h. ^9 r3 ~+ X- s% d
缺少文件1 C! x, ^$ C% C& p, l" N; j
运行出错,发现缺少文件。打开项目目录,发现有这两个文件 Cartfile、Cartfile.resolved:' |! C$ `; i7 D/ [
0 E5 [' t0 Y% g. w
Cartfile 文件: O, M: }6 a% o/ V* {- y
该项目是用 Carthage 管理 iOS 依赖库的,安装使用方法看这里,如果安装不成功请下载 Releases 版本进行安装。
打开终端,cd 到该项目目录,运行如下命令:
$ carthage update --platform iOS3 E8 t0 @8 K" w i5 i
1 w1 e+ P0 h; v" ^* _
$ carthage update –platform iOS 命令; {+ f; W% c0 d o, ~+ j$ Q$ T
, W, c% Z1 O/ q: r q
缺少的文件已下载完成
命令运行成功之后,再次运行项目:
/ i3 i9 N& R+ q
info.plist 文件错误
发现 info.plist 文件读取错误,无法打开。我的解决方法是,新建一个 Project,然后把新工程里的 info.plist 文件拷贝到该项目里替换掉,然后再次运行:
Reason image not found 错误
在 Finder 里前往文件夹 ~/Library/Developer/Xcode/DerivedData ,删除缓存目录下的文件 :5 M' q0 d6 a1 o% o# H: D2 d3 r. u5 M
再次运行,发现还是同样的错误,后来发现新加的一个库文件 AutoInsetter 没有加进去:
*** Building scheme "AutoInsetter" in AutoInsetter.xcworkspace
添加库文件 1
/ j3 C$ V! u. r& E& j
添加库文件 2" Y) U# M# V7 }! K: N
添加好后再次运行:
“networkKey” 出错. l& Z8 o6 m7 e2 V
这个错误不知道怎么分析,全局搜索了一下“ networkKey”,发现是跟用户数据有关,后来整体看了一下项目,然后把项目的 Main Interface 改了一下:
修改 Main Interface
再一次运行:1 s1 \* v2 c; G3 n2 I
. f" E$ } D; b/ I1 m+ w/ g5 n9 z2 f
Info.plist 文件缺少 Fabric 字段 1' g4 Z7 C+ p( u d% b
Info.plist 文件缺少 Fabric 字段 2* a+ n5 Z! r6 x' g, Q
开启 Background Modes:4 q3 Q0 t9 a& h' W5 Q" k
6 ^6 c7 p- L. P. P
开启 Background Modes( a: w0 i! @( {, h D6 a
向 Info.plist 文件添加 Fabric 字段,包含一个 String 类型的 APIKey 和一个 Array 类型的 Kits:( Q. e4 w" e. i& t$ v
6 ?/ i2 B& n8 Z$ P" X7 Z9 o
QQ20180131-144207@2x.png( t- z6 v6 m% Y+ D8 q3 o; L
好了,再次运行:. J& f6 U: e6 g' y8 U0 d
模拟器运行界面1 m* N+ V0 C% v5 y* F
终于运行成功了!!!/(ㄒoㄒ)/~~
AppDelegate.swift
Channel.framework 大概是跟推送通知有关的库:
func setupChannel() {: z/ [" v' K4 f8 n1 D
//O3 Development on Channel app_gUHDmimXT8oXRSpJvCxrz5DZvUisko_mliB61uda9iY
Channel.setup(withApplicationId: "app_gUHDmimXT8oXRSpJvCxrz5DZvUisko_mliB61uda9iY"): W/ e9 j! V' u+ [( Q V* R$ Z$ U, ~
}8 [& C3 ~+ o& r( j
设置应用的外观样式:+ H! P. x; l# X3 _& x2 w
func setupApperances() {
UIBarButtonItem.appearance().setTitleTextAttributes([
NSAttributedStringKey.font: ThemeManager.barButtonItemFont,
NSAttributedStringKey.foregroundColor: UserDefaultsManager.theme.primaryColor], for: .normal)
UINavigationBar.appearance().largeTitleTextAttributes = [9 U3 d, }6 R$ h" R: j) K5 j `: u
NSAttributedStringKey.foregroundColor: UserDefaultsManager.theme.textColor,3 ^( O# K) g2 s3 w1 ^; e
NSAttributedStringKey.font: UIFont(name: "Avenir-Heavy", size: 32) as Any]
}1 b* q5 [, Q: ~5 I: W
创建用户的默认配置:
func registerDefaults() {
let userDefaultsDefaults: [String: Any] = [. ^) D: [$ V8 O- \; W6 t
"networkKey": "main",5 _% P! Z- J0 i: ]9 a' h
"usedDefaultSeedKey": false,
"selectedThemeKey": Theme.light.rawValue% Q+ D8 i1 q, K6 g
]
UserDefaults.standard.register(defaults: userDefaultsDefaults)
}
开启网络状态监测:
let alertController = UIAlertController(title: "Uh oh! There is no internet connection.
成为第一个吐槽的人