├── .DS_Store ├── ._MyBill.xcodeproj ├── .gitattributes ├── .gitignore ├── Default-568h@2x.png ├── MyBill.xcodeproj ├── ._project.xcworkspace ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ ├── WorkspaceSettings.xcsettings │ │ └── swiftpm │ │ │ └── Package.resolved │ └── xcuserdata │ │ └── attempt.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings ├── xcshareddata │ └── xcschemes │ │ └── MyBill.xcscheme └── xcuserdata │ └── attempt.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── MyBill ├── .DS_Store ├── ._AppDelegate.swift ├── ._SceneDelegate.swift ├── ._TranserView.swift ├── AppData │ ├── .DS_Store │ ├── ._FolderBill.swift │ ├── ._ModelApp.swift │ ├── ._RealmDb.swift │ ├── FolderBill.swift │ ├── ModelApp.swift │ ├── MycenterData.swift │ ├── RealmDb.swift │ └── SettingModel.swift ├── AppDelegate.swift ├── Assets.xcassets │ ├── .DS_Store │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── icon-1024.png │ │ ├── icon-20-ipad.png │ │ ├── icon-20@2x-ipad.png │ │ ├── icon-20@2x.png │ │ ├── icon-20@3x.png │ │ ├── icon-29-ipad.png │ │ ├── icon-29.png │ │ ├── icon-29@2x-ipad.png │ │ ├── icon-29@2x.png │ │ ├── icon-29@3x.png │ │ ├── icon-40.png │ │ ├── icon-40@2x.png │ │ ├── icon-40@3x.png │ │ ├── icon-50.png │ │ ├── icon-50@2x.png │ │ ├── icon-57.png │ │ ├── icon-57@2x.png │ │ ├── icon-60@2x.png │ │ ├── icon-60@3x.png │ │ ├── icon-72.png │ │ ├── icon-72@2x.png │ │ ├── icon-76.png │ │ ├── icon-76@2x.png │ │ └── icon-83.5@2x.png │ ├── Color │ │ ├── AllViewCircle.colorset │ │ │ └── Contents.json │ │ ├── Color.colorset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── FontColor.colorset │ │ │ └── Contents.json │ │ ├── HeaderIconBack.colorset │ │ │ └── Contents.json │ │ ├── HeaderIconBack_dark.colorset │ │ │ └── Contents.json │ │ ├── MainCellSpacerColor.colorset │ │ │ └── Contents.json │ │ ├── MainThemeColor.colorset │ │ │ └── Contents.json │ │ ├── MyCenterColor.colorset │ │ │ └── Contents.json │ │ ├── NavigationBarColor.colorset │ │ │ └── Contents.json │ │ ├── SettingColor.colorset │ │ │ └── Contents.json │ │ ├── home-selected.imageset │ │ │ ├── Contents.json │ │ │ ├── home-selected-1.png │ │ │ ├── home-selected-2.png │ │ │ └── home-selected.png │ │ ├── home.imageset │ │ │ ├── Contents.json │ │ │ └── home.png │ │ ├── myCenter-selected.imageset │ │ │ ├── Contents.json │ │ │ └── myCenter-selected.png │ │ ├── myCenter.imageset │ │ │ ├── Contents.json │ │ │ └── myCenter.png │ │ ├── transerTime.colorset │ │ │ └── Contents.json │ │ └── while.colorset │ │ │ └── Contents.json │ ├── Contents.json │ ├── Image │ │ ├── .DS_Store │ │ ├── Contents.json │ │ ├── IMG_0090.imageset │ │ │ ├── Contents.json │ │ │ └── IMG_0090.png │ │ ├── MyImageBack.imageset │ │ │ ├── Contents.json │ │ │ └── E6EB5818-0EDD-406B-B178-4754357DCB68_1_105_c.jpeg │ │ ├── Setting.imageset │ │ │ ├── Contents.json │ │ │ ├── Setting-1.jpg │ │ │ ├── Setting-2.jpg │ │ │ └── Setting.jpg │ │ ├── about_icon.imageset │ │ │ ├── Contents.json │ │ │ └── icon-1024.png │ │ ├── background.imageset │ │ │ ├── Contents.json │ │ │ └── background.png │ │ ├── background2.imageset │ │ │ ├── Contents.json │ │ │ └── F45D5D02-0A05-45B6-9A52-9A9A19CCCD6E_1_105_c.jpeg │ │ ├── day.imageset │ │ │ ├── Contents.json │ │ │ └── day.png │ │ ├── night.imageset │ │ │ ├── Contents.json │ │ │ └── night.png │ │ ├── 支出-1.imageset │ │ │ ├── Contents.json │ │ │ └── 支出-1.png │ │ ├── 支出.imageset │ │ │ ├── Contents.json │ │ │ └── 支出.png │ │ ├── 支出_dark.imageset │ │ │ ├── Contents.json │ │ │ └── 支出_dark.png │ │ ├── 收入-1.imageset │ │ │ ├── Contents.json │ │ │ └── 收入.png │ │ ├── 收入-1_dark.imageset │ │ │ ├── Contents.json │ │ │ └── 收入-1_dark.png │ │ ├── 收入.imageset │ │ │ ├── Contents.json │ │ │ └── 收入.png │ │ ├── 点.imageset │ │ │ ├── Contents.json │ │ │ └── 点.png │ │ ├── 设置.imageset │ │ │ ├── Contents.json │ │ │ └── 设置.png │ │ └── 透明.imageset │ │ │ ├── Contents.json │ │ │ └── 透明.png │ ├── SettingIcon │ │ ├── .DS_Store │ │ ├── Contents.json │ │ ├── 主题样式.imageset │ │ │ ├── Contents.json │ │ │ └── 主题样式.png │ │ ├── 关于.imageset │ │ │ ├── Contents.json │ │ │ └── 关于.png │ │ ├── 反馈.imageset │ │ │ ├── Contents.json │ │ │ └── 反馈.png │ │ ├── 清理缓存.imageset │ │ │ ├── Contents.json │ │ │ └── 清理缓存.png │ │ ├── 背景修改.imageset │ │ │ ├── Contents.json │ │ │ └── 背景修改.png │ │ └── 资料修改.imageset │ │ │ ├── Contents.json │ │ │ └── 资料修改.png │ ├── SettingIcon_dark │ │ ├── Contents.json │ │ ├── 主题样式_dark.imageset │ │ │ ├── Contents.json │ │ │ └── 主题样式_dark.png │ │ ├── 关于_dark.imageset │ │ │ ├── Contents.json │ │ │ └── 关于_dark.png │ │ ├── 反馈_dark.imageset │ │ │ ├── Contents.json │ │ │ └── 反馈_dark.png │ │ ├── 清理缓存_dark.imageset │ │ │ ├── Contents.json │ │ │ └── 清理缓存_dark.png │ │ ├── 背景修改_dark.imageset │ │ │ ├── Contents.json │ │ │ └── 背景修改_dark.png │ │ └── 资料修改_dark.imageset │ │ │ ├── Contents.json │ │ │ └── 资料修改_dark.png │ ├── ThemeModel_animation │ │ ├── .DS_Store │ │ ├── Contents.json │ │ ├── fan_l.imageset │ │ │ ├── Contents.json │ │ │ └── fan_l.pdf │ │ ├── fan_l_dark.imageset │ │ │ ├── Contents.json │ │ │ └── fan_l_dark.png │ │ ├── fan_s.imageset │ │ │ ├── Contents.json │ │ │ └── fan_s.pdf │ │ ├── fan_s_dark.imageset │ │ │ ├── Contents.json │ │ │ └── fan_s_dark.png │ │ ├── stand_l.imageset │ │ │ ├── Contents.json │ │ │ └── stand_l.pdf │ │ └── stand_s.imageset │ │ │ ├── Contents.json │ │ │ └── stand_s.pdf │ ├── animation_allView │ │ ├── .DS_Store │ │ ├── Contents.json │ │ ├── floor.imageset │ │ │ ├── Contents.json │ │ │ └── floor.pdf │ │ ├── flower_left_left.imageset │ │ │ ├── Contents.json │ │ │ └── flower_left_left.pdf │ │ ├── flower_left_right.imageset │ │ │ ├── Contents.json │ │ │ └── flower_left_right.pdf │ │ ├── flower_middle_left.imageset │ │ │ ├── Contents.json │ │ │ └── flower_middle_left.pdf │ │ ├── flower_middle_right.imageset │ │ │ ├── Contents.json │ │ │ └── flower_middle_right.pdf │ │ ├── flower_right_left.imageset │ │ │ ├── Contents.json │ │ │ └── flower_right_left.pdf │ │ ├── flower_right_right.imageset │ │ │ ├── Contents.json │ │ │ └── flower_right_right.pdf │ │ ├── lady.imageset │ │ │ ├── Contents.json │ │ │ └── lady.pdf │ │ ├── lady_on_swing.imageset │ │ │ ├── Contents.json │ │ │ └── lady_on_swing.pdf │ │ ├── leg_left.imageset │ │ │ ├── Contents.json │ │ │ └── leg_left.pdf │ │ ├── leg_right.imageset │ │ │ ├── Contents.json │ │ │ └── leg_right.pdf │ │ └── tree.imageset │ │ │ ├── Contents.json │ │ │ └── tree.pdf │ ├── dark_modelColor │ │ ├── Contents.json │ │ └── MainCellSpacerColor_dark.colorset │ │ │ └── Contents.json │ └── dark_modelImage │ │ ├── Contents.json │ │ ├── Setting_dark.imageset │ │ ├── Contents.json │ │ └── Setting_dark.png │ │ └── tanser.colorset │ │ └── Contents.json ├── Base.lproj │ └── LaunchScreen.storyboard ├── EncapsulationView │ ├── .DS_Store │ ├── ._All_ViewAnimation.swift │ ├── ._DiyShape.swift │ ├── ._HomeAnimation.swift │ ├── ._KeyboardUp.swift │ ├── ._MyNavigationBar.swift │ ├── ._Setting.swift │ ├── ._StyleTheme_animtion.swift │ ├── ._TrackableScrollView.swift │ ├── ._chartView.swift │ ├── ._imagePicker.swift │ ├── ._pageViewController.swift │ ├── All_ViewAnimation.swift │ ├── DatePicker.swift │ ├── DiyShape.swift │ ├── DropDownView.swift │ ├── FancyScrollView │ │ ├── ._BlurView.swift │ │ ├── ._HeaderScrollView.swift │ │ ├── ._HeaderScrollViewTitle.swift │ │ ├── AppleMusicStyleScrollView.swift │ │ ├── BackButton.swift │ │ ├── BlurView.swift │ │ ├── FancyScrollView.swift │ │ ├── HeaderScrollView.swift │ │ ├── HeaderScrollViewTitle.swift │ │ ├── ScrollDownHeaderBehavior.swift │ │ ├── ScrollUpHeaderBehavior.swift │ │ ├── View+hideNavigationBarWithoutLosingSwipeBack.swift │ │ └── View+navigationAllowSpipeBackWhenHidden.swift │ ├── HomeAnimation.swift │ ├── KeyboardUp.swift │ ├── MYTextfield.swift │ ├── MyNavigationBar.swift │ ├── SearchView.swift │ ├── Setting.swift │ ├── StyleTheme_animtion.swift │ ├── SwiftUIPager │ │ ├── ._Page.swift │ │ ├── ._Pager.swift │ │ ├── ._PagerContent.swift │ │ ├── Helpers │ │ │ ├── Buildable.swift │ │ │ ├── CGPoint+Angle.swift │ │ │ ├── OnAnimationCompletedModifier.swift │ │ │ ├── OnDeactivateModifier.swift │ │ │ └── View+Helper.swift │ │ ├── Page.swift │ │ ├── PageConfiguration │ │ │ ├── ContentLoadingPolicy.swift │ │ │ ├── GesturePriority.swift │ │ │ ├── PaginationSensitivity.swift │ │ │ ├── PagingAnimation.swift │ │ │ ├── PositionAlignment.swift │ │ │ ├── SwipeDirection.swift │ │ │ └── SwipeInteractionArea.swift │ │ ├── PageTransition.swift │ │ ├── PageWrapper.swift │ │ ├── Pager+Buildable.swift │ │ ├── Pager.swift │ │ ├── PagerContent+Buildable.swift │ │ ├── PagerContent+Helper.swift │ │ └── PagerContent.swift │ ├── TrackableScrollView.swift │ ├── chartView.swift │ ├── imagePicker.swift │ └── pageViewController.swift ├── Home │ ├── .DS_Store │ ├── ._MainView.swift │ ├── ._SetInfoView.swift │ ├── MainView.swift │ ├── SetInfoView.swift │ └── child │ │ ├── ._ChartTagle.swift │ │ ├── ._DetailView.swift │ │ ├── ._Home.swift │ │ ├── ._MyCenterView.swift │ │ ├── ._NewBuild_Update.swift │ │ ├── ChartTagle.swift │ │ ├── DetailView.swift │ │ ├── Home.swift │ │ ├── HomeChildView │ │ ├── ._AllView.swift │ │ ├── AllView.swift │ │ ├── EarningView.swift │ │ └── PayView.swift │ │ ├── HomeView.swift │ │ ├── MyCenterView.swift │ │ ├── MyCenterchildView │ │ ├── ._WeekDetailView.swift │ │ ├── ._chartView_detail.swift │ │ ├── SettingChildView │ │ │ ├── ._AboutView.swift │ │ │ ├── ._BackgroundEdit.swift │ │ │ ├── ._SettingChildMainView.swift │ │ │ ├── ._StyleTheme.swift │ │ │ ├── ._SwiftUIView.swift │ │ │ ├── AboutView.swift │ │ │ ├── BackgroundEdit.swift │ │ │ ├── SettingChildMainView.swift │ │ │ ├── StyleTheme.swift │ │ │ └── SwiftUIView.swift │ │ ├── WeekDetailView.swift │ │ └── chartView_detail.swift │ │ ├── NewBuild_Update.swift │ │ └── RememberView.swift ├── Info.plist ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── SceneDelegate.swift ├── SearchView.swift ├── Tools │ ├── ._TimeTools.swift │ ├── ImageTranser.swift │ ├── NumberTranser.swift │ ├── SrcSysystem.swift │ └── TimeTools.swift ├── ToolsView │ └── StatusBarLight.swift ├── TranserView.swift ├── pageView.xcdatamodeld │ ├── .xccurrentversion │ └── pageView.xcdatamodel │ │ └── contents ├── zh.lproj │ └── LaunchScreen.strings └── 小猪罐.entitlements ├── README.md ├── RPReplay_Final1597018389.gif ├── RPReplay_Final1599448204 - 01.gif ├── pageViewTests ├── .DS_Store ├── Info.plist └── pageViewTests.swift └── pageViewUITests ├── .DS_Store ├── Info.plist └── pageViewUITests.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/.DS_Store -------------------------------------------------------------------------------- /._MyBill.xcodeproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/._MyBill.xcodeproj -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/Default-568h@2x.png -------------------------------------------------------------------------------- /MyBill.xcodeproj/._project.xcworkspace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill.xcodeproj/._project.xcworkspace -------------------------------------------------------------------------------- /MyBill.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MyBill.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyBill.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyBill.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "realm-cocoa", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/realm/realm-cocoa.git", 7 | "state" : { 8 | "revision" : "77658519b13388c098a7624a94491738f8bb2983", 9 | "version" : "10.10.0" 10 | } 11 | }, 12 | { 13 | "identity" : "realm-core", 14 | "kind" : "remoteSourceControl", 15 | "location" : "https://github.com/realm/realm-core", 16 | "state" : { 17 | "revision" : "95da0df7815d7cbaff14ed5e8b73fe4c2a992816", 18 | "version" : "11.0.4" 19 | } 20 | }, 21 | { 22 | "identity" : "swiftui-charts", 23 | "kind" : "remoteSourceControl", 24 | "location" : "https://github.com/spacenation/swiftui-charts.git", 25 | "state" : { 26 | "revision" : "0b66e5c2326e954efdcc94a9eeb699e2f2ae80a2", 27 | "version" : "1.0.0" 28 | } 29 | }, 30 | { 31 | "identity" : "swiftui-shapes", 32 | "kind" : "remoteSourceControl", 33 | "location" : "https://github.com/swift-extensions/swiftui-shapes.git", 34 | "state" : { 35 | "revision" : "c58b15c37eae9bd20525c6daa93a06a689ca75cb", 36 | "version" : "1.1.0" 37 | } 38 | }, 39 | { 40 | "identity" : "swiftuix", 41 | "kind" : "remoteSourceControl", 42 | "location" : "https://github.com/SwiftUIX/SwiftUIX.git", 43 | "state" : { 44 | "revision" : "1b8b443b61b8b37fafb06c1abad9b6be244c9de9", 45 | "version" : "0.1.4" 46 | } 47 | }, 48 | { 49 | "identity" : "swiftyjson", 50 | "kind" : "remoteSourceControl", 51 | "location" : "https://github.com/SwiftyJSON/SwiftyJSON.git", 52 | "state" : { 53 | "revision" : "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07", 54 | "version" : "5.0.1" 55 | } 56 | } 57 | ], 58 | "version" : 2 59 | } 60 | -------------------------------------------------------------------------------- /MyBill.xcodeproj/project.xcworkspace/xcuserdata/attempt.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill.xcodeproj/project.xcworkspace/xcuserdata/attempt.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MyBill.xcodeproj/project.xcworkspace/xcuserdata/attempt.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseAppPreferences 7 | CustomBuildLocationType 8 | RelativeToDerivedData 9 | DerivedDataLocationStyle 10 | Default 11 | IssueFilterStyle 12 | ShowActiveSchemeOnly 13 | LiveSourceIssuesEnabled 14 | 15 | ShowSharedSchemesAutomaticallyEnabled 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /MyBill.xcodeproj/xcshareddata/xcschemes/MyBill.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /MyBill.xcodeproj/xcuserdata/attempt.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /MyBill/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/.DS_Store -------------------------------------------------------------------------------- /MyBill/._AppDelegate.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/._AppDelegate.swift -------------------------------------------------------------------------------- /MyBill/._SceneDelegate.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/._SceneDelegate.swift -------------------------------------------------------------------------------- /MyBill/._TranserView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/._TranserView.swift -------------------------------------------------------------------------------- /MyBill/AppData/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/AppData/.DS_Store -------------------------------------------------------------------------------- /MyBill/AppData/._FolderBill.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/AppData/._FolderBill.swift -------------------------------------------------------------------------------- /MyBill/AppData/._ModelApp.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/AppData/._ModelApp.swift -------------------------------------------------------------------------------- /MyBill/AppData/._RealmDb.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/AppData/._RealmDb.swift -------------------------------------------------------------------------------- /MyBill/AppData/MycenterData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MycenterData.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/8/13. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | class MyInfoData:ObservableObject{ 13 | 14 | @Published var ToMain = false 15 | @Published var name = "" 16 | 17 | @Published var headerIco = Data() 18 | @Published var background = Data() 19 | 20 | init() { 21 | getMyInfo() 22 | 23 | } 24 | 25 | func getMyInfo() { 26 | 27 | 28 | let mydata = RealmDB().getDB().objects(PersonInfo.self) 29 | 30 | for data in mydata { 31 | 32 | 33 | if data.username != "" { 34 | self.ToMain = true 35 | } 36 | 37 | self.name = data.username 38 | 39 | self.headerIco = data.headerIcon 40 | self.background = data.mainBackground 41 | } 42 | 43 | } 44 | 45 | // func getMouthPieData() { 46 | // let mouthPieData = RealmDB().getDB().objects(Bill.self).filter(" blurTime <='\(TimeTools().getDay(value: 0, Timetype: "yyyy年MM月dd日"))' and blurTime >='\(TimeTools().getDay(value: -30, Timetype: "yyyy年MM月dd日"))' ") 47 | // 48 | // 49 | // } 50 | } 51 | -------------------------------------------------------------------------------- /MyBill/AppData/SettingModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingModel.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/9/1. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Combine 11 | 12 | struct SettingModel:Identifiable { 13 | 14 | var id: Int = 0 15 | var seleterName = "" 16 | var seleterIcon = "" 17 | 18 | } 19 | 20 | class SettingData: ObservableObject { 21 | 22 | @Published var settingData = [ 23 | SettingModel(id: 0, seleterName: "资料修改", seleterIcon: "资料修改"), 24 | SettingModel(id: 1, seleterName: "背景修改", seleterIcon: "背景修改"), 25 | SettingModel(id: 2, seleterName: "主题样式", seleterIcon: "主题样式"), 26 | SettingModel(id: 3, seleterName: "清理缓存", seleterIcon: "清理缓存"), 27 | SettingModel(id: 4, seleterName: "反馈", seleterIcon: "反馈"), 28 | SettingModel(id: 5, seleterName: "关于", seleterIcon: "关于") 29 | ] 30 | 31 | @Published var settingData_dark = [ 32 | SettingModel(id: 0, seleterName: "资料修改", seleterIcon: "资料修改_dark"), 33 | SettingModel(id: 1, seleterName: "背景修改", seleterIcon: "背景修改_dark"), 34 | SettingModel(id: 2, seleterName: "主题样式", seleterIcon: "主题样式_dark"), 35 | SettingModel(id: 3, seleterName: "清理缓存", seleterIcon: "清理缓存_dark"), 36 | SettingModel(id: 4, seleterName: "反馈", seleterIcon: "反馈_dark"), 37 | SettingModel(id: 5, seleterName: "关于", seleterIcon: "关于_dark") 38 | ] 39 | 40 | } 41 | -------------------------------------------------------------------------------- /MyBill/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/6/22. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreData 11 | import RealmSwift 12 | 13 | 14 | @UIApplicationMain 15 | class AppDelegate: UIResponder, UIApplicationDelegate { 16 | 17 | 18 | 19 | 20 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 21 | // Override point for customization after application launch. 22 | 23 | 24 | application.registerForRemoteNotifications() 25 | return true 26 | } 27 | 28 | func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { 29 | 30 | 31 | } 32 | // MARK: UISceneSession Lifecycle 33 | 34 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 35 | // Called when a new scene session is being created. 36 | // Use this method to select a configuration to create the new scene with. 37 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 38 | } 39 | 40 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 41 | // Called when the user discards a scene session. 42 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 43 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 44 | } 45 | 46 | // MARK: - Core Data stack 47 | 48 | lazy var persistentContainer: NSPersistentContainer = { 49 | /* 50 | The persistent container for the application. This implementation 51 | creates and returns a container, having loaded the store for the 52 | application to it. This property is optional since there are legitimate 53 | error conditions that could cause the creation of the store to fail. 54 | */ 55 | let container = NSPersistentContainer(name: "pageView") 56 | container.loadPersistentStores(completionHandler: { (storeDescription, error) in 57 | if let error = error as NSError? { 58 | // Replace this implementation with code to handle the error appropriately. 59 | // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 60 | 61 | /* 62 | Typical reasons for an error here include: 63 | * The parent directory does not exist, cannot be created, or disallows writing. 64 | * The persistent store is not accessible, due to permissions or data protection when the device is locked. 65 | * The device is out of space. 66 | * The store could not be migrated to the current model version. 67 | Check the error message to determine what the actual problem was. 68 | */ 69 | fatalError("Unresolved error \(error), \(error.userInfo)") 70 | } 71 | }) 72 | return container 73 | }() 74 | 75 | // MARK: - Core Data Saving support 76 | 77 | func saveContext () { 78 | let context = persistentContainer.viewContext 79 | if context.hasChanges { 80 | do { 81 | try context.save() 82 | } catch { 83 | // Replace this implementation with code to handle the error appropriately. 84 | // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 85 | let nserror = error as NSError 86 | fatalError("Unresolved error \(nserror), \(nserror.userInfo)") 87 | } 88 | } 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/.DS_Store -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "size": "20x20", 5 | "idiom": "iphone", 6 | "filename": "icon-20@2x.png", 7 | "scale": "2x" 8 | }, 9 | { 10 | "size": "20x20", 11 | "idiom": "iphone", 12 | "filename": "icon-20@3x.png", 13 | "scale": "3x" 14 | }, 15 | { 16 | "size": "29x29", 17 | "idiom": "iphone", 18 | "filename": "icon-29.png", 19 | "scale": "1x" 20 | }, 21 | { 22 | "size": "29x29", 23 | "idiom": "iphone", 24 | "filename": "icon-29@2x.png", 25 | "scale": "2x" 26 | }, 27 | { 28 | "size": "29x29", 29 | "idiom": "iphone", 30 | "filename": "icon-29@3x.png", 31 | "scale": "3x" 32 | }, 33 | { 34 | "size": "40x40", 35 | "idiom": "iphone", 36 | "filename": "icon-40@2x.png", 37 | "scale": "2x" 38 | }, 39 | { 40 | "size": "40x40", 41 | "idiom": "iphone", 42 | "filename": "icon-40@3x.png", 43 | "scale": "3x" 44 | }, 45 | { 46 | "size": "57x57", 47 | "idiom": "iphone", 48 | "filename": "icon-57.png", 49 | "scale": "1x" 50 | }, 51 | { 52 | "size": "57x57", 53 | "idiom": "iphone", 54 | "filename": "icon-57@2x.png", 55 | "scale": "2x" 56 | }, 57 | { 58 | "size": "60x60", 59 | "idiom": "iphone", 60 | "filename": "icon-60@2x.png", 61 | "scale": "2x" 62 | }, 63 | { 64 | "size": "60x60", 65 | "idiom": "iphone", 66 | "filename": "icon-60@3x.png", 67 | "scale": "3x" 68 | }, 69 | { 70 | "size": "20x20", 71 | "idiom": "ipad", 72 | "filename": "icon-20-ipad.png", 73 | "scale": "1x" 74 | }, 75 | { 76 | "size": "20x20", 77 | "idiom": "ipad", 78 | "filename": "icon-20@2x-ipad.png", 79 | "scale": "2x" 80 | }, 81 | { 82 | "size": "29x29", 83 | "idiom": "ipad", 84 | "filename": "icon-29-ipad.png", 85 | "scale": "1x" 86 | }, 87 | { 88 | "size": "29x29", 89 | "idiom": "ipad", 90 | "filename": "icon-29@2x-ipad.png", 91 | "scale": "2x" 92 | }, 93 | { 94 | "size": "40x40", 95 | "idiom": "ipad", 96 | "filename": "icon-40.png", 97 | "scale": "1x" 98 | }, 99 | { 100 | "size": "40x40", 101 | "idiom": "ipad", 102 | "filename": "icon-40@2x.png", 103 | "scale": "2x" 104 | }, 105 | { 106 | "size": "50x50", 107 | "idiom": "ipad", 108 | "filename": "icon-50.png", 109 | "scale": "1x" 110 | }, 111 | { 112 | "size": "50x50", 113 | "idiom": "ipad", 114 | "filename": "icon-50@2x.png", 115 | "scale": "2x" 116 | }, 117 | { 118 | "size": "72x72", 119 | "idiom": "ipad", 120 | "filename": "icon-72.png", 121 | "scale": "1x" 122 | }, 123 | { 124 | "size": "72x72", 125 | "idiom": "ipad", 126 | "filename": "icon-72@2x.png", 127 | "scale": "2x" 128 | }, 129 | { 130 | "size": "76x76", 131 | "idiom": "ipad", 132 | "filename": "icon-76.png", 133 | "scale": "1x" 134 | }, 135 | { 136 | "size": "76x76", 137 | "idiom": "ipad", 138 | "filename": "icon-76@2x.png", 139 | "scale": "2x" 140 | }, 141 | { 142 | "size": "83.5x83.5", 143 | "idiom": "ipad", 144 | "filename": "icon-83.5@2x.png", 145 | "scale": "2x" 146 | }, 147 | { 148 | "size": "1024x1024", 149 | "idiom": "ios-marketing", 150 | "filename": "icon-1024.png", 151 | "scale": "1x" 152 | } 153 | ], 154 | "info": { 155 | "version": 1, 156 | "author": "icon.wuruihong.com" 157 | } 158 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-50.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-57.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-72.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/AllViewCircle.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.948", 9 | "green" : "0.934", 10 | "red" : "0.913" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/Color.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "0.200", 8 | "blue" : "255", 9 | "green" : "255", 10 | "red" : "255" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "0.200", 26 | "blue" : "0.000", 27 | "green" : "0.000", 28 | "red" : "0.000" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/FontColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.548", 9 | "green" : "0.457", 10 | "red" : "0.442" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/HeaderIconBack.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "0.422", 8 | "blue" : "1.000", 9 | "green" : "1.000", 10 | "red" : "1.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/HeaderIconBack_dark.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "0.422", 8 | "blue" : "0.000", 9 | "green" : "0.000", 10 | "red" : "0.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/MainCellSpacerColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.965", 9 | "green" : "0.965", 10 | "red" : "0.965" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/MainThemeColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0x73", 9 | "green" : "0xBB", 10 | "red" : "0xF4" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/MyCenterColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "0.150", 8 | "blue" : "1.000", 9 | "green" : "1.000", 10 | "red" : "1.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "0.150", 26 | "blue" : "0.000", 27 | "green" : "0.000", 28 | "red" : "0.000" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/NavigationBarColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.242", 9 | "green" : "0.619", 10 | "red" : "0.914" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/SettingColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.997", 9 | "green" : "0.990", 10 | "red" : "0.986" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/home-selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "home-selected.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "home-selected-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "home-selected-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/home-selected.imageset/home-selected-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Color/home-selected.imageset/home-selected-1.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/home-selected.imageset/home-selected-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Color/home-selected.imageset/home-selected-2.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/home-selected.imageset/home-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Color/home-selected.imageset/home-selected.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "home.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/home.imageset/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Color/home.imageset/home.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/myCenter-selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "myCenter-selected.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/myCenter-selected.imageset/myCenter-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Color/myCenter-selected.imageset/myCenter-selected.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/myCenter.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "myCenter.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/myCenter.imageset/myCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Color/myCenter.imageset/myCenter.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/transerTime.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.288", 9 | "green" : "0.132", 10 | "red" : "0.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Color/while.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "1.000", 9 | "green" : "1.000", 10 | "red" : "1.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/.DS_Store -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/IMG_0090.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "IMG_0090.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/IMG_0090.imageset/IMG_0090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/IMG_0090.imageset/IMG_0090.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/MyImageBack.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "E6EB5818-0EDD-406B-B178-4754357DCB68_1_105_c.jpeg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/MyImageBack.imageset/E6EB5818-0EDD-406B-B178-4754357DCB68_1_105_c.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/MyImageBack.imageset/E6EB5818-0EDD-406B-B178-4754357DCB68_1_105_c.jpeg -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/Setting.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Setting.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "Setting-1.jpg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "Setting-2.jpg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/Setting.imageset/Setting-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/Setting.imageset/Setting-1.jpg -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/Setting.imageset/Setting-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/Setting.imageset/Setting-2.jpg -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/Setting.imageset/Setting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/Setting.imageset/Setting.jpg -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/about_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon-1024.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/about_icon.imageset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/about_icon.imageset/icon-1024.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "background.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/background.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/background.imageset/background.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/background2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "F45D5D02-0A05-45B6-9A52-9A9A19CCCD6E_1_105_c.jpeg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/background2.imageset/F45D5D02-0A05-45B6-9A52-9A9A19CCCD6E_1_105_c.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/background2.imageset/F45D5D02-0A05-45B6-9A52-9A9A19CCCD6E_1_105_c.jpeg -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/day.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "day.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/day.imageset/day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/day.imageset/day.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "night.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/night.imageset/night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/night.imageset/night.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/支出-1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "支出-1.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/支出-1.imageset/支出-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/支出-1.imageset/支出-1.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/支出.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "支出.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/支出.imageset/支出.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/支出.imageset/支出.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/支出_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "支出_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/支出_dark.imageset/支出_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/支出_dark.imageset/支出_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/收入-1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "收入.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/收入-1.imageset/收入.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/收入-1.imageset/收入.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/收入-1_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "收入-1_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/收入-1_dark.imageset/收入-1_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/收入-1_dark.imageset/收入-1_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/收入.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "收入.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/收入.imageset/收入.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/收入.imageset/收入.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/点.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "点.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/点.imageset/点.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/点.imageset/点.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/设置.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "设置.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/设置.imageset/设置.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/设置.imageset/设置.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/透明.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "透明.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/Image/透明.imageset/透明.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/Image/透明.imageset/透明.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon/.DS_Store -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/主题样式.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "主题样式.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/主题样式.imageset/主题样式.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon/主题样式.imageset/主题样式.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/关于.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "关于.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/关于.imageset/关于.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon/关于.imageset/关于.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/反馈.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "反馈.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/反馈.imageset/反馈.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon/反馈.imageset/反馈.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/清理缓存.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "清理缓存.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/清理缓存.imageset/清理缓存.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon/清理缓存.imageset/清理缓存.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/背景修改.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "背景修改.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/背景修改.imageset/背景修改.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon/背景修改.imageset/背景修改.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/资料修改.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "资料修改.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon/资料修改.imageset/资料修改.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon/资料修改.imageset/资料修改.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/主题样式_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "主题样式_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/主题样式_dark.imageset/主题样式_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon_dark/主题样式_dark.imageset/主题样式_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/关于_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "关于_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/关于_dark.imageset/关于_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon_dark/关于_dark.imageset/关于_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/反馈_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "反馈_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/反馈_dark.imageset/反馈_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon_dark/反馈_dark.imageset/反馈_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/清理缓存_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "清理缓存_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/清理缓存_dark.imageset/清理缓存_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon_dark/清理缓存_dark.imageset/清理缓存_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/背景修改_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "背景修改_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/背景修改_dark.imageset/背景修改_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon_dark/背景修改_dark.imageset/背景修改_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/资料修改_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "资料修改_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/SettingIcon_dark/资料修改_dark.imageset/资料修改_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/SettingIcon_dark/资料修改_dark.imageset/资料修改_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/ThemeModel_animation/.DS_Store -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/fan_l.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "fan_l.pdf", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/fan_l.imageset/fan_l.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/ThemeModel_animation/fan_l.imageset/fan_l.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/fan_l_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "fan_l_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/fan_l_dark.imageset/fan_l_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/ThemeModel_animation/fan_l_dark.imageset/fan_l_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/fan_s.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "fan_s.pdf", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/fan_s.imageset/fan_s.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/ThemeModel_animation/fan_s.imageset/fan_s.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/fan_s_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "fan_s_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/fan_s_dark.imageset/fan_s_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/ThemeModel_animation/fan_s_dark.imageset/fan_s_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/stand_l.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "stand_l.pdf", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/stand_l.imageset/stand_l.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/ThemeModel_animation/stand_l.imageset/stand_l.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/stand_s.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "stand_s.pdf", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/ThemeModel_animation/stand_s.imageset/stand_s.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/ThemeModel_animation/stand_s.imageset/stand_s.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/.DS_Store -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/floor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "floor.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/floor.imageset/floor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/floor.imageset/floor.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_left_left.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "flower_left_left.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_left_left.imageset/flower_left_left.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/flower_left_left.imageset/flower_left_left.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_left_right.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "flower_left_right.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_left_right.imageset/flower_left_right.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/flower_left_right.imageset/flower_left_right.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_middle_left.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "flower_middle_left.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_middle_left.imageset/flower_middle_left.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/flower_middle_left.imageset/flower_middle_left.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_middle_right.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "flower_middle_right.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_middle_right.imageset/flower_middle_right.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/flower_middle_right.imageset/flower_middle_right.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_right_left.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "flower_right_left.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_right_left.imageset/flower_right_left.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/flower_right_left.imageset/flower_right_left.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_right_right.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "flower_right_right.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/flower_right_right.imageset/flower_right_right.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/flower_right_right.imageset/flower_right_right.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/lady.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "lady.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/lady.imageset/lady.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/lady.imageset/lady.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/lady_on_swing.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "lady_on_swing.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/lady_on_swing.imageset/lady_on_swing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/lady_on_swing.imageset/lady_on_swing.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/leg_left.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "leg_left.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/leg_left.imageset/leg_left.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/leg_left.imageset/leg_left.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/leg_right.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "leg_right.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/leg_right.imageset/leg_right.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/leg_right.imageset/leg_right.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/tree.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "tree.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/animation_allView/tree.imageset/tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/animation_allView/tree.imageset/tree.pdf -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/dark_modelColor/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/dark_modelColor/MainCellSpacerColor_dark.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.118", 9 | "green" : "0.108", 10 | "red" : "0.108" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/dark_modelImage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/dark_modelImage/Setting_dark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Setting_dark.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/dark_modelImage/Setting_dark.imageset/Setting_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Assets.xcassets/dark_modelImage/Setting_dark.imageset/Setting_dark.png -------------------------------------------------------------------------------- /MyBill/Assets.xcassets/dark_modelImage/tanser.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "0.000", 8 | "blue" : "1.000", 9 | "green" : "1.000", 10 | "red" : "1.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/.DS_Store -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._All_ViewAnimation.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._All_ViewAnimation.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._DiyShape.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._DiyShape.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._HomeAnimation.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._HomeAnimation.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._KeyboardUp.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._KeyboardUp.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._MyNavigationBar.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._MyNavigationBar.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._Setting.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._Setting.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._StyleTheme_animtion.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._StyleTheme_animtion.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._TrackableScrollView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._TrackableScrollView.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._chartView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._chartView.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._imagePicker.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._imagePicker.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/._pageViewController.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/._pageViewController.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/DatePicker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DatePicker.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/7/10. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct DatePacker: View { 12 | @State var title :String 13 | 14 | @Binding var date : Date 15 | @State var datetype : Bool 16 | @State var isshow = false 17 | @State var color : Color = .gray 18 | var body: some View { 19 | 20 | VStack{ 21 | HStack{ 22 | Text("\(title)") 23 | .font(.system(size: 13)) 24 | .fontWeight(.light) 25 | 26 | Spacer() 27 | Text("\(dateChanged(date: date))") 28 | 29 | .foregroundColor(color) 30 | } 31 | 32 | if self.isshow == true { 33 | Setting(date: self.$date, type: self.$datetype) 34 | 35 | 36 | } 37 | 38 | } 39 | .onTapGesture { 40 | 41 | if self.isshow == true{ 42 | 43 | self.isshow = false 44 | self.color = .gray 45 | 46 | }else{ 47 | withAnimation(.default){ 48 | self.isshow = true 49 | self.color = Color.init("MainThemeColor") 50 | } 51 | 52 | } 53 | 54 | } 55 | 56 | } 57 | } 58 | 59 | func dateChanged(date:Date) -> String{ 60 | // 更新提醒时间文本框 61 | let formatter = DateFormatter() 62 | formatter.dateFormat = "yyyy年MM月dd日" 63 | let time = date 64 | let dateText = formatter.string(from: time) 65 | return dateText 66 | } 67 | 68 | struct Setting: UIViewRepresentable { 69 | @Binding var date: Date 70 | @Binding var type: Bool 71 | 72 | private let datePicker = UIDatePicker() 73 | 74 | func makeUIView(context: Context) -> UIDatePicker { 75 | 76 | let loc = Locale(identifier: "zh_CN") 77 | datePicker.locale = loc 78 | if self.type == true { 79 | datePicker.datePickerMode = .date 80 | }else{ 81 | datePicker.datePickerMode = .time 82 | } 83 | datePicker.maximumDate = Date.init() 84 | 85 | 86 | datePicker.addTarget(context.coordinator, action: #selector(Coordinator.changed(_:)), for: .valueChanged) 87 | return datePicker 88 | } 89 | 90 | func updateUIView(_ uiView: UIDatePicker, context: Context) { 91 | datePicker.date = date 92 | } 93 | 94 | func makeCoordinator() -> Setting.Coordinator { 95 | Coordinator(date: $date) 96 | } 97 | 98 | class Coordinator: NSObject { 99 | private let date: Binding 100 | 101 | init(date: Binding) { 102 | self.date = date 103 | } 104 | 105 | @objc func changed(_ sender: UIDatePicker) { 106 | self.date.wrappedValue = sender.date 107 | } 108 | } 109 | } 110 | 111 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/DiyShape.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DiyShape.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/8/15. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct DiyShape: Shape { 12 | var tl: CGFloat = 0.0 13 | var tr: CGFloat = 0.0 14 | var bl: CGFloat = 0.0 15 | var br: CGFloat = 0.0 16 | 17 | func path(in rect: CGRect) -> Path { 18 | var path = Path() 19 | 20 | let w = rect.size.width 21 | let h = rect.size.height 22 | 23 | // Make sure we do not exceed the size of the rectangle 24 | let tr = min(min(self.tr, h/2), w/2) 25 | let tl = min(min(self.tl, h/2), w/2) 26 | let bl = min(min(self.bl, h/2), w/2) 27 | let br = min(min(self.br, h/2), w/2) 28 | 29 | path.move(to: CGPoint(x: w / 2.0, y: 0)) 30 | path.addLine(to: CGPoint(x: w - tr, y: 0)) 31 | path.addArc(center: CGPoint(x: w - tr, y: tr), radius: tr, 32 | startAngle: Angle(degrees: -90), endAngle: Angle(degrees: 0), clockwise: false) 33 | 34 | path.addLine(to: CGPoint(x: w, y: h - br)) 35 | path.addArc(center: CGPoint(x: w - br, y: h - br), radius: br, 36 | startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 90), clockwise: false) 37 | 38 | path.addLine(to: CGPoint(x: bl, y: h)) 39 | path.addArc(center: CGPoint(x: bl, y: h - bl), radius: bl, 40 | startAngle: Angle(degrees: 90), endAngle: Angle(degrees: 180), clockwise: false) 41 | 42 | path.addLine(to: CGPoint(x: 0, y: tl)) 43 | path.addArc(center: CGPoint(x: tl, y: tl), radius: tl, 44 | startAngle: Angle(degrees: 180), endAngle: Angle(degrees: 270), clockwise: false) 45 | 46 | return path 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/DropDownView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DropDownView.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/6/30. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct DropDownView: View { 12 | 13 | 14 | @State var expand = false 15 | @State var menu = ["支出","收入"] 16 | @State var show = "支出" 17 | var body: some View { 18 | VStack() { 19 | 20 | VStack(spacing: 10) { 21 | HStack() { 22 | Text("\(show)") 23 | 24 | .foregroundColor(.white) 25 | 26 | 27 | Image(systemName: expand ? "chevron.up" : "chevron.down") 28 | .resizable() 29 | .frame(width: 13, height: 6) 30 | .foregroundColor(.white) 31 | } 32 | 33 | .contentShape(Rectangle()) 34 | 35 | .onTapGesture { 36 | self.expand.toggle() 37 | } 38 | if expand { 39 | 40 | Button(action: { 41 | self.expand.toggle() 42 | self.show = self.menu[0] 43 | }) { 44 | Text("\(menu[0])") 45 | .padding(5) 46 | .shadow(color: .black, radius: 3.5, x: 1, y: 1) 47 | }.foregroundColor(.white) 48 | 49 | Button(action: { 50 | self.expand.toggle() 51 | self.show = self.menu[1] 52 | }) { 53 | Text("\(menu[1])") 54 | .padding(5) 55 | .shadow(color: .black, radius: 3.5, x: 1, y: 1) 56 | }.foregroundColor(.white) 57 | 58 | 59 | } 60 | } 61 | .padding(.horizontal) 62 | .cornerRadius(15) 63 | .animation(.spring()) 64 | } 65 | } 66 | 67 | 68 | } 69 | 70 | struct DropDownView_Previews: PreviewProvider { 71 | static var previews: some View { 72 | DropDownView() 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/._BlurView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/FancyScrollView/._BlurView.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/._HeaderScrollView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/FancyScrollView/._HeaderScrollView.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/._HeaderScrollViewTitle.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/FancyScrollView/._HeaderScrollViewTitle.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/AppleMusicStyleScrollView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct AppleMusicStyleScrollView: View { 4 | let content: AnyView 5 | 6 | @State 7 | private var offset: CGFloat = 0 8 | 9 | var body: some View { 10 | ZStack { 11 | ScrollView { 12 | ZStack { 13 | GeometryReader { geometry -> Text in 14 | let offset = geometry.frame(in: .global).minY 15 | DispatchQueue.main.async { 16 | self.offset = offset 17 | } 18 | return Text("") 19 | } 20 | content 21 | .animation(nil) 22 | } 23 | } 24 | GeometryReader { geometry in 25 | BlurView() 26 | .opacity(self.offset >= 0 ? 0 : 1) 27 | .frame(width: geometry.size.width, 28 | height: geometry.safeAreaInsets.top) 29 | .position(x: geometry.size.width / 2, y: geometry.safeAreaInsets.top / 2) 30 | .edgesIgnoringSafeArea(.top) 31 | .animation(.spring()) 32 | } 33 | } 34 | .navigationBarTitle("") 35 | .navigationBarHidden(true) 36 | } 37 | } 38 | 39 | 40 | extension AppleMusicStyleScrollView { 41 | 42 | init(content: () -> Content) { 43 | self.init(content: AnyView(content())) 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/BackButton.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct BackButton: View { 4 | let color: Color 5 | 6 | @Environment(\.presentationMode) 7 | var presentationMode: Binding 8 | 9 | var body: some View { 10 | presentationMode.wrappedValue.isPresented ? 11 | Button(action: { self.presentationMode.wrappedValue.dismiss() }) { 12 | Image(systemName: "chevron.left") 13 | .resizable() 14 | .aspectRatio(contentMode: .fit) 15 | .frame(height: 20, alignment: .leading) 16 | .foregroundColor(color) 17 | .padding(.horizontal, 16) 18 | .font(Font.body.bold()) 19 | .hidden() 20 | 21 | } : nil 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/BlurView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BlurView.swift 3 | // FancyScrollView 4 | // 5 | // Created by Mathias Quintero on 12/25/19. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct BlurView: UIViewRepresentable { 11 | func makeUIView(context: UIViewRepresentableContext) -> UIView { 12 | let view = UIView(frame: .zero) 13 | view.backgroundColor = UIColor.init(named: "NavigationBarColor") 14 | let blurEffect = UIBlurEffect(style: context.environment.colorScheme == .dark ? .dark : .light) 15 | let blurView = UIVisualEffectView(effect: blurEffect) 16 | blurView.translatesAutoresizingMaskIntoConstraints = false 17 | view.insertSubview(blurView, at: 0) 18 | NSLayoutConstraint.activate([ 19 | blurView.heightAnchor.constraint(equalTo: view.heightAnchor), 20 | blurView.widthAnchor.constraint(equalTo: view.widthAnchor), 21 | blurView.centerYAnchor.constraint(equalTo: view.centerYAnchor), 22 | blurView.centerXAnchor.constraint(equalTo: view.centerXAnchor), 23 | ]) 24 | return view 25 | } 26 | 27 | func updateUIView(_ uiView: UIView, context: UIViewRepresentableContext) { } 28 | } 29 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/FancyScrollView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | public struct FancyScrollView: View { 4 | let title: String 5 | let headerHeight: CGFloat 6 | let scrollUpHeaderBehavior: ScrollUpHeaderBehavior 7 | let scrollDownHeaderBehavior: ScrollDownHeaderBehavior 8 | let cornerRadiusNub : CGFloat 9 | @State var showTitle : Bool 10 | @Environment(\.colorScheme) var colorScheme 11 | let header: AnyView? 12 | 13 | let content: AnyView 14 | 15 | 16 | public var body: some View { 17 | if let header = header { 18 | return AnyView( 19 | HeaderScrollView(title: title, 20 | headerHeight: headerHeight, 21 | scrollUpBehavior: scrollUpHeaderBehavior, 22 | scrollDownBehavior: scrollDownHeaderBehavior, 23 | cornerRadiusNub:cornerRadiusNub, 24 | header: header, 25 | content: content, showTitle: showTitle) 26 | ) 27 | } else { 28 | return AnyView( 29 | AppleMusicStyleScrollView { 30 | VStack { 31 | title != "" ? HStack { 32 | Text(title) 33 | .font(.largeTitle) 34 | .foregroundColor(colorScheme == .dark ? .white :.black) 35 | .fontWeight(.black) 36 | .padding(.horizontal, 16) 37 | 38 | Spacer() 39 | } : nil 40 | 41 | title != "" ? Spacer() : nil 42 | 43 | content 44 | } 45 | } 46 | ) 47 | } 48 | } 49 | } 50 | 51 | extension FancyScrollView { 52 | 53 | public init(title: String = "", 54 | headerHeight: CGFloat = 300, 55 | scrollUpHeaderBehavior: ScrollUpHeaderBehavior = .parallax, 56 | scrollDownHeaderBehavior: ScrollDownHeaderBehavior = .offset, 57 | cornerRadiusNub:CGFloat = 15, 58 | showTitle:Bool = false, 59 | header: () -> A?, 60 | content: () -> B) { 61 | 62 | self.init(title: title, 63 | headerHeight: headerHeight, 64 | scrollUpHeaderBehavior: scrollUpHeaderBehavior, 65 | scrollDownHeaderBehavior: scrollDownHeaderBehavior, 66 | cornerRadiusNub:cornerRadiusNub, 67 | showTitle:showTitle, 68 | header: AnyView(header()), 69 | content: AnyView(content()) 70 | ) 71 | } 72 | 73 | public init(title: String = "", 74 | headerHeight: CGFloat = 300, 75 | scrollUpHeaderBehavior: ScrollUpHeaderBehavior = .parallax, 76 | scrollDownHeaderBehavior: ScrollDownHeaderBehavior = .offset, 77 | cornerRadiusNub:CGFloat = 15, 78 | showTitle:Bool = false, 79 | content: () -> A) { 80 | 81 | self.init(title: title, 82 | headerHeight: headerHeight, 83 | scrollUpHeaderBehavior: scrollUpHeaderBehavior, 84 | scrollDownHeaderBehavior: scrollDownHeaderBehavior, 85 | cornerRadiusNub:cornerRadiusNub, 86 | showTitle:showTitle, 87 | header: nil, 88 | content: AnyView(content())) 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/HeaderScrollViewTitle.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct HeaderScrollViewTitle: View { 4 | let title: String 5 | let height: CGFloat 6 | let largeTitle: Double 7 | @State var showTitle : Bool 8 | @Environment(\.colorScheme) var colorScheme 9 | var body: some View { 10 | let largeTitleOpacity = (max(largeTitle, 0.5) - 0.5) * 2 11 | let tinyTitleOpacity = 1 - min(largeTitle, 0.5) * 2 12 | return ZStack { 13 | 14 | if showTitle{ 15 | HStack { 16 | Text(title) 17 | .font(.largeTitle) 18 | .foregroundColor(colorScheme == .dark ? .white :.black) 19 | .fontWeight(.black) 20 | .padding(.horizontal, 16) 21 | 22 | Spacer() 23 | } 24 | .padding(.bottom, 20) 25 | .opacity(sqrt(largeTitleOpacity)) 26 | } 27 | 28 | ZStack { 29 | HStack { 30 | BackButton(color: .primary) 31 | Spacer() 32 | } 33 | HStack { 34 | Text(title) 35 | .font(.system(size: 18)) 36 | .fontWeight(.bold) 37 | .foregroundColor(.white) 38 | } 39 | } 40 | .padding(.bottom, (height - 18) / 2) 41 | .opacity(sqrt(tinyTitleOpacity)) 42 | }.frame(height: height) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/ScrollDownHeaderBehavior.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum ScrollDownHeaderBehavior { 4 | case offset 5 | case sticky 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/ScrollUpHeaderBehavior.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum ScrollUpHeaderBehavior { 4 | case parallax 5 | case sticky 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/View+hideNavigationBarWithoutLosingSwipeBack.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | import SwiftUI 4 | 5 | extension View { 6 | 7 | func hideNavigationBarWithoutLosingSwipeBack(_ hidden: Bool) -> some View { 8 | return background(NavigationConfigurator(hidden: hidden)) 9 | } 10 | 11 | } 12 | 13 | private struct NavigationConfigurator: UIViewControllerRepresentable { 14 | let hidden: Bool 15 | 16 | class Coordinator: NSObject { 17 | weak var navigationController: UINavigationController? 18 | 19 | deinit { 20 | navigationController?.navigationBar.isHidden = false 21 | } 22 | } 23 | 24 | func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIViewController { 25 | return UIViewController() 26 | } 27 | 28 | func makeCoordinator() -> NavigationConfigurator.Coordinator { 29 | return Coordinator() 30 | } 31 | 32 | func updateUIViewController(_ uiViewController: UIViewController, 33 | context: UIViewControllerRepresentableContext) { 34 | 35 | uiViewController.navigationController?.navigationBar.isHidden = hidden 36 | 37 | context.coordinator.navigationController = uiViewController.navigationController 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/FancyScrollView/View+navigationAllowSpipeBackWhenHidden.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | extension View { 4 | 5 | func hackNavigationToAllowSpipeBackWhenHidden() -> some View { 6 | return background(NavigationConfigurator()) 7 | } 8 | 9 | } 10 | 11 | private struct NavigationConfigurator: UIViewControllerRepresentable { 12 | 13 | class Coordinator: NSObject, UIGestureRecognizerDelegate { 14 | weak var navigationController: UINavigationController? 15 | weak var originalDelegate: UIGestureRecognizerDelegate? 16 | 17 | deinit { 18 | navigationController?.interactivePopGestureRecognizer?.delegate = originalDelegate 19 | } 20 | 21 | override func responds(to aSelector: Selector!) -> Bool { 22 | if aSelector == #selector(gestureRecognizer(_:shouldReceive:)) { 23 | return true 24 | } else if let responds = originalDelegate?.responds(to: aSelector) { 25 | return responds 26 | } else { 27 | return false 28 | } 29 | } 30 | 31 | override func forwardingTarget(for aSelector: Selector!) -> Any? { 32 | return originalDelegate 33 | } 34 | 35 | func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { 36 | if let navigationController = navigationController, 37 | navigationController.isNavigationBarHidden { 38 | 39 | return true 40 | } else if let result = originalDelegate?.gestureRecognizerShouldBegin?(gestureRecognizer) { 41 | return result 42 | } else { 43 | return false 44 | } 45 | } 46 | 47 | func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { 48 | if let navigationController = navigationController, 49 | navigationController.isNavigationBarHidden { 50 | 51 | return true 52 | } else if let result = originalDelegate?.gestureRecognizer?(gestureRecognizer, shouldReceive: touch) { 53 | return result 54 | } else { 55 | return false 56 | } 57 | } 58 | } 59 | 60 | func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIViewController { 61 | return UIViewController() 62 | } 63 | 64 | func makeCoordinator() -> NavigationConfigurator.Coordinator { 65 | return Coordinator() 66 | } 67 | 68 | func updateUIViewController(_ uiViewController: UIViewController, 69 | context: UIViewControllerRepresentableContext) { 70 | 71 | uiViewController.navigationController?.interactivePopGestureRecognizer?.isEnabled = true 72 | 73 | guard !(uiViewController.navigationController?.interactivePopGestureRecognizer?.delegate is Coordinator) else { return } 74 | 75 | context.coordinator.navigationController = uiViewController.navigationController 76 | context.coordinator.originalDelegate = uiViewController.navigationController?.interactivePopGestureRecognizer?.delegate 77 | uiViewController.navigationController?.interactivePopGestureRecognizer?.delegate = context.coordinator 78 | 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/KeyboardUp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardUp.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/7/10. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | import SwiftUI 9 | import UIKit 10 | import Combine 11 | 12 | struct KeyboardHost: View { 13 | let view: Content 14 | 15 | @State private var keyboardHeight: CGFloat = 0 16 | 17 | private let showPublisher = NotificationCenter.Publisher.init( 18 | center: .default, 19 | name: UIResponder.keyboardWillShowNotification 20 | ).map { (notification) -> CGFloat in 21 | if let rect = notification.userInfo?["UIKeyboardFrameEndUserInfoKey"] as? CGRect { 22 | return rect.size.height 23 | } else { 24 | return 0 25 | } 26 | } 27 | 28 | private let hidePublisher = NotificationCenter.Publisher.init( 29 | center: .default, 30 | name: UIResponder.keyboardWillHideNotification 31 | ).map {_ -> CGFloat in 0} 32 | 33 | // Like HStack or VStack, the only parameter is the view that this view should layout. 34 | // (It takes one view rather than the multiple views that Stacks can take) 35 | init(@ViewBuilder content: () -> Content) { 36 | view = content() 37 | } 38 | 39 | var body: some View { 40 | VStack { 41 | view .padding(.bottom, keyboardHeight) 42 | .animation(.default) } 43 | .onReceive(showPublisher.merge(with: hidePublisher)) { (height) in self.keyboardHeight = height 44 | 45 | } 46 | 47 | } 48 | } 49 | 50 | 51 | struct AdaptsToSoftwareKeyboard: ViewModifier { 52 | @State var currentHeight: CGFloat = 0 53 | 54 | func body(content: Content) -> some View { 55 | content 56 | .padding(.bottom, currentHeight) 57 | //.edgesIgnoringSafeArea(currentHeight == 0 ? [] : .bottom) 58 | .onAppear(perform: subscribeToKeyboardEvents) 59 | 60 | } 61 | 62 | private func subscribeToKeyboardEvents() { 63 | NotificationCenter.Publisher( 64 | center: NotificationCenter.default, 65 | name: UIResponder.keyboardWillShowNotification 66 | ) 67 | .compactMap { notification in 68 | notification.userInfo?["UIKeyboardFrameEndUserInfoKey"] as? CGRect 69 | }.map { rect in 70 | rect.height 71 | 72 | }.subscribe(Subscribers.Assign(object: self, keyPath: \.currentHeight)) 73 | 74 | 75 | NotificationCenter.Publisher( 76 | center: NotificationCenter.default, 77 | name: UIResponder.keyboardWillHideNotification 78 | 79 | ).compactMap { notification in 80 | CGFloat.zero 81 | }.subscribe(Subscribers.Assign(object: self, keyPath: \.currentHeight)) 82 | 83 | 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/MYTextfield.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MYTextfield.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/7/22. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | struct MyTextField: UIViewRepresentable { 13 | let keyboardType: UIKeyboardType 14 | @Binding var text: String 15 | @State var placeholder : String 16 | var paddingHor:CGFloat = 10 17 | @Binding var showLine : Bool 18 | @Environment(\.colorScheme) var colorScheme 19 | func makeUIView(context: Context) -> UITextField { 20 | 21 | 22 | let textField = UITextField(frame: .zero) 23 | textField.keyboardType = self.keyboardType 24 | textField.delegate = context.coordinator 25 | 26 | textField.text = self.text 27 | 28 | textField.returnKeyType = UIReturnKeyType.done 29 | textField.backgroundColor = UIColor.init(named: colorScheme == .dark ? "MainCellSpacerColor_dark" : "while") 30 | 31 | textField.placeholder = placeholder 32 | 33 | textField.leftView = UIView(frame: CGRect(x: 0, y: 0, width: paddingHor, height: 1)); 34 | textField.leftViewMode = .always 35 | 36 | return textField 37 | } 38 | 39 | func updateUIView(_ uiView: UITextField, context: Context) { 40 | DispatchQueue.main.async{ 41 | self.$text.wrappedValue = uiView.text! 42 | 43 | } 44 | } 45 | 46 | func makeCoordinator() -> Coordinator { 47 | Coordinator(self,text: self.$text,showLine: self.$showLine) 48 | } 49 | 50 | 51 | class Coordinator: NSObject, UITextFieldDelegate { 52 | var parent: MyTextField 53 | var text: Binding 54 | var showLine : Binding 55 | init(_ textField: MyTextField,text:Binding,showLine:Binding) { 56 | self.parent = textField 57 | self.text = text 58 | self.showLine = showLine 59 | } 60 | 61 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 62 | //收起键盘 63 | textField.resignFirstResponder() 64 | 65 | self.text.wrappedValue = textField.text! 66 | 67 | self.showLine.wrappedValue = false 68 | 69 | return true 70 | } 71 | 72 | //结束编辑 73 | func textFieldDidEndEditing(_ textField: UITextField) { 74 | 75 | self.text.wrappedValue = textField.text! 76 | 77 | self.showLine.wrappedValue = false 78 | } 79 | 80 | //开始编辑 81 | func textFieldDidBeginEditing(_ textField: UITextField) { 82 | 83 | self.showLine.wrappedValue = true 84 | 85 | } 86 | 87 | func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { 88 | 89 | 90 | let pointRange = (textField.text! as NSString).range(of: ".") 91 | 92 | if textField.text == "" && string == "." { 93 | return false 94 | } 95 | 96 | if pointRange.length > 0 && pointRange.location > 0{//判断输入框内是否含有“.”。 97 | if string == "." { 98 | return false 99 | } 100 | 101 | 102 | } 103 | 104 | self.text.wrappedValue = string 105 | return true 106 | 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/MyNavigationBar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MyNavigationBar.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/7/9. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct MyNavigationBar: View { 12 | @Binding var scrollViewContentOffset : CGFloat 13 | @Binding var middle : String 14 | @State var right : String 15 | var body: some View { 16 | VStack { 17 | ZStack(alignment: .center) { 18 | // iPhone x -> 88pt iPhone x not -> 64pt 19 | Rectangle() 20 | .frame(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height >= 812 ? 88 : 64) 21 | .foregroundColor(Color(red: 0.914, green: 0.619, blue: 0.242, opacity: -scrollViewContentOffset > height/4.5 ? 1 : 0)) 22 | HStack(alignment:.center){ 23 | 24 | Text("") 25 | .foregroundColor(.white) 26 | .font(.system(size: 20)) 27 | .bold() 28 | .padding(.leading, 15.0) 29 | .frame(width: 80, height: UIScreen.main.bounds.height >= 812 ? 88 : 64, alignment: .leading) 30 | 31 | Spacer() 32 | Text(-scrollViewContentOffset > height/4.5 ? self.middle : "") 33 | .foregroundColor(.white) 34 | .font(.system(size: 17)) 35 | 36 | .bold() 37 | .padding(.top,20) 38 | .frame(width: 100, height: UIScreen.main.bounds.height >= 812 ? 88 : 64, alignment: .center) 39 | .animation(.none) 40 | 41 | 42 | 43 | Spacer() 44 | Button(action: { 45 | 46 | }) { 47 | if self.right == "透明"{ 48 | Image(self.right ) 49 | }else{ 50 | Image(systemName: self.right) 51 | .padding(.top,10) 52 | } 53 | 54 | //.resizable().frame(width: 30,height: 10) 55 | } 56 | 57 | .accentColor(.white) 58 | .padding(.trailing, 15.0) 59 | .frame(width: 80, height: UIScreen.main.bounds.height >= 812 ? 88 : 64, alignment: .trailing) 60 | 61 | } 62 | .frame(width: UIScreen.main.bounds.width,height: UIScreen.main.bounds.height >= 812 ? 88 : 64,alignment: .top) 63 | .foregroundColor(Color(red: 1, green: 1, blue: 1, opacity: -scrollViewContentOffset > height/4.5 ? 1 : 0)) 64 | } 65 | Spacer() 66 | } 67 | .animation(.spring()) 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/Setting.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Setting.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/8/13. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct SettingView: View { 12 | @ObservedObject var setting = SettingData() 13 | @ObservedObject var mycenterdata : MyInfoData 14 | @Environment(\.presentationMode) var persentationMode 15 | @Environment(\.colorScheme) var colorScheme 16 | @State var window: UIWindow 17 | var body: some View { 18 | 19 | ZStack(alignment:.topLeading){ 20 | FancyScrollView(title: "设置", 21 | headerHeight: 200, 22 | scrollUpHeaderBehavior: .parallax, 23 | scrollDownHeaderBehavior: .offset, 24 | cornerRadiusNub:15, 25 | showTitle: true, 26 | header: { Image(colorScheme == .dark ? "Setting_dark" : "Setting").resizable().scaledToFill() }) 27 | { 28 | 29 | VStack{ 30 | Spacer().frame(height:20) 31 | VStack{ 32 | ScrollView{ 33 | ForEach(colorScheme == .dark ? setting.settingData_dark: setting.settingData){item in 34 | 35 | NavigationLink(destination:SettingChildMainView(settingModel: item,mycenterdata:self.mycenterdata,window: self.window)){ 36 | 37 | HStack{ 38 | Image(item.seleterIcon) 39 | .resizable() 40 | .scaledToFit() 41 | .scaleEffect(0.7) 42 | Text(item.seleterName) 43 | Spacer() 44 | Image(systemName: "chevron.right") 45 | } 46 | .padding(.horizontal,15) 47 | .frame(width: width-40, height: 40, alignment: .center) 48 | .contentShape(Rectangle()) 49 | 50 | 51 | }.buttonStyle(PlainButtonStyle()) 52 | } 53 | 54 | }.background(self.colorScheme == .dark ? Color.init("MainCellSpacerColor_dark") : Color.white) 55 | 56 | } 57 | .padding(.vertical,15) 58 | 59 | .frame(width: width-40,alignment: .center) 60 | .background(self.colorScheme == .dark ? Color.init("MainCellSpacerColor_dark") : Color.white) 61 | .cornerRadius(15) 62 | .shadow(radius: 5) 63 | } 64 | 65 | .background(colorScheme == .dark ? Color.black : Color.init("SettingColor") ) 66 | 67 | 68 | } 69 | .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) 70 | .background(colorScheme == .dark ? Color.black : Color.init("SettingColor") ) 71 | .navigationBarTitle("设置") 72 | .navigationBarHidden(true) 73 | 74 | 75 | Button(action: { 76 | self.persentationMode.wrappedValue.dismiss() 77 | }) { 78 | Image(systemName: "chevron.left") 79 | .scaleEffect(1.2) 80 | .foregroundColor(colorScheme == .dark ? .white :.black) 81 | .padding(.leading,25) 82 | .padding(.top,10) 83 | 84 | }.frame(width: 50, height: 30, alignment: .center) 85 | .contentShape(Rectangle()) 86 | 87 | }.onAppear(){ 88 | 89 | 90 | 91 | if self.colorScheme != .dark{ 92 | let controller = UIApplication.shared.windows[0].rootViewController as? MyHontingController 93 | controller?.statusBarStyle = .darkContent 94 | } 95 | 96 | } 97 | 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/StyleTheme_animtion.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // yahoo_weather_sun_and_wind 4 | // 5 | // Created by Amos Gyamfi on 29.7.2019. 6 | // Copyright © 2019 Amos Gyamfi. All rights reserved. 7 | // 8 | 9 | // 10 | // ContentView.swift 11 | // yahoo_weather_sun_and_wind 12 | // 13 | // Created by Amos Gyamfi on 29.7.2019. 14 | // Copyright © 2019 Amos Gyamfi. All rights reserved. 15 | // 16 | 17 | import SwiftUI 18 | 19 | struct StyleTheme_animtion: View { 20 | 21 | @State var sunMotion = false 22 | @State var drawSunPath = false 23 | @State var rotateLargeFan = false 24 | @State var rotateSmallFan = false 25 | @Environment(\.colorScheme) var colorScheme 26 | var body: some View { 27 | ZStack { 28 | Divider() 29 | Divider() 30 | .rotationEffect(.degrees(90)) 31 | .offset(x: -200) 32 | 33 | Circle() 34 | .frame(width: 10) 35 | .foregroundColor(.yellow) 36 | .offset(x: -200 + 25) 37 | 38 | Circle() 39 | .frame(width: 10) 40 | .foregroundColor(.yellow) 41 | .offset(x: 175) 42 | 43 | // Motion Path Background 44 | Circle() 45 | .trim(from: 1/2, to: 1) 46 | .stroke() 47 | .frame(width: 350) 48 | .foregroundColor(.black) 49 | .offset(x: 0) 50 | .opacity(2/10) 51 | 52 | // Motion Path 53 | ZStack { 54 | Circle() 55 | .trim(from: drawSunPath ? 1/2 : 1, to: 1) 56 | .stroke(Color.gray, lineWidth: 1) 57 | 58 | .frame(width: 350) 59 | .foregroundColor(.black) 60 | 61 | .rotationEffect(.degrees(180), anchor: .center) 62 | .rotation3DEffect(.degrees(180), axis: (x: 90, y: 0, z: 0)) 63 | .onAppear(){ 64 | self.drawSunPath.toggle() 65 | } 66 | 67 | 68 | 69 | 70 | 71 | Image(systemName: "sun.max") 72 | .font(.largeTitle) 73 | .foregroundColor(.yellow) 74 | .offset(x: -175) 75 | .rotationEffect(.degrees(colorScheme == .dark ? 180 : 60)) 76 | .opacity(colorScheme == .dark ? 0 : 1) 77 | .animation(Animation.easeInOut(duration: 4)) 78 | 79 | 80 | 81 | 82 | 83 | Image(systemName: "moon.circle") 84 | .font(.largeTitle) 85 | .rotationEffect(.degrees(220)) 86 | .opacity(colorScheme == .dark ? 1:0) 87 | .foregroundColor(colorScheme == .dark ? .yellow : .white) 88 | .offset(x: 110, y: colorScheme == .dark ? -200:0) 89 | .animation(Animation.easeInOut(duration: 4)) 90 | 91 | 92 | 93 | 94 | 95 | } 96 | 97 | // Fan Large 98 | Image("stand_l") 99 | .offset(x: -100, y: -40) 100 | .opacity(1/2) 101 | 102 | Image(colorScheme == .dark ? "fan_l_dark":"fan_l") 103 | //.rotationEffect(.degrees(rotateSmallFan ? 360*4 : 0)) 104 | .offset(x: -100, y: -80) 105 | .opacity(1/2) 106 | .animation(Animation.easeInOut(duration: 4*4)) 107 | 108 | 109 | 110 | 111 | // Fan Small 112 | Image("stand_s") 113 | .offset(x: -60, y: -20) 114 | .opacity(1/2) 115 | 116 | 117 | Image(colorScheme == .dark ? "fan_s_dark" : "fan_s") 118 | .rotationEffect(.degrees(rotateSmallFan ? 360*4 : 0)) 119 | .animation(Animation.easeInOut(duration: 4*4).repeatForever(autoreverses: false)) 120 | .offset(x: -60, y: -40) 121 | .opacity(1/2) 122 | .onAppear() { 123 | self.rotateSmallFan.toggle() 124 | } 125 | } 126 | 127 | 128 | 129 | } 130 | } 131 | 132 | 133 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/._Page.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/SwiftUIPager/._Page.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/._Pager.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/SwiftUIPager/._Pager.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/._PagerContent.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/EncapsulationView/SwiftUIPager/._PagerContent.swift -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/Helpers/Buildable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Buildable.swift 3 | // iPod 4 | // 5 | // Created by Fernando Moya de Rivas on 09/12/2019. 6 | // Copyright © 2019 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Adds a helper function to mutate a properties and help implement _Builder_ pattern 12 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 13 | protocol Buildable { } 14 | 15 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 16 | extension Buildable { 17 | 18 | /// Mutates a property of the instance 19 | /// 20 | /// - Parameter keyPath: `WritableKeyPath` to the instance property to be modified 21 | /// - Parameter value: value to overwrite the instance property 22 | func mutating(keyPath: WritableKeyPath, value: T) -> Self { 23 | var newSelf = self 24 | newSelf[keyPath: keyPath] = value 25 | return newSelf 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/Helpers/CGPoint+Angle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGPoint+Angle.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 23/07/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 12 | extension CGPoint { 13 | 14 | var angle: Angle? { 15 | guard x != 0 || y != 0 else { return nil } 16 | guard x != 0 else { return y > 0 ? Angle(degrees: 90) : Angle(degrees: 270) } 17 | guard y != 0 else { return x > 0 ? Angle(degrees: 0) : Angle(degrees: 180) } 18 | var angle = atan(abs(y) / abs(x)) * 180 / .pi 19 | switch (x, y) { 20 | case (let x, let y) where x < 0 && y < 0: 21 | angle = 180 + angle 22 | case (let x, let y) where x < 0 && y > 0: 23 | angle = 180 - angle 24 | case (let x, let y) where x > 0 && y < 0: 25 | angle = 360 - angle 26 | default: 27 | break 28 | } 29 | 30 | return .init(degrees: Double(angle)) 31 | } 32 | 33 | static func -(lhs: CGPoint, rhs: CGPoint) -> CGPoint { 34 | return CGPoint(x: lhs.x - rhs.x, y: lhs.y - rhs.y) 35 | } 36 | 37 | } 38 | 39 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 40 | extension Angle { 41 | var isAlongXAxis: Bool { 42 | let degrees = ((Int(self.degrees.rounded()) % 360) + 360) % 360 43 | return degrees >= 330 || degrees <= 30 || (degrees >= 150 && degrees <= 210) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/Helpers/OnAnimationCompletedModifier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OnAnimationCompletedModifier.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 14/1/21. 6 | // Copyright © 2021 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | /// `ViewModifier` used to observe the end of an animation 12 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 13 | struct OnAnimationCompletedModifier: AnimatableModifier where Value: VectorArithmetic { 14 | 15 | var animatableData: Value { 16 | didSet { 17 | notifyCompletionIfFinished() 18 | } 19 | } 20 | 21 | private var target: Value 22 | private var completion: () -> Void 23 | 24 | init(target: Value, completion: @escaping () -> Void) { 25 | self.completion = completion 26 | self.animatableData = target 27 | self.target = target 28 | } 29 | 30 | private func notifyCompletionIfFinished() { 31 | guard animatableData == target else { return } 32 | DispatchQueue.main.async { 33 | self.completion() 34 | } 35 | } 36 | 37 | func body(content: Content) -> some View { 38 | content 39 | } 40 | } 41 | 42 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 43 | extension View { 44 | 45 | /// Calls the completion handler whenever an animation on the given value completes. 46 | /// 47 | /// - Parameter value: The value to observe 48 | /// - Parameter completion: The completion callback 49 | func onAnimationCompleted(for value: Value, completion: @escaping () -> Void) -> some View { 50 | return modifier(OnAnimationCompletedModifier(target: value, completion: completion)) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/Helpers/OnDeactivateModifier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OnDeactivateModifier.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 07/07/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | /// This modifier allows the `View` to listen to the `UIScene.didActivateNotification` in `iOS` 12 | /// and perform an action when received. 13 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 14 | struct OnDeactivateView: View { 15 | 16 | var content: Content 17 | var perform: () -> Void 18 | 19 | var body: some View { 20 | #if os(iOS) 21 | return content 22 | .onReceive(NotificationCenter.default.publisher(for: UIScene.didActivateNotification), perform: { _ in 23 | self.perform() 24 | }) 25 | #else 26 | return content 27 | #endif 28 | } 29 | 30 | } 31 | 32 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 33 | extension View { 34 | 35 | func onDeactivate(perform: @escaping () -> Void) -> some View { 36 | return OnDeactivateView(content: self, perform: perform) 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/Helpers/View+Helper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View+Helper.swift 3 | // SwiftUIPager 4 | // 5 | // Created by Fernando Moya de Rivas on 19/01/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 12 | extension View { 13 | 14 | func frame(size: CGSize) -> some View { 15 | frame(width: size.width, height: size.height) 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/Page.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Pager.swift 3 | // SwiftUIPager 4 | // 5 | // Created by Fernando Moya de Rivas on 19/01/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | import Combine 11 | 12 | /// Encapsulates `Pager` state. 13 | /// 14 | /// Initialize with one of its convenience methods: 15 | /// - `firstPage()` 16 | /// - `withIndex(_:)` 17 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 18 | public class Page: ObservableObject { 19 | 20 | // Needed for `iOS 13` or else it won't trigger an update 21 | public var objectWillChange = PassthroughSubject() 22 | var _index: Int 23 | 24 | /// Current page index. 25 | /// - Note: Modifying its value won't trigger a `SwiftUI` update, use `update(_:)` method instead. 26 | public var index: Int { 27 | get { _index } 28 | set { _index = min(totalPages - 1, max(0, newValue)) } 29 | } 30 | 31 | /// Total number of pages 32 | var totalPages: Int = Int.max 33 | 34 | #if !os(tvOS) 35 | 36 | /// `swipeGesture` translation on the X-Axis 37 | var draggingOffset: CGFloat = 0 38 | 39 | /// `swipeGesture` last translation on the X-Axis 40 | var lastDraggingValue: DragGesture.Value? 41 | 42 | /// `swipeGesture` velocity on the X-Axis 43 | var draggingVelocity: Double = 0 44 | 45 | #endif 46 | 47 | /// Increment resulting from the last swipe 48 | var pageIncrement = 0 49 | 50 | /// Initializes a new instance 51 | /// 52 | /// - Parameter page: Current page index 53 | private init(page: Int) { 54 | self._index = page 55 | } 56 | 57 | } 58 | 59 | // MARK: Public 60 | 61 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 62 | extension Page { 63 | 64 | /// An update to perform on a `Page` index 65 | public enum Update { 66 | 67 | /// Will increase the `index` by `1` 68 | case next 69 | 70 | /// Will decrease the `index` by `1` 71 | case previous 72 | 73 | /// Will move to the first page 74 | case moveToFirst 75 | 76 | /// Will move to the last page 77 | case moveToLast 78 | 79 | /// Will set the `index` to the new value 80 | case new(index: Int) 81 | } 82 | 83 | /// Convenience method to initialize a new `Page` 84 | /// 85 | /// - Parameter index: Current page index 86 | public static func withIndex(_ index: Int) -> Page { 87 | Page(page: index) 88 | } 89 | 90 | /// Convenience method to initialize a new `Page` 91 | /// 92 | /// - Parameter index: Current page index 93 | public static func first() -> Page { 94 | withIndex(0) 95 | } 96 | 97 | /// Will update `Page` accordingly and trigger `objectWillChange` 98 | /// 99 | /// - Parameter update: update to perform 100 | /// 101 | /// If you do not wish to trigger an update because you want to take control of the update, set `index` direclty 102 | public func update(_ update: Update) { 103 | switch update { 104 | case .next: 105 | index += 1 106 | case .previous: 107 | index -= 1 108 | case .moveToFirst: 109 | index = 0 110 | case .moveToLast: 111 | index = totalPages - 1 112 | case .new(let newIndex): 113 | index = newIndex 114 | } 115 | 116 | objectWillChange.send() 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageConfiguration/ContentLoadingPolicy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Fernando Moya de Rivas on 05/07/2020. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Policy to follow when loading content 11 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 12 | public enum ContentLoadingPolicy: Equatable { 13 | 14 | /// Content is loaded on demand by applying a recycling the ratio. 15 | /// 16 | /// - Parameter recyclingRatio: Manages the number of items that should be displayed in the screen. 17 | /// 18 | /// A ratio of `5`, for instance, will load enough items in memory to fill five times the size of `Pager`. 19 | /// - Note: `recyclingRatio` must be greather than `0`. 20 | case lazy(recyclingRatio: UInt) 21 | 22 | /// Choose `eager` to load all items at once 23 | case eager 24 | 25 | /// Default policy, a.k.a, `lazy(recyclingRatio: 5)` 26 | static var `default`: ContentLoadingPolicy = .lazy(recyclingRatio: 5) 27 | } 28 | 29 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageConfiguration/GesturePriority.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GesturePriority.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 01/07/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | /// Defines a set of priorities to interact with gestures 12 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 13 | public enum GesturePriority { 14 | /// Refers to `highPriorityGesture` modifier 15 | case high 16 | 17 | /// Refers to `simultaneousGesture` modifier 18 | case simultaneous 19 | 20 | /// Refers to `gesture` modifier 21 | case normal 22 | 23 | /// Default value, a.k.a, `normal` 24 | static let `default`: GesturePriority = .normal 25 | } 26 | 27 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 28 | extension View { 29 | 30 | func gesture(_ gesture: T, priority: GesturePriority) -> some View where T : Gesture { 31 | Group { 32 | if priority == .high { 33 | highPriorityGesture(gesture) 34 | } else if priority == .simultaneous { 35 | simultaneousGesture(gesture) 36 | } else { 37 | self.gesture(gesture) 38 | } 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageConfiguration/PaginationSensitivity.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PaginationSensitivity.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 12/10/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import CoreGraphics 10 | 11 | /// Defines how sensitive the pagination is to determine whether or not to move to the next the page. 12 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 13 | public enum PaginationSensitivity: Equatable { 14 | 15 | /// The shift relative to container size needs to be greater than or equal to 75% 16 | case low 17 | 18 | /// The shift relative to container size needs to be greater than or equal to 50% 19 | case medium 20 | 21 | /// The shift relative to container size needs to be greater than or equal to 25% 22 | case high 23 | 24 | /// The shift relative to container size needs to be greater than or equal to the specified value 25 | case custom(CGFloat) 26 | 27 | /// The shift relative to container size needs to be greater than or equal to 50% 28 | public static var `default`: Self = .medium 29 | 30 | var value: CGFloat { 31 | switch self { 32 | case .low: 33 | return 0.75 34 | case .high: 35 | return 0.25 36 | case .medium: 37 | return 0.5 38 | case .custom(let value): 39 | return value 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageConfiguration/PagingAnimation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PagingAnimation.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 01/08/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 12 | public typealias DraggingAnimation = PagingAnimation 13 | 14 | /// Animation to be used when the user stops dragging 15 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 16 | public enum PagingAnimation: Equatable { 17 | 18 | /// Highly steep curve. Very fast on start, slow on end. 19 | /// 20 | /// - Parameter duration: duration of the animation 21 | /// 22 | /// See the bezier curve [here](https://cubic-bezier.com/#.2,1,.9,1). 23 | case steep(duration: TimeInterval) 24 | 25 | /// Standard animation, ease-out. 26 | /// 27 | /// - Parameter duration: duration of the animation 28 | case standard(duration: TimeInterval) 29 | 30 | /// Interactive spring with a response of 0.3, dampingFraction: 0.8, and blendDuration: 0.5 31 | case interactive 32 | 33 | /// Pass your custom animation 34 | /// 35 | /// - Parameter animation: animation to be applied 36 | case custom(animation: Animation?) 37 | 38 | /// Standard animation. Single pagination `Pager` defaults to this value. Ease-out, 0.35 seconds. 39 | public static var standard: PagingAnimation = .standard(duration: 0.35) 40 | 41 | /// Highly steep curve. Very fast on start, slow on end. Multiple pagination `Pager` defaults to this value. 42 | /// See the bezier curve [here](https://cubic-bezier.com/#.2,1,.9,1). 43 | public static var steep: PagingAnimation = .steep(duration: 0.2) 44 | 45 | /// No animation applied 46 | public static var none: PagingAnimation = .custom(animation: nil) 47 | 48 | /// Translates the option selected to a `SwiftUI` animation 49 | var animation: Animation? { 50 | switch self { 51 | case .steep(let duration): 52 | return Animation.timingCurve(0.2, 1, 0.9, 1, duration: duration) 53 | case .standard(let duration): 54 | return Animation.easeOut(duration: duration) 55 | case .interactive: 56 | return .interactiveSpring() 57 | case .custom(let animation): 58 | return animation 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageConfiguration/PositionAlignment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PositionAlignment.swift 3 | // 4 | // 5 | // Created by Fernando Moya de Rivas on 24/02/2020. 6 | // 7 | 8 | import CoreGraphics 9 | 10 | /// `Alignment` determines the focused page alignment inside `Pager` 11 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 12 | public enum PositionAlignment { 13 | /// Sets the alignment to be centered 14 | case center 15 | 16 | /// Sets the alignment to be centered, but first and last pages snapping to the sides with the specified insets: 17 | /// - Left, Right if horizontal 18 | /// - Top, Bottom if vertical 19 | case justified(CGFloat) 20 | 21 | /// Sets the alignment to be at the start of the container with the specified insets: 22 | /// 23 | /// - Left, if horizontal 24 | /// - Top, if vertical 25 | case start(CGFloat) 26 | 27 | /// Sets the alignment to be at the start of the container with the specified insets: 28 | /// 29 | /// - Right, if horizontal 30 | /// - Bottom, if vertical 31 | case end(CGFloat) 32 | 33 | /// Returns the alignment insets 34 | var insets: CGFloat { 35 | switch self { 36 | case .center: 37 | return 0 38 | case .end(let insets), .start(let insets), .justified(let insets): 39 | return insets 40 | } 41 | } 42 | 43 | /// Helper to compare `Alignment` ignoring associated values 44 | func equalsIgnoreValues(_ alignment: PositionAlignment) -> Bool { 45 | switch (self, alignment) { 46 | case (.center, .center), (.justified, .justified), (.start, .start), (.end, .end): 47 | return true 48 | default: 49 | return false 50 | } 51 | } 52 | 53 | /// Sets the alignment at the start, with 0 px of margin 54 | public static var start: PositionAlignment { .start(0) } 55 | 56 | /// Sets the alignment at the end, with 0 px of margin 57 | public static var end: PositionAlignment { .end(0) } 58 | 59 | /// Sets the alignment justified, with 0 px of margin 60 | public static var justified: PositionAlignment { .justified(0) } 61 | } 62 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageConfiguration/SwipeDirection.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwipeDirection.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 01/07/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Swipe direction for a vertical `Pager` 12 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 13 | public enum HorizontalSwipeDirection { 14 | 15 | /// Pages move from left to right 16 | case leftToRight 17 | 18 | /// Pages move from right to left 19 | case rightToLeft 20 | } 21 | 22 | /// Swipe direction for a horizontal `Pager` 23 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 24 | public enum VerticalSwipeDirection { 25 | 26 | /// Pages move from top left to bottom 27 | case topToBottom 28 | 29 | /// Pages move from bottom to top 30 | case bottomToTop 31 | } 32 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageConfiguration/SwipeInteractionArea.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwipeInteractionArea.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 01/07/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | /// Defines the area in `Pager` that allows hits and listens to swipes 12 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 13 | public enum SwipeInteractionArea { 14 | 15 | /// All available space inside `Pager` 16 | case allAvailable 17 | 18 | /// Just the page frame 19 | case page 20 | } 21 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageTransition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PageTransition.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 3/6/21. 6 | // Copyright © 2021 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Holds information regarding the previous and new page 12 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 13 | public struct PageTransition { 14 | 15 | /// Current page 16 | public let currentPage: Int 17 | 18 | /// New page to transition to 19 | public let nextPage: Int 20 | 21 | /// Page Increment in absolute terms 22 | public let pageIncrement: Int 23 | } 24 | 25 | /// Errors that occur over a `PageTransition` 26 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 27 | public enum PageTransitionError: Error { 28 | 29 | /// Indicates that the transition couldn't success as the translation wasn't enough to move to the next page 30 | case draggingStopped 31 | } 32 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/SwiftUIPager/PageWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PageWrapper.swift 3 | // SwiftUIPagerExample 4 | // 5 | // Created by Fernando Moya de Rivas on 23/07/2020. 6 | // Copyright © 2020 Fernando Moya de Rivas. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Wrapper to `Pager` elements. It allows `Pager` to replicate the input data elements if required by the user. 12 | @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) 13 | struct PageWrapper: Equatable, Identifiable where Element: Equatable, ID: Hashable { 14 | 15 | /// This _id_ indicates batch iteration 16 | var batchId: UInt 17 | 18 | /// `KeyPath` to use as `Element` _id_ 19 | var keyPath: KeyPath 20 | 21 | /// Wrappes Value 22 | var element: Element 23 | 24 | /// `Identifiable` _id_ 25 | var id: String { 26 | "\(batchId)-\(element[keyPath: keyPath])" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/TrackableScrollView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TrackableScrollView.swift 3 | // yixiang-ios 4 | // 5 | // Created by Attempt D on 2020/4/18. 6 | // Copyright © 2020 Ai. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct TrackableScrollView: View where Content: View { 12 | let axis: Axis.Set 13 | let showIndicators: Bool 14 | @Binding var contentOffset: CGFloat 15 | let content: Content 16 | 17 | init(axis: Axis.Set = .vertical, showIndicators: Bool = true, contentOffset: Binding, @ViewBuilder content: ()-> Content) { 18 | 19 | self.axis = axis 20 | self.showIndicators = showIndicators 21 | self._contentOffset = contentOffset 22 | self.content = content() 23 | } 24 | 25 | var body: some View { 26 | GeometryReader { outProxy in 27 | ScrollView(self.axis, showsIndicators: self.showIndicators) { 28 | GeometryReader { inProxy in 29 | ZStack(alignment: self.axis == .vertical ? .top : .leading) { 30 | Color.clear.preference(key: ScrollOffsetPreferenceKey.self, value: [ScrollOffsetPreferenceData(offset: self.offset(outProxy, inProxy))]) 31 | } 32 | } 33 | VStack { 34 | self.content 35 | } 36 | } 37 | .onPreferenceChange(ScrollOffsetPreferenceKey.self) { (preferences) in 38 | self.contentOffset = preferences[0].offset 39 | } 40 | } 41 | } 42 | 43 | func offset(_ outProxy: GeometryProxy, _ inProxy: GeometryProxy) -> CGFloat { 44 | return self.axis == .vertical ? 45 | inProxy.frame(in: .global).minY - outProxy.frame(in: .global).minY : 46 | inProxy.frame(in: .global).minX - outProxy.frame(in: .global).minX 47 | } 48 | 49 | 50 | } 51 | 52 | private struct ScrollOffsetPreferenceKey: PreferenceKey { 53 | typealias Value = [ScrollOffsetPreferenceData] 54 | 55 | static var defaultValue: [ScrollOffsetPreferenceData] = [] 56 | 57 | static func reduce(value: inout [ScrollOffsetPreferenceData], nextValue: () -> [ScrollOffsetPreferenceData]) { 58 | value.append(contentsOf: nextValue()) 59 | } 60 | } 61 | 62 | private struct ScrollOffsetPreferenceData: Equatable { 63 | let offset: CGFloat 64 | } 65 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/chartView.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// chartView.swift 3 | //// MyBill 4 | //// 5 | //// Created by Attempt D on 2020/9/11. 6 | //// Copyright © 2020 Frank D. All rights reserved. 7 | //// 8 | // 9 | //import SwiftUI 10 | // 11 | //struct chartView: UIViewControllerRepresentable { 12 | // 13 | // @State var width:CGFloat 14 | // @State var height:CGFloat 15 | // @State var chartX : [String] 16 | // @ObservedObject var appData:AppData 17 | // @Environment(\.colorScheme) var colorScheme 18 | // func makeUIViewController(context: Context) -> UIViewController { 19 | // let uiViewController = UIViewController() 20 | // return uiViewController 21 | // } 22 | // 23 | // func updateUIViewController(_ uiViewController: UIViewController, context: Context) { 24 | // var chartView: LineChartView! 25 | // 26 | // //创建折线图组件对象 27 | // chartView = LineChartView() 28 | // chartView.frame = CGRect(x: 0, y: 0, width: self.width,height: self.height) 29 | // chartView.legend.enabled = false 30 | // chartView.leftAxis.enabled = false 31 | // chartView.leftAxis.spaceTop = 0.4 32 | // chartView.leftAxis.spaceBottom = 0.4 33 | // chartView.rightAxis.spaceTop = 0.4 34 | // chartView.rightAxis.enabled = false 35 | // 36 | // chartView.xAxis.enabled = true 37 | // 38 | // 39 | // //折线图背景色 40 | // chartView.backgroundColor = colorScheme == .dark ? UIColor.init(named: "MainCellSpacerColor_dark") : .white 41 | // 42 | // //生成数据 43 | // var dataEntries = [ChartDataEntry]() 44 | // 45 | // var data = [Double]() 46 | // 47 | // data = self.appData.weekData 48 | // 49 | // for i in 0.. ImagePicker.Coordinator { 16 | 17 | 18 | return ImagePicker.Coordinator( 19 | image: $image, 20 | isPresented: $isPresented 21 | ) 22 | } 23 | public func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIImagePickerController { 24 | let controller = UIImagePickerController() 25 | controller.delegate = context.coordinator 26 | return controller 27 | } 28 | public func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext) { 29 | // No op 30 | } 31 | } 32 | public extension ImagePicker { 33 | class Coordinator: NSObject, UINavigationControllerDelegate { 34 | @Binding var isPresented: Bool 35 | @Binding var image: UIImage? 36 | public init(image: Binding, isPresented: Binding) { 37 | self._image = image 38 | self._isPresented = isPresented 39 | } 40 | } 41 | } 42 | extension ImagePicker.Coordinator: UIImagePickerControllerDelegate { 43 | public func imagePickerController( 44 | _ picker: UIImagePickerController, 45 | didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { 46 | self.image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage 47 | isPresented = false 48 | } 49 | public func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { 50 | isPresented = false 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /MyBill/EncapsulationView/pageViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // pageViewController.swift 3 | // PageView 4 | // 5 | // Created by Attempt D on 2020/6/22. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | import UIKit 11 | 12 | struct PageViewController: UIViewControllerRepresentable { 13 | var controllers: [UIViewController] 14 | @Binding var currentPage: Int 15 | 16 | func makeCoordinator() -> Coordinator { 17 | Coordinator(self) 18 | } 19 | 20 | func makeUIViewController(context: Context) -> UIPageViewController { 21 | let pageViewController = UIPageViewController( 22 | transitionStyle: .scroll, 23 | navigationOrientation: .horizontal,options :[UIPageViewController.OptionsKey.spineLocation:NSNumber(value: .bitWidth)]) 24 | pageViewController.dataSource = context.coordinator 25 | pageViewController.delegate = context.coordinator 26 | pageViewController.setViewControllers( 27 | [controllers[currentPage]], direction: .forward, animated: true) 28 | return pageViewController 29 | 30 | } 31 | 32 | func updateUIViewController(_ pageViewController: UIPageViewController, context: Context) { 33 | 34 | pageViewController.navigationController?.setNavigationBarHidden(true, animated: false) 35 | 36 | 37 | 38 | } 39 | 40 | class Coordinator: NSObject, UIPageViewControllerDataSource, UIPageViewControllerDelegate { 41 | var parent: PageViewController 42 | 43 | init(_ pageViewController: PageViewController) { 44 | self.parent = pageViewController 45 | } 46 | 47 | func pageViewController( 48 | _ pageViewController: UIPageViewController, 49 | viewControllerBefore viewController: UIViewController) -> UIViewController? 50 | { 51 | guard let index = parent.controllers.firstIndex(of: viewController) else { 52 | return nil 53 | } 54 | if index == 0 { 55 | return nil 56 | } 57 | 58 | return parent.controllers[index - 1] 59 | } 60 | 61 | func pageViewController( 62 | _ pageViewController: UIPageViewController, 63 | viewControllerAfter viewController: UIViewController) -> UIViewController? 64 | { 65 | guard let index = parent.controllers.firstIndex(of: viewController) else { 66 | return nil 67 | } 68 | if index + 1 == parent.controllers.count { 69 | return nil 70 | } 71 | 72 | return parent.controllers[index + 1] 73 | } 74 | 75 | func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { 76 | if completed, 77 | let visibleViewController = pageViewController.viewControllers?.first, 78 | let index = parent.controllers.firstIndex(of: visibleViewController) 79 | { 80 | parent.currentPage = index 81 | } 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /MyBill/Home/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/.DS_Store -------------------------------------------------------------------------------- /MyBill/Home/._MainView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/._MainView.swift -------------------------------------------------------------------------------- /MyBill/Home/._SetInfoView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/._SetInfoView.swift -------------------------------------------------------------------------------- /MyBill/Home/child/._ChartTagle.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/._ChartTagle.swift -------------------------------------------------------------------------------- /MyBill/Home/child/._DetailView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/._DetailView.swift -------------------------------------------------------------------------------- /MyBill/Home/child/._Home.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/._Home.swift -------------------------------------------------------------------------------- /MyBill/Home/child/._MyCenterView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/._MyCenterView.swift -------------------------------------------------------------------------------- /MyBill/Home/child/._NewBuild_Update.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/._NewBuild_Update.swift -------------------------------------------------------------------------------- /MyBill/Home/child/ChartTagle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChartTagle.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2021/7/20. 6 | // Copyright © 2021 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct ChartTagle: View { 12 | 13 | @State var appData : [week] 14 | @State var time : [String] 15 | @State var hover = false 16 | @Environment(\.colorScheme) var colorScheme 17 | var body: some View { 18 | VStack{ 19 | 20 | HStack(alignment: .bottom){ 21 | 22 | ForEach(appData){ item in 23 | Rectangle() 24 | .frame(width: 12, height:CGFloat(item.money), alignment: .center) 25 | .cornerRadius(180) 26 | .foregroundColor(item.isSelect ? Color.init("MainThemeColor") : Color.init("MainThemeColor")) 27 | 28 | }.frame(width: (width-20)/8.3, alignment: .center) 29 | 30 | }.frame(width: width - 20,alignment: .center) 31 | 32 | HStack{ 33 | ForEach(time,id: \.self){ 34 | 35 | Text("\($0)") 36 | .font(.system(size: 13)) 37 | .foregroundColor(Color.init("FontColor")) 38 | .frame(width: (width-20)/8.3, alignment: .center) 39 | 40 | } 41 | } 42 | .frame(width: width - 20,alignment: .center) 43 | .padding(.bottom,10) 44 | } 45 | .frame(width: width - 20, height: height/5, alignment: .bottom) 46 | .background(self.colorScheme == .dark ? Color.init("MainCellSpacerColor_dark") :Color.white) 47 | .cornerRadius(15) 48 | } 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /MyBill/Home/child/DetailView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetailView.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/7/24. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct DetailView: View { 12 | let billData : Model 13 | var body: some View { 14 | Text(billData.doWhat) 15 | //haptic(type:.error) 16 | 17 | 18 | 19 | } 20 | } 21 | 22 | struct DetailView_Previews: PreviewProvider { 23 | static var previews: some View { 24 | DetailView(billData: Model()) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MyBill/Home/child/HomeChildView/._AllView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/HomeChildView/._AllView.swift -------------------------------------------------------------------------------- /MyBill/Home/child/HomeChildView/EarningView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EarningView.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/6/29. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct EarningView: View { 12 | @ObservedObject var appData : AppData 13 | var body: some View { 14 | ScrollView{ 15 | ForEach(appData.EaringDatas){item in 16 | NavigationLink(destination:EmptyView()){ 17 | VStack(spacing:0){ 18 | 19 | HStack{ 20 | Text("¥ \(transer(value:item.money))") 21 | .padding() 22 | .font(.system(size: 28)) 23 | .foregroundColor(.black) 24 | Spacer() 25 | Text(item.type) 26 | .padding() 27 | .foregroundColor(item.type == "支出" ? .gray:.orange) 28 | } 29 | 30 | 31 | HStack{ 32 | 33 | VStack(spacing:8){ 34 | 35 | HStack{ 36 | Text(item.doWhat) 37 | .foregroundColor(.black) 38 | .font(.system(size: 15)) 39 | Spacer() 40 | } .padding(.horizontal) 41 | 42 | 43 | 44 | HStack{ 45 | Text(item.time) 46 | .foregroundColor(.gray) 47 | .fontWeight(.light) 48 | Spacer() 49 | }.padding(.horizontal) 50 | 51 | } 52 | 53 | Image(item.type) 54 | .resizable() 55 | .scaledToFit() 56 | .frame(width: 30, height: 30) 57 | .padding(.horizontal) 58 | } 59 | 60 | 61 | } 62 | .frame(width:width-20,height: height/6,alignment: .topLeading) 63 | .background(Color.white) 64 | .cornerRadius(5) 65 | .shadow(radius: 5) 66 | .padding(.vertical,10) 67 | .padding(.horizontal,20) 68 | } 69 | .buttonStyle(PlainButtonStyle()) 70 | } 71 | .padding(.top,30) 72 | } 73 | .onAppear(){ 74 | 75 | self.appData.refreshData() 76 | 77 | } 78 | 79 | 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /MyBill/Home/child/HomeChildView/PayView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PayView.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/6/29. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct PayView: View { 12 | @ObservedObject var appData : AppData 13 | var body: some View { 14 | ScrollView{ 15 | ForEach(appData.payDatas){item in 16 | 17 | NavigationLink(destination:EmptyView()){ 18 | VStack(spacing:0){ 19 | 20 | HStack{ 21 | Text("¥ \(transer(value:item.money))") 22 | .padding() 23 | .font(.system(size: 28)) 24 | .foregroundColor(.black) 25 | Spacer() 26 | Text(item.type) 27 | .padding() 28 | .foregroundColor(item.type == "支出" ? .gray:.orange) 29 | } 30 | 31 | 32 | HStack{ 33 | 34 | VStack(spacing:8){ 35 | 36 | HStack{ 37 | Text(item.doWhat) 38 | .foregroundColor(.black) 39 | .font(.system(size: 15)) 40 | Spacer() 41 | } .padding(.horizontal) 42 | 43 | 44 | 45 | HStack{ 46 | Text(item.time) 47 | .foregroundColor(.gray) 48 | .fontWeight(.light) 49 | Spacer() 50 | }.padding(.horizontal) 51 | 52 | } 53 | 54 | Image(item.type) 55 | .resizable() 56 | .scaledToFit() 57 | .frame(width: 30, height: 30) 58 | .padding(.horizontal) 59 | 60 | } 61 | 62 | 63 | } 64 | .frame(width:width-20,height: height/6,alignment: .topLeading) 65 | .background(Color.white) 66 | .cornerRadius(5) 67 | .shadow(radius: 5) 68 | .padding(.vertical,10) 69 | .padding(.horizontal,20) 70 | } 71 | .buttonStyle(PlainButtonStyle()) 72 | } 73 | .padding(.top,30) 74 | } 75 | .onAppear(){ 76 | self.appData.refreshData() 77 | } 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/._WeekDetailView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/MyCenterchildView/._WeekDetailView.swift -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/._chartView_detail.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/MyCenterchildView/._chartView_detail.swift -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/SettingChildView/._AboutView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/MyCenterchildView/SettingChildView/._AboutView.swift -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/SettingChildView/._BackgroundEdit.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/MyCenterchildView/SettingChildView/._BackgroundEdit.swift -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/SettingChildView/._SettingChildMainView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/MyCenterchildView/SettingChildView/._SettingChildMainView.swift -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/SettingChildView/._StyleTheme.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/MyCenterchildView/SettingChildView/._StyleTheme.swift -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/SettingChildView/._SwiftUIView.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Home/child/MyCenterchildView/SettingChildView/._SwiftUIView.swift -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/SettingChildView/AboutView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AboutView.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/9/9. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct AboutView: View { 12 | @State var needdata :CGFloat = -500 13 | @State var middel = "关于" 14 | var body: some View { 15 | ZStack{ 16 | VStack{ 17 | Image("about_icon") 18 | .resizable() 19 | .frame(width: 100, height: 100, alignment: .center) 20 | .cornerRadius(90) 21 | Text("记录你的每一笔") 22 | }.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .center) 23 | 24 | 25 | 26 | MyNavigationBar(scrollViewContentOffset:$needdata, middle: $middel, right: "透明") 27 | 28 | }.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .center) 29 | .navigationBarTitle("关于",displayMode: .inline) 30 | .navigationBarHidden(true) 31 | .edgesIgnoringSafeArea(.all) 32 | 33 | 34 | } 35 | } 36 | 37 | struct AboutView_Previews: PreviewProvider { 38 | static var previews: some View { 39 | AboutView() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/SettingChildView/SettingChildMainView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingChildView.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/9/1. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct SettingChildMainView: View { 12 | let settingModel:SettingModel 13 | @ObservedObject var mycenterdata : MyInfoData 14 | @State var view = AnyView(EmptyView()) 15 | @State var window: UIWindow 16 | var body: some View { 17 | 18 | if(self.settingModel.seleterName == "资料修改"){ 19 | SetInfoView(mycenterdata: self.mycenterdata, openType: "修改") 20 | } 21 | 22 | if(self.settingModel.seleterName == "背景修改"){ 23 | BackgroundEdit(mycenterdata: self.mycenterdata) 24 | } 25 | 26 | if(self.settingModel.seleterName == "主题样式"){ 27 | StyleTheme(window: self.window) 28 | } 29 | 30 | if(self.settingModel.seleterName == "关于"){ 31 | AboutView() 32 | 33 | 34 | } 35 | 36 | } 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/SettingChildView/SwiftUIView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftUIView.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/12/23. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct SwiftUIView: View { 12 | var body: some View { 13 | FancyScrollView(title: "我的", 14 | headerHeight: 88, 15 | scrollUpHeaderBehavior: .parallax, 16 | scrollDownHeaderBehavior:.offset, 17 | cornerRadiusNub:0, 18 | showTitle:false, 19 | header: { 20 | EmptyView() 21 | 22 | 23 | 24 | }){ 25 | 26 | VStack(spacing:20){ 27 | Text("dsds") 28 | 29 | 30 | 31 | } 32 | .background(Color.init("MainCellSpacerColor")) 33 | 34 | 35 | 36 | 37 | } 38 | .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) 39 | 40 | 41 | .navigationBarTitle("我的",displayMode: .inline) 42 | .navigationBarHidden(true) 43 | } 44 | } 45 | 46 | struct SwiftUIView_Previews: PreviewProvider { 47 | static var previews: some View { 48 | SwiftUIView() 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/WeekDetailView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WeekDetailView.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/9/14. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct WeekDetailView: View { 12 | @Environment(\.colorScheme) var colorScheme 13 | var body: some View { 14 | FancyScrollView(title: "设置", 15 | headerHeight: 200, 16 | scrollUpHeaderBehavior: .parallax, 17 | scrollDownHeaderBehavior: .offset, 18 | showTitle: true, 19 | header: { Image(colorScheme == .dark ? "Setting_dark" : "Setting").resizable().scaledToFill() }) 20 | { 21 | Text("") 22 | } 23 | .navigationBarTitle("") 24 | .navigationBarHidden(true) 25 | 26 | } 27 | } 28 | 29 | struct WeekDetailView_Previews: PreviewProvider { 30 | static var previews: some View { 31 | WeekDetailView() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /MyBill/Home/child/MyCenterchildView/chartView_detail.swift: -------------------------------------------------------------------------------- 1 | // 2 | // chartView_detail.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/11/27. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct chartView_detail: View { 12 | 13 | @State var title = "称生55" 14 | @State var appData : [Double] 15 | @Environment(\.presentationMode) var persentationMode 16 | @Environment(\.colorScheme) var colorScheme 17 | var body: some View { 18 | 19 | VStack(alignment:.center){ 20 | 21 | HStack{ 22 | 23 | Button(action: { 24 | self.persentationMode.wrappedValue.dismiss() 25 | }) { 26 | Image(systemName: "chevron.down") 27 | .scaleEffect(1.2) 28 | .foregroundColor(colorScheme == .dark ? .white :.black) 29 | .padding(.leading,20) 30 | } 31 | 32 | Text("我的") 33 | } 34 | .frame(width: width, alignment: .leading) 35 | .padding(.top,20) 36 | 37 | ScrollView{ 38 | 39 | HStack{ 40 | Text("详情面板") 41 | .font(.title) 42 | } 43 | .padding(.leading,20) 44 | .frame(width: width, alignment: .leading) 45 | 46 | 47 | } 48 | 49 | } 50 | 51 | 52 | 53 | } 54 | } 55 | 56 | struct chartView_detail_Previews: PreviewProvider { 57 | static var previews: some View { 58 | chartView_detail(appData: [1,2,3,4,5]) 59 | .padding(4.0) 60 | .previewDevice("iPhone 11pro") 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /MyBill/Home/child/RememberView.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// HomeView.swift 3 | //// PageView 4 | //// 5 | //// Created by Attempt D on 2020/6/22. 6 | //// Copyright © 2020 Frank D. All rights reserved. 7 | //// 8 | // 9 | //import SwiftUI 10 | // 11 | //struct RememberView: View { 12 | // @State var pageType = 0 13 | // @State var haveTo : CGFloat = -height 14 | // 15 | // @State var barTitle = ["钱记","收入","支出"] 16 | // @ObservedObject var folderData : FolderData 17 | // var body: some View { 18 | // 19 | // ZStack(alignment:.top){ 20 | // 21 | // 22 | // PageViewController(controllers: 23 | // [UIHostingController(rootView: ) 24 | // ,UIHostingController(rootView: EarningView(appData: self.appData)), 25 | // UIHostingController(rootView: PayView(appData: self.appData))], currentPage: $pageType) 26 | // .padding(.top,60) 27 | // 28 | // 29 | // 30 | // MyNavigationBar(scrollViewContentOffset: self.$haveTo, middle: self.$barTitle[pageType], right: "透明") 31 | // 32 | // }.edgesIgnoringSafeArea(.top) 33 | // 34 | // } 35 | //} 36 | // 37 | // 38 | -------------------------------------------------------------------------------- /MyBill/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | zh_CN 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | LSRequiresIPhoneOS 22 | 23 | NSCameraUsageDescription 24 | App需要您的同意,才能访问相机 25 | NSMicrophoneUsageDescription 26 | App需要您的同意,才能访问麦克风 27 | NSPhotoLibraryUsageDescription 28 | App需要您的同意,才能访问相册 29 | NSUserActivityTypes 30 | 31 | ConfigurationIntent 32 | 33 | UIApplicationSceneManifest 34 | 35 | UIApplicationSupportsMultipleScenes 36 | 37 | UISceneConfigurations 38 | 39 | UIWindowSceneSessionRoleApplication 40 | 41 | 42 | UISceneConfigurationName 43 | Default Configuration 44 | UISceneDelegateClassName 45 | $(PRODUCT_MODULE_NAME).SceneDelegate 46 | 47 | 48 | 49 | 50 | UIBackgroundModes 51 | 52 | fetch 53 | remote-notification 54 | 55 | UILaunchStoryboardName 56 | LaunchScreen 57 | UIMainStoryboardFile 58 | LaunchScreen 59 | UIRequiredDeviceCapabilities 60 | 61 | armv7 62 | 63 | UIStatusBarStyle 64 | UIStatusBarStyleDarkContent 65 | UISupportedInterfaceOrientations 66 | 67 | UIInterfaceOrientationPortrait 68 | 69 | UISupportedInterfaceOrientations~ipad 70 | 71 | UIInterfaceOrientationPortrait 72 | UIInterfaceOrientationPortraitUpsideDown 73 | UIInterfaceOrientationLandscapeLeft 74 | UIInterfaceOrientationLandscapeRight 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /MyBill/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MyBill/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/6/22. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | 22 | // Get the managed object context from the shared persistent container. 23 | let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext 24 | 25 | // Create the SwiftUI view and set the context as the value for the managedObjectContext environment keyPath. 26 | // Add `@Environment(\.managedObjectContext)` in the views that will need the context. 27 | 28 | // Use a UIHostingController as window root view controller. 29 | if let windowScene = scene as? UIWindowScene { 30 | 31 | let window = UIWindow(windowScene: windowScene) 32 | 33 | let contentView = TranserView(window: window).environment(\.managedObjectContext, context) 34 | 35 | let style = userDefault.string(forKey: "style") 36 | 37 | switch style { 38 | case "dark": 39 | window.overrideUserInterfaceStyle = .dark 40 | case "light": 41 | window.overrideUserInterfaceStyle = .light 42 | default: 43 | window.overrideUserInterfaceStyle = .unspecified 44 | } 45 | 46 | 47 | window.rootViewController = MyHontingController(rootView: AnyView(contentView)) 48 | self.window = window 49 | window.makeKeyAndVisible() 50 | } 51 | 52 | let tapGesture = AnyGestureRecognizer(target: window, action:#selector(UIView.endEditing)) 53 | tapGesture.requiresExclusiveTouchType = false 54 | tapGesture.cancelsTouchesInView = false 55 | tapGesture.delegate = self //I don't use window as delegate to minimize possible side effects 56 | window?.addGestureRecognizer(tapGesture) 57 | } 58 | 59 | 60 | func sceneDidDisconnect(_ scene: UIScene) { 61 | // Called as the scene is being released by the system. 62 | // This occurs shortly after the scene enters the background, or when its session is discarded. 63 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 64 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 65 | } 66 | 67 | func sceneDidBecomeActive(_ scene: UIScene) { 68 | // Called when the scene has moved from an inactive state to an active state. 69 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 70 | } 71 | 72 | func sceneWillResignActive(_ scene: UIScene) { 73 | // Called when the scene will move from an active state to an inactive state. 74 | // This may occur due to temporary interruptions (ex. an incoming phone call). 75 | } 76 | 77 | func sceneWillEnterForeground(_ scene: UIScene) { 78 | // Called as the scene transitions from the background to the foreground. 79 | // Use this method to undo the changes made on entering the background. 80 | } 81 | 82 | func sceneDidEnterBackground(_ scene: UIScene) { 83 | // Called as the scene transitions from the foreground to the background. 84 | // Use this method to save data, release shared resources, and store enough scene-specific state information 85 | // to restore the scene back to its current state. 86 | 87 | // Save changes in the application's managed object context when the application transitions to the background. 88 | (UIApplication.shared.delegate as? AppDelegate)?.saveContext() 89 | } 90 | 91 | 92 | } 93 | 94 | extension SceneDelegate: UIGestureRecognizerDelegate { 95 | func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { 96 | return true 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /MyBill/SearchView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SearchView.swift 3 | // JFQ 4 | // 5 | // Created by Attempt D on 2020/3/24. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct SearchBar: UIViewRepresentable { 12 | 13 | @Binding var text: String 14 | @Binding var clean : Bool 15 | 16 | class Coordinator: NSObject, UISearchBarDelegate { 17 | 18 | @Binding var text: String 19 | 20 | init(text: Binding) { 21 | _text = text 22 | } 23 | 24 | func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { 25 | 26 | text = searchText 27 | } 28 | } 29 | 30 | func makeCoordinator() -> SearchBar.Coordinator { 31 | 32 | return Coordinator(text: $text) 33 | } 34 | 35 | func makeUIView(context: UIViewRepresentableContext) -> UISearchBar { 36 | let searchBar = UISearchBar(frame: .zero) 37 | searchBar.delegate = context.coordinator 38 | searchBar.searchBarStyle = .minimal 39 | searchBar.barStyle = .black 40 | searchBar.backgroundColor = UIColor.init(named: "首页标题背景色") 41 | searchBar.barTintColor = .white 42 | searchBar.tintColor = .white 43 | searchBar.setImage(UIImage(named: "search"), for: .search, state: .normal) 44 | 45 | return searchBar 46 | } 47 | 48 | func updateUIView(_ uiView: UISearchBar, context: UIViewRepresentableContext) { 49 | 50 | DispatchQueue.main.async { 51 | if self.clean == false{ 52 | self.text.removeAll() 53 | } 54 | } 55 | 56 | uiView.text = text 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /MyBill/Tools/._TimeTools.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/MyBill/Tools/._TimeTools.swift -------------------------------------------------------------------------------- /MyBill/Tools/ImageTranser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageTranser.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/8/13. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | 13 | class ImageTranser { 14 | func ImageToData(image : UIImage) -> Data{ 15 | let data = image.jpegData(compressionQuality: 0.3) 16 | return data! 17 | 18 | } 19 | 20 | func DataToImage(data : Data) -> UIImage { 21 | let uiImage: UIImage = UIImage(data: data)! 22 | return uiImage 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /MyBill/Tools/NumberTranser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NumberTranser.swift 3 | // pageView 4 | // 5 | // Created by Attempt D on 2020/6/29. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | func transer (value:Double) ->String{ 13 | let num = NSNumber(value: value) 14 | let numberFormatter = NumberFormatter() 15 | 16 | numberFormatter.maximumFractionDigits = 2 //保留小数点后面的2位 17 | return numberFormatter.string(from: num) ?? "" 18 | 19 | } 20 | 21 | func getArrayFromJSONString(jsonString:String) ->NSArray{ 22 | 23 | let jsonData:Data = jsonString.data(using: .utf8)! 24 | 25 | let array = try? JSONSerialization.jsonObject(with: jsonData, options: .mutableContainers) 26 | if array != nil { 27 | return array as! NSArray 28 | } 29 | return array as! NSArray 30 | 31 | } 32 | 33 | func getString(time :String ,min:Int,max:Int) -> String{ 34 | 35 | let index1 = time.index(time.startIndex,offsetBy: min) 36 | let index2 = time.index(time.startIndex,offsetBy: max) 37 | 38 | let sub4 = time[index1..String{ 15 | let dateFormatter = DateFormatter() 16 | dateFormatter.dateFormat = type 17 | return dateFormatter.string(from: date) 18 | } 19 | 20 | func getDay(value : Int,Timetype : String) ->String{ 21 | let calendar = Calendar.current 22 | let twoDaysAgo = calendar.date(byAdding: .day, value: value, to: Date())! 23 | let formatter = DateFormatter() 24 | formatter.dateFormat = Timetype 25 | let date = formatter.string(from: twoDaysAgo) 26 | return date 27 | } 28 | 29 | 30 | func getMouth(value : Int,Timetype : String) ->String{ 31 | let calendar = Calendar.current 32 | let twoDaysAgo = calendar.date(byAdding: .month, value: value, to: Date())! 33 | let formatter = DateFormatter() 34 | formatter.dateFormat = Timetype 35 | let date = formatter.string(from: twoDaysAgo) 36 | return date 37 | } 38 | 39 | func stringConvertDate(string:String) -> Date { 40 | let dateFormatter = DateFormatter.init() 41 | dateFormatter.dateFormat = "yyyy年MM月dd日 HH:mm:ss" 42 | let date = dateFormatter.date(from: string) 43 | return date! 44 | } 45 | 46 | 47 | } 48 | func getweekTime() ->[String] { 49 | var week = [String]() 50 | for i in 0 ..< 7{ 51 | if i == 0{ 52 | week.append("今天") 53 | }else if -i == -1 { 54 | week.append("昨天") 55 | }else if -i == -2 { 56 | week.append("前天") 57 | }else{ 58 | week.append(TimeTools().getDay(value: -i, Timetype: "MM-dd")) 59 | } 60 | } 61 | return week 62 | } 63 | func getMouthTime() ->[String] { 64 | var mouth = [String]() 65 | for i in 0 ..< 7{ 66 | if i == 0{ 67 | mouth.append("本月") 68 | }else if -i == -1 { 69 | mouth.append("上月") 70 | }else{ 71 | mouth.append(TimeTools().getMouth(value: -i, Timetype: "MM月")) 72 | } 73 | } 74 | return mouth 75 | } 76 | -------------------------------------------------------------------------------- /MyBill/ToolsView/StatusBarLight.swift: -------------------------------------------------------------------------------- 1 | // 2 | // statusbarlight.swift 3 | // yixiang-ios 4 | // 5 | // Created by Attempt D on 2020/4/12. 6 | // Copyright © 2020 Ai. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | class MyHontingController: UIHostingController { 12 | var statusBarStyle: UIStatusBarStyle = .default { 13 | didSet { 14 | self.setNeedsStatusBarAppearanceUpdate() 15 | } 16 | } 17 | 18 | @objc override var preferredStatusBarStyle: UIStatusBarStyle { 19 | return statusBarStyle 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyBill/TranserView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftUIView.swift 3 | // MyBill 4 | // 5 | // Created by Attempt D on 2020/8/13. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct TranserView: View { 12 | @ObservedObject var mycenterdata = MyInfoData() 13 | @State var window: UIWindow 14 | var body: some View { 15 | 16 | VStack{ 17 | if mycenterdata.ToMain { 18 | MainView(mycenterdata:mycenterdata,window: self.window) 19 | }else{ 20 | SetInfoView(mycenterdata: mycenterdata, openType: "新建") 21 | } 22 | }.transition(.identity) 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /MyBill/pageView.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MyBill/pageView.xcdatamodeld/pageView.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /MyBill/zh.lproj/LaunchScreen.strings: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /MyBill/小猪罐.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftUI-MyBill 2 | 3 | 一个使用SwiftUI开发的本地记账app 4 | 在其中,有数据库操作类文件,暂不开放,可以自己实现数据库操作,本app中使用realm数据库操作,大多数代码中使用方法为Realm().方法名 5 | 6 | 已经适配黑暗模式,其方法很是生硬,暂时我并不知道有更好的方法实现,还望大家指导,已经能修改自己的用户名,头像等,目前初始头像还是那张网络找到的图片,后期会更换,暂时更换是也不能剪辑图片,后期也会更新,主页也可更换背景,同样无法剪辑图片 7 | 8 | 9 | ![](https://github.com/AttemptD/SwiftUI-MyBill/blob/master/RPReplay_Final1597018389.gif) 10 | 11 | ![](https://github.com/AttemptD/SwiftUI-MyBill/blob/master/RPReplay_Final1599448204%20-%2001.gif) 12 | -------------------------------------------------------------------------------- /RPReplay_Final1597018389.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/RPReplay_Final1597018389.gif -------------------------------------------------------------------------------- /RPReplay_Final1599448204 - 01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/RPReplay_Final1599448204 - 01.gif -------------------------------------------------------------------------------- /pageViewTests/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/pageViewTests/.DS_Store -------------------------------------------------------------------------------- /pageViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /pageViewTests/pageViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // pageViewTests.swift 3 | // pageViewTests 4 | // 5 | // Created by Attempt D on 2020/6/22. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import pageView 11 | 12 | class pageViewTests: XCTestCase { 13 | 14 | override func setUpWithError() throws { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDownWithError() throws { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() throws { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() throws { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /pageViewUITests/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AttemptD/SwiftUI-MyBill/c3233985efa090a61cb1ec4e02420107c46260f7/pageViewUITests/.DS_Store -------------------------------------------------------------------------------- /pageViewUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /pageViewUITests/pageViewUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // pageViewUITests.swift 3 | // pageViewUITests 4 | // 5 | // Created by Attempt D on 2020/6/22. 6 | // Copyright © 2020 Frank D. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class pageViewUITests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | 16 | // In UI tests it is usually best to stop immediately when a failure occurs. 17 | continueAfterFailure = false 18 | 19 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 20 | } 21 | 22 | override func tearDownWithError() throws { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | } 25 | 26 | func testExample() throws { 27 | // UI tests must launch the application that they test. 28 | let app = XCUIApplication() 29 | app.launch() 30 | 31 | // Use recording to get started writing UI tests. 32 | // Use XCTAssert and related functions to verify your tests produce the correct results. 33 | } 34 | 35 | func testLaunchPerformance() throws { 36 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 37 | // This measures how long it takes to launch your application. 38 | measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) { 39 | XCUIApplication().launch() 40 | } 41 | } 42 | } 43 | } 44 | --------------------------------------------------------------------------------