Compare commits
6 Commits
715d76bd7e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e08f5273d0 | ||
|
|
1527be4329 | ||
|
|
d8ea4236cc | ||
|
|
0103281cd4 | ||
|
|
872c69df6b | ||
|
|
bea4505eaa |
@ -7,6 +7,7 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
24BB349029C5F28100A52D20 /* InstanceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24BB348F29C5F28100A52D20 /* InstanceViewModel.swift */; };
|
||||||
24D4D3B529AB83E80064E566 /* DUDUJIApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3B429AB83E80064E566 /* DUDUJIApp.swift */; };
|
24D4D3B529AB83E80064E566 /* DUDUJIApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3B429AB83E80064E566 /* DUDUJIApp.swift */; };
|
||||||
24D4D3B729AB83E80064E566 /* DUDUJIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3B629AB83E80064E566 /* DUDUJIView.swift */; };
|
24D4D3B729AB83E80064E566 /* DUDUJIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3B629AB83E80064E566 /* DUDUJIView.swift */; };
|
||||||
24D4D3B929AB83E90064E566 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 24D4D3B829AB83E90064E566 /* Assets.xcassets */; };
|
24D4D3B929AB83E90064E566 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 24D4D3B829AB83E90064E566 /* Assets.xcassets */; };
|
||||||
@ -17,9 +18,16 @@
|
|||||||
24D4D3CC29ABBA800064E566 /* MastodonSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 24D4D3CB29ABBA800064E566 /* MastodonSwift */; };
|
24D4D3CC29ABBA800064E566 /* MastodonSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 24D4D3CB29ABBA800064E566 /* MastodonSwift */; };
|
||||||
24D4D3CE29ABBC030064E566 /* InstanceApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3CD29ABBC030064E566 /* InstanceApp.swift */; };
|
24D4D3CE29ABBC030064E566 /* InstanceApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3CD29ABBC030064E566 /* InstanceApp.swift */; };
|
||||||
24D4D3D029ABC01E0064E566 /* AddAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3CF29ABC01E0064E566 /* AddAccountView.swift */; };
|
24D4D3D029ABC01E0064E566 /* AddAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3CF29ABC01E0064E566 /* AddAccountView.swift */; };
|
||||||
|
24D4D3D429AF97A40064E566 /* InstanceAppViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3D329AF97A40064E566 /* InstanceAppViewModel.swift */; };
|
||||||
|
24D4D3D629AFA1970064E566 /* InstanceAppManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3D529AFA1970064E566 /* InstanceAppManager.swift */; };
|
||||||
|
24D4D3DA29B2EB7B0064E566 /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 24D4D3D929B2EB7B0064E566 /* Moya */; };
|
||||||
|
24D4D3DC29B2EC160064E566 /* MastodonService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3DB29B2EC160064E566 /* MastodonService.swift */; };
|
||||||
|
24D4D3DE29B6341A0064E566 /* Instance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3DD29B6341A0064E566 /* Instance.swift */; };
|
||||||
|
24D4D3E029B640B20064E566 /* InstanceInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D4D3DF29B640B20064E566 /* InstanceInfoView.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
24BB348F29C5F28100A52D20 /* InstanceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceViewModel.swift; sourceTree = "<group>"; };
|
||||||
24D4D3B129AB83E80064E566 /* DUDUJI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DUDUJI.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
24D4D3B129AB83E80064E566 /* DUDUJI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DUDUJI.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
24D4D3B429AB83E80064E566 /* DUDUJIApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DUDUJIApp.swift; sourceTree = "<group>"; };
|
24D4D3B429AB83E80064E566 /* DUDUJIApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DUDUJIApp.swift; sourceTree = "<group>"; };
|
||||||
24D4D3B629AB83E80064E566 /* DUDUJIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DUDUJIView.swift; sourceTree = "<group>"; };
|
24D4D3B629AB83E80064E566 /* DUDUJIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DUDUJIView.swift; sourceTree = "<group>"; };
|
||||||
@ -31,6 +39,11 @@
|
|||||||
24D4D3C829ABB7590064E566 /* Const.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Const.swift; sourceTree = "<group>"; };
|
24D4D3C829ABB7590064E566 /* Const.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Const.swift; sourceTree = "<group>"; };
|
||||||
24D4D3CD29ABBC030064E566 /* InstanceApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceApp.swift; sourceTree = "<group>"; };
|
24D4D3CD29ABBC030064E566 /* InstanceApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceApp.swift; sourceTree = "<group>"; };
|
||||||
24D4D3CF29ABC01E0064E566 /* AddAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddAccountView.swift; sourceTree = "<group>"; };
|
24D4D3CF29ABC01E0064E566 /* AddAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddAccountView.swift; sourceTree = "<group>"; };
|
||||||
|
24D4D3D329AF97A40064E566 /* InstanceAppViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceAppViewModel.swift; sourceTree = "<group>"; };
|
||||||
|
24D4D3D529AFA1970064E566 /* InstanceAppManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = InstanceAppManager.swift; path = DUDUJI/Managers/InstanceAppManager.swift; sourceTree = SOURCE_ROOT; };
|
||||||
|
24D4D3DB29B2EC160064E566 /* MastodonService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MastodonService.swift; path = DUDUJI/MastodonService.swift; sourceTree = SOURCE_ROOT; };
|
||||||
|
24D4D3DD29B6341A0064E566 /* Instance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Instance.swift; sourceTree = "<group>"; };
|
||||||
|
24D4D3DF29B640B20064E566 /* InstanceInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceInfoView.swift; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -38,6 +51,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
24D4D3DA29B2EB7B0064E566 /* Moya in Frameworks */,
|
||||||
24D4D3CC29ABBA800064E566 /* MastodonSwift in Frameworks */,
|
24D4D3CC29ABBA800064E566 /* MastodonSwift in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@ -64,7 +78,10 @@
|
|||||||
24D4D3B329AB83E80064E566 /* DUDUJI */ = {
|
24D4D3B329AB83E80064E566 /* DUDUJI */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
24D4D3DB29B2EC160064E566 /* MastodonService.swift */,
|
||||||
24D4D3D129ABC0280064E566 /* Views */,
|
24D4D3D129ABC0280064E566 /* Views */,
|
||||||
|
24D4D3D229AF8E9D0064E566 /* ViewModels */,
|
||||||
|
24D4D3D729B10FB90064E566 /* Managers */,
|
||||||
24D4D3C529ABB5830064E566 /* Models */,
|
24D4D3C529ABB5830064E566 /* Models */,
|
||||||
24D4D3C829ABB7590064E566 /* Const.swift */,
|
24D4D3C829ABB7590064E566 /* Const.swift */,
|
||||||
24D4D3B429AB83E80064E566 /* DUDUJIApp.swift */,
|
24D4D3B429AB83E80064E566 /* DUDUJIApp.swift */,
|
||||||
@ -90,6 +107,7 @@
|
|||||||
24D4D3C329ABAE5A0064E566 /* AccountInfo.swift */,
|
24D4D3C329ABAE5A0064E566 /* AccountInfo.swift */,
|
||||||
24D4D3C629ABB6500064E566 /* OauthToken.swift */,
|
24D4D3C629ABB6500064E566 /* OauthToken.swift */,
|
||||||
24D4D3CD29ABBC030064E566 /* InstanceApp.swift */,
|
24D4D3CD29ABBC030064E566 /* InstanceApp.swift */,
|
||||||
|
24D4D3DD29B6341A0064E566 /* Instance.swift */,
|
||||||
);
|
);
|
||||||
path = Models;
|
path = Models;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -98,10 +116,28 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
24D4D3CF29ABC01E0064E566 /* AddAccountView.swift */,
|
24D4D3CF29ABC01E0064E566 /* AddAccountView.swift */,
|
||||||
|
24D4D3DF29B640B20064E566 /* InstanceInfoView.swift */,
|
||||||
);
|
);
|
||||||
path = Views;
|
path = Views;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
24D4D3D229AF8E9D0064E566 /* ViewModels */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
24D4D3D329AF97A40064E566 /* InstanceAppViewModel.swift */,
|
||||||
|
24BB348F29C5F28100A52D20 /* InstanceViewModel.swift */,
|
||||||
|
);
|
||||||
|
path = ViewModels;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
24D4D3D729B10FB90064E566 /* Managers */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
24D4D3D529AFA1970064E566 /* InstanceAppManager.swift */,
|
||||||
|
);
|
||||||
|
path = Managers;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
@ -120,6 +156,7 @@
|
|||||||
name = DUDUJI;
|
name = DUDUJI;
|
||||||
packageProductDependencies = (
|
packageProductDependencies = (
|
||||||
24D4D3CB29ABBA800064E566 /* MastodonSwift */,
|
24D4D3CB29ABBA800064E566 /* MastodonSwift */,
|
||||||
|
24D4D3D929B2EB7B0064E566 /* Moya */,
|
||||||
);
|
);
|
||||||
productName = DUDUJI;
|
productName = DUDUJI;
|
||||||
productReference = 24D4D3B129AB83E80064E566 /* DUDUJI.app */;
|
productReference = 24D4D3B129AB83E80064E566 /* DUDUJI.app */;
|
||||||
@ -151,6 +188,7 @@
|
|||||||
mainGroup = 24D4D3A829AB83E80064E566;
|
mainGroup = 24D4D3A829AB83E80064E566;
|
||||||
packageReferences = (
|
packageReferences = (
|
||||||
24D4D3CA29ABBA800064E566 /* XCRemoteSwiftPackageReference "Mastodon" */,
|
24D4D3CA29ABBA800064E566 /* XCRemoteSwiftPackageReference "Mastodon" */,
|
||||||
|
24D4D3D829B2EB7B0064E566 /* XCRemoteSwiftPackageReference "Moya" */,
|
||||||
);
|
);
|
||||||
productRefGroup = 24D4D3B229AB83E80064E566 /* Products */;
|
productRefGroup = 24D4D3B229AB83E80064E566 /* Products */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
@ -178,13 +216,19 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
24BB349029C5F28100A52D20 /* InstanceViewModel.swift in Sources */,
|
||||||
|
24D4D3DE29B6341A0064E566 /* Instance.swift in Sources */,
|
||||||
24D4D3C429ABAE5A0064E566 /* AccountInfo.swift in Sources */,
|
24D4D3C429ABAE5A0064E566 /* AccountInfo.swift in Sources */,
|
||||||
24D4D3C729ABB6500064E566 /* OauthToken.swift in Sources */,
|
24D4D3C729ABB6500064E566 /* OauthToken.swift in Sources */,
|
||||||
24D4D3CE29ABBC030064E566 /* InstanceApp.swift in Sources */,
|
24D4D3CE29ABBC030064E566 /* InstanceApp.swift in Sources */,
|
||||||
24D4D3B729AB83E80064E566 /* DUDUJIView.swift in Sources */,
|
24D4D3B729AB83E80064E566 /* DUDUJIView.swift in Sources */,
|
||||||
|
24D4D3DC29B2EC160064E566 /* MastodonService.swift in Sources */,
|
||||||
24D4D3B529AB83E80064E566 /* DUDUJIApp.swift in Sources */,
|
24D4D3B529AB83E80064E566 /* DUDUJIApp.swift in Sources */,
|
||||||
24D4D3C929ABB7590064E566 /* Const.swift in Sources */,
|
24D4D3C929ABB7590064E566 /* Const.swift in Sources */,
|
||||||
24D4D3D029ABC01E0064E566 /* AddAccountView.swift in Sources */,
|
24D4D3D029ABC01E0064E566 /* AddAccountView.swift in Sources */,
|
||||||
|
24D4D3E029B640B20064E566 /* InstanceInfoView.swift in Sources */,
|
||||||
|
24D4D3D629AFA1970064E566 /* InstanceAppManager.swift in Sources */,
|
||||||
|
24D4D3D429AF97A40064E566 /* InstanceAppViewModel.swift in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -408,6 +452,14 @@
|
|||||||
minimumVersion = 2.0.0;
|
minimumVersion = 2.0.0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
24D4D3D829B2EB7B0064E566 /* XCRemoteSwiftPackageReference "Moya" */ = {
|
||||||
|
isa = XCRemoteSwiftPackageReference;
|
||||||
|
repositoryURL = "https://github.com/Moya/Moya";
|
||||||
|
requirement = {
|
||||||
|
kind = upToNextMajorVersion;
|
||||||
|
minimumVersion = 15.0.0;
|
||||||
|
};
|
||||||
|
};
|
||||||
/* End XCRemoteSwiftPackageReference section */
|
/* End XCRemoteSwiftPackageReference section */
|
||||||
|
|
||||||
/* Begin XCSwiftPackageProductDependency section */
|
/* Begin XCSwiftPackageProductDependency section */
|
||||||
@ -416,6 +468,11 @@
|
|||||||
package = 24D4D3CA29ABBA800064E566 /* XCRemoteSwiftPackageReference "Mastodon" */;
|
package = 24D4D3CA29ABBA800064E566 /* XCRemoteSwiftPackageReference "Mastodon" */;
|
||||||
productName = MastodonSwift;
|
productName = MastodonSwift;
|
||||||
};
|
};
|
||||||
|
24D4D3D929B2EB7B0064E566 /* Moya */ = {
|
||||||
|
isa = XCSwiftPackageProductDependency;
|
||||||
|
package = 24D4D3D829B2EB7B0064E566 /* XCRemoteSwiftPackageReference "Moya" */;
|
||||||
|
productName = Moya;
|
||||||
|
};
|
||||||
/* End XCSwiftPackageProductDependency section */
|
/* End XCSwiftPackageProductDependency section */
|
||||||
};
|
};
|
||||||
rootObject = 24D4D3A929AB83E80064E566 /* Project object */;
|
rootObject = 24D4D3A929AB83E80064E566 /* Project object */;
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@ -1,5 +1,14 @@
|
|||||||
{
|
{
|
||||||
"pins" : [
|
"pins" : [
|
||||||
|
{
|
||||||
|
"identity" : "alamofire",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/Alamofire/Alamofire.git",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "78424be314842833c04bc3bef5b72e85fff99204",
|
||||||
|
"version" : "5.6.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"identity" : "mastodon.swift",
|
"identity" : "mastodon.swift",
|
||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
@ -8,6 +17,33 @@
|
|||||||
"revision" : "26d970a92d31cbb0b797f8031746e07f656aee2b",
|
"revision" : "26d970a92d31cbb0b797f8031746e07f656aee2b",
|
||||||
"version" : "2.1.2"
|
"version" : "2.1.2"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identity" : "moya",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/Moya/Moya",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "c263811c1f3dbf002be9bd83107f7cdc38992b26",
|
||||||
|
"version" : "15.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identity" : "reactiveswift",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/ReactiveCocoa/ReactiveSwift.git",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "c43bae3dac73fdd3cb906bd5a1914686ca71ed3c",
|
||||||
|
"version" : "6.7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identity" : "rxswift",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/ReactiveX/RxSwift.git",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "b4307ba0b6425c0ba4178e138799946c3da594f8",
|
||||||
|
"version" : "6.5.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version" : 2
|
"version" : 2
|
||||||
|
|||||||
@ -9,6 +9,69 @@
|
|||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>ReactiveSwift (Playground) 1.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>2</integer>
|
||||||
|
</dict>
|
||||||
|
<key>ReactiveSwift (Playground) 2.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>3</integer>
|
||||||
|
</dict>
|
||||||
|
<key>ReactiveSwift (Playground).xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
<key>ReactiveSwift-UIExamples (Playground) 1.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>5</integer>
|
||||||
|
</dict>
|
||||||
|
<key>ReactiveSwift-UIExamples (Playground) 2.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>6</integer>
|
||||||
|
</dict>
|
||||||
|
<key>ReactiveSwift-UIExamples (Playground).xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>4</integer>
|
||||||
|
</dict>
|
||||||
|
<key>Rx (Playground) 1.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>8</integer>
|
||||||
|
</dict>
|
||||||
|
<key>Rx (Playground) 2.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>9</integer>
|
||||||
|
</dict>
|
||||||
|
<key>Rx (Playground).xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>isShown</key>
|
||||||
|
<false/>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>7</integer>
|
||||||
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -15,3 +15,10 @@ enum Const {
|
|||||||
enum DUDUConst {
|
enum DUDUConst {
|
||||||
static let name: String = "嘟嘟机"
|
static let name: String = "嘟嘟机"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
enum HttpMethod {
|
||||||
|
static let get: String = "GET"
|
||||||
|
static let post: String = "POST"
|
||||||
|
static let put: String = "PUT"
|
||||||
|
}
|
||||||
|
|||||||
@ -10,11 +10,7 @@ import SwiftUI
|
|||||||
struct DUDUJIView: View {
|
struct DUDUJIView: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
// TextField(Text("server address"))
|
|
||||||
AddAccountView()
|
AddAccountView()
|
||||||
Button("Login") {
|
|
||||||
print("123 \(Date().debugDescription)")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
|
|||||||
27
DUDUJI/Managers/InstanceAppManager.swift
Normal file
27
DUDUJI/Managers/InstanceAppManager.swift
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// InstanceAppManager.swift
|
||||||
|
// DUDUJI
|
||||||
|
//
|
||||||
|
// Created by ching on 2023/3/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
class InstanceAppManager {
|
||||||
|
func getClientIdAndClientSecret(at serverAddress: String) -> (clientId: String, clientSecret: String) {
|
||||||
|
return ("123", "321")
|
||||||
|
}
|
||||||
|
|
||||||
|
func createInstanceApp(at serverAddress: String) -> InstanceApp {
|
||||||
|
print("服务器地址是\(serverAddress)")
|
||||||
|
let instanceApp = InstanceApp(
|
||||||
|
// name: DUDUConst.name,
|
||||||
|
website: nil,
|
||||||
|
redirectUri: serverAddress,
|
||||||
|
clientId: "abc",
|
||||||
|
clientSecret: "cba")
|
||||||
|
// save the instanceApp to database
|
||||||
|
print("客户端名称:\(instanceApp.clientId)")
|
||||||
|
return instanceApp
|
||||||
|
}
|
||||||
|
}
|
||||||
86
DUDUJI/MastodonService.swift
Normal file
86
DUDUJI/MastodonService.swift
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
//
|
||||||
|
// MastodonService.swift
|
||||||
|
// DUDUJI
|
||||||
|
//
|
||||||
|
// Created by ching on 2023/3/4.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import Moya
|
||||||
|
|
||||||
|
enum MastodonSevice {
|
||||||
|
case instance
|
||||||
|
}
|
||||||
|
|
||||||
|
extension MastodonSevice: TargetType {
|
||||||
|
var baseURL: URL {
|
||||||
|
switch self {
|
||||||
|
case .instance:
|
||||||
|
return URL(string: "")! // base URL will be set later
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var path: String {
|
||||||
|
switch self {
|
||||||
|
case .instance:
|
||||||
|
return "/api/v1/instance"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var method: Moya.Method {
|
||||||
|
switch self {
|
||||||
|
case .instance:
|
||||||
|
return .get
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var sampleData: Data {
|
||||||
|
return Data()
|
||||||
|
}
|
||||||
|
|
||||||
|
var task: Task {
|
||||||
|
switch self {
|
||||||
|
case .instance:
|
||||||
|
return .requestPlain
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var headers: [String: String]? {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MastodonClient {
|
||||||
|
private let service: MoyaProvider<MastodonSevice>
|
||||||
|
|
||||||
|
init(baseURL: String) {
|
||||||
|
service = MoyaProvider<MastodonSevice>(endpointClosure: { (target: MastodonSevice) -> Endpoint in
|
||||||
|
Endpoint(
|
||||||
|
url: baseURL + target.path,
|
||||||
|
sampleResponseClosure: { .networkResponse(200, target.sampleData) },
|
||||||
|
method: target.method,
|
||||||
|
task: target.task,
|
||||||
|
httpHeaderFields: target.headers
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func getInstance() async throws -> Instance {
|
||||||
|
return try await withCheckedThrowingContinuation { continuation in
|
||||||
|
service.request(.instance) { result in
|
||||||
|
switch result {
|
||||||
|
case .success(let response):
|
||||||
|
do {
|
||||||
|
let instance = try JSONDecoder().decode(Instance.self, from: response.data)
|
||||||
|
print("instance: \(instance.title)")
|
||||||
|
continuation.resume(returning: instance)
|
||||||
|
} catch {
|
||||||
|
continuation.resume(throwing: error)
|
||||||
|
}
|
||||||
|
case .failure(let error):
|
||||||
|
continuation.resume(throwing: error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -7,8 +7,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct AccoutInfo {
|
public struct AccountInfo {
|
||||||
public let id: String
|
|
||||||
public let username: String
|
public let username: String
|
||||||
public let serverAddress: URL
|
public let serverAddress: URL
|
||||||
public let oauthToken: OauthToken?
|
public let oauthToken: OauthToken?
|
||||||
|
|||||||
115
DUDUJI/Models/Instance.swift
Normal file
115
DUDUJI/Models/Instance.swift
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
//
|
||||||
|
// Instance.swift
|
||||||
|
// DUDUJI
|
||||||
|
//
|
||||||
|
// Created by ching on 2023/3/6.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
struct Instance: Decodable {
|
||||||
|
public let title: String
|
||||||
|
public let url: URL
|
||||||
|
public let userCount: Int?
|
||||||
|
public let statusCount: Int?
|
||||||
|
public let thumbnail: URL?
|
||||||
|
public let shortDescription: String?
|
||||||
|
public let description: String?
|
||||||
|
|
||||||
|
enum CodingKeys: String, CodingKey {
|
||||||
|
case title
|
||||||
|
case url = "uri"
|
||||||
|
case stats
|
||||||
|
case thumbnail
|
||||||
|
case shortDescription = "short_description"
|
||||||
|
case description
|
||||||
|
}
|
||||||
|
|
||||||
|
enum StatsCodingKeys: String, CodingKey {
|
||||||
|
case userCount = "user_count"
|
||||||
|
case statusCount = "status_count"
|
||||||
|
}
|
||||||
|
|
||||||
|
private struct Container: Decodable {
|
||||||
|
let title: String
|
||||||
|
let url: URL
|
||||||
|
let thumbnail: URL?
|
||||||
|
let shortDescription: String?
|
||||||
|
let description: String?
|
||||||
|
let stats: Stats?
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case title
|
||||||
|
case url = "uri"
|
||||||
|
case thumbnail
|
||||||
|
case shortDescription = "short_description"
|
||||||
|
case description
|
||||||
|
case stats
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Stats: Decodable {
|
||||||
|
let userCount: Int?
|
||||||
|
let statusCount: Int?
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case userCount = "user_count"
|
||||||
|
case statusCount = "status_count"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
init(from url: URL) throws {
|
||||||
|
let data = try Data(contentsOf: url)
|
||||||
|
let decoder = JSONDecoder()
|
||||||
|
decoder.keyDecodingStrategy = .convertFromSnakeCase
|
||||||
|
|
||||||
|
let container = try decoder.decode(Container.self, from: data)
|
||||||
|
title = container.title
|
||||||
|
self.url = container.url
|
||||||
|
thumbnail = container.thumbnail
|
||||||
|
shortDescription = container.shortDescription
|
||||||
|
description = container.description
|
||||||
|
userCount = container.stats?.userCount
|
||||||
|
statusCount = container.stats?.statusCount
|
||||||
|
}
|
||||||
|
|
||||||
|
init(from decoder: Decoder) throws {
|
||||||
|
print("into decoder")
|
||||||
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
|
|
||||||
|
title = try container.decode(String.self, forKey: .title)
|
||||||
|
url = try container.decode(URL.self, forKey: .url)
|
||||||
|
thumbnail = try container.decodeIfPresent(URL.self, forKey: .thumbnail)
|
||||||
|
shortDescription = try container.decodeIfPresent(String.self, forKey: .shortDescription)
|
||||||
|
description = try container.decodeIfPresent(String.self, forKey: .description)
|
||||||
|
|
||||||
|
if let statsContainer = try? container.nestedContainer(keyedBy: StatsCodingKeys.self, forKey: .stats) {
|
||||||
|
userCount = try statsContainer.decodeIfPresent(Int.self, forKey: .userCount)
|
||||||
|
statusCount = try statsContainer.decodeIfPresent(Int.self, forKey: .statusCount)
|
||||||
|
} else {
|
||||||
|
userCount = nil
|
||||||
|
statusCount = nil
|
||||||
|
}
|
||||||
|
print("title: \(title)")
|
||||||
|
}
|
||||||
|
|
||||||
|
init(title: String, url: URL, userCount: Int? = nil, statusCount: Int? = nil, thumbnail: URL? = nil, shortDescription: String? = nil, description: String? = nil) {
|
||||||
|
self.title = title
|
||||||
|
self.url = url
|
||||||
|
self.userCount = userCount
|
||||||
|
self.statusCount = statusCount
|
||||||
|
self.thumbnail = thumbnail
|
||||||
|
self.shortDescription = shortDescription
|
||||||
|
self.description = description
|
||||||
|
}
|
||||||
|
|
||||||
|
static func defaultInstance() -> Instance {
|
||||||
|
Instance(title: "Example", url: URL(string: "http://example.com")!, userCount: 100, statusCount: 200, thumbnail: nil, shortDescription: "This is an example.", description: "This is a longer description.")
|
||||||
|
}
|
||||||
|
|
||||||
|
static func instanceFromURL(url: String) async throws -> Instance {
|
||||||
|
let client = MastodonClient(baseURL: url)
|
||||||
|
let newInstance = try await client.getInstance()
|
||||||
|
return newInstance
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -7,9 +7,8 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct InstanceApp {
|
struct InstanceApp {
|
||||||
public let id: String
|
// public let name: String
|
||||||
public let name: String
|
|
||||||
public let website: URL?
|
public let website: URL?
|
||||||
public let redirectUri: String
|
public let redirectUri: String
|
||||||
public let clientId: String
|
public let clientId: String
|
||||||
|
|||||||
31
DUDUJI/ViewModels/InstanceAppViewModel.swift
Normal file
31
DUDUJI/ViewModels/InstanceAppViewModel.swift
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
//
|
||||||
|
// InstanceAppViewModel.swift
|
||||||
|
// DUDUJI
|
||||||
|
//
|
||||||
|
// Created by ching on 2023/3/1.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
class InstanceAppViewModel: ObservableObject {
|
||||||
|
private let instanceAppManager = InstanceAppManager()
|
||||||
|
@Published private var instance: Instance?
|
||||||
|
// let instanceApp: InstanceApp
|
||||||
|
//
|
||||||
|
// init(url: String) {
|
||||||
|
// self.instanceAppManager = InstanceAppManager()
|
||||||
|
//
|
||||||
|
// // 使用一个闭包来初始化 instanceApp
|
||||||
|
// let instanceApp: InstanceApp = instanceAppManager.createInstanceApp(at: url)
|
||||||
|
// self.instanceApp = instanceApp
|
||||||
|
// }
|
||||||
|
|
||||||
|
/// 提交实例地址
|
||||||
|
/// 在该实例中创建对应的 App
|
||||||
|
/// - Parameter url: 实例地址
|
||||||
|
func submitServerAddress(with url: String) -> InstanceApp {
|
||||||
|
instanceAppManager.createInstanceApp(at: url)
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: intents
|
||||||
|
}
|
||||||
41
DUDUJI/ViewModels/InstanceViewModel.swift
Normal file
41
DUDUJI/ViewModels/InstanceViewModel.swift
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
//
|
||||||
|
// InstanceViewModel.swift
|
||||||
|
// DUDUJI
|
||||||
|
//
|
||||||
|
// Created by ching on 2023/3/18.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
class InstanceViewModel: ObservableObject {
|
||||||
|
@Published var instance: Instance = .defaultInstance()
|
||||||
|
@Published var isLoading: Bool = false
|
||||||
|
|
||||||
|
func addPrefixIfNecessary(_ str: String) -> String {
|
||||||
|
if str.hasPrefix("http://") || str.hasPrefix("https://") {
|
||||||
|
return str
|
||||||
|
} else {
|
||||||
|
return "https://" + str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func getInstance(from url: String) async {
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.isLoading = true
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
let url = addPrefixIfNecessary(url)
|
||||||
|
let newInstance = try await Instance.instanceFromURL(url: url)
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.instance = newInstance
|
||||||
|
self.isLoading = false
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
print("!!!Error: \(error)")
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.instance = Instance.defaultInstance()
|
||||||
|
self.isLoading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,17 +8,65 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct AddAccountView: View {
|
struct AddAccountView: View {
|
||||||
@State private var serverAddress: String = ""
|
@State var serverAddress: String = ""
|
||||||
|
@ObservedObject var instanceViewModel = InstanceViewModel()
|
||||||
|
@State var showInstanceInfo = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Form {
|
VStack {
|
||||||
TextField("server address", text: $serverAddress)
|
Form {
|
||||||
|
serverAddressSection
|
||||||
|
submitButtonSection
|
||||||
|
if showInstanceInfo {
|
||||||
|
InstanceInfoSection
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var serverAddressSection: some View {
|
||||||
|
Section(header: Text("服务器地址")) {
|
||||||
|
TextField("nofan.xyz", text: $serverAddress)
|
||||||
|
.autocorrectionDisabled(true)
|
||||||
|
.autocapitalization(.none)
|
||||||
|
}
|
||||||
|
.onChange(of: serverAddress) { newValue in
|
||||||
|
if newValue.isEmpty {
|
||||||
|
self.showInstanceInfo = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var submitButtonSection: some View {
|
||||||
|
Section {
|
||||||
|
Button("提交") {
|
||||||
|
Task {
|
||||||
|
await instanceViewModel.getInstance(from: serverAddress)
|
||||||
|
showInstanceInfo = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var InstanceInfoSection: some View {
|
||||||
|
Section {
|
||||||
|
if instanceViewModel.isLoading {
|
||||||
|
HStack {
|
||||||
|
Spacer()
|
||||||
|
ProgressView() // 显示加载指示器
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
InstanceInfoView(instance: instanceViewModel.instance)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct AddAccountView_Previews: PreviewProvider {
|
struct AddAccountView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
|
// FIXME: priview
|
||||||
|
// Text("Fixme")
|
||||||
AddAccountView()
|
AddAccountView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
71
DUDUJI/Views/InstanceInfoView.swift
Normal file
71
DUDUJI/Views/InstanceInfoView.swift
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
//
|
||||||
|
// InstanceInfoView.swift
|
||||||
|
// DUDUJI
|
||||||
|
//
|
||||||
|
// Created by ching on 2023/3/6.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
class ImageLoader: ObservableObject {
|
||||||
|
@Published var image: UIImage?
|
||||||
|
|
||||||
|
func loadImage(from url: URL) {
|
||||||
|
URLSession.shared.dataTask(with: url) { data, _, error in
|
||||||
|
guard let data = data, error == nil else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.image = UIImage(data: data)
|
||||||
|
}
|
||||||
|
}.resume()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct InstanceInfoView: View {
|
||||||
|
// @ObservedObject private var instanceViewModel = InstanceViewModel()
|
||||||
|
var instance: Instance
|
||||||
|
@StateObject private var imageLoader = ImageLoader()
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
VStack(alignment: .leading) {
|
||||||
|
Text("实例名称: \(instance.title)")
|
||||||
|
Text("实例人数: \(instance.userCount != nil ? "\(instance.userCount!)" : "N/A")")
|
||||||
|
Text("嘟嘟数量: \(instance.statusCount != nil ? "\(instance.statusCount!)" : "N/A")")
|
||||||
|
// TODO: 更新图片后不应该先显示旧图片然后再显示新图片,应该是占位符 -> 新图片
|
||||||
|
Group {
|
||||||
|
if let imageURL = instance.thumbnail {
|
||||||
|
if let image = imageLoader.image {
|
||||||
|
Image(uiImage: image)
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.onAppear {
|
||||||
|
imageLoader.loadImage(from: imageURL)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
VStack {
|
||||||
|
Text("缩略图: 加载中...")
|
||||||
|
ProgressView() // 或者其他视图
|
||||||
|
}
|
||||||
|
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.onAppear {
|
||||||
|
imageLoader.loadImage(from: imageURL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Text("缩略图: N/A")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Text("简介: \(instance.shortDescription ?? "N/A")")
|
||||||
|
Text("介绍: \(instance.description ?? "N/A")")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct InstanceInfoView_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
InstanceInfoView(instance: .defaultInstance())
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user