O3(OzoneWalletIOS)项目
卡哇伊嘉人
发表于 2022-12-18 19:47:49
296
0
0
OzoneWalletIOS:https://github.com/CityOfZion/OzoneWalletIOS9 f: o. U" D5 U1 k4 Z! V9 B
neo-swift:https://github.com/CityOfZion/neo-swift) x* {8 L, D8 n: b: Z! v
neo-wallet-address-go:https://github.com/apisit/neo-wallet-address-go2 z1 g) E: O1 s$ l9 z+ y' d. \7 M
7 L8 R- |' c; v8 V* G! V: J$ o+ [
下载 OzoneWalletIOS 项目' V9 j3 b4 y, g, ?6 L4 Q
下载 OzoneWalletIOS 项目到本地:
下载 OzoneWalletIOS 项目- }% ^9 A7 x- ~5 m W7 j: @9 |) Z
用 Xcode 打开项目并运行:
运行出错- P6 e g! E3 a8 M
缺少文件; K, D `1 P: x: J9 `' P! A
运行出错,发现缺少文件。打开项目目录,发现有这两个文件 Cartfile、Cartfile.resolved:8 O, k3 h0 B7 Y5 Z4 F
7 e( k$ ~, c0 P3 X$ m
Cartfile 文件( S1 |: |3 M- _+ [/ B( _
该项目是用 Carthage 管理 iOS 依赖库的,安装使用方法看这里,如果安装不成功请下载 Releases 版本进行安装。
打开终端,cd 到该项目目录,运行如下命令:* H0 Z4 \& f! ]. s. O }8 y* n
$ carthage update --platform iOS4 u, |3 U. Z4 U+ q1 s, _) `
4 V8 b" z5 Z( j. ]' \2 ^- N
$ carthage update –platform iOS 命令
缺少的文件已下载完成
命令运行成功之后,再次运行项目:
info.plist 文件错误8 q' t0 J* b, T2 N
发现 info.plist 文件读取错误,无法打开。我的解决方法是,新建一个 Project,然后把新工程里的 info.plist 文件拷贝到该项目里替换掉,然后再次运行:
Reason image not found 错误
在 Finder 里前往文件夹 ~/Library/Developer/Xcode/DerivedData ,删除缓存目录下的文件 :
再次运行,发现还是同样的错误,后来发现新加的一个库文件 AutoInsetter 没有加进去:- y' I1 J" z: H* ^5 r
*** Building scheme "AutoInsetter" in AutoInsetter.xcworkspace3 h0 x. y, x' Y( [- n2 p8 C
添加库文件 1( c" v. \$ T" j% Z3 d
) Z; O) W' w0 ]; A' o
添加库文件 25 d$ k/ w+ M8 v7 [: T/ v
添加好后再次运行:- b4 p9 b$ p3 p3 i7 A2 b
“networkKey” 出错3 }1 C# }) O L4 m6 r0 j2 S3 _, S$ m
这个错误不知道怎么分析,全局搜索了一下“ networkKey”,发现是跟用户数据有关,后来整体看了一下项目,然后把项目的 Main Interface 改了一下:
: E. `# k5 E0 J/ Q% c# A
修改 Main Interface
再一次运行: }' k- r: c, z: i- U9 `
Info.plist 文件缺少 Fabric 字段 1( u$ x; [. r* d, |1 j* I5 e' ]0 E
Info.plist 文件缺少 Fabric 字段 2
开启 Background Modes:
开启 Background Modes4 L2 b% S8 n! \5 T
向 Info.plist 文件添加 Fabric 字段,包含一个 String 类型的 APIKey 和一个 Array 类型的 Kits:+ m3 Q, V4 _+ p' }- L4 M8 H. {
QQ20180131-144207@2x.png
好了,再次运行:% U3 R5 A6 ^! |6 p" B8 l
% p0 K9 J3 ]8 h6 F: G" T% R
模拟器运行界面
终于运行成功了!!!/(ㄒoㄒ)/~~. b0 Y5 H( t/ N. n2 @3 I5 }
AppDelegate.swift$ {0 X0 Q# ^( s, V* y
Channel.framework 大概是跟推送通知有关的库:
func setupChannel() {
//O3 Development on Channel app_gUHDmimXT8oXRSpJvCxrz5DZvUisko_mliB61uda9iY2 J8 g, u2 j2 U3 L3 g
Channel.setup(withApplicationId: "app_gUHDmimXT8oXRSpJvCxrz5DZvUisko_mliB61uda9iY")) z2 \' S0 J1 W
}9 L' D+ }4 e+ Z6 d
设置应用的外观样式:
func setupApperances() {& B+ Z9 f! J. c8 j; o2 k
UIBarButtonItem.appearance().setTitleTextAttributes([
NSAttributedStringKey.font: ThemeManager.barButtonItemFont,( k" p3 [3 c; }: d7 Z
NSAttributedStringKey.foregroundColor: UserDefaultsManager.theme.primaryColor], for: .normal)
UINavigationBar.appearance().largeTitleTextAttributes = [; c7 M1 T( I7 A
NSAttributedStringKey.foregroundColor: UserDefaultsManager.theme.textColor,
NSAttributedStringKey.font: UIFont(name: "Avenir-Heavy", size: 32) as Any]
}
创建用户的默认配置:
func registerDefaults() {
let userDefaultsDefaults: [String: Any] = [
"networkKey": "main",
"usedDefaultSeedKey": false,. P) t& s# Y3 C3 p& r
"selectedThemeKey": Theme.light.rawValue+ V' c! @9 u, ~) Y/ M
]
UserDefaults.standard.register(defaults: userDefaultsDefaults)
}# a; P1 Y, U$ P7 i' E2 e6 g
开启网络状态监测:* ?1 @0 B( p* b8 A# q3 ^3 w D
let alertController = UIAlertController(title: "Uh oh! There is no internet connection.
成为第一个吐槽的人