commit e83f58454f1c6565574e66ec4c4e423dff0b23ad Author: 忆海16 <> Date: Mon Jul 22 15:18:42 2024 +0800 框架 diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..e2d61ab --- /dev/null +++ b/Podfile @@ -0,0 +1,22 @@ +# Uncomment the next line to define a global platform for your project +# platform :ios, '9.0' + +target 'WallpaperHD_Live' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + + pod 'SnapKit' + #pod 'AFNetworking' + pod 'SDWebImage' + pod 'IQKeyboardManagerSwift' + pod 'BRPickerView' + pod 'Alamofire' + pod 'FSPagerView' + pod 'SVProgressHUD' + pod 'CYLTabBarController' + pod 'GYSide' + pod 'JXSegmentedView' + pod 'MJExtension' + pod 'MJRefresh' + +end diff --git a/WallpaperHD_Live.xcodeproj/project.pbxproj b/WallpaperHD_Live.xcodeproj/project.pbxproj new file mode 100644 index 0000000..810fae6 --- /dev/null +++ b/WallpaperHD_Live.xcodeproj/project.pbxproj @@ -0,0 +1,643 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 20E56B217F7725712DE82B32 /* Pods_WallpaperHD_Live.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F59CBF68E08818FF22B15165 /* Pods_WallpaperHD_Live.framework */; }; + 75B426A02C4E092C001844C2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B4269F2C4E092C001844C2 /* AppDelegate.swift */; }; + 75B426A42C4E092C001844C2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426A32C4E092C001844C2 /* ViewController.swift */; }; + 75B426A72C4E092C001844C2 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 75B426A62C4E092C001844C2 /* Base */; }; + 75B426A92C4E092F001844C2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75B426A82C4E092F001844C2 /* Assets.xcassets */; }; + 75B426AC2C4E092F001844C2 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 75B426AB2C4E092F001844C2 /* Base */; }; + 75B426B42C4E0CF5001844C2 /* WP_RootVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426B32C4E0CF5001844C2 /* WP_RootVC.swift */; }; + 75B426B82C4E0D21001844C2 /* WP_RootNAV.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426B72C4E0D21001844C2 /* WP_RootNAV.swift */; }; + 75B426BE2C4E1046001844C2 /* WP_TabButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426BC2C4E1046001844C2 /* WP_TabButton.swift */; }; + 75B426BF2C4E1046001844C2 /* WP_TabbarCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426BD2C4E1046001844C2 /* WP_TabbarCommon.swift */; }; + 75B426C12C4E10D7001844C2 /* WP_TabBarVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426C02C4E10D7001844C2 /* WP_TabBarVC.swift */; }; + 75B426CA2C4E2B25001844C2 /* WP_HomeVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B426C92C4E2B25001844C2 /* WP_HomeVC.xib */; }; + 75B426CB2C4E2B25001844C2 /* WP_HomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426C82C4E2B25001844C2 /* WP_HomeVC.swift */; }; + 75B426CE2C4E2B31001844C2 /* WP_RankingVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B426CD2C4E2B31001844C2 /* WP_RankingVC.xib */; }; + 75B426CF2C4E2B31001844C2 /* WP_RankingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426CC2C4E2B31001844C2 /* WP_RankingVC.swift */; }; + 75B426D22C4E2B49001844C2 /* WP_MineVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B426D12C4E2B49001844C2 /* WP_MineVC.xib */; }; + 75B426D32C4E2B49001844C2 /* WP_MineVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426D02C4E2B49001844C2 /* WP_MineVC.swift */; }; + 75B426D62C4E2B9F001844C2 /* colorManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426D52C4E2B9F001844C2 /* colorManager.swift */; }; + 75B426D82C4E36D9001844C2 /* my_wallpaper.json in Resources */ = {isa = PBXBuildFile; fileRef = 75B426D72C4E36D9001844C2 /* my_wallpaper.json */; }; + 75B426DB2C4E3705001844C2 /* WP_NewestVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B426DA2C4E3705001844C2 /* WP_NewestVC.xib */; }; + 75B426DC2C4E3705001844C2 /* WP_NewestVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426D92C4E3705001844C2 /* WP_NewestVC.swift */; }; + 75B426DF2C4E3711001844C2 /* WP_PopularVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B426DE2C4E3711001844C2 /* WP_PopularVC.xib */; }; + 75B426E02C4E3711001844C2 /* WP_PopularVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426DD2C4E3711001844C2 /* WP_PopularVC.swift */; }; + 75B426E32C4E371D001844C2 /* WP_Christmas.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B426E22C4E371D001844C2 /* WP_Christmas.xib */; }; + 75B426E42C4E371D001844C2 /* WP_Christmas.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426E12C4E371D001844C2 /* WP_Christmas.swift */; }; + 75B426E72C4E372C001844C2 /* WP_FlowersVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B426E62C4E372C001844C2 /* WP_FlowersVC.xib */; }; + 75B426E82C4E372C001844C2 /* WP_FlowersVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426E52C4E372C001844C2 /* WP_FlowersVC.swift */; }; + 75B426EB2C4E38F9001844C2 /* WallpaperModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426EA2C4E38F9001844C2 /* WallpaperModel.swift */; }; + 75B426ED2C4E3A02001844C2 /* CustomCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426EC2C4E3A02001844C2 /* CustomCollectionViewFlowLayout.swift */; }; + 75B426F12C4E3A3C001844C2 /* WP_WallpaperCollectionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B426F02C4E3A3C001844C2 /* WP_WallpaperCollectionCell.xib */; }; + 75B426F22C4E3A3C001844C2 /* WP_WallpaperCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B426EF2C4E3A3C001844C2 /* WP_WallpaperCollectionCell.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 75B4269C2C4E092C001844C2 /* WallpaperHD_Live.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WallpaperHD_Live.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 75B4269F2C4E092C001844C2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 75B426A32C4E092C001844C2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 75B426A62C4E092C001844C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 75B426A82C4E092F001844C2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 75B426AB2C4E092F001844C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 75B426AD2C4E092F001844C2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 75B426B32C4E0CF5001844C2 /* WP_RootVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_RootVC.swift; sourceTree = ""; }; + 75B426B72C4E0D21001844C2 /* WP_RootNAV.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_RootNAV.swift; sourceTree = ""; }; + 75B426BA2C4E0FBB001844C2 /* waperLivePCH.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = waperLivePCH.pch; sourceTree = ""; }; + 75B426BB2C4E0FDA001844C2 /* wallpaperLive_Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wallpaperLive_Header.h; sourceTree = ""; }; + 75B426BC2C4E1046001844C2 /* WP_TabButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WP_TabButton.swift; sourceTree = ""; }; + 75B426BD2C4E1046001844C2 /* WP_TabbarCommon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WP_TabbarCommon.swift; sourceTree = ""; }; + 75B426C02C4E10D7001844C2 /* WP_TabBarVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_TabBarVC.swift; sourceTree = ""; }; + 75B426C82C4E2B25001844C2 /* WP_HomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_HomeVC.swift; sourceTree = ""; }; + 75B426C92C4E2B25001844C2 /* WP_HomeVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WP_HomeVC.xib; sourceTree = ""; }; + 75B426CC2C4E2B31001844C2 /* WP_RankingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_RankingVC.swift; sourceTree = ""; }; + 75B426CD2C4E2B31001844C2 /* WP_RankingVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WP_RankingVC.xib; sourceTree = ""; }; + 75B426D02C4E2B49001844C2 /* WP_MineVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_MineVC.swift; sourceTree = ""; }; + 75B426D12C4E2B49001844C2 /* WP_MineVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WP_MineVC.xib; sourceTree = ""; }; + 75B426D52C4E2B9F001844C2 /* colorManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = colorManager.swift; sourceTree = ""; }; + 75B426D72C4E36D9001844C2 /* my_wallpaper.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = my_wallpaper.json; sourceTree = ""; }; + 75B426D92C4E3705001844C2 /* WP_NewestVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_NewestVC.swift; sourceTree = ""; }; + 75B426DA2C4E3705001844C2 /* WP_NewestVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WP_NewestVC.xib; sourceTree = ""; }; + 75B426DD2C4E3711001844C2 /* WP_PopularVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_PopularVC.swift; sourceTree = ""; }; + 75B426DE2C4E3711001844C2 /* WP_PopularVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WP_PopularVC.xib; sourceTree = ""; }; + 75B426E12C4E371D001844C2 /* WP_Christmas.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_Christmas.swift; sourceTree = ""; }; + 75B426E22C4E371D001844C2 /* WP_Christmas.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WP_Christmas.xib; sourceTree = ""; }; + 75B426E52C4E372C001844C2 /* WP_FlowersVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_FlowersVC.swift; sourceTree = ""; }; + 75B426E62C4E372C001844C2 /* WP_FlowersVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WP_FlowersVC.xib; sourceTree = ""; }; + 75B426EA2C4E38F9001844C2 /* WallpaperModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WallpaperModel.swift; sourceTree = ""; }; + 75B426EC2C4E3A02001844C2 /* CustomCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomCollectionViewFlowLayout.swift; sourceTree = ""; }; + 75B426EF2C4E3A3C001844C2 /* WP_WallpaperCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WP_WallpaperCollectionCell.swift; sourceTree = ""; }; + 75B426F02C4E3A3C001844C2 /* WP_WallpaperCollectionCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WP_WallpaperCollectionCell.xib; sourceTree = ""; }; + 9CBEA2442AE6AC8044848FC3 /* Pods-WallpaperHD_Live.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WallpaperHD_Live.release.xcconfig"; path = "Target Support Files/Pods-WallpaperHD_Live/Pods-WallpaperHD_Live.release.xcconfig"; sourceTree = ""; }; + A14E883F09B5C78F804A4357 /* Pods-WallpaperHD_Live.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WallpaperHD_Live.debug.xcconfig"; path = "Target Support Files/Pods-WallpaperHD_Live/Pods-WallpaperHD_Live.debug.xcconfig"; sourceTree = ""; }; + F59CBF68E08818FF22B15165 /* Pods_WallpaperHD_Live.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WallpaperHD_Live.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 75B426992C4E092C001844C2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 20E56B217F7725712DE82B32 /* Pods_WallpaperHD_Live.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3B26693A1DA3C12D1BA78081 /* Frameworks */ = { + isa = PBXGroup; + children = ( + F59CBF68E08818FF22B15165 /* Pods_WallpaperHD_Live.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 5C323131DEFE000D71DE4890 /* Pods */ = { + isa = PBXGroup; + children = ( + A14E883F09B5C78F804A4357 /* Pods-WallpaperHD_Live.debug.xcconfig */, + 9CBEA2442AE6AC8044848FC3 /* Pods-WallpaperHD_Live.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 75B426932C4E092C001844C2 = { + isa = PBXGroup; + children = ( + 75B4269E2C4E092C001844C2 /* WallpaperHD_Live */, + 75B4269D2C4E092C001844C2 /* Products */, + 5C323131DEFE000D71DE4890 /* Pods */, + 3B26693A1DA3C12D1BA78081 /* Frameworks */, + ); + sourceTree = ""; + }; + 75B4269D2C4E092C001844C2 /* Products */ = { + isa = PBXGroup; + children = ( + 75B4269C2C4E092C001844C2 /* WallpaperHD_Live.app */, + ); + name = Products; + sourceTree = ""; + }; + 75B4269E2C4E092C001844C2 /* WallpaperHD_Live */ = { + isa = PBXGroup; + children = ( + 75B426D42C4E2B89001844C2 /* Tool */, + 75B426C62C4E2AF6001844C2 /* Ranking */, + 75B426C42C4E2AEE001844C2 /* Mine */, + 75B426C22C4E2AE4001844C2 /* Home */, + 75B426B92C4E0FA2001844C2 /* Header */, + 75B426B62C4E0D01001844C2 /* Root */, + 75B4269F2C4E092C001844C2 /* AppDelegate.swift */, + 75B426A32C4E092C001844C2 /* ViewController.swift */, + 75B426A52C4E092C001844C2 /* Main.storyboard */, + 75B426A82C4E092F001844C2 /* Assets.xcassets */, + 75B426AA2C4E092F001844C2 /* LaunchScreen.storyboard */, + 75B426AD2C4E092F001844C2 /* Info.plist */, + ); + path = WallpaperHD_Live; + sourceTree = ""; + }; + 75B426B62C4E0D01001844C2 /* Root */ = { + isa = PBXGroup; + children = ( + 75B426BD2C4E1046001844C2 /* WP_TabbarCommon.swift */, + 75B426BC2C4E1046001844C2 /* WP_TabButton.swift */, + 75B426B32C4E0CF5001844C2 /* WP_RootVC.swift */, + 75B426B72C4E0D21001844C2 /* WP_RootNAV.swift */, + 75B426C02C4E10D7001844C2 /* WP_TabBarVC.swift */, + ); + path = Root; + sourceTree = ""; + }; + 75B426B92C4E0FA2001844C2 /* Header */ = { + isa = PBXGroup; + children = ( + 75B426BA2C4E0FBB001844C2 /* waperLivePCH.pch */, + 75B426BB2C4E0FDA001844C2 /* wallpaperLive_Header.h */, + ); + path = Header; + sourceTree = ""; + }; + 75B426C22C4E2AE4001844C2 /* Home */ = { + isa = PBXGroup; + children = ( + 75B426EE2C4E3A12001844C2 /* V */, + 75B426E92C4E38B1001844C2 /* M */, + 75B426C32C4E2AEB001844C2 /* C */, + ); + path = Home; + sourceTree = ""; + }; + 75B426C32C4E2AEB001844C2 /* C */ = { + isa = PBXGroup; + children = ( + 75B426C82C4E2B25001844C2 /* WP_HomeVC.swift */, + 75B426C92C4E2B25001844C2 /* WP_HomeVC.xib */, + 75B426D92C4E3705001844C2 /* WP_NewestVC.swift */, + 75B426DA2C4E3705001844C2 /* WP_NewestVC.xib */, + 75B426DD2C4E3711001844C2 /* WP_PopularVC.swift */, + 75B426DE2C4E3711001844C2 /* WP_PopularVC.xib */, + 75B426E12C4E371D001844C2 /* WP_Christmas.swift */, + 75B426E22C4E371D001844C2 /* WP_Christmas.xib */, + 75B426E52C4E372C001844C2 /* WP_FlowersVC.swift */, + 75B426E62C4E372C001844C2 /* WP_FlowersVC.xib */, + ); + path = C; + sourceTree = ""; + }; + 75B426C42C4E2AEE001844C2 /* Mine */ = { + isa = PBXGroup; + children = ( + 75B426C52C4E2AF3001844C2 /* C */, + ); + path = Mine; + sourceTree = ""; + }; + 75B426C52C4E2AF3001844C2 /* C */ = { + isa = PBXGroup; + children = ( + 75B426D02C4E2B49001844C2 /* WP_MineVC.swift */, + 75B426D12C4E2B49001844C2 /* WP_MineVC.xib */, + ); + path = C; + sourceTree = ""; + }; + 75B426C62C4E2AF6001844C2 /* Ranking */ = { + isa = PBXGroup; + children = ( + 75B426C72C4E2B00001844C2 /* C */, + ); + path = Ranking; + sourceTree = ""; + }; + 75B426C72C4E2B00001844C2 /* C */ = { + isa = PBXGroup; + children = ( + 75B426CC2C4E2B31001844C2 /* WP_RankingVC.swift */, + 75B426CD2C4E2B31001844C2 /* WP_RankingVC.xib */, + ); + path = C; + sourceTree = ""; + }; + 75B426D42C4E2B89001844C2 /* Tool */ = { + isa = PBXGroup; + children = ( + 75B426EC2C4E3A02001844C2 /* CustomCollectionViewFlowLayout.swift */, + 75B426D72C4E36D9001844C2 /* my_wallpaper.json */, + 75B426D52C4E2B9F001844C2 /* colorManager.swift */, + ); + path = Tool; + sourceTree = ""; + }; + 75B426E92C4E38B1001844C2 /* M */ = { + isa = PBXGroup; + children = ( + 75B426EA2C4E38F9001844C2 /* WallpaperModel.swift */, + ); + path = M; + sourceTree = ""; + }; + 75B426EE2C4E3A12001844C2 /* V */ = { + isa = PBXGroup; + children = ( + 75B426EF2C4E3A3C001844C2 /* WP_WallpaperCollectionCell.swift */, + 75B426F02C4E3A3C001844C2 /* WP_WallpaperCollectionCell.xib */, + ); + path = V; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 75B4269B2C4E092C001844C2 /* WallpaperHD_Live */ = { + isa = PBXNativeTarget; + buildConfigurationList = 75B426B02C4E092F001844C2 /* Build configuration list for PBXNativeTarget "WallpaperHD_Live" */; + buildPhases = ( + 023EE99FFD0E0E6657209E48 /* [CP] Check Pods Manifest.lock */, + 75B426982C4E092C001844C2 /* Sources */, + 75B426992C4E092C001844C2 /* Frameworks */, + 75B4269A2C4E092C001844C2 /* Resources */, + DB736BC1CC064FEBC287AA87 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WallpaperHD_Live; + productName = WallpaperHD_Live; + productReference = 75B4269C2C4E092C001844C2 /* WallpaperHD_Live.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 75B426942C4E092C001844C2 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + CLASSPREFIX = WP_; + LastSwiftUpdateCheck = 1530; + LastUpgradeCheck = 1530; + TargetAttributes = { + 75B4269B2C4E092C001844C2 = { + CreatedOnToolsVersion = 15.3; + }; + }; + }; + buildConfigurationList = 75B426972C4E092C001844C2 /* Build configuration list for PBXProject "WallpaperHD_Live" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 75B426932C4E092C001844C2; + productRefGroup = 75B4269D2C4E092C001844C2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 75B4269B2C4E092C001844C2 /* WallpaperHD_Live */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 75B4269A2C4E092C001844C2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 75B426D82C4E36D9001844C2 /* my_wallpaper.json in Resources */, + 75B426E72C4E372C001844C2 /* WP_FlowersVC.xib in Resources */, + 75B426DF2C4E3711001844C2 /* WP_PopularVC.xib in Resources */, + 75B426D22C4E2B49001844C2 /* WP_MineVC.xib in Resources */, + 75B426E32C4E371D001844C2 /* WP_Christmas.xib in Resources */, + 75B426A92C4E092F001844C2 /* Assets.xcassets in Resources */, + 75B426AC2C4E092F001844C2 /* Base in Resources */, + 75B426CE2C4E2B31001844C2 /* WP_RankingVC.xib in Resources */, + 75B426DB2C4E3705001844C2 /* WP_NewestVC.xib in Resources */, + 75B426F12C4E3A3C001844C2 /* WP_WallpaperCollectionCell.xib in Resources */, + 75B426CA2C4E2B25001844C2 /* WP_HomeVC.xib in Resources */, + 75B426A72C4E092C001844C2 /* Base in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 023EE99FFD0E0E6657209E48 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-WallpaperHD_Live-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + DB736BC1CC064FEBC287AA87 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-WallpaperHD_Live/Pods-WallpaperHD_Live-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-WallpaperHD_Live/Pods-WallpaperHD_Live-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WallpaperHD_Live/Pods-WallpaperHD_Live-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 75B426982C4E092C001844C2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 75B426CF2C4E2B31001844C2 /* WP_RankingVC.swift in Sources */, + 75B426E42C4E371D001844C2 /* WP_Christmas.swift in Sources */, + 75B426DC2C4E3705001844C2 /* WP_NewestVC.swift in Sources */, + 75B426A42C4E092C001844C2 /* ViewController.swift in Sources */, + 75B426B42C4E0CF5001844C2 /* WP_RootVC.swift in Sources */, + 75B426CB2C4E2B25001844C2 /* WP_HomeVC.swift in Sources */, + 75B426B82C4E0D21001844C2 /* WP_RootNAV.swift in Sources */, + 75B426D62C4E2B9F001844C2 /* colorManager.swift in Sources */, + 75B426EB2C4E38F9001844C2 /* WallpaperModel.swift in Sources */, + 75B426ED2C4E3A02001844C2 /* CustomCollectionViewFlowLayout.swift in Sources */, + 75B426A02C4E092C001844C2 /* AppDelegate.swift in Sources */, + 75B426D32C4E2B49001844C2 /* WP_MineVC.swift in Sources */, + 75B426E82C4E372C001844C2 /* WP_FlowersVC.swift in Sources */, + 75B426BF2C4E1046001844C2 /* WP_TabbarCommon.swift in Sources */, + 75B426F22C4E3A3C001844C2 /* WP_WallpaperCollectionCell.swift in Sources */, + 75B426E02C4E3711001844C2 /* WP_PopularVC.swift in Sources */, + 75B426C12C4E10D7001844C2 /* WP_TabBarVC.swift in Sources */, + 75B426BE2C4E1046001844C2 /* WP_TabButton.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 75B426A52C4E092C001844C2 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 75B426A62C4E092C001844C2 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 75B426AA2C4E092F001844C2 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 75B426AB2C4E092F001844C2 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 75B426AE2C4E092F001844C2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.4; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 75B426AF2C4E092F001844C2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.4; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 75B426B12C4E092F001844C2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A14E883F09B5C78F804A4357 /* Pods-WallpaperHD_Live.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 6HWQW9JC74; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_PREFIX_HEADER = "$(SRCROOT)/WallpaperHD_Live/Header/waperLivePCH.pch"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WallpaperHD_Live/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.520.cn.WallpaperHD-Live"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/WallpaperHD_Live/Header/wallpaperLive_Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Debug; + }; + 75B426B22C4E092F001844C2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9CBEA2442AE6AC8044848FC3 /* Pods-WallpaperHD_Live.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 6HWQW9JC74; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_PREFIX_HEADER = "$(SRCROOT)/WallpaperHD_Live/Header/waperLivePCH.pch"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WallpaperHD_Live/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.520.cn.WallpaperHD-Live"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/WallpaperHD_Live/Header/wallpaperLive_Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 75B426972C4E092C001844C2 /* Build configuration list for PBXProject "WallpaperHD_Live" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 75B426AE2C4E092F001844C2 /* Debug */, + 75B426AF2C4E092F001844C2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 75B426B02C4E092F001844C2 /* Build configuration list for PBXNativeTarget "WallpaperHD_Live" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 75B426B12C4E092F001844C2 /* Debug */, + 75B426B22C4E092F001844C2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 75B426942C4E092C001844C2 /* Project object */; +} diff --git a/WallpaperHD_Live/AppDelegate.swift b/WallpaperHD_Live/AppDelegate.swift new file mode 100644 index 0000000..d59f280 --- /dev/null +++ b/WallpaperHD_Live/AppDelegate.swift @@ -0,0 +1,26 @@ +// +// AppDelegate.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit +import IQKeyboardManagerSwift +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + IQKeyboardManager.shared.enable = true + window = UIWindow(frame: UIScreen.main.bounds) + WP_TabbarCommon.TabBarController() + + self.window?.makeKeyAndVisible() + return true + } + + +} + diff --git a/WallpaperHD_Live/Assets.xcassets/AccentColor.colorset/Contents.json b/WallpaperHD_Live/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/AppIcon.appiconset/Contents.json b/WallpaperHD_Live/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/Contents.json b/WallpaperHD_Live/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/home_n.imageset/Contents.json b/WallpaperHD_Live/Assets.xcassets/home_n.imageset/Contents.json new file mode 100644 index 0000000..fd2ab24 --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/home_n.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "home (1).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/home_n.imageset/home (1).png b/WallpaperHD_Live/Assets.xcassets/home_n.imageset/home (1).png new file mode 100644 index 0000000..05f4714 Binary files /dev/null and b/WallpaperHD_Live/Assets.xcassets/home_n.imageset/home (1).png differ diff --git a/WallpaperHD_Live/Assets.xcassets/home_s.imageset/Contents.json b/WallpaperHD_Live/Assets.xcassets/home_s.imageset/Contents.json new file mode 100644 index 0000000..7f2c0a7 --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/home_s.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "home.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/home_s.imageset/home.png b/WallpaperHD_Live/Assets.xcassets/home_s.imageset/home.png new file mode 100644 index 0000000..997c798 Binary files /dev/null and b/WallpaperHD_Live/Assets.xcassets/home_s.imageset/home.png differ diff --git a/WallpaperHD_Live/Assets.xcassets/ic_arrow_left.imageset/Contents.json b/WallpaperHD_Live/Assets.xcassets/ic_arrow_left.imageset/Contents.json new file mode 100644 index 0000000..907bc13 --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/ic_arrow_left.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "ic_arrow_left.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/ic_arrow_left.imageset/ic_arrow_left.png b/WallpaperHD_Live/Assets.xcassets/ic_arrow_left.imageset/ic_arrow_left.png new file mode 100644 index 0000000..1537c42 Binary files /dev/null and b/WallpaperHD_Live/Assets.xcassets/ic_arrow_left.imageset/ic_arrow_left.png differ diff --git a/WallpaperHD_Live/Assets.xcassets/mine_n.imageset/Contents.json b/WallpaperHD_Live/Assets.xcassets/mine_n.imageset/Contents.json new file mode 100644 index 0000000..8cd85fa --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/mine_n.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "mine (1).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/mine_n.imageset/mine (1).png b/WallpaperHD_Live/Assets.xcassets/mine_n.imageset/mine (1).png new file mode 100644 index 0000000..959826d Binary files /dev/null and b/WallpaperHD_Live/Assets.xcassets/mine_n.imageset/mine (1).png differ diff --git a/WallpaperHD_Live/Assets.xcassets/mine_s.imageset/Contents.json b/WallpaperHD_Live/Assets.xcassets/mine_s.imageset/Contents.json new file mode 100644 index 0000000..b1cc4bd --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/mine_s.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "mine.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/mine_s.imageset/mine.png b/WallpaperHD_Live/Assets.xcassets/mine_s.imageset/mine.png new file mode 100644 index 0000000..35a912b Binary files /dev/null and b/WallpaperHD_Live/Assets.xcassets/mine_s.imageset/mine.png differ diff --git a/WallpaperHD_Live/Assets.xcassets/rank_n.imageset/Contents.json b/WallpaperHD_Live/Assets.xcassets/rank_n.imageset/Contents.json new file mode 100644 index 0000000..89181c1 --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/rank_n.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "ranking (1).png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/rank_n.imageset/ranking (1).png b/WallpaperHD_Live/Assets.xcassets/rank_n.imageset/ranking (1).png new file mode 100644 index 0000000..9ad8f26 Binary files /dev/null and b/WallpaperHD_Live/Assets.xcassets/rank_n.imageset/ranking (1).png differ diff --git a/WallpaperHD_Live/Assets.xcassets/rank_s.imageset/Contents.json b/WallpaperHD_Live/Assets.xcassets/rank_s.imageset/Contents.json new file mode 100644 index 0000000..5e74b74 --- /dev/null +++ b/WallpaperHD_Live/Assets.xcassets/rank_s.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "ranking.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WallpaperHD_Live/Assets.xcassets/rank_s.imageset/ranking.png b/WallpaperHD_Live/Assets.xcassets/rank_s.imageset/ranking.png new file mode 100644 index 0000000..846042e Binary files /dev/null and b/WallpaperHD_Live/Assets.xcassets/rank_s.imageset/ranking.png differ diff --git a/WallpaperHD_Live/Header/wallpaperLive_Header.h b/WallpaperHD_Live/Header/wallpaperLive_Header.h new file mode 100644 index 0000000..d6e8567 --- /dev/null +++ b/WallpaperHD_Live/Header/wallpaperLive_Header.h @@ -0,0 +1,14 @@ +// +// wallpaperLive_Header.h +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +#ifndef wallpaperLive_Header_h +#define wallpaperLive_Header_h +#import "CYLTabBarController.h" +#import +#import + +#endif /* wallpaperLive_Header_h */ diff --git a/WallpaperHD_Live/Header/waperLivePCH.pch b/WallpaperHD_Live/Header/waperLivePCH.pch new file mode 100644 index 0000000..a910b26 --- /dev/null +++ b/WallpaperHD_Live/Header/waperLivePCH.pch @@ -0,0 +1,14 @@ +// +// waperLivePCH.pch +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// +#import "WallpaperHD_Live" +#ifndef waperLivePCH_pch +#define waperLivePCH_pch + +// Include any system framework and library headers here that should be included in all compilation units. +// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. + +#endif /* waperLivePCH_pch */ diff --git a/WallpaperHD_Live/Home/C/WP_Christmas.swift b/WallpaperHD_Live/Home/C/WP_Christmas.swift new file mode 100644 index 0000000..1f4ce70 --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_Christmas.swift @@ -0,0 +1,165 @@ +// +// WP_Christmas.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit +import JXSegmentedView + +import MJRefresh +import SDWebImage + +class WP_Christmas: WP_RootVC { + + @IBOutlet weak var collectionView: UICollectionView! + + + var christmasWallpapers: [WallpaperData] = [] + + + var currentPage: Int = 1 // 当前页数 + let pageSize: Int = 10 // 每页加载的数量 + + // 顶部刷新 + let header = MJRefreshNormalHeader() + // 底部刷新 + let footer = MJRefreshAutoNormalFooter() + override func viewDidLoad() { + super.viewDidLoad() + setCollectionView() + setRefresh() + } + + + @objc func setRefresh(){ + refreshData() + + header.setRefreshingTarget(self, refreshingAction: #selector(WP_NewestVC.setRefresh)) + // 现在的版本要用mj_header + + header.setTitle("pull-to-refresh", for: .idle) + header.setTitle("Release updates", for: .pulling) + header.setTitle("Refreshing...", for: .refreshing) + self.collectionView.mj_header = header + + + // 上拉刷新 + footer.setRefreshingTarget(self, refreshingAction: #selector(WP_NewestVC.loadMoreData)) + footer.setTitle("Pull up loading", for: .idle) + footer.setTitle("Release Load", for: .pulling) + footer.setTitle("Loading...", for: .refreshing) + self.collectionView.mj_footer = footer + + + header.beginRefreshing() + // footer.beginRefreshing() + + + } + // 下拉刷新 + @objc func refreshData() { + currentPage = 1 + settypeNetwork() + } + + // 上拉加载更多 + @objc func loadMoreData() { + currentPage += 1 + settypeNetwork() + } + + func setCollectionView(){ + collectionView.delegate = self + collectionView.dataSource = self + + // 设置 collection view 的布局 + let layout = CustomCollectionViewFlowLayout() + collectionView.collectionViewLayout = layout + layout.scrollDirection = .vertical + + collectionView.register(UINib(nibName: "WP_WallpaperCollectionCell", bundle: nil), forCellWithReuseIdentifier: "WP_WallpaperCollectionCell") + + } + func settypeNetwork(){ + // 读取 JSON 文件路径 + guard let jsonFilePath = Bundle.main.path(forResource: "my_wallpaper", ofType: "json") else { + fatalError("Unable to locate my_wallpaper.json file.") + } + + // 读取 JSON 数据 + do { + // 读取 JSON 数据 + let jsonData = try Data(contentsOf: URL(fileURLWithPath: jsonFilePath)) + + // 尝试将 JSON 数据转换为 Swift 对象 + let decoder = JSONDecoder() + let wallpaperModels = try decoder.decode([WallpaperModel].self, from: jsonData) + + var newwallpaperarr:[WallpaperData] = [] + // 遍历解析后的 WallpaperModel 对象数组 + for wallpaperModel in wallpaperModels { + // 根据名称将数据放入不同的数组中 + switch wallpaperModel.name { + case "Christmas Wallpapers": + newwallpaperarr = wallpaperModel.data + default: + break + } + } + if currentPage == 1 { + // 只取前10条数据 + let firstTenWallpapers = Array(newwallpaperarr.prefix(10)) + self.christmasWallpapers = firstTenWallpapers + collectionView.reloadData() + collectionView.mj_header?.endRefreshing() + } else { + // 上拉加载更多 + let startIndex = currentPage * pageSize + let moreWallpapers = Array(newwallpaperarr.prefix(startIndex)) + DispatchQueue.main.asyncAfter(deadline: .now() + 1.5){ + self.christmasWallpapers = moreWallpapers + self.collectionView.reloadData() + self.collectionView.mj_footer?.endRefreshing() + + } + } + + } catch { + print("Error reading or parsing JSON file: \(error)") + } + } +} +extension WP_Christmas:JXSegmentedListContainerViewListDelegate{ + func listView() -> UIView { + return view + } +} +extension WP_Christmas:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{ + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + + return self.christmasWallpapers.count + + } + + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WP_WallpaperCollectionCell", for: indexPath)as!WP_WallpaperCollectionCell + let model = self.christmasWallpapers[indexPath.row] + if let imageURL = URL(string: model.previewThumb ?? "") { + cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle")) + } + + return cell + + + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + + + + } +} diff --git a/WallpaperHD_Live/Home/C/WP_Christmas.xib b/WallpaperHD_Live/Home/C/WP_Christmas.xib new file mode 100644 index 0000000..df3c118 --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_Christmas.xib @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WallpaperHD_Live/Home/C/WP_FlowersVC.swift b/WallpaperHD_Live/Home/C/WP_FlowersVC.swift new file mode 100644 index 0000000..56c9e6e --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_FlowersVC.swift @@ -0,0 +1,162 @@ +// +// WP_FlowersVC.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit +import JXSegmentedView +import MJRefresh +import SDWebImage + +class WP_FlowersVC: WP_RootVC { + + @IBOutlet weak var collectionView: UICollectionView! + var flowersWallpapers: [WallpaperData] = [] + + + var currentPage: Int = 1 // 当前页数 + let pageSize: Int = 10 // 每页加载的数量 + + // 顶部刷新 + let header = MJRefreshNormalHeader() + // 底部刷新 + let footer = MJRefreshAutoNormalFooter() + override func viewDidLoad() { + super.viewDidLoad() + setCollectionView() + setRefresh() + } + + + @objc func setRefresh(){ + refreshData() + + header.setRefreshingTarget(self, refreshingAction: #selector(WP_NewestVC.setRefresh)) + // 现在的版本要用mj_header + + header.setTitle("pull-to-refresh", for: .idle) + header.setTitle("Release updates", for: .pulling) + header.setTitle("Refreshing...", for: .refreshing) + self.collectionView.mj_header = header + + + // 上拉刷新 + footer.setRefreshingTarget(self, refreshingAction: #selector(WP_NewestVC.loadMoreData)) + footer.setTitle("Pull up loading", for: .idle) + footer.setTitle("Release Load", for: .pulling) + footer.setTitle("Loading...", for: .refreshing) + self.collectionView.mj_footer = footer + + + header.beginRefreshing() + // footer.beginRefreshing() + + + } + // 下拉刷新 + @objc func refreshData() { + currentPage = 1 + settypeNetwork() + } + + // 上拉加载更多 + @objc func loadMoreData() { + currentPage += 1 + settypeNetwork() + } + + func setCollectionView(){ + collectionView.delegate = self + collectionView.dataSource = self + + // 设置 collection view 的布局 + let layout = CustomCollectionViewFlowLayout() + collectionView.collectionViewLayout = layout + layout.scrollDirection = .vertical + + collectionView.register(UINib(nibName: "WP_WallpaperCollectionCell", bundle: nil), forCellWithReuseIdentifier: "WP_WallpaperCollectionCell") + + } + func settypeNetwork(){ + // 读取 JSON 文件路径 + guard let jsonFilePath = Bundle.main.path(forResource: "my_wallpaper", ofType: "json") else { + fatalError("Unable to locate my_wallpaper.json file.") + } + + // 读取 JSON 数据 + do { + // 读取 JSON 数据 + let jsonData = try Data(contentsOf: URL(fileURLWithPath: jsonFilePath)) + + // 尝试将 JSON 数据转换为 Swift 对象 + let decoder = JSONDecoder() + let wallpaperModels = try decoder.decode([WallpaperModel].self, from: jsonData) + + var newwallpaperarr:[WallpaperData] = [] + // 遍历解析后的 WallpaperModel 对象数组 + for wallpaperModel in wallpaperModels { + // 根据名称将数据放入不同的数组中 + switch wallpaperModel.name { + case "Flowers": + newwallpaperarr = wallpaperModel.data + default: + break + } + } + if currentPage == 1 { + // 只取前10条数据 + let firstTenWallpapers = Array(newwallpaperarr.prefix(10)) + self.flowersWallpapers = firstTenWallpapers + collectionView.reloadData() + collectionView.mj_header?.endRefreshing() + } else { + // 上拉加载更多 + let startIndex = currentPage * pageSize + let moreWallpapers = Array(newwallpaperarr.prefix(startIndex)) + DispatchQueue.main.asyncAfter(deadline: .now() + 1.5){ + self.flowersWallpapers = moreWallpapers + self.collectionView.reloadData() + self.collectionView.mj_footer?.endRefreshing() + + } + } + + } catch { + print("Error reading or parsing JSON file: \(error)") + } + } +} +extension WP_FlowersVC:JXSegmentedListContainerViewListDelegate{ + func listView() -> UIView { + return view + } +} +extension WP_FlowersVC:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{ + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + + return self.flowersWallpapers.count + + } + + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WP_WallpaperCollectionCell", for: indexPath)as!WP_WallpaperCollectionCell + let model = self.flowersWallpapers[indexPath.row] + if let imageURL = URL(string: model.previewThumb ?? "") { + cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle")) + } + + return cell + + + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + + + + } +} diff --git a/WallpaperHD_Live/Home/C/WP_FlowersVC.xib b/WallpaperHD_Live/Home/C/WP_FlowersVC.xib new file mode 100644 index 0000000..1946b32 --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_FlowersVC.xib @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WallpaperHD_Live/Home/C/WP_HomeVC.swift b/WallpaperHD_Live/Home/C/WP_HomeVC.swift new file mode 100644 index 0000000..8732d4d --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_HomeVC.swift @@ -0,0 +1,87 @@ +// +// WP_HomeVC.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit +import JXSegmentedView + +import SnapKit +class WP_HomeVC: WP_RootVC { + + @IBOutlet weak var segmentedView: JXSegmentedView! + var segmentedDataSource = JXSegmentedTitleDataSource() + var listContainerView: JXSegmentedListContainerView! + override func viewDidLoad() { + super.viewDidLoad() + + setSegmentedViewUI() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationController?.navigationBar.isHidden = true + + + } + func setSegmentedViewUI(){ + segmentedView.delegate = self + //配置数据源相关配置属性 + segmentedDataSource.titles = [ "Flowers","Popular","Christmas","Newest"] + segmentedDataSource.titleSelectedColor = UIColor.black + segmentedDataSource.titleNormalColor = UIColor.gray + segmentedDataSource.titleSelectedFont = .boldSystemFont(ofSize: 20) + segmentedDataSource.titleNormalFont = .systemFont(ofSize: 18) + segmentedDataSource.isTitleColorGradientEnabled = true + self.segmentedDataSource.reloadData(selectedIndex: 0) + //关联dataSource + self.segmentedView.dataSource = segmentedDataSource + + + let indicator = JXSegmentedIndicatorLineView() + indicator.indicatorColor = UIColor.black + self.segmentedView.indicators = [indicator] + + listContainerView = JXSegmentedListContainerView(dataSource: self) + self.view.addSubview(listContainerView) + + segmentedView.listContainer = listContainerView + } + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + + listContainerView.snp.makeConstraints { make in + make.top.equalTo(segmentedView.snp.bottom).offset(0) + make.width.equalToSuperview() + make.bottom.equalToSuperview() + } + } + +} +extension WP_HomeVC:JXSegmentedListContainerViewDataSource,JXSegmentedViewDelegate { + //返回列表的数量 + func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int { + return 4 + } + //返回遵从`JXSegmentedListContainerViewListDelegate`协议的实例 + func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate { + + if index == 0 { + let vc = WP_FlowersVC() + return vc + }else if index == 1{ + let vc = WP_PopularVC() + return vc + }else if index == 2{ + let vc = WP_Christmas() + return vc + }else{ + let vc = WP_NewestVC() + return vc + } + } + +} diff --git a/WallpaperHD_Live/Home/C/WP_HomeVC.xib b/WallpaperHD_Live/Home/C/WP_HomeVC.xib new file mode 100644 index 0000000..7e20d9b --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_HomeVC.xib @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WallpaperHD_Live/Home/C/WP_NewestVC.swift b/WallpaperHD_Live/Home/C/WP_NewestVC.swift new file mode 100644 index 0000000..be2c443 --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_NewestVC.swift @@ -0,0 +1,163 @@ +// +// WP_NewestVC.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit +import JXSegmentedView +import MJRefresh +import SDWebImage + +class WP_NewestVC: WP_RootVC { + @IBOutlet weak var collectionView: UICollectionView! + + var newestWallpapers: [WallpaperData] = [] + + + var currentPage: Int = 1 // 当前页数 + let pageSize: Int = 10 // 每页加载的数量 + + // 顶部刷新 + let header = MJRefreshNormalHeader() + // 底部刷新 + let footer = MJRefreshAutoNormalFooter() + + override func viewDidLoad() { + super.viewDidLoad() + setCollectionView() + setRefresh() + } + + + @objc func setRefresh(){ + refreshData() + + header.setRefreshingTarget(self, refreshingAction: #selector(WP_NewestVC.setRefresh)) + // 现在的版本要用mj_header + + header.setTitle("pull-to-refresh", for: .idle) + header.setTitle("Release updates", for: .pulling) + header.setTitle("Refreshing...", for: .refreshing) + self.collectionView.mj_header = header + + + // 上拉刷新 + footer.setRefreshingTarget(self, refreshingAction: #selector(WP_NewestVC.loadMoreData)) + footer.setTitle("Pull up loading", for: .idle) + footer.setTitle("Release Load", for: .pulling) + footer.setTitle("Loading...", for: .refreshing) + self.collectionView.mj_footer = footer + + + header.beginRefreshing() + // footer.beginRefreshing() + + + } + // 下拉刷新 + @objc func refreshData() { + currentPage = 1 + settypeNetwork() + } + + // 上拉加载更多 + @objc func loadMoreData() { + currentPage += 1 + settypeNetwork() + } + + func setCollectionView(){ + collectionView.delegate = self + collectionView.dataSource = self + + // 设置 collection view 的布局 + let layout = CustomCollectionViewFlowLayout() + collectionView.collectionViewLayout = layout + layout.scrollDirection = .vertical + + collectionView.register(UINib(nibName: "WP_WallpaperCollectionCell", bundle: nil), forCellWithReuseIdentifier: "WP_WallpaperCollectionCell") + + } + func settypeNetwork(){ + // 读取 JSON 文件路径 + guard let jsonFilePath = Bundle.main.path(forResource: "my_wallpaper", ofType: "json") else { + fatalError("Unable to locate my_wallpaper.json file.") + } + + // 读取 JSON 数据 + do { + // 读取 JSON 数据 + let jsonData = try Data(contentsOf: URL(fileURLWithPath: jsonFilePath)) + + // 尝试将 JSON 数据转换为 Swift 对象 + let decoder = JSONDecoder() + let wallpaperModels = try decoder.decode([WallpaperModel].self, from: jsonData) + + var newwallpaperarr:[WallpaperData] = [] + // 遍历解析后的 WallpaperModel 对象数组 + for wallpaperModel in wallpaperModels { + // 根据名称将数据放入不同的数组中 + switch wallpaperModel.name { + case "Newest": + newwallpaperarr = wallpaperModel.data + default: + break + } + } + if currentPage == 1 { + // 只取前10条数据 + let firstTenWallpapers = Array(newwallpaperarr.prefix(10)) + self.newestWallpapers = firstTenWallpapers + collectionView.reloadData() + collectionView.mj_header?.endRefreshing() + } else { + // 上拉加载更多 + let startIndex = currentPage * pageSize + let moreWallpapers = Array(newwallpaperarr.prefix(startIndex)) + DispatchQueue.main.asyncAfter(deadline: .now() + 1.5){ + self.newestWallpapers = moreWallpapers + self.collectionView.reloadData() + self.collectionView.mj_footer?.endRefreshing() + + } + } + + } catch { + print("Error reading or parsing JSON file: \(error)") + } + } +} +extension WP_NewestVC:JXSegmentedListContainerViewListDelegate{ + func listView() -> UIView { + return view + } +} +extension WP_NewestVC:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{ + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + + return self.newestWallpapers.count + + } + + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WP_WallpaperCollectionCell", for: indexPath)as!WP_WallpaperCollectionCell + let model = self.newestWallpapers[indexPath.row] + if let imageURL = URL(string: model.previewThumb ?? "") { + cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle")) + } + + return cell + + + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + + + + } +} diff --git a/WallpaperHD_Live/Home/C/WP_NewestVC.xib b/WallpaperHD_Live/Home/C/WP_NewestVC.xib new file mode 100644 index 0000000..5d32b92 --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_NewestVC.xib @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WallpaperHD_Live/Home/C/WP_PopularVC.swift b/WallpaperHD_Live/Home/C/WP_PopularVC.swift new file mode 100644 index 0000000..a3e4462 --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_PopularVC.swift @@ -0,0 +1,166 @@ +// +// WP_PopularVC.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit +import JXSegmentedView +import MJRefresh +import SDWebImage + + +class WP_PopularVC: WP_RootVC { + @IBOutlet weak var collectionView: UICollectionView! + + + + var populartWallpapers: [WallpaperData] = [] + + + var currentPage: Int = 1 // 当前页数 + let pageSize: Int = 10 // 每页加载的数量 + + // 顶部刷新 + let header = MJRefreshNormalHeader() + // 底部刷新 + let footer = MJRefreshAutoNormalFooter() + + override func viewDidLoad() { + super.viewDidLoad() + setCollectionView() + setRefresh() + } + + + @objc func setRefresh(){ + refreshData() + + header.setRefreshingTarget(self, refreshingAction: #selector(WP_NewestVC.setRefresh)) + // 现在的版本要用mj_header + + header.setTitle("pull-to-refresh", for: .idle) + header.setTitle("Release updates", for: .pulling) + header.setTitle("Refreshing...", for: .refreshing) + self.collectionView.mj_header = header + + + // 上拉刷新 + footer.setRefreshingTarget(self, refreshingAction: #selector(WP_NewestVC.loadMoreData)) + footer.setTitle("Pull up loading", for: .idle) + footer.setTitle("Release Load", for: .pulling) + footer.setTitle("Loading...", for: .refreshing) + self.collectionView.mj_footer = footer + + + header.beginRefreshing() + // footer.beginRefreshing() + + + } + // 下拉刷新 + @objc func refreshData() { + currentPage = 1 + settypeNetwork() + } + + // 上拉加载更多 + @objc func loadMoreData() { + currentPage += 1 + settypeNetwork() + } + + func setCollectionView(){ + collectionView.delegate = self + collectionView.dataSource = self + + // 设置 collection view 的布局 + let layout = CustomCollectionViewFlowLayout() + collectionView.collectionViewLayout = layout + layout.scrollDirection = .vertical + + collectionView.register(UINib(nibName: "WP_WallpaperCollectionCell", bundle: nil), forCellWithReuseIdentifier: "WP_WallpaperCollectionCell") + + } + func settypeNetwork(){ + // 读取 JSON 文件路径 + guard let jsonFilePath = Bundle.main.path(forResource: "my_wallpaper", ofType: "json") else { + fatalError("Unable to locate my_wallpaper.json file.") + } + + // 读取 JSON 数据 + do { + // 读取 JSON 数据 + let jsonData = try Data(contentsOf: URL(fileURLWithPath: jsonFilePath)) + + // 尝试将 JSON 数据转换为 Swift 对象 + let decoder = JSONDecoder() + let wallpaperModels = try decoder.decode([WallpaperModel].self, from: jsonData) + + var newwallpaperarr:[WallpaperData] = [] + // 遍历解析后的 WallpaperModel 对象数组 + for wallpaperModel in wallpaperModels { + // 根据名称将数据放入不同的数组中 + switch wallpaperModel.name { + case "Popular Wallpapers": + newwallpaperarr = wallpaperModel.data + default: + break + } + } + if currentPage == 1 { + // 只取前10条数据 + let firstTenWallpapers = Array(newwallpaperarr.prefix(10)) + self.populartWallpapers = firstTenWallpapers + collectionView.reloadData() + collectionView.mj_header?.endRefreshing() + } else { + // 上拉加载更多 + let startIndex = currentPage * pageSize + let moreWallpapers = Array(newwallpaperarr.prefix(startIndex)) + DispatchQueue.main.asyncAfter(deadline: .now() + 1.5){ + self.populartWallpapers = moreWallpapers + self.collectionView.reloadData() + self.collectionView.mj_footer?.endRefreshing() + + } + } + + } catch { + print("Error reading or parsing JSON file: \(error)") + } + } +} +extension WP_PopularVC:JXSegmentedListContainerViewListDelegate{ + func listView() -> UIView { + return view + } +} +extension WP_PopularVC:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{ + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + + return self.populartWallpapers.count + + } + + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WP_WallpaperCollectionCell", for: indexPath)as!WP_WallpaperCollectionCell + let model = self.populartWallpapers[indexPath.row] + if let imageURL = URL(string: model.previewThumb ?? "") { + cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle")) + } + + return cell + + + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + + + + } +} diff --git a/WallpaperHD_Live/Home/C/WP_PopularVC.xib b/WallpaperHD_Live/Home/C/WP_PopularVC.xib new file mode 100644 index 0000000..a617e7c --- /dev/null +++ b/WallpaperHD_Live/Home/C/WP_PopularVC.xib @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WallpaperHD_Live/Home/M/WallpaperModel.swift b/WallpaperHD_Live/Home/M/WallpaperModel.swift new file mode 100644 index 0000000..09a24b2 --- /dev/null +++ b/WallpaperHD_Live/Home/M/WallpaperModel.swift @@ -0,0 +1,41 @@ +// +// WallpaperModel.swift +// wallpaper_project + + +import UIKit +@objcMembers +class WallpaperModel: NSObject,Decodable,Encodable { + var name:String? + let data: [WallpaperData] +} +class WallpaperData: NSObject,Codable { + var original: String? + var previewThumb: String? + var source: String? + var banner:String? + + + enum CodingKeys: String, CodingKey { + case original + case previewThumb + case source + case banner + + } + + // 实现 Decodable 协议中的初始化方法 + required override init() { + super.init() + } + + // 实现 Encodable 协议中的编码方法 + func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(original, forKey: .original) + try container.encode(previewThumb, forKey: .previewThumb) + try container.encode(source, forKey: .source) + try container.encode(banner, forKey: .banner) + + } +} diff --git a/WallpaperHD_Live/Home/V/WP_WallpaperCollectionCell.swift b/WallpaperHD_Live/Home/V/WP_WallpaperCollectionCell.swift new file mode 100644 index 0000000..2a83971 --- /dev/null +++ b/WallpaperHD_Live/Home/V/WP_WallpaperCollectionCell.swift @@ -0,0 +1,19 @@ +// +// WP_WallpaperCollectionCell.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit + +class WP_WallpaperCollectionCell: UICollectionViewCell { + + @IBOutlet weak var wpImagV: UIImageView! + override func awakeFromNib() { + super.awakeFromNib() + self.wpImagV.layer.cornerRadius = 10 + self.wpImagV.clipsToBounds = true + } + +} diff --git a/WallpaperHD_Live/Home/V/WP_WallpaperCollectionCell.xib b/WallpaperHD_Live/Home/V/WP_WallpaperCollectionCell.xib new file mode 100644 index 0000000..67d9719 --- /dev/null +++ b/WallpaperHD_Live/Home/V/WP_WallpaperCollectionCell.xib @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WallpaperHD_Live/Info.plist b/WallpaperHD_Live/Info.plist new file mode 100644 index 0000000..6a6654d --- /dev/null +++ b/WallpaperHD_Live/Info.plist @@ -0,0 +1,11 @@ + + + + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + + diff --git a/WallpaperHD_Live/Mine/C/WP_MineVC.swift b/WallpaperHD_Live/Mine/C/WP_MineVC.swift new file mode 100644 index 0000000..bc912ad --- /dev/null +++ b/WallpaperHD_Live/Mine/C/WP_MineVC.swift @@ -0,0 +1,18 @@ +// +// WP_MineVC.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit + +class WP_MineVC: WP_RootVC { + + override func viewDidLoad() { + super.viewDidLoad() + + + } + +} diff --git a/WallpaperHD_Live/Mine/C/WP_MineVC.xib b/WallpaperHD_Live/Mine/C/WP_MineVC.xib new file mode 100644 index 0000000..ec06477 --- /dev/null +++ b/WallpaperHD_Live/Mine/C/WP_MineVC.xib @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/WallpaperHD_Live/Ranking/C/WP_RankingVC.swift b/WallpaperHD_Live/Ranking/C/WP_RankingVC.swift new file mode 100644 index 0000000..980d167 --- /dev/null +++ b/WallpaperHD_Live/Ranking/C/WP_RankingVC.swift @@ -0,0 +1,18 @@ +// +// WP_RankingVC.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit + +class WP_RankingVC: WP_RootVC { + + override func viewDidLoad() { + super.viewDidLoad() + + + } + +} diff --git a/WallpaperHD_Live/Ranking/C/WP_RankingVC.xib b/WallpaperHD_Live/Ranking/C/WP_RankingVC.xib new file mode 100644 index 0000000..cb752e1 --- /dev/null +++ b/WallpaperHD_Live/Ranking/C/WP_RankingVC.xib @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/WallpaperHD_Live/Root/WP_RootNAV.swift b/WallpaperHD_Live/Root/WP_RootNAV.swift new file mode 100644 index 0000000..e18d762 --- /dev/null +++ b/WallpaperHD_Live/Root/WP_RootNAV.swift @@ -0,0 +1,69 @@ +// +// WP_RootNAV.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit + +class WP_RootNAV: UINavigationController { + + override func viewDidLoad() { + super.viewDidLoad() + + setBackItmer() + } + + func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { + if self.viewControllers.count <= 1 { + let viewController = UIViewController() + viewController.hidesBottomBarWhenPushed = true + tabBarController?.tabBar.isHidden = true + return false + } + setBackItmer() + return true + } + + + override func pushViewController(_ viewController: UIViewController, animated: Bool) { + if viewControllers.count > 0 { +// setBackItmer()/ + viewController.hidesBottomBarWhenPushed = true + tabBarController?.tabBar.isHidden = true + } + setBackItmer() + super.pushViewController(viewController, animated: animated) + + } + func setBackItmer(){ + // 返回按钮 + let backButton = UIButton(type: .custom) + + // 给按钮设置返回箭头图片 + backButton.setBackgroundImage(#imageLiteral(resourceName: "ic_arrow_left"), for: .normal) + + // 设置frame +// backButton.frame = CGRect(x: 200, y: 13, width: 18, height: 18) + backButton.addTarget(self, action: #selector(back), for: .touchUpInside) + +// // 自定义导航栏的UIBarButtonItem类型的按钮 + let backView = UIBarButtonItem(customView: backButton) +// +// // 重要方法,用来调整自定义返回view距离左边的距离 + let barButtonItem = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil) + barButtonItem.width = -5 + + // 返回按钮设置成功 + navigationItem.leftBarButtonItems = [barButtonItem, backView] + + } + // + @objc func back(){ + navigationController?.popViewController(animated: true) + + } + + +} diff --git a/WallpaperHD_Live/Root/WP_RootVC.swift b/WallpaperHD_Live/Root/WP_RootVC.swift new file mode 100644 index 0000000..35c3a37 --- /dev/null +++ b/WallpaperHD_Live/Root/WP_RootVC.swift @@ -0,0 +1,66 @@ +// +// WP_RootVC.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit + +class WP_RootVC: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + setNavigtionContrilerBase() + + } + //设置导航栏属性 + func setNavigtionContrilerBase(){ + self.navigationController?.navigationBar.barTintColor = .white + let titleTextAttributes = [ + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16, weight: .bold), + NSAttributedString.Key.foregroundColor: UIColor.black + ] + + ///控制导航栏的背景颜色和底部线的隐藏 + if #available(iOS 13.0, *) { + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() //重置导航栏背景颜色和阴影 + appearance.backgroundColor = UIColor.white + appearance.shadowImage = UIImage() + appearance.shadowColor = nil + appearance.titleTextAttributes = titleTextAttributes + self.navigationController?.navigationBar.standardAppearance = appearance + self.navigationController?.navigationBar.scrollEdgeAppearance = appearance + } else { + + self.navigationController?.navigationBar.barTintColor = UIColor.white + self.navigationController?.navigationBar.titleTextAttributes = titleTextAttributes + self.navigationController?.navigationBar.shadowImage = UIImage() + self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) + } + + } + + + //设置导航栏透明 + func setNavigationCotrollerHide(){ + // 1.设置导航栏半透明 + self.navigationController?.navigationBar.isTranslucent = true + + // 2.设置导航栏背景图片 + self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default) + + // 3.设置导航栏阴影图片 + self.navigationController?.navigationBar.shadowImage = UIImage() + } + + + // func setNavigationCotrollerOpaque(){ + // + // } + override var preferredStatusBarStyle : UIStatusBarStyle { + return .lightContent + } + +} diff --git a/WallpaperHD_Live/Root/WP_TabBarVC.swift b/WallpaperHD_Live/Root/WP_TabBarVC.swift new file mode 100644 index 0000000..5c73e78 --- /dev/null +++ b/WallpaperHD_Live/Root/WP_TabBarVC.swift @@ -0,0 +1,18 @@ +// +// WP_TabBarVC.swift +// WallpaperHD_Live +// +// Created by 忆海16 on 2024/7/22. +// + +import UIKit +import CYLTabBarController +class WP_TabBarVC: CYLTabBarController { + + override func viewDidLoad() { + super.viewDidLoad() + + + } + +} diff --git a/WallpaperHD_Live/Root/WP_TabButton.swift b/WallpaperHD_Live/Root/WP_TabButton.swift new file mode 100644 index 0000000..d8beba5 --- /dev/null +++ b/WallpaperHD_Live/Root/WP_TabButton.swift @@ -0,0 +1,89 @@ +// +// WP_TabButton.swift +// WallpaperHD_Live + + +import UIKit +import CYLTabBarController + +class WP_TabButton: CYLPlusButton,CYLPlusButtonSubclassing { + + static func plusButton() -> Any { + let button = WP_TabButton() + + button.setBackgroundImage(UIImage(named: "icon_add"), for: .normal) +// button.sizeThatFits(CGSize(width: 40, height: 40)) + button.bounds = CGRect(x: 0, y: 0, width: 30, height: 30) + button.titleLabel?.textAlignment = .center + + button.titleLabel?.font = UIFont.systemFont(ofSize: 15) + + button.adjustsImageWhenHighlighted = false + button.addTarget(button, action: #selector(clickbtn), for: .touchUpInside) + button.sizeToFit() + + return button + } + + + @objc func clickbtn(){ + let tabBarController = WP_TabButton.cyl_tabBarController() + let viewController = tabBarController.selectedViewController + + let vc = WP_HomeVC() + vc.modalPresentationStyle = .custom + viewController?.present(vc, animated: true, completion: nil) + } + override func sizeThatFits(_ size: CGSize) -> CGSize { + return CGSize(width: 30, height: 30) + } + + /// MARK: 插入位置 + static func indexOfPlusButtonInTabBar() -> UInt { + return 1 + } + + static func multiplier(ofTabBarHeight tabBarHeight: CGFloat) -> CGFloat { + return 0.7 + } + + + static func constantOfPlusButtonCenterYOffset(forTabBarHeight tabBarHeight: CGFloat) -> CGFloat { + let screenHeight = UIScreen.main.nativeBounds.size.height; + if screenHeight == 2436 || screenHeight == 1792 || screenHeight == 2688 || screenHeight == 1624 { + return -40 + } + return -30 + } + + static func shouldSelectPlusChildViewController() -> Bool { + return true + } + + override func layoutSubviews() { + super.layoutSubviews() + + // tabbar UI layout setup +// let imageViewEdgeWidth:CGFloat = self.bounds.size.width * 0.5 + let imageViewEdgeWidth:CGFloat = 40 +// let imageViewEdgeHeight:CGFloat = imageViewEdgeWidth * 0.5 + let imageViewEdgeHeight:CGFloat = 40 + let centerOfView = self.bounds.size.width * 0.5 + let labelLineHeight = self.titleLabel!.font.lineHeight + let verticalMargin = (self.bounds.size.height - labelLineHeight - imageViewEdgeHeight ) * 0.5 + + let centerOfImageView = verticalMargin + imageViewEdgeHeight * 0.5 + let centerOfTitleLabel = imageViewEdgeHeight + verticalMargin * 2 + labelLineHeight * 0.5 + 10 + + //imageView position layout + self.imageView!.bounds = CGRect(x:0, y:0, width:30, height:30) + self.imageView!.center = CGPoint(x:centerOfView, y:centerOfImageView) + + //title position layout + self.titleLabel!.bounds = CGRect(x:0, y:0, width:self.bounds.size.width,height:labelLineHeight) + self.titleLabel!.center = CGPoint(x:centerOfView, y:centerOfTitleLabel) + + } + + +} diff --git a/WallpaperHD_Live/Root/WP_TabbarCommon.swift b/WallpaperHD_Live/Root/WP_TabbarCommon.swift new file mode 100644 index 0000000..cf009e0 --- /dev/null +++ b/WallpaperHD_Live/Root/WP_TabbarCommon.swift @@ -0,0 +1,97 @@ +// +// WP_TabbarCommon.swift +// WallpaperHD_Live + + +import UIKit +import CYLTabBarController + +class WP_TabbarCommon: NSObject { + /// MARK: 切换跳转主界面 + class func tabBarSelectIndex(_ selectIndex: Int) { +// WP_TabButton.register() + let tabBarController = WP_TabBarVC(viewControllers: viewControllers(), tabBarItemsAttributes: tabBarItemsAttributesForController()) + + + tabBarController.selectedIndex = selectIndex; + let appDelegate = UIApplication.shared.delegate + appDelegate?.window??.rootViewController = tabBarController + } + + /// MARK: 切换跳转主界面 操作其他事件 + class func completionhandler(_ selectIndex: Int, _: () ->()) { + tabBarSelectIndex(selectIndex) + } + + /// MARK: 进入APP + class func enterApp(_ : () -> ()) { + TabBarController() + } + + /// MARK: 创建根视图 + class func TabBarController() { +// WP_TabButton.register() + let appDelegate = UIApplication.shared.delegate + appDelegate?.window??.rootViewController = WP_TabBarVC(viewControllers: viewControllers(), tabBarItemsAttributes: tabBarItemsAttributesForController()) + let tabBarController = WP_TabBarVC() + tabBarController.cyl_tabBarController.tabBar.backgroundColor = .white + tabBarController.tabBar.shadowImage = UIImage() + tabBarController.tabBar.backgroundImage = UIImage() + } + + + class func viewControllers() -> [WP_RootNAV]{ + + //首页 + let home = WP_RootNAV(rootViewController: WP_HomeVC()) + home.tabBarItem.imageInsets = UIEdgeInsets.init(top: 20, left: 0, bottom: 20, right: 0) + + home.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.hexSting(color: "#2c2c2c", alpha: 1)], for: .selected) + + let rank = WP_RootNAV(rootViewController: WP_RankingVC()) + rank.tabBarItem.imageInsets = UIEdgeInsets.init(top: 20, left: 0, bottom: 20, right: 0) + + rank.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.hexSting(color: "#2c2c2c", alpha: 1)], for: .selected) + + + + let mine = WP_RootNAV(rootViewController: WP_MineVC()) + mine.tabBarItem.imageInsets = UIEdgeInsets.init(top: 20, left: 0, bottom: 20, right: 0) + mine.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.hexSting(color: "#2c2c2c", alpha: 1)], for: .selected) + + + let viewControllers = [home,rank,mine] + + + + + return viewControllers + + } + + class func tabBarItemsAttributesForController() -> [[String : String]] { + + + let tabBarItemOne = [CYLTabBarItemTitle:"Home", + CYLTabBarItemImage:"home_n", + CYLTabBarItemSelectedImage:"home_s"] + + let tabBarItemrank = [CYLTabBarItemTitle:"Ranking", + CYLTabBarItemImage:"rank_n", + CYLTabBarItemSelectedImage:"rank_s"] + + + + let tabBarItemtwo = [CYLTabBarItemTitle:"Setting", + CYLTabBarItemImage:"mine_n", + CYLTabBarItemSelectedImage:"mine_s"] + + + let tabBarItemsAttributes = [tabBarItemOne,tabBarItemrank,tabBarItemtwo] +// + + return tabBarItemsAttributes + } + + +} diff --git a/WallpaperHD_Live/Tool/CustomCollectionViewFlowLayout.swift b/WallpaperHD_Live/Tool/CustomCollectionViewFlowLayout.swift new file mode 100644 index 0000000..4008c71 --- /dev/null +++ b/WallpaperHD_Live/Tool/CustomCollectionViewFlowLayout.swift @@ -0,0 +1,23 @@ +// +// CustomCollectionViewFlowLayout.swift +// wallpaper_project + + +import UIKit + +class CustomCollectionViewFlowLayout: UICollectionViewFlowLayout { + override func prepare() { + super.prepare() + + guard let collectionView = collectionView else { return } + +// let availableWidth = collectionView.bounds.width - sectionInset.left - sectionInset.right - minimumInteritemSpacing + + let itemWidth = (collectionView.bounds.width - minimumInteritemSpacing * 3) / 2 + + itemSize = CGSize(width: itemWidth, height: 300) // 设置每个单元格的大小 + minimumLineSpacing = 10 // 设置行间距 + minimumInteritemSpacing = 10 // 设置列间距 + sectionInset = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10) + } +} diff --git a/WallpaperHD_Live/Tool/colorManager.swift b/WallpaperHD_Live/Tool/colorManager.swift new file mode 100644 index 0000000..036b5ab --- /dev/null +++ b/WallpaperHD_Live/Tool/colorManager.swift @@ -0,0 +1,59 @@ +// +// colorManager.swift +// wallpaper_project + +import UIKit +import Foundation + +var screenWidth = UIScreen.main.bounds.size.width +var screenHeight = UIScreen.main.bounds.size.height + +extension UIColor{ + + ///转hex值 + /// + class func hexSting(color:String,alpha:CGFloat)->UIColor{ + //删除字符串中的kongge + var cString:String = color.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased() + if cString.count < 6{ + return UIColor.white + } + if cString.hasPrefix("OX") { + let temstr:NSString = cString as NSString + cString = temstr.substring(from: 2)as String + } + if cString.hasPrefix("#") { + let temstr:NSString = cString as NSString + cString = temstr.substring(from: 1) as String + } + if cString.count != 6{ + return UIColor.white + } + var range:NSRange = NSMakeRange(0, 2) + let temstr2:NSString = cString as NSString + let rString = temstr2.substring(with: range)as String + range = NSMakeRange(2, 2) + let gString = temstr2.substring(with: range)as String + range = NSMakeRange(4, 2) + let bString = temstr2.substring(with: range)as String + var r:UInt32 = 0,g:UInt32 = 0,b:UInt32 = 0 + Scanner(string: rString).scanHexInt32(&r) + Scanner(string: gString).scanHexInt32(&g) + Scanner(string: bString).scanHexInt32(&b) + + return self.init(red: CGFloat(r)/255.0, green: CGFloat(g)/255.0, blue: CGFloat(b)/255.0, alpha: alpha) + } + class func colorWithHexString(color:String)->UIColor{ + return hexSting(color: color, alpha: 1.0) + } +} +func generateRandomString(length: Int) -> String { + let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + var randomString = "" + for _ in 0..