O3(OzoneWalletIOS)项目
卡哇伊嘉人
发表于 2022-12-18 19:47:49
299
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-go
下载 OzoneWalletIOS 项目7 {7 v% y- x( _! n
下载 OzoneWalletIOS 项目到本地:
/ G, l+ \& p2 ^3 K& R- M1 R
下载 OzoneWalletIOS 项目3 ^6 \# A4 ]1 H {9 M
用 Xcode 打开项目并运行:& Z- R$ R2 f; M% D1 A
6 E! T; |6 r: n6 i; b% Q! ~ r
运行出错
缺少文件+ a7 U! m" _6 k1 B# B# X7 T' {
运行出错,发现缺少文件。打开项目目录,发现有这两个文件 Cartfile、Cartfile.resolved:
8 W9 ~( @( x4 ]6 j' E
Cartfile 文件/ |* g, W- b6 q
该项目是用 Carthage 管理 iOS 依赖库的,安装使用方法看这里,如果安装不成功请下载 Releases 版本进行安装。
打开终端,cd 到该项目目录,运行如下命令:8 N. J9 j" \+ s! J, ~4 a
$ carthage update --platform iOS, q" N5 }& B4 \+ _: L! o1 a) e
$ carthage update –platform iOS 命令
缺少的文件已下载完成
命令运行成功之后,再次运行项目:
info.plist 文件错误. |1 U: G8 e; J! ]" Y
发现 info.plist 文件读取错误,无法打开。我的解决方法是,新建一个 Project,然后把新工程里的 info.plist 文件拷贝到该项目里替换掉,然后再次运行:
Reason image not found 错误) |2 g6 T/ J5 B
在 Finder 里前往文件夹 ~/Library/Developer/Xcode/DerivedData ,删除缓存目录下的文件 :3 Q: _) t+ l+ }6 |* ]3 v# E
" x! Z( D% m7 V1 f w
再次运行,发现还是同样的错误,后来发现新加的一个库文件 AutoInsetter 没有加进去:
*** Building scheme "AutoInsetter" in AutoInsetter.xcworkspace# K) G! C/ \1 u
$ v9 o E& _: \5 ~; Y
添加库文件 19 u3 ]( w* X4 S9 R8 R* M8 d
* q, W, m2 t& q$ b
添加库文件 2+ ?# r2 ?- d* J* y& L7 f
添加好后再次运行:
“networkKey” 出错
这个错误不知道怎么分析,全局搜索了一下“ networkKey”,发现是跟用户数据有关,后来整体看了一下项目,然后把项目的 Main Interface 改了一下:$ s7 b+ K! H# Y
+ g3 g1 u- y8 I6 G9 `2 P
修改 Main Interface! \7 b+ E0 D5 K+ Z& a" u( B4 ?4 Y
再一次运行:
Info.plist 文件缺少 Fabric 字段 1" n) f, y' S) p6 o6 f0 O
3 `! R, n( j+ i
Info.plist 文件缺少 Fabric 字段 2" t8 |+ P- }4 J- l% U4 A) R9 h* W
开启 Background Modes:& M& ]( V/ R0 _% G5 C
开启 Background Modes; O Y2 p3 I1 h) r1 {1 `. A+ i
向 Info.plist 文件添加 Fabric 字段,包含一个 String 类型的 APIKey 和一个 Array 类型的 Kits:, I- a5 r d6 {/ `5 @% n
QQ20180131-144207@2x.png
好了,再次运行:* x+ F) w' j& N i2 Q
# v& R4 j. Y& l3 r: H1 F( @+ \) x- x
模拟器运行界面2 r9 R1 B1 P: j
终于运行成功了!!!/(ㄒoㄒ)/~~
AppDelegate.swift% M, y" \) c5 V& h7 v t
Channel.framework 大概是跟推送通知有关的库:! v: p; ~$ O' {. q+ @8 g& L$ x- z* j
func setupChannel() {8 A- n( n6 V) z6 Q2 B. q f6 O
//O3 Development on Channel app_gUHDmimXT8oXRSpJvCxrz5DZvUisko_mliB61uda9iY% h( o& E7 u/ Z( }, e1 g
Channel.setup(withApplicationId: "app_gUHDmimXT8oXRSpJvCxrz5DZvUisko_mliB61uda9iY")2 f: b" ?8 h# Y
}
设置应用的外观样式:
func setupApperances() {2 m# c; }8 A4 W3 ^% u
UIBarButtonItem.appearance().setTitleTextAttributes([# h0 w! `; L) e( y: T
NSAttributedStringKey.font: ThemeManager.barButtonItemFont,0 ~. V+ b5 K5 G4 W. v" a( h
NSAttributedStringKey.foregroundColor: UserDefaultsManager.theme.primaryColor], for: .normal)
UINavigationBar.appearance().largeTitleTextAttributes = [' D( B' w. c& |) r6 n1 V
NSAttributedStringKey.foregroundColor: UserDefaultsManager.theme.textColor,
NSAttributedStringKey.font: UIFont(name: "Avenir-Heavy", size: 32) as Any]
}: ~) \4 h+ y; |8 z) Q
创建用户的默认配置:% S, U! U, t! }: X4 v5 M
func registerDefaults() {% c+ m$ r0 P4 {/ f- ? @
let userDefaultsDefaults: [String: Any] = [4 m F$ t& a/ o1 K
"networkKey": "main",
"usedDefaultSeedKey": false,$ F: {2 n3 U2 I% D3 W
"selectedThemeKey": Theme.light.rawValue% F0 W* g( ?) C$ I% I7 D/ O
]% l+ @" s4 I- Z! Z* f5 n
UserDefaults.standard.register(defaults: userDefaultsDefaults)# k* n5 \% { k0 b8 e: {
}4 h0 }6 q; d- O4 k' I5 {/ R
开启网络状态监测: m/ C4 `- m4 H+ }; D
let alertController = UIAlertController(title: "Uh oh! There is no internet connection.
成为第一个吐槽的人