- Made shop module, with mvvm, sb, shoplistingview
- Made cell for shop list. - Made shopCategory vc - Worked on dynamic cart button - Worked on Subcategory cells and api call with model - Added product listing api and made the model
This commit is contained in:
@@ -92,6 +92,22 @@
|
||||
52A3F6AB2BECBF550000BB0B /* LinkedChildVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A3F6AA2BECBF550000BB0B /* LinkedChildVC.swift */; };
|
||||
52A3F6AD2BECC0340000BB0B /* TypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A3F6AC2BECC0340000BB0B /* TypeAlias.swift */; };
|
||||
52A3F6AF2BECC0690000BB0B /* LinkedChildVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A3F6AE2BECC0690000BB0B /* LinkedChildVM.swift */; };
|
||||
52A6DC962C4E387F00F63C51 /* Shop.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 52A6DC952C4E387F00F63C51 /* Shop.storyboard */; };
|
||||
52A6DC9C2C4E38E000F63C51 /* ShopListingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DC9B2C4E38E000F63C51 /* ShopListingVC.swift */; };
|
||||
52A6DC9F2C4E3AA600F63C51 /* ShopListingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 52A6DC9E2C4E3AA600F63C51 /* ShopListingCell.xib */; };
|
||||
52A6DCA02C4E3AA600F63C51 /* ShopListingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DC9D2C4E3AA600F63C51 /* ShopListingCell.swift */; };
|
||||
52A6DCA22C4E3B7500F63C51 /* ShopListingVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCA12C4E3B7500F63C51 /* ShopListingVM.swift */; };
|
||||
52A6DCA42C4E48AF00F63C51 /* ShopSuperCategoryDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCA32C4E48AF00F63C51 /* ShopSuperCategoryDM.swift */; };
|
||||
52A6DCAA2C4E59BD00F63C51 /* ShopCategoryDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCA92C4E59BD00F63C51 /* ShopCategoryDM.swift */; };
|
||||
52A6DCAC2C4E5A1100F63C51 /* ShopCategoryVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCAB2C4E5A1100F63C51 /* ShopCategoryVC.swift */; };
|
||||
52A6DCAE2C4E5A3900F63C51 /* ShopCategoryVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCAD2C4E5A3900F63C51 /* ShopCategoryVM.swift */; };
|
||||
52A6DCB02C4E621800F63C51 /* BadgedBarButtonItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCAF2C4E621800F63C51 /* BadgedBarButtonItem.swift */; };
|
||||
52A6DCB22C4E73C800F63C51 /* ShopProductsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCB12C4E73C800F63C51 /* ShopProductsVC.swift */; };
|
||||
52A6DCB42C4E73F100F63C51 /* ShopProductsVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCB32C4E73F100F63C51 /* ShopProductsVM.swift */; };
|
||||
52A6DCB62C4E748100F63C51 /* ShopSubCategoryDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCB52C4E748100F63C51 /* ShopSubCategoryDM.swift */; };
|
||||
52A6DCB82C4E754800F63C51 /* ShopProductDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCB72C4E754800F63C51 /* ShopProductDM.swift */; };
|
||||
52A6DCBB2C4EA46400F63C51 /* ShopProductsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 52A6DCBA2C4EA46400F63C51 /* ShopProductsCell.xib */; };
|
||||
52A6DCBC2C4EA46400F63C51 /* ShopProductsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCB92C4EA46400F63C51 /* ShopProductsCell.swift */; };
|
||||
52A981CE2C1AFE66000E0BEC /* FavouriteListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981CD2C1AFE66000E0BEC /* FavouriteListingDM.swift */; };
|
||||
52A981D02C1AFEE8000E0BEC /* MyListVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981CF2C1AFEE8000E0BEC /* MyListVM.swift */; };
|
||||
52A981D72C1B0E27000E0BEC /* FavouriteCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981D52C1B0E27000E0BEC /* FavouriteCell.swift */; };
|
||||
@@ -377,6 +393,22 @@
|
||||
52A3F6AA2BECBF550000BB0B /* LinkedChildVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkedChildVC.swift; sourceTree = "<group>"; };
|
||||
52A3F6AC2BECC0340000BB0B /* TypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeAlias.swift; sourceTree = "<group>"; };
|
||||
52A3F6AE2BECC0690000BB0B /* LinkedChildVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkedChildVM.swift; sourceTree = "<group>"; };
|
||||
52A6DC952C4E387F00F63C51 /* Shop.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Shop.storyboard; sourceTree = "<group>"; };
|
||||
52A6DC9B2C4E38E000F63C51 /* ShopListingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopListingVC.swift; sourceTree = "<group>"; };
|
||||
52A6DC9D2C4E3AA600F63C51 /* ShopListingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopListingCell.swift; sourceTree = "<group>"; };
|
||||
52A6DC9E2C4E3AA600F63C51 /* ShopListingCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShopListingCell.xib; sourceTree = "<group>"; };
|
||||
52A6DCA12C4E3B7500F63C51 /* ShopListingVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopListingVM.swift; sourceTree = "<group>"; };
|
||||
52A6DCA32C4E48AF00F63C51 /* ShopSuperCategoryDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopSuperCategoryDM.swift; sourceTree = "<group>"; };
|
||||
52A6DCA92C4E59BD00F63C51 /* ShopCategoryDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopCategoryDM.swift; sourceTree = "<group>"; };
|
||||
52A6DCAB2C4E5A1100F63C51 /* ShopCategoryVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopCategoryVC.swift; sourceTree = "<group>"; };
|
||||
52A6DCAD2C4E5A3900F63C51 /* ShopCategoryVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopCategoryVM.swift; sourceTree = "<group>"; };
|
||||
52A6DCAF2C4E621800F63C51 /* BadgedBarButtonItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BadgedBarButtonItem.swift; sourceTree = "<group>"; };
|
||||
52A6DCB12C4E73C800F63C51 /* ShopProductsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopProductsVC.swift; sourceTree = "<group>"; };
|
||||
52A6DCB32C4E73F100F63C51 /* ShopProductsVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopProductsVM.swift; sourceTree = "<group>"; };
|
||||
52A6DCB52C4E748100F63C51 /* ShopSubCategoryDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopSubCategoryDM.swift; sourceTree = "<group>"; };
|
||||
52A6DCB72C4E754800F63C51 /* ShopProductDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopProductDM.swift; sourceTree = "<group>"; };
|
||||
52A6DCB92C4EA46400F63C51 /* ShopProductsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopProductsCell.swift; sourceTree = "<group>"; };
|
||||
52A6DCBA2C4EA46400F63C51 /* ShopProductsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShopProductsCell.xib; sourceTree = "<group>"; };
|
||||
52A981CD2C1AFE66000E0BEC /* FavouriteListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteListingDM.swift; sourceTree = "<group>"; };
|
||||
52A981CF2C1AFEE8000E0BEC /* MyListVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyListVM.swift; sourceTree = "<group>"; };
|
||||
52A981D52C1B0E27000E0BEC /* FavouriteCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteCell.swift; sourceTree = "<group>"; };
|
||||
@@ -690,6 +722,8 @@
|
||||
523ED25C2BDA2BC700CFED02 /* WOKA */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52A6DCAF2C4E621800F63C51 /* BadgedBarButtonItem.swift */,
|
||||
52A6DC942C4E385500F63C51 /* Shop */,
|
||||
9CB3D0832C37BA470062869D /* Karaoke */,
|
||||
526A436D2C36A96A00AE148F /* Games */,
|
||||
52BFB52B2C33DA9700BAAE15 /* Audio Books */,
|
||||
@@ -977,6 +1011,60 @@
|
||||
path = Timer;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52A6DC942C4E385500F63C51 /* Shop */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52A6DC9A2C4E388C00F63C51 /* Model */,
|
||||
52A6DC992C4E388900F63C51 /* View */,
|
||||
52A6DC982C4E388600F63C51 /* ViewModel */,
|
||||
52A6DC972C4E388300F63C51 /* Controller */,
|
||||
52A6DC952C4E387F00F63C51 /* Shop.storyboard */,
|
||||
);
|
||||
path = Shop;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52A6DC972C4E388300F63C51 /* Controller */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52A6DC9B2C4E38E000F63C51 /* ShopListingVC.swift */,
|
||||
52A6DCAB2C4E5A1100F63C51 /* ShopCategoryVC.swift */,
|
||||
52A6DCB12C4E73C800F63C51 /* ShopProductsVC.swift */,
|
||||
);
|
||||
path = Controller;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52A6DC982C4E388600F63C51 /* ViewModel */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52A6DCA12C4E3B7500F63C51 /* ShopListingVM.swift */,
|
||||
52A6DCAD2C4E5A3900F63C51 /* ShopCategoryVM.swift */,
|
||||
52A6DCB32C4E73F100F63C51 /* ShopProductsVM.swift */,
|
||||
);
|
||||
path = ViewModel;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52A6DC992C4E388900F63C51 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52A6DC9D2C4E3AA600F63C51 /* ShopListingCell.swift */,
|
||||
52A6DC9E2C4E3AA600F63C51 /* ShopListingCell.xib */,
|
||||
52A6DCB92C4EA46400F63C51 /* ShopProductsCell.swift */,
|
||||
52A6DCBA2C4EA46400F63C51 /* ShopProductsCell.xib */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52A6DC9A2C4E388C00F63C51 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
52A6DCA32C4E48AF00F63C51 /* ShopSuperCategoryDM.swift */,
|
||||
52A6DCA92C4E59BD00F63C51 /* ShopCategoryDM.swift */,
|
||||
52A6DCB52C4E748100F63C51 /* ShopSubCategoryDM.swift */,
|
||||
52A6DCB72C4E754800F63C51 /* ShopProductDM.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
52BFB52B2C33DA9700BAAE15 /* Audio Books */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -1624,6 +1712,7 @@
|
||||
52D6A24B2C21B43300145908 /* WebSeriesCell.xib in Resources */,
|
||||
52DAC6482C21762900E2F85B /* WebSeries.storyboard in Resources */,
|
||||
527AC6F82C171C8F00434FB7 /* BlogsCell.xib in Resources */,
|
||||
52A6DC962C4E387F00F63C51 /* Shop.storyboard in Resources */,
|
||||
52A981D82C1B0E27000E0BEC /* FavouriteCell.xib in Resources */,
|
||||
52C1A4E82C05C95D007BAA50 /* Theme.storyboard in Resources */,
|
||||
526A436F2C36A97400AE148F /* Games.storyboard in Resources */,
|
||||
@@ -1639,10 +1728,12 @@
|
||||
9C834ED32C1C1F9200B29A9C /* Exo2-SemiBold.ttf in Resources */,
|
||||
9C834ED42C1C1F9200B29A9C /* Exo2-Medium.ttf in Resources */,
|
||||
52BFB52D2C33DAA500BAAE15 /* AudioBooks.storyboard in Resources */,
|
||||
52A6DC9F2C4E3AA600F63C51 /* ShopListingCell.xib in Resources */,
|
||||
9C834ED52C1C1F9200B29A9C /* Exo2-Bold.ttf in Resources */,
|
||||
9C834ED62C1C1F9200B29A9C /* Exo2-ExtraBold.ttf in Resources */,
|
||||
9C834ED72C1C1F9200B29A9C /* Exo2-Regular.ttf in Resources */,
|
||||
9C834ED82C1C1F9200B29A9C /* Exo2-Thin.ttf in Resources */,
|
||||
52A6DCBB2C4EA46400F63C51 /* ShopProductsCell.xib in Resources */,
|
||||
9CB3D0852C37BA530062869D /* Karaoke.storyboard in Resources */,
|
||||
52C6E0262BE3B46A00E22D59 /* SelectAvatarCell.xib in Resources */,
|
||||
52C8B0712BDA7512003B51D0 /* PassingCloud.json in Resources */,
|
||||
@@ -1735,6 +1826,7 @@
|
||||
5202AAFE2BDF90590043B7BD /* TextFieldImage.swift in Sources */,
|
||||
9C7939152C0F23AA00F5D6E6 /* NsNotificationExtension.swift in Sources */,
|
||||
528E5F1B2C24531200E33E4E /* SeasonListingDM.swift in Sources */,
|
||||
52A6DCAA2C4E59BD00F63C51 /* ShopCategoryDM.swift in Sources */,
|
||||
52FDDAB52BF34DC300E037C1 /* YesNoAlertVC.swift in Sources */,
|
||||
52C6E0232BE3B3E300E22D59 /* SelectAvatarVC.swift in Sources */,
|
||||
52F4E8662C3D123B00778FBC /* JWKaraokePlayerVC.swift in Sources */,
|
||||
@@ -1753,14 +1845,17 @@
|
||||
52D6A24C2C21B43300145908 /* WebSeriesCell.swift in Sources */,
|
||||
5242FE5B2C24317A0086A86D /* WebSeriesSeasonVM.swift in Sources */,
|
||||
524C422B2C04781B0016A11C /* ThemeTwoVM.swift in Sources */,
|
||||
52A6DCA22C4E3B7500F63C51 /* ShopListingVM.swift in Sources */,
|
||||
52C8EC7A2C353653002DC35C /* ContinueAudioListDM.swift in Sources */,
|
||||
52B8D4DF2C04A25E00ED65F3 /* StatusBar.swift in Sources */,
|
||||
5259541D2BE8D94400191286 /* QueueHelper.swift in Sources */,
|
||||
525954232BE8F00400191286 /* BaseResponseModel.swift in Sources */,
|
||||
52A6DCB42C4E73F100F63C51 /* ShopProductsVM.swift in Sources */,
|
||||
9C27E1692BDB76F200EC1DA9 /* OnBoardVM.swift in Sources */,
|
||||
9C7939172C0F23E900F5D6E6 /* LinkTypeEnum.swift in Sources */,
|
||||
523ED2622BDA2BC700CFED02 /* SplashVC.swift in Sources */,
|
||||
9CDC343C2BDBBC6B00093089 /* SelectAgeVC.swift in Sources */,
|
||||
52A6DCAC2C4E5A1100F63C51 /* ShopCategoryVC.swift in Sources */,
|
||||
525327D02BFCBC4A00F64283 /* ExploreWokaVC.swift in Sources */,
|
||||
52C8B0542BDA4BD1003B51D0 /* RoundCorner.swift in Sources */,
|
||||
522242662BFC74380085C632 /* MyListVC.swift in Sources */,
|
||||
@@ -1775,6 +1870,7 @@
|
||||
52B8D4E12C04A25E00ED65F3 /* BasicTransitionAnimator.swift in Sources */,
|
||||
52AF71F02C36B29A00BC5972 /* GamesListDM.swift in Sources */,
|
||||
52BC3BF02C1701F8002FACA6 /* BlogDM.swift in Sources */,
|
||||
52A6DCA02C4E3AA600F63C51 /* ShopListingCell.swift in Sources */,
|
||||
525954192BE8CC3400191286 /* ConstantString.swift in Sources */,
|
||||
52D774EB2BDFC0BF001D87DE /* OTPVC.swift in Sources */,
|
||||
9C8446872C40FC6E003E3E53 /* AVPlayerTesting.swift in Sources */,
|
||||
@@ -1811,6 +1907,7 @@
|
||||
9CBCB2A52BE50D49007D7934 /* NewPasswordVC.swift in Sources */,
|
||||
52C8D8D42C2D9F3400CA72A6 /* LikeFavCommonFunc.swift in Sources */,
|
||||
9CBCB29F2BE4E13A007D7934 /* ValidatorClass.swift in Sources */,
|
||||
52A6DCBC2C4EA46400F63C51 /* ShopProductsCell.swift in Sources */,
|
||||
528BEF602C2C372900FFDAB8 /* ContinueWatchingVC.swift in Sources */,
|
||||
9CBCB29B2BE4D614007D7934 /* LoginVC.swift in Sources */,
|
||||
52BC3BE82C0E04A9002FACA6 /* FaqListDM.swift in Sources */,
|
||||
@@ -1832,6 +1929,7 @@
|
||||
52AF71EE2C36AD3100BC5972 /* GamesListVM.swift in Sources */,
|
||||
52A981CE2C1AFE66000E0BEC /* FavouriteListingDM.swift in Sources */,
|
||||
527AC6FD2C173A5100434FB7 /* SongListCell.swift in Sources */,
|
||||
52A6DCAE2C4E5A3900F63C51 /* ShopCategoryVM.swift in Sources */,
|
||||
52D6A2542C22B93F00145908 /* CategoryListingDM.swift in Sources */,
|
||||
9C27E1672BDB706700EC1DA9 /* StoryBoard.swift in Sources */,
|
||||
52C8B0692BDA6E1E003B51D0 /* LocalizedEnum.swift in Sources */,
|
||||
@@ -1843,6 +1941,7 @@
|
||||
9C1C69FC2C106C240035B2C7 /* ContactSupportVM.swift in Sources */,
|
||||
52AF71F22C36B77B00BC5972 /* GamesDetailVC.swift in Sources */,
|
||||
52A3F6AF2BECC0690000BB0B /* LinkedChildVM.swift in Sources */,
|
||||
52A6DCB02C4E621800F63C51 /* BadgedBarButtonItem.swift in Sources */,
|
||||
52C8EC7D2C3536E5002DC35C /* ContinueAudioCell.swift in Sources */,
|
||||
525954252BE8F01600191286 /* ValueWrapper.swift in Sources */,
|
||||
52A3F6A82BECBF2A0000BB0B /* LinkedChildCell.swift in Sources */,
|
||||
@@ -1852,6 +1951,7 @@
|
||||
52FDBA7D2BFF481A009D7AC7 /* ThemeOneVM.swift in Sources */,
|
||||
9C7939192C0F345000F5D6E6 /* ContactSupportVC.swift in Sources */,
|
||||
9CBE1B432C0F37B300CA6E61 /* DropDown.swift in Sources */,
|
||||
52A6DC9C2C4E38E000F63C51 /* ShopListingVC.swift in Sources */,
|
||||
52C8B0742BDA7626003B51D0 /* OnBoardVC.swift in Sources */,
|
||||
5219C2C22C086D9C00A1DF4D /* DataTypeConversion.swift in Sources */,
|
||||
525953CF2BE8B28F00191286 /* Utilities.swift in Sources */,
|
||||
@@ -1880,6 +1980,7 @@
|
||||
5272FCE52BDFDC8C000ECB1D /* UserDetailsRegisterVM.swift in Sources */,
|
||||
528E5F222C24660F00E33E4E /* SeasonCategoryCell.swift in Sources */,
|
||||
525954272BE9178F00191286 /* UserDataDM.swift in Sources */,
|
||||
52A6DCB62C4E748100F63C51 /* ShopSubCategoryDM.swift in Sources */,
|
||||
9C27E1652BDB6FBC00EC1DA9 /* StoryBoardID.swift in Sources */,
|
||||
9CB3D08B2C37BBA50062869D /* KaraokeListingVC.swift in Sources */,
|
||||
52FDBA782BFF23F4009D7AC7 /* TimePeriod.swift in Sources */,
|
||||
@@ -1903,8 +2004,10 @@
|
||||
52E214C72C2AD47F00BC2D29 /* EpisodeDetailsVC.swift in Sources */,
|
||||
52D774F12BDFC53B001D87DE /* StringSubScript.swift in Sources */,
|
||||
9CBE1B3F2C0F37B300CA6E61 /* DPDConstants.swift in Sources */,
|
||||
52A6DCA42C4E48AF00F63C51 /* ShopSuperCategoryDM.swift in Sources */,
|
||||
52B8D4DA2C04A25E00ED65F3 /* Preferences.swift in Sources */,
|
||||
52FB2D8F2BDF898F0009B0C7 /* TextFieldPadding.swift in Sources */,
|
||||
52A6DCB22C4E73C800F63C51 /* ShopProductsVC.swift in Sources */,
|
||||
5257B2652BDFB6F50086D79B /* CheckPhoneHomeBtnOrNotch.swift in Sources */,
|
||||
52663FF92BDFAF110001D8CE /* EmailVM.swift in Sources */,
|
||||
52C1A4E52C05BC86007BAA50 /* MainNavController.swift in Sources */,
|
||||
@@ -1923,6 +2026,7 @@
|
||||
52C6E0212BE3ADE300E22D59 /* GenderEnum.swift in Sources */,
|
||||
9CA7C6C02C1093E500D73742 /* ProfileVC.swift in Sources */,
|
||||
525953D12BE8B2B200191286 /* LLSpinner.swift in Sources */,
|
||||
52A6DCB82C4E754800F63C51 /* ShopProductDM.swift in Sources */,
|
||||
52C6E0272BE3B46A00E22D59 /* SelectAvatarCell.swift in Sources */,
|
||||
9C535DB82C0089B400DA6DCD /* ViewButtonAnimation.swift in Sources */,
|
||||
);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Group 183.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB |
212
WOKA/BadgedBarButtonItem.swift
Normal file
212
WOKA/BadgedBarButtonItem.swift
Normal file
@@ -0,0 +1,212 @@
|
||||
//
|
||||
// BadgedBarButtonItem.swift
|
||||
// BadgedBarButtonItem
|
||||
//
|
||||
// Created by Maksim Artemov on 17/07/2019.
|
||||
// Copyright © 2019 Max. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public enum BadgePosition {
|
||||
case left
|
||||
case right
|
||||
}
|
||||
|
||||
public enum BadgeSize {
|
||||
case extraSmall
|
||||
case small
|
||||
case medium
|
||||
case large
|
||||
}
|
||||
|
||||
public class BadgedButtonItem: UIBarButtonItem {
|
||||
|
||||
public func setBadge(with value: Int?) {
|
||||
self.badgeValue = value
|
||||
}
|
||||
|
||||
public var badgeTintColor: UIColor? {
|
||||
didSet {
|
||||
lblBadge.backgroundColor = badgeTintColor
|
||||
}
|
||||
}
|
||||
|
||||
public var badgeTextColor: UIColor? {
|
||||
didSet {
|
||||
lblBadge.textColor = badgeTextColor
|
||||
}
|
||||
}
|
||||
|
||||
public var position: BadgePosition? = .right {
|
||||
didSet {
|
||||
if position == .left {
|
||||
self.lblBadge.frame = CGRect(x: 0,
|
||||
y: 0,
|
||||
width: badgeRadius * 2,
|
||||
height: badgeRadius * 2)
|
||||
} else {
|
||||
self.lblBadge.frame = CGRect(x: filterBtn.frame.maxX - badgeRadius * 2 - 5,
|
||||
y: 0,
|
||||
width: badgeRadius * 2,
|
||||
height: badgeRadius * 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public var hasBorder: Bool? {
|
||||
didSet {
|
||||
if hasBorder == true {
|
||||
lblBadge.layer.borderWidth = 1.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public var borderColor: UIColor? = .black {
|
||||
didSet {
|
||||
lblBadge.layer.borderColor = borderColor?.cgColor
|
||||
}
|
||||
}
|
||||
|
||||
public var badgeSize: BadgeSize = .medium {
|
||||
didSet {
|
||||
switch badgeSize {
|
||||
case .extraSmall:
|
||||
self.badgeRadius = 6.0
|
||||
case .small:
|
||||
self.badgeRadius = 7.0
|
||||
case .medium:
|
||||
self.badgeRadius = 8.0
|
||||
case .large:
|
||||
self.badgeRadius = 9.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public var badgeAnimation: Bool? = false {
|
||||
didSet {
|
||||
self.isAnimated = badgeAnimation
|
||||
}
|
||||
}
|
||||
|
||||
public var tapAction: (() -> Void)?
|
||||
|
||||
private var badgeValue: Int? {
|
||||
didSet {
|
||||
if let value = badgeValue,
|
||||
value > 0 {
|
||||
|
||||
// reducing font size if the value has two digits
|
||||
if "\(value)".count > 1 {
|
||||
lblBadge.font = UIFont.systemFont(ofSize: twoDigitsFontSize)
|
||||
} else {
|
||||
lblBadge.font = UIFont.systemFont(ofSize: oneDigitFontSize)
|
||||
}
|
||||
|
||||
lblBadge.isHidden = false
|
||||
lblBadge.text = "\(value)"
|
||||
animateBadge(isAnimated)
|
||||
} else {
|
||||
lblBadge.isHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private let filterBtn = UIButton()
|
||||
private let lblBadge = UILabel()
|
||||
private var isAnimated: Bool? = false
|
||||
private var badgeRadius: CGFloat = 8.0 {
|
||||
didSet {
|
||||
self.lblBadge.layer.cornerRadius = badgeRadius
|
||||
}
|
||||
}
|
||||
|
||||
private var oneDigitFontSize: CGFloat {
|
||||
return badgeRadius + 1
|
||||
}
|
||||
private var twoDigitsFontSize: CGFloat {
|
||||
return badgeRadius
|
||||
}
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
setup()
|
||||
}
|
||||
|
||||
init(with image: UIImage?) {
|
||||
super.init()
|
||||
setup(image: image)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
setup()
|
||||
}
|
||||
|
||||
private func setup(image: UIImage? = nil) {
|
||||
|
||||
self.filterBtn.frame = CGRect(x: 0, y: 0, width: 55, height: 55)
|
||||
self.filterBtn.adjustsImageWhenHighlighted = false
|
||||
let scaledImage = UIImage.imageWithImage(image, scaledToSize: CGSize(width: 45, height: 50))
|
||||
self.filterBtn.setImage(scaledImage?.withRenderingMode(.alwaysOriginal), for: .normal)
|
||||
self.filterBtn.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside)
|
||||
|
||||
self.lblBadge.frame = CGRect(x: filterBtn.frame.maxX - badgeRadius * 2,
|
||||
y: 0,
|
||||
width: badgeRadius * 2,
|
||||
height: badgeRadius * 2)
|
||||
self.lblBadge.backgroundColor = .red
|
||||
self.lblBadge.clipsToBounds = true
|
||||
self.lblBadge.layer.cornerRadius = badgeRadius
|
||||
self.lblBadge.textColor = .white
|
||||
self.lblBadge.font = UIFont.systemFont(ofSize: 10)
|
||||
self.lblBadge.textAlignment = .center
|
||||
self.lblBadge.isHidden = true
|
||||
self.lblBadge.minimumScaleFactor = 0.5
|
||||
self.lblBadge.adjustsFontSizeToFitWidth = true
|
||||
self.filterBtn.addSubview(lblBadge)
|
||||
self.customView = filterBtn
|
||||
}
|
||||
|
||||
@objc private func buttonPressed() {
|
||||
if let action = tapAction {
|
||||
action()
|
||||
}
|
||||
}
|
||||
|
||||
private func animateBadge(_ animate: Bool?) {
|
||||
guard animate == true else { return }
|
||||
lblBadge.transform = CGAffineTransform(scaleX: 1.2, y: 1.2)
|
||||
UIView.animate(withDuration: 0.4,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: 0.2,
|
||||
initialSpringVelocity: 3,
|
||||
options: [.curveLinear],
|
||||
animations: { [weak self] in
|
||||
|
||||
guard let strongSelf = self else { return }
|
||||
strongSelf.lblBadge.transform = .identity
|
||||
|
||||
}) { [weak self] (finished) in
|
||||
|
||||
guard let strongSelf = self else { return }
|
||||
if !finished {
|
||||
strongSelf.lblBadge.transform = .identity
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Takes an image and returns a new one identical but resized.
|
||||
private extension UIImage {
|
||||
static func imageWithImage(_ image: UIImage?, scaledToSize newSize: CGSize) -> UIImage? {
|
||||
guard let image = image else { return nil }
|
||||
UIGraphicsBeginImageContextWithOptions(newSize, false, 0.0)
|
||||
image.draw(in: CGRect(origin: CGPoint.zero, size: CGSize(width: newSize.width, height: newSize.height)))
|
||||
let newImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
|
||||
UIGraphicsEndImageContext()
|
||||
return newImage
|
||||
}
|
||||
}
|
||||
@@ -48,5 +48,10 @@ extension K{
|
||||
struct AudioBooks{
|
||||
static let continueAudioCell = "ContinueAudioCell"
|
||||
}
|
||||
|
||||
struct Shop{
|
||||
static let shopListingCell = "ShopListingCell"
|
||||
static let shopProductsCell = "ShopProductsCell"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,5 +20,6 @@ extension K{
|
||||
static let audioBooks = "AudioBooks"
|
||||
static let Games = "Games"
|
||||
static let Karaoke = "Karaoke"
|
||||
static let shop = "Shop"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,5 +91,12 @@ extension K{
|
||||
static let aVPlayerVC = "AVPlayerVC"
|
||||
}
|
||||
|
||||
// MARK: - Shop
|
||||
|
||||
struct Shop{
|
||||
static let shopListingVC = "ShopListingVC"
|
||||
static let shopCategoryVC = "ShopCategoryVC"
|
||||
static let shopProductsVC = "ShopProductsVC"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,12 @@ import UIKit
|
||||
|
||||
class ShimmerEffectView: UIView {
|
||||
|
||||
var gradientColorOne: CGColor = UIColor(red: 0.176, green: 0.012, blue: 0.561, alpha: 1.0).cgColor
|
||||
var gradientColorTwo: CGColor = UIColor(white: 0.925, alpha: 1.0).cgColor
|
||||
// var gradientColorOne: CGColor = UIColor(red: 0.176, green: 0.012, blue: 0.561, alpha: 1.0).cgColor
|
||||
var gradientColorOne: CGColor = #colorLiteral(red: 0.2364082336, green: 0.1172600761, blue: 0.6259267926, alpha: 1).cgColor
|
||||
// var gradientColorTwo: CGColor = UIColor(white: 0.925, alpha: 1.0).cgColor
|
||||
var gradientColorTwo: CGColor = #colorLiteral(red: 0.9254901961, green: 0.9254901961, blue: 0.9254901961, alpha: 1).cgColor
|
||||
|
||||
|
||||
private var gradientLayer: CAGradientLayer?
|
||||
|
||||
override init(frame: CGRect) {
|
||||
|
||||
@@ -103,6 +103,13 @@ struct APIEndPoints {
|
||||
static let sing_karaoke_listing = makeURL(path: "sing_karaoke_listing")
|
||||
}
|
||||
|
||||
struct Shop{
|
||||
static let super_category_listing = makeURL(path: "super_category_listing")
|
||||
static let category_listing = makeURL(path: "category_listing")
|
||||
static let sub_category_listing = makeURL(path: "sub_category_listing")
|
||||
static let shop_product_listing = makeURL(path: "shop_product_listing")
|
||||
}
|
||||
|
||||
// Other endpoint categories...
|
||||
struct Links {
|
||||
static let privacyPolicy = "https://www.wokaland.com/privacy-policy/"
|
||||
|
||||
107
WOKA/Shop/Controller/ShopCategoryVC.swift
Normal file
107
WOKA/Shop/Controller/ShopCategoryVC.swift
Normal file
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// ShopCategoryVC.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ShopCategoryVC: UIViewController {
|
||||
|
||||
@IBOutlet weak var tableView: UITableView!
|
||||
|
||||
var vm = ShopCategoryVM()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
vm.vc = self
|
||||
vm.initView()
|
||||
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
||||
navigationController?.navigationBar.shadowImage = UIImage()
|
||||
|
||||
// Create the button
|
||||
let backbutton = UIButton(type: .custom)
|
||||
backbutton.setImage(UIImage(named: "CartIcon"), for: .normal) // Image can be downloaded from the provided link
|
||||
backbutton.setTitleColor(.black, for: .normal) // You can change the TitleColor
|
||||
backbutton.addTarget(self, action: #selector(cartBtnTapped), for: .touchUpInside)
|
||||
|
||||
// Set button height and width
|
||||
let buttonHeight: CGFloat = 50
|
||||
let buttonWidth: CGFloat = 50
|
||||
backbutton.translatesAutoresizingMaskIntoConstraints = false
|
||||
backbutton.widthAnchor.constraint(equalToConstant: buttonWidth).isActive = true
|
||||
backbutton.heightAnchor.constraint(equalToConstant: buttonHeight).isActive = true
|
||||
|
||||
// Create a container view for the button
|
||||
let containerView = UIView(frame: CGRect(x: 0, y: 0, width: buttonWidth, height: buttonHeight))
|
||||
containerView.addSubview(backbutton)
|
||||
|
||||
// Set constraints for the button inside the container view
|
||||
NSLayoutConstraint.activate([
|
||||
backbutton.centerYAnchor.constraint(equalTo: containerView.centerYAnchor),
|
||||
backbutton.centerXAnchor.constraint(equalTo: containerView.centerXAnchor)
|
||||
])
|
||||
|
||||
// Create a UIBarButtonItem with the custom view
|
||||
let customBarButton = UIBarButtonItem(customView: containerView)
|
||||
|
||||
// Create a flexible space item to push the custom view to the left
|
||||
let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
|
||||
flexibleSpace.width = 10
|
||||
// Create a negative spacer to fine-tune the position
|
||||
let negativeSpacer = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
|
||||
negativeSpacer.width = 10 // Adjust this value to move the button to the left
|
||||
|
||||
// Add the custom bar button and the spacer to the navigation bar
|
||||
self.navigationItem.rightBarButtonItems = [flexibleSpace,negativeSpacer, customBarButton]
|
||||
}
|
||||
|
||||
@objc func cartBtnTapped(){
|
||||
print("cart tapped")
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
self.navigationController?.setNavigationBarHidden(false, animated: animated)
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
self.navigationController?.setColor(color: .white)
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
self.navigationController?.setNavigationBarHidden(true, animated: animated)
|
||||
}
|
||||
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
|
||||
// Customize the navigation bar's appearance
|
||||
self.navigationController?.setColor(color: .black)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - TableView DataSource , Delegates
|
||||
|
||||
extension ShopCategoryVC : TableViewSRC{
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return vm.categoryData.count
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Shop.shopListingCell) as! ShopListingCell
|
||||
let data = vm.categoryData[indexPath.row]
|
||||
cell.setCategoryData(data: data)
|
||||
return cell
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
let data = vm.categoryData[indexPath.row]
|
||||
let sb = UIStoryboard(name: K.StoryBoard.shop, bundle: nil)
|
||||
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Shop.shopProductsVC) as! ShopProductsVC
|
||||
vcPush.vm.categoryID = data.id
|
||||
vcPush.vm.pageTitle = data.categoryName
|
||||
self.navigationController?.pushViewController(vcPush, animated: true)
|
||||
}
|
||||
}
|
||||
107
WOKA/Shop/Controller/ShopListingVC.swift
Normal file
107
WOKA/Shop/Controller/ShopListingVC.swift
Normal file
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// ShopListingVC.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ShopListingVC: UIViewController {
|
||||
|
||||
@IBOutlet weak var tableView: UITableView!
|
||||
|
||||
var vm = ShopListingVM()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
vm.vc = self
|
||||
vm.initView()
|
||||
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
||||
navigationController?.navigationBar.shadowImage = UIImage()
|
||||
|
||||
// Create the button
|
||||
let backbutton = UIButton(type: .custom)
|
||||
backbutton.setImage(UIImage(named: "CartIcon"), for: .normal) // Image can be downloaded from the provided link
|
||||
backbutton.setTitleColor(.black, for: .normal) // You can change the TitleColor
|
||||
backbutton.addTarget(self, action: #selector(vm.cartBtnTapped), for: .touchUpInside)
|
||||
|
||||
// Set button height and width
|
||||
let buttonHeight: CGFloat = 50
|
||||
let buttonWidth: CGFloat = 50
|
||||
backbutton.translatesAutoresizingMaskIntoConstraints = false
|
||||
backbutton.widthAnchor.constraint(equalToConstant: buttonWidth).isActive = true
|
||||
backbutton.heightAnchor.constraint(equalToConstant: buttonHeight).isActive = true
|
||||
|
||||
// Create a container view for the button
|
||||
let containerView = UIView(frame: CGRect(x: 0, y: 0, width: buttonWidth, height: buttonHeight))
|
||||
containerView.addSubview(backbutton)
|
||||
|
||||
// Set constraints for the button inside the container view
|
||||
NSLayoutConstraint.activate([
|
||||
backbutton.centerYAnchor.constraint(equalTo: containerView.centerYAnchor),
|
||||
backbutton.centerXAnchor.constraint(equalTo: containerView.centerXAnchor)
|
||||
])
|
||||
|
||||
// Create a UIBarButtonItem with the custom view
|
||||
let customBarButton = UIBarButtonItem(customView: containerView)
|
||||
|
||||
// Create a flexible space item to push the custom view to the left
|
||||
let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
|
||||
flexibleSpace.width = 10
|
||||
// Create a negative spacer to fine-tune the position
|
||||
let negativeSpacer = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
|
||||
negativeSpacer.width = 10 // Adjust this value to move the button to the left
|
||||
|
||||
// Add the custom bar button and the spacer to the navigation bar
|
||||
self.navigationItem.rightBarButtonItems = [flexibleSpace,negativeSpacer, customBarButton]
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
navigationController?.setNavigationBarHidden(false, animated: animated)
|
||||
self.navigationController?.setColor(color: .white)
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
self.navigationController?.setNavigationBarHidden(true, animated: animated)
|
||||
}
|
||||
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
|
||||
// Customize the navigation bar's appearance
|
||||
self.navigationController?.setColor(color: .black)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - TableView DataSource , Delegates
|
||||
|
||||
extension ShopListingVC : TableViewSRC{
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return vm.superCatData.count == 0 ? 3 : vm.superCatData.count
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Shop.shopListingCell) as! ShopListingCell
|
||||
|
||||
if vm.superCatData.count == 0{
|
||||
cell.showShimmer()
|
||||
}else{
|
||||
let data = vm.superCatData[indexPath.row]
|
||||
cell.setData(data: data)
|
||||
cell.stopShimmer()
|
||||
}
|
||||
return cell
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
if vm.superCatData.count == 0 {return}
|
||||
let superCatID = vm.superCatData[indexPath.row].id
|
||||
let sb = UIStoryboard(name: K.StoryBoard.shop, bundle: nil)
|
||||
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Shop.shopCategoryVC) as! ShopCategoryVC
|
||||
vcPush.vm.superCatID = superCatID
|
||||
self.navigationController?.pushViewController(vcPush, animated: true)
|
||||
}
|
||||
}
|
||||
138
WOKA/Shop/Controller/ShopProductsVC.swift
Normal file
138
WOKA/Shop/Controller/ShopProductsVC.swift
Normal file
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// ShopProductsVC.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ShopProductsVC: UIViewController {
|
||||
|
||||
@IBOutlet weak var collectionView: UICollectionView!
|
||||
@IBOutlet weak var subCategoryCV: UICollectionView!
|
||||
@IBOutlet weak var productCV: UICollectionView!
|
||||
|
||||
var vm = ShopProductsVM()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
vm.vc = self
|
||||
vm.initView()
|
||||
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
||||
navigationController?.navigationBar.shadowImage = UIImage()
|
||||
|
||||
// Create the button
|
||||
let backbutton = UIButton(type: .custom)
|
||||
backbutton.setImage(UIImage(named: "CartIcon"), for: .normal) // Image can be downloaded from the provided link
|
||||
backbutton.setTitleColor(.black, for: .normal) // You can change the TitleColor
|
||||
backbutton.addTarget(self, action: #selector(cartBtnTapped), for: .touchUpInside)
|
||||
|
||||
// Set button height and width
|
||||
let buttonHeight: CGFloat = 50
|
||||
let buttonWidth: CGFloat = 50
|
||||
backbutton.translatesAutoresizingMaskIntoConstraints = false
|
||||
backbutton.widthAnchor.constraint(equalToConstant: buttonWidth).isActive = true
|
||||
backbutton.heightAnchor.constraint(equalToConstant: buttonHeight).isActive = true
|
||||
|
||||
// Create a container view for the button
|
||||
let containerView = UIView(frame: CGRect(x: 0, y: 0, width: buttonWidth, height: buttonHeight))
|
||||
containerView.addSubview(backbutton)
|
||||
|
||||
// Set constraints for the button inside the container view
|
||||
NSLayoutConstraint.activate([
|
||||
backbutton.centerYAnchor.constraint(equalTo: containerView.centerYAnchor),
|
||||
backbutton.centerXAnchor.constraint(equalTo: containerView.centerXAnchor)
|
||||
])
|
||||
|
||||
// Create a UIBarButtonItem with the custom view
|
||||
let customBarButton = UIBarButtonItem(customView: containerView)
|
||||
|
||||
// Create a flexible space item to push the custom view to the left
|
||||
let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
|
||||
flexibleSpace.width = 10
|
||||
// Create a negative spacer to fine-tune the position
|
||||
let negativeSpacer = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
|
||||
negativeSpacer.width = 10 // Adjust this value to move the button to the left
|
||||
|
||||
// Add the custom bar button and the spacer to the navigation bar
|
||||
self.navigationItem.rightBarButtonItems = [flexibleSpace,negativeSpacer, customBarButton]
|
||||
}
|
||||
|
||||
@objc func cartBtnTapped(){
|
||||
print("cart tapped")
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
self.navigationController?.setNavigationBarHidden(false, animated: animated)
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
self.navigationController?.setColor(color: .white)
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
self.navigationController?.setNavigationBarHidden(true, animated: animated)
|
||||
}
|
||||
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
|
||||
// Customize the navigation bar's appearance
|
||||
self.navigationController?.setColor(color: .black)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - CollectionView Delegate
|
||||
|
||||
extension ShopProductsVC : CollectionViewSRC{
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return vm.subCategoryData.count
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: K.CellIdentifier.WebSeries.seasonCategoryCell, for: indexPath) as! SeasonCategoryCell
|
||||
|
||||
let data = vm.subCategoryData[indexPath.row]
|
||||
// cell.setData(title: data.seasonNumber ?? "Season", iselected: data.id == vm.episodeSelectedCateogory)
|
||||
cell.setSubCategory(data: data, isSelected: data.id == vm.selectedSubCategory)
|
||||
return cell
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
// vm.episodeSelectedCateogory = vm.seasonListingData[indexPath.row].id
|
||||
// vm.setSeasonData()
|
||||
// episodeTitle.isHidden = false
|
||||
// episodeTitle.text = ""
|
||||
// vm.getSeasonEpisode()
|
||||
// vm.getTeaserListing()
|
||||
// self.categoryCV.reloadData()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Collection Flow Layout
|
||||
|
||||
extension ShopProductsVC : UICollectionViewDelegateFlowLayout{
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
||||
// Generate a random string for testing purposes
|
||||
let randomText = vm.subCategoryData[indexPath.row].subCategoryName!
|
||||
|
||||
// Define the font for the text
|
||||
let font = FontCustom.shareInstance.customFont(fontName: .Exo2_Bold, size: 18) // Adjust the font size as needed
|
||||
|
||||
// Calculate the width of the text
|
||||
let attributes = [NSAttributedString.Key.font: font]
|
||||
let textWidth = (randomText as NSString).size(withAttributes: attributes).width
|
||||
|
||||
// Set the cell width based on the text width and any additional padding
|
||||
// 14 for container view + 10 for inside spacing.
|
||||
let padding: CGFloat = 24 + 20 // Adjust padding as needed
|
||||
let cellWidth = textWidth + padding
|
||||
return CGSize(width: cellWidth , height: 50)
|
||||
}
|
||||
|
||||
}
|
||||
33
WOKA/Shop/Model/ShopCategoryDM.swift
Normal file
33
WOKA/Shop/Model/ShopCategoryDM.swift
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// ShopCategoryDM.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - ShopCategoryDM
|
||||
struct ShopCategoryDM: Codable {
|
||||
let result: [ResultData]?
|
||||
let totalRecords: Int?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case result
|
||||
case totalRecords = "total_records"
|
||||
}
|
||||
|
||||
// MARK: - ResultData
|
||||
struct ResultData: Codable {
|
||||
let id: Int?
|
||||
let categoryName: String?
|
||||
let categoryThumbnail: String?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case categoryName = "category_name"
|
||||
case categoryThumbnail = "category_thumbnail"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
71
WOKA/Shop/Model/ShopProductDM.swift
Normal file
71
WOKA/Shop/Model/ShopProductDM.swift
Normal file
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ShopProductDM.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - ShopProductDM
|
||||
struct ShopProductDM: Codable {
|
||||
let result: ResultData?
|
||||
|
||||
// MARK: - ResultData
|
||||
struct ResultData: Codable {
|
||||
let sabakDegiNaniSeries: [SabakDegiNaniSery]?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case sabakDegiNaniSeries = "Sabak Degi Nani Series"
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - SabakDegiNaniSery
|
||||
struct SabakDegiNaniSery: Codable {
|
||||
let id: Int?
|
||||
let skuID, productName, productThumbnail: String?
|
||||
let categoryMasterID, subCategoryMasterID: Int?
|
||||
let productPrice: String?
|
||||
let remainStockQuantity: Int?
|
||||
let stockStatus: String?
|
||||
// let taxCategory: JSONNull?
|
||||
let taxValue: String?
|
||||
let shopMasterDetail: ShopMasterDetail?
|
||||
let shopImage: [String]?
|
||||
let addedToCart: Bool?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case skuID = "sku_id"
|
||||
case productName = "product_name"
|
||||
case productThumbnail = "product_thumbnail"
|
||||
case categoryMasterID = "category_master_id"
|
||||
case subCategoryMasterID = "sub_category_master_id"
|
||||
case productPrice = "product_price"
|
||||
case remainStockQuantity = "remain_stock_quantity"
|
||||
case stockStatus = "stock_status"
|
||||
// case taxCategory = "tax_category"
|
||||
case taxValue = "tax_value"
|
||||
case shopMasterDetail = "shop_master_detail"
|
||||
case shopImage = "shop_image"
|
||||
case addedToCart = "added_to_cart"
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - ShopMasterDetail
|
||||
struct ShopMasterDetail: Codable {
|
||||
let id, productID: Int?
|
||||
let productNameEnglish, productNameHindi, descriptionEnglish, descriptionHindi: String?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case productID = "product_id"
|
||||
case productNameEnglish = "product_name_english"
|
||||
case productNameHindi = "product_name_hindi"
|
||||
case descriptionEnglish = "description_english"
|
||||
case descriptionHindi = "description_hindi"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
34
WOKA/Shop/Model/ShopSubCategoryDM.swift
Normal file
34
WOKA/Shop/Model/ShopSubCategoryDM.swift
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// ShopSubCategoryDM.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - ShopSubCategoryDM
|
||||
struct ShopSubCategoryDM: Codable {
|
||||
let result: [ResultData]?
|
||||
let totalRecords: Int?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case result
|
||||
case totalRecords = "total_records"
|
||||
}
|
||||
|
||||
// MARK: - ResultData
|
||||
struct ResultData: Codable {
|
||||
let id, categoryMasterID: Int?
|
||||
let subCategoryName: String?
|
||||
let subCategoryThumbnail: String?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case categoryMasterID = "category_master_id"
|
||||
case subCategoryName = "sub_category_name"
|
||||
case subCategoryThumbnail = "sub_category_thumbnail"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
33
WOKA/Shop/Model/ShopSuperCategoryDM.swift
Normal file
33
WOKA/Shop/Model/ShopSuperCategoryDM.swift
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// ShopSuperCategoryDM.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - ShopSuperCategoryDM
|
||||
struct ShopSuperCategoryDM: Codable {
|
||||
let result: [ResultData]?
|
||||
let totalRecords: Int?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case result
|
||||
case totalRecords = "total_records"
|
||||
}
|
||||
|
||||
// MARK: - Result
|
||||
struct ResultData: Codable {
|
||||
let id: Int?
|
||||
let superCategoryName: String?
|
||||
let superCategoryThumbnail: String?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case superCategoryName = "super_category_name"
|
||||
case superCategoryThumbnail = "super_category_thumbnail"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
169
WOKA/Shop/Shop.storyboard
Normal file
169
WOKA/Shop/Shop.storyboard
Normal file
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Shop ListingVC-->
|
||||
<scene sceneID="s0d-6b-0kx">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="ShopListingVC" id="Y6W-OH-hqX" customClass="ShopListingVC" customModule="WOKA" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zhb-Th-KAe">
|
||||
<rect key="frame" x="0.0" y="59" width="393" height="793"/>
|
||||
<color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="gRK-pM-dPn">
|
||||
<rect key="frame" x="0.0" y="523.33333333333337" width="393" height="294.66666666666663"/>
|
||||
</imageView>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="UPY-aY-67P">
|
||||
<rect key="frame" x="0.0" y="59" width="393" height="793"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="zhb-Th-KAe" secondAttribute="bottom" id="7W2-OK-8w8"/>
|
||||
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="UPY-aY-67P" secondAttribute="trailing" id="7iM-GP-HTA"/>
|
||||
<constraint firstItem="zhb-Th-KAe" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="B7w-Dx-USZ"/>
|
||||
<constraint firstItem="UPY-aY-67P" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" id="Hyn-4V-Bfy"/>
|
||||
<constraint firstItem="gRK-pM-dPn" firstAttribute="leading" secondItem="5EZ-qb-Rvc" secondAttribute="leading" id="ICF-iB-ed7"/>
|
||||
<constraint firstAttribute="trailing" secondItem="gRK-pM-dPn" secondAttribute="trailing" id="Zyn-bA-Fdh"/>
|
||||
<constraint firstItem="zhb-Th-KAe" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" id="bqB-3f-7QW"/>
|
||||
<constraint firstItem="vDu-zF-Fre" firstAttribute="bottom" secondItem="gRK-pM-dPn" secondAttribute="bottom" id="d2i-QF-oQ4"/>
|
||||
<constraint firstItem="UPY-aY-67P" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="dTK-fu-JTe"/>
|
||||
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="zhb-Th-KAe" secondAttribute="trailing" id="pxo-3d-4Ob"/>
|
||||
<constraint firstAttribute="bottom" secondItem="UPY-aY-67P" secondAttribute="bottom" id="vt7-RK-kbR"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="tableView" destination="UPY-aY-67P" id="hxW-SC-cSS"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-1051" y="-35"/>
|
||||
</scene>
|
||||
<!--Shop CategoryVC-->
|
||||
<scene sceneID="aA6-gp-Ayq">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="ShopCategoryVC" id="zpR-em-oVu" customClass="ShopCategoryVC" customModule="WOKA" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="t2V-lq-AGt">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="DtQ-TG-hwD">
|
||||
<rect key="frame" x="0.0" y="523.33333333333337" width="393" height="294.66666666666663"/>
|
||||
</imageView>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="NEV-vt-kk0">
|
||||
<rect key="frame" x="0.0" y="59" width="393" height="793"/>
|
||||
<color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="34g-eG-JoV"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="34g-eG-JoV" firstAttribute="trailing" secondItem="NEV-vt-kk0" secondAttribute="trailing" id="4IY-xc-RF2"/>
|
||||
<constraint firstItem="34g-eG-JoV" firstAttribute="bottom" secondItem="DtQ-TG-hwD" secondAttribute="bottom" id="B5X-cq-xSL"/>
|
||||
<constraint firstAttribute="bottom" secondItem="NEV-vt-kk0" secondAttribute="bottom" id="BVA-9I-H8Z"/>
|
||||
<constraint firstItem="NEV-vt-kk0" firstAttribute="top" secondItem="34g-eG-JoV" secondAttribute="top" id="D6B-YT-I5F"/>
|
||||
<constraint firstAttribute="trailing" secondItem="DtQ-TG-hwD" secondAttribute="trailing" id="mta-ZU-MYK"/>
|
||||
<constraint firstItem="DtQ-TG-hwD" firstAttribute="leading" secondItem="t2V-lq-AGt" secondAttribute="leading" id="qrD-CC-Y5b"/>
|
||||
<constraint firstItem="NEV-vt-kk0" firstAttribute="leading" secondItem="34g-eG-JoV" secondAttribute="leading" id="r5B-c2-2FG"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="tableView" destination="NEV-vt-kk0" id="TGI-27-jrC"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="hWm-a0-o95" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-208" y="-35"/>
|
||||
</scene>
|
||||
<!--Shop ProductsVC-->
|
||||
<scene sceneID="y0V-gk-elP">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="ShopProductsVC" id="kU5-IV-9fW" customClass="ShopProductsVC" customModule="WOKA" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="iBQ-FY-Qg9">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Fdg-SY-oNd">
|
||||
<rect key="frame" x="0.0" y="59" width="393" height="793"/>
|
||||
<color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="03T-HE-97c">
|
||||
<rect key="frame" x="0.0" y="557.33333333333337" width="393" height="294.66666666666663"/>
|
||||
</imageView>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="ibd-Ky-5QZ">
|
||||
<rect key="frame" x="10" y="69" width="383" height="50"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="hgB-eB-epB"/>
|
||||
</constraints>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="Pad-jm-O98">
|
||||
<size key="itemSize" width="128" height="70"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
<cells/>
|
||||
</collectionView>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="qrc-nF-3bM">
|
||||
<rect key="frame" x="0.0" y="134" width="393" height="718"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" automaticEstimatedItemSize="YES" minimumLineSpacing="10" minimumInteritemSpacing="10" id="Akd-Zt-0d3">
|
||||
<size key="itemSize" width="128" height="128"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
<cells/>
|
||||
</collectionView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="EEU-2F-lPA"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="03T-HE-97c" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="CpK-v3-Qcu"/>
|
||||
<constraint firstItem="Fdg-SY-oNd" firstAttribute="top" secondItem="EEU-2F-lPA" secondAttribute="top" id="SpN-9a-czs"/>
|
||||
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="Fdg-SY-oNd" secondAttribute="trailing" id="W91-7B-A8x"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Fdg-SY-oNd" secondAttribute="bottom" id="ftY-Br-VBe"/>
|
||||
<constraint firstItem="ibd-Ky-5QZ" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" constant="10" id="gOk-Il-uBj"/>
|
||||
<constraint firstItem="ibd-Ky-5QZ" firstAttribute="top" secondItem="EEU-2F-lPA" secondAttribute="top" constant="10" id="gvR-Eu-UvL"/>
|
||||
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="qrc-nF-3bM" secondAttribute="trailing" id="jAR-uY-cKV"/>
|
||||
<constraint firstItem="qrc-nF-3bM" firstAttribute="top" secondItem="ibd-Ky-5QZ" secondAttribute="bottom" constant="15" id="jFK-oJ-8HO"/>
|
||||
<constraint firstItem="Fdg-SY-oNd" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="q1i-Vc-6Pq"/>
|
||||
<constraint firstItem="03T-HE-97c" firstAttribute="trailing" secondItem="EEU-2F-lPA" secondAttribute="trailing" id="ttW-dy-Pb4"/>
|
||||
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="ibd-Ky-5QZ" secondAttribute="trailing" id="uiq-HX-kWV"/>
|
||||
<constraint firstItem="qrc-nF-3bM" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="uux-x1-sEU"/>
|
||||
<constraint firstAttribute="bottom" secondItem="03T-HE-97c" secondAttribute="bottom" id="wMq-xo-NyQ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="qrc-nF-3bM" secondAttribute="bottom" id="xt2-CW-1ye"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="collectionView" destination="qrc-nF-3bM" id="5UB-pP-lI4"/>
|
||||
<outlet property="productCV" destination="qrc-nF-3bM" id="0dx-wj-O2z"/>
|
||||
<outlet property="subCategoryCV" destination="ibd-Ky-5QZ" id="0j8-y0-HeP"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="P44-mc-g6G" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="445" y="-45"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="OrderBottom" width="570.66668701171875" height="294.66665649414062"/>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
50
WOKA/Shop/View/ShopListingCell.swift
Normal file
50
WOKA/Shop/View/ShopListingCell.swift
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ShopListingCell.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ShopListingCell: UITableViewCell {
|
||||
|
||||
@IBOutlet weak var cellImage: UIImageView!
|
||||
@IBOutlet weak var cellTitle: UILabel!
|
||||
@IBOutlet weak var shimmerEffectView: ShimmerEffectView!
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
self.backgroundColor = .clear
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
func showShimmer(){
|
||||
shimmerEffectView.gradientColorOne = #colorLiteral(red: 0.4969186187, green: 0.8725844026, blue: 1, alpha: 1)
|
||||
shimmerEffectView.gradientColorTwo = #colorLiteral(red: 0.9254901961, green: 0.9254901961, blue: 0.9254901961, alpha: 1)
|
||||
shimmerEffectView.startShimmer()
|
||||
}
|
||||
|
||||
func stopShimmer(){
|
||||
shimmerEffectView.stopShimmer()
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
}
|
||||
|
||||
func setData(data : ShopSuperCategoryDM.ResultData){
|
||||
if let url = data.superCategoryThumbnail{
|
||||
self.cellImage.imageURL(url, color: .black)
|
||||
}
|
||||
self.cellTitle.text = data.superCategoryName
|
||||
}
|
||||
|
||||
func setCategoryData(data : ShopCategoryDM.ResultData){
|
||||
if let url = data.categoryThumbnail{
|
||||
self.cellImage.imageURL(url, color: .black)
|
||||
}
|
||||
self.cellTitle.text = data.categoryName
|
||||
}
|
||||
}
|
||||
103
WOKA/Shop/View/ShopListingCell.xib
Normal file
103
WOKA/Shop/View/ShopListingCell.xib
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<customFonts key="customFonts">
|
||||
<array key="Exo2-Bold.ttf">
|
||||
<string>Exo2-Bold</string>
|
||||
</array>
|
||||
</customFonts>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="241" id="KGk-i7-Jjw" customClass="ShopListingCell" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="392" height="241"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="392" height="241"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fIB-0u-s5x" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="10" y="8" width="372" height="223"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="mJf-iU-iXo">
|
||||
<rect key="frame" x="0.0" y="0.0" width="372" height="223"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WaI-mH-feh">
|
||||
<rect key="frame" x="10" y="10" width="352" height="170"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="180" id="MAu-oG-jtt"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<integer key="value" value="5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" distribution="equalSpacing" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="bNT-Ga-1cb" userLabel="TitleLikeFav">
|
||||
<rect key="frame" x="10" y="183" width="352" height="35"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OAi-7e-Ifq">
|
||||
<rect key="frame" x="0.0" y="7.9999999999999982" width="352" height="19.333333333333329"/>
|
||||
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="16"/>
|
||||
<color key="textColor" name="ImageDarkBlue"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="35" id="CTN-NN-fqG"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<edgeInsets key="layoutMargins" top="10" left="10" bottom="5" right="10"/>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="mJf-iU-iXo" secondAttribute="trailing" id="2dr-i7-fPB"/>
|
||||
<constraint firstItem="mJf-iU-iXo" firstAttribute="top" secondItem="fIB-0u-s5x" secondAttribute="top" id="Ehl-IP-pq9"/>
|
||||
<constraint firstItem="mJf-iU-iXo" firstAttribute="leading" secondItem="fIB-0u-s5x" secondAttribute="leading" id="jaA-r1-Ep8"/>
|
||||
<constraint firstAttribute="bottom" secondItem="mJf-iU-iXo" secondAttribute="bottom" id="rqd-Uy-uyZ"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<integer key="value" value="5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="fIB-0u-s5x" secondAttribute="bottom" constant="8" id="3mF-mf-hNf"/>
|
||||
<constraint firstItem="fIB-0u-s5x" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="10" id="69U-UE-tXx"/>
|
||||
<constraint firstAttribute="trailing" secondItem="fIB-0u-s5x" secondAttribute="trailing" constant="10" id="OZU-Aj-s0I"/>
|
||||
<constraint firstItem="fIB-0u-s5x" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="8" id="aAo-bq-CHD"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
|
||||
<connections>
|
||||
<outlet property="cellImage" destination="WaI-mH-feh" id="8qs-st-jVc"/>
|
||||
<outlet property="cellTitle" destination="OAi-7e-Ifq" id="LhX-KE-jZc"/>
|
||||
<outlet property="shimmerEffectView" destination="fIB-0u-s5x" id="wYP-ox-Pt8"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="184.73282442748092" y="58.098591549295776"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<namedColor name="ImageDarkBlue">
|
||||
<color red="0.035000000149011612" green="0.0" blue="0.36500000953674316" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</namedColor>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
17
WOKA/Shop/View/ShopProductsCell.swift
Normal file
17
WOKA/Shop/View/ShopProductsCell.swift
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// ShopProductsCell.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ShopProductsCell: UICollectionViewCell {
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
}
|
||||
25
WOKA/Shop/View/ShopProductsCell.xib
Normal file
25
WOKA/Shop/View/ShopProductsCell.xib
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="ShopProductsCell" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="167" height="167"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
|
||||
<rect key="frame" x="0.0" y="0.0" width="167" height="167"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</view>
|
||||
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
|
||||
<size key="customSize" width="167" height="167"/>
|
||||
<point key="canvasLocation" x="129.00763358778624" y="29.929577464788736"/>
|
||||
</collectionViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
90
WOKA/Shop/ViewModel/ShopCategoryVM.swift
Normal file
90
WOKA/Shop/ViewModel/ShopCategoryVM.swift
Normal file
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// ShopCategoryVM.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import Alamofire
|
||||
|
||||
class ShopCategoryVM{
|
||||
|
||||
weak var vc : ShopCategoryVC!
|
||||
var superCatID : Int?
|
||||
|
||||
var categoryData = [ShopCategoryDM.ResultData]()
|
||||
|
||||
func initView(){
|
||||
setupCell()
|
||||
addGradient()
|
||||
getCategory()
|
||||
}
|
||||
|
||||
func setupCell(){
|
||||
vc.tableView.register(UINib(nibName: K.CellIdentifier.Shop.shopListingCell, bundle: nil), forCellReuseIdentifier: K.CellIdentifier.Shop.shopListingCell)
|
||||
vc.tableView.delegate = vc.self
|
||||
vc.tableView.dataSource = vc.self
|
||||
}
|
||||
|
||||
func addGradient(){
|
||||
self.vc.title = "Shop".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
|
||||
let color1 = #colorLiteral(red: 0.6745098039, green: 0.6235294118, blue: 0.1725490196, alpha: 1)
|
||||
let color2 = #colorLiteral(red: 0.5450980392, green: 0.6745098039, blue: 0.1725490196, alpha: 1)
|
||||
|
||||
vc.view.applyGradient(colors: [color2, color1], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Get SuperCategory
|
||||
|
||||
func getCategory(){
|
||||
guard let superCatID else{return}
|
||||
Utilities.startProgressHUD()
|
||||
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
|
||||
let params : Parameters = ["module_id" : "5",
|
||||
"super_category_id" : superCatID]
|
||||
|
||||
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Shop.category_listing, method: .post,parameters: params,headers: headers) { [weak self](result : Result<BaseResponseModel<ShopCategoryDM>, NetworkManager.APIError>) in
|
||||
switch result{
|
||||
case .success(let data):
|
||||
guard let self else{
|
||||
Utilities.dismissProgressHUD()
|
||||
return
|
||||
}
|
||||
switch data.success{
|
||||
case 0:
|
||||
/*
|
||||
Error
|
||||
*/
|
||||
Utilities.dismissProgressHUD()
|
||||
Utilities.alertWithBtnCompletion(title: "Error", msgBody: data.message ?? K.ConstantString.unRecognised, okBtnStr: "Retry?", vc: self.vc) { isDone in
|
||||
if isDone{
|
||||
self.getCategory()
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
Utilities.dismissProgressHUD()
|
||||
guard let data = data.data?.result else{return}
|
||||
self.categoryData = data
|
||||
self.vc.tableView.reloadData()
|
||||
default:
|
||||
Utilities.dismissProgressHUD()
|
||||
break
|
||||
}
|
||||
case .failure(let error):
|
||||
guard let self else{
|
||||
Utilities.dismissProgressHUD()
|
||||
return
|
||||
}
|
||||
Utilities.dismissProgressHUD()
|
||||
Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in
|
||||
if isDone{
|
||||
self.getCategory()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
77
WOKA/Shop/ViewModel/ShopListingVM.swift
Normal file
77
WOKA/Shop/ViewModel/ShopListingVM.swift
Normal file
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// ShopListingVM.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import Alamofire
|
||||
|
||||
class ShopListingVM{
|
||||
|
||||
weak var vc : ShopListingVC!
|
||||
var superCatData = [ShopSuperCategoryDM.ResultData]()
|
||||
|
||||
func initView(){
|
||||
setupCell()
|
||||
addGradient()
|
||||
getSuperCategory()
|
||||
}
|
||||
|
||||
func setupCell(){
|
||||
vc.tableView.register(UINib(nibName: K.CellIdentifier.Shop.shopListingCell, bundle: nil), forCellReuseIdentifier: K.CellIdentifier.Shop.shopListingCell)
|
||||
vc.tableView.delegate = vc.self
|
||||
vc.tableView.dataSource = vc.self
|
||||
}
|
||||
|
||||
func addGradient(){
|
||||
self.vc.title = "Shop".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue)
|
||||
let color1 = #colorLiteral(red: 0.6745098039, green: 0.6235294118, blue: 0.1725490196, alpha: 1)
|
||||
let color2 = #colorLiteral(red: 0.5450980392, green: 0.6745098039, blue: 0.1725490196, alpha: 1)
|
||||
|
||||
vc.view.applyGradient(colors: [color2, color1], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
|
||||
}
|
||||
|
||||
@objc func cartBtnTapped(){
|
||||
print("cart tapped")
|
||||
}
|
||||
|
||||
// MARK: - Get SuperCategory
|
||||
|
||||
func getSuperCategory(){
|
||||
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
|
||||
let params : Parameters = ["module_id" : "5"]
|
||||
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Shop.super_category_listing, method: .post,parameters: params,headers: headers) { [weak self](result : Result<BaseResponseModel<ShopSuperCategoryDM>, NetworkManager.APIError>) in
|
||||
switch result{
|
||||
case .success(let data):
|
||||
guard let self else{
|
||||
Utilities.dismissProgressHUD()
|
||||
return
|
||||
}
|
||||
switch data.success{
|
||||
case 0:
|
||||
/*
|
||||
Error
|
||||
*/
|
||||
Utilities.dismissProgressHUD()
|
||||
|
||||
case 1:
|
||||
Utilities.dismissProgressHUD()
|
||||
guard let data = data.data?.result else{return}
|
||||
self.superCatData = data
|
||||
self.vc.tableView.reloadData()
|
||||
default:
|
||||
break
|
||||
}
|
||||
case .failure(let error):
|
||||
guard let self else{
|
||||
Utilities.dismissProgressHUD()
|
||||
return
|
||||
}
|
||||
Utilities.dismissProgressHUD()
|
||||
vc.toast(msg: error.localizedDescription , time: 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
142
WOKA/Shop/ViewModel/ShopProductsVM.swift
Normal file
142
WOKA/Shop/ViewModel/ShopProductsVM.swift
Normal file
@@ -0,0 +1,142 @@
|
||||
//
|
||||
// ShopProductsVM.swift
|
||||
// WOKA
|
||||
//
|
||||
// Created by MacBook Pro on 22/07/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Alamofire
|
||||
|
||||
class ShopProductsVM{
|
||||
|
||||
weak var vc : ShopProductsVC!
|
||||
var subCategoryData = [ShopSubCategoryDM.ResultData]()
|
||||
var shopProducts = [ShopProductDM.ResultData]()
|
||||
|
||||
var categoryID : Int?
|
||||
var selectedSubCategory = 0
|
||||
var pageTitle : String?
|
||||
|
||||
func initView(){
|
||||
getCategory()
|
||||
addGradient()
|
||||
setupCell()
|
||||
}
|
||||
|
||||
func addGradient(){
|
||||
let color1 = #colorLiteral(red: 0.6745098039, green: 0.6235294118, blue: 0.1725490196, alpha: 1)
|
||||
let color2 = #colorLiteral(red: 0.5450980392, green: 0.6745098039, blue: 0.1725490196, alpha: 1)
|
||||
self.vc.title = pageTitle ?? "Shop"
|
||||
vc.view.applyGradient(colors: [color2, color1], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
|
||||
}
|
||||
|
||||
func setupCell(){
|
||||
vc.subCategoryCV.register(UINib(nibName: K.CellIdentifier.WebSeries.seasonCategoryCell, bundle: nil), forCellWithReuseIdentifier: K.CellIdentifier.WebSeries.seasonCategoryCell)
|
||||
vc.subCategoryCV.delegate = vc.self
|
||||
vc.subCategoryCV.dataSource = vc.self
|
||||
}
|
||||
|
||||
// MARK: - Get SuperCategory
|
||||
|
||||
func getCategory(){
|
||||
guard let categoryID else{return}
|
||||
Utilities.startProgressHUD()
|
||||
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
|
||||
let params : Parameters = ["category_id" : categoryID]
|
||||
|
||||
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Shop.sub_category_listing, method: .post,parameters: params,headers: headers) { [weak self](result : Result<BaseResponseModel<ShopSubCategoryDM>, NetworkManager.APIError>) in
|
||||
switch result{
|
||||
case .success(let data):
|
||||
guard let self else{
|
||||
Utilities.dismissProgressHUD()
|
||||
return
|
||||
}
|
||||
switch data.success{
|
||||
case 0:
|
||||
/*
|
||||
Error
|
||||
*/
|
||||
Utilities.dismissProgressHUD()
|
||||
Utilities.alertWithBtnCompletion(title: "Error", msgBody: data.message ?? K.ConstantString.unRecognised, okBtnStr: "Retry?", vc: self.vc) { isDone in
|
||||
if isDone{
|
||||
self.getCategory()
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
Utilities.dismissProgressHUD()
|
||||
guard let data = data.data?.result else{return}
|
||||
self.subCategoryData.append(ShopSubCategoryDM.ResultData(id: 0, categoryMasterID: 0, subCategoryName: "All", subCategoryThumbnail: ""))
|
||||
self.subCategoryData.append(contentsOf: data)
|
||||
self.selectedSubCategory = data.first?.id ?? 0
|
||||
self.vc.subCategoryCV.reloadData()
|
||||
// if let subCatID = data.first?.id{
|
||||
// self.getShopProducts(subCategoryID: nil)
|
||||
// }
|
||||
default:
|
||||
Utilities.dismissProgressHUD()
|
||||
break
|
||||
}
|
||||
case .failure(let error):
|
||||
guard let self else{
|
||||
Utilities.dismissProgressHUD()
|
||||
return
|
||||
}
|
||||
Utilities.dismissProgressHUD()
|
||||
Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in
|
||||
if isDone{
|
||||
self.getCategory()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getShopProducts(subCategoryID : Int?){
|
||||
guard let categoryID else{return}
|
||||
Utilities.startProgressHUD()
|
||||
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
|
||||
let params : Parameters = ["category_id" : categoryID,
|
||||
"sub_category_id" : subCategoryID ?? ""]
|
||||
|
||||
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Shop.shop_product_listing, method: .post,parameters: params,headers: headers) { [weak self](result : Result<BaseResponseModel<ShopProductDM>, NetworkManager.APIError>) in
|
||||
switch result{
|
||||
case .success(let data):
|
||||
guard let self else{
|
||||
Utilities.dismissProgressHUD()
|
||||
return
|
||||
}
|
||||
switch data.success{
|
||||
case 0:
|
||||
/*
|
||||
Error
|
||||
*/
|
||||
Utilities.dismissProgressHUD()
|
||||
Utilities.alertWithBtnCompletion(title: "Error", msgBody: data.message ?? K.ConstantString.unRecognised, okBtnStr: "Retry?", vc: self.vc) { isDone in
|
||||
if isDone{
|
||||
self.getShopProducts(subCategoryID: subCategoryID)
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
Utilities.dismissProgressHUD()
|
||||
guard let data = data.data?.result else{return}
|
||||
print(data)
|
||||
default:
|
||||
Utilities.dismissProgressHUD()
|
||||
break
|
||||
}
|
||||
case .failure(let error):
|
||||
guard let self else{
|
||||
Utilities.dismissProgressHUD()
|
||||
return
|
||||
}
|
||||
Utilities.dismissProgressHUD()
|
||||
Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in
|
||||
// if isDone{
|
||||
// self.getCategory()
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,42 +12,21 @@ class MyOrdersVC: UIViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
self.title = "MY ORDERS"
|
||||
|
||||
// Create the button
|
||||
let backbutton = UIButton(type: .custom)
|
||||
backbutton.setImage(UIImage(named: "CartIcon"), for: .normal) // Image can be downloaded from the provided link
|
||||
backbutton.setTitleColor(.black, for: .normal) // You can change the TitleColor
|
||||
backbutton.addTarget(self, action: #selector(cartBtnTapped), for: .touchUpInside)
|
||||
|
||||
// Set button height and width
|
||||
let buttonHeight: CGFloat = 60
|
||||
let buttonWidth: CGFloat = 60
|
||||
backbutton.translatesAutoresizingMaskIntoConstraints = false
|
||||
backbutton.widthAnchor.constraint(equalToConstant: buttonWidth).isActive = true
|
||||
backbutton.heightAnchor.constraint(equalToConstant: buttonHeight).isActive = true
|
||||
|
||||
// Create a container view for the button
|
||||
let containerView = UIView(frame: CGRect(x: 0, y: 0, width: buttonWidth, height: buttonHeight))
|
||||
containerView.addSubview(backbutton)
|
||||
|
||||
// Set constraints for the button inside the container view
|
||||
NSLayoutConstraint.activate([
|
||||
backbutton.centerYAnchor.constraint(equalTo: containerView.centerYAnchor),
|
||||
backbutton.centerXAnchor.constraint(equalTo: containerView.centerXAnchor)
|
||||
])
|
||||
|
||||
// Create a UIBarButtonItem with the custom view
|
||||
let customBarButton = UIBarButtonItem(customView: containerView)
|
||||
|
||||
// Create a flexible space item to push the custom view to the left
|
||||
let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
|
||||
flexibleSpace.width = 20
|
||||
// Create a negative spacer to fine-tune the position
|
||||
let negativeSpacer = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
|
||||
negativeSpacer.width = 10 // Adjust this value to move the button to the left
|
||||
|
||||
// Add the custom bar button and the spacer to the navigation bar
|
||||
self.navigationItem.rightBarButtonItems = [flexibleSpace,negativeSpacer, customBarButton]
|
||||
|
||||
let btn = BadgedButtonItem(with: UIImage(named: "CartIcon"))
|
||||
btn.badgeTintColor = .red
|
||||
btn.badgeTextColor = .green
|
||||
btn.position = .right
|
||||
btn.hasBorder = true
|
||||
btn.borderColor = .red
|
||||
btn.badgeSize = .large
|
||||
btn.badgeAnimation = true
|
||||
btn.setBadge(with: 1)
|
||||
btn.tapAction = {
|
||||
// do something
|
||||
print("tapped")
|
||||
}
|
||||
self.navigationItem.rightBarButtonItem = btn
|
||||
|
||||
}
|
||||
|
||||
@@ -65,8 +44,5 @@ class MyOrdersVC: UIViewController {
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
self.navigationController?.setColor(color: .black)
|
||||
}
|
||||
|
||||
@objc func cartBtnTapped(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -214,34 +214,47 @@
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ppi-HI-rj1" userLabel="IconView">
|
||||
<rect key="frame" x="0.0" y="395.66666666666674" width="393" height="456.33333333333326"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="Ehe-Th-asW" userLabel="Shop">
|
||||
<rect key="frame" x="288" y="-10" width="95" height="95"/>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qS4-gX-qTX">
|
||||
<rect key="frame" x="288" y="0.0" width="95" height="95"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Shop" translatesAutoresizingMaskIntoConstraints="NO" id="z9r-YX-CUk">
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="79"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SHOP" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a1C-yY-cjD" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="80" width="95" height="15"/>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="Ehe-Th-asW" userLabel="Shop">
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="95"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Shop" translatesAutoresizingMaskIntoConstraints="NO" id="z9r-YX-CUk">
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="79"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SHOP" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a1C-yY-cjD" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="80" width="95" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="QSf-0H-Fwk"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="13"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="QSf-0H-Fwk"/>
|
||||
<constraint firstAttribute="height" constant="95" id="LJb-1R-ZRv"/>
|
||||
<constraint firstAttribute="width" constant="95" id="oeO-z9-81t"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="13"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="Ehe-Th-asW" secondAttribute="height" multiplier="1:1" id="afK-Dm-U4l"/>
|
||||
<constraint firstItem="Ehe-Th-asW" firstAttribute="leading" secondItem="qS4-gX-qTX" secondAttribute="leading" id="M8B-ha-YyQ"/>
|
||||
<constraint firstItem="Ehe-Th-asW" firstAttribute="top" secondItem="qS4-gX-qTX" secondAttribute="top" id="Sv2-ts-JH2"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Ehe-Th-asW" secondAttribute="trailing" id="als-18-0Fs"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Ehe-Th-asW" secondAttribute="bottom" id="wo1-7N-aJf"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
</view>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="lRy-nX-Xia" userLabel="LiveTV">
|
||||
<rect key="frame" x="149" y="42.333333333333314" width="95" height="95"/>
|
||||
<rect key="frame" x="149" y="50" width="95" height="95"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LiveTV" translatesAutoresizingMaskIntoConstraints="NO" id="LoO-Qh-9ci">
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="79"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LIVE TV" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="arX-6A-JO0" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="80" width="95" height="15"/>
|
||||
<rect key="frame" x="0.0" y="79.999999999999943" width="95" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="Ff3-ym-Dew"/>
|
||||
</constraints>
|
||||
@@ -255,7 +268,7 @@
|
||||
</constraints>
|
||||
</stackView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GGC-rX-Pyw">
|
||||
<rect key="frame" x="10" y="67.333333333333314" width="95" height="95"/>
|
||||
<rect key="frame" x="10" y="75" width="95" height="95"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="Sp0-yh-bdj" userLabel="WebSeries">
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="95"/>
|
||||
@@ -264,7 +277,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="79"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WEB SERIES" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zmu-oJ-DFc" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="80" width="95" height="15"/>
|
||||
<rect key="frame" x="0.0" y="79.999999999999943" width="95" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="tmo-ie-b2U"/>
|
||||
</constraints>
|
||||
@@ -285,7 +298,7 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yuF-d6-Tag">
|
||||
<rect key="frame" x="293" y="124.99999999999994" width="95" height="95"/>
|
||||
<rect key="frame" x="293" y="115" width="95" height="95"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="r88-JP-phS" userLabel="Games">
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="95"/>
|
||||
@@ -294,7 +307,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="79"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GAMES" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="blr-Es-vfw" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="80" width="95" height="15"/>
|
||||
<rect key="frame" x="0.0" y="79.999999999999943" width="95" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="cfa-zV-qLo"/>
|
||||
</constraints>
|
||||
@@ -315,7 +328,7 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ugr-Tf-Y1l">
|
||||
<rect key="frame" x="160" y="202.33333333333331" width="95" height="95"/>
|
||||
<rect key="frame" x="160" y="209.99999999999994" width="95" height="95"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="JHO-R6-WGZ" userLabel="Audio Books">
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="95"/>
|
||||
@@ -345,7 +358,7 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gk8-xm-Hh5">
|
||||
<rect key="frame" x="10" y="192.33333333333331" width="95" height="95"/>
|
||||
<rect key="frame" x="10" y="199.99999999999994" width="95" height="95"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="9fz-vc-Ufb" userLabel="Karaoke">
|
||||
<rect key="frame" x="0.0" y="0.0" width="95" height="95"/>
|
||||
@@ -380,19 +393,18 @@
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Ehe-Th-asW" firstAttribute="baseline" secondItem="lRy-nX-Xia" secondAttribute="firstBaseline" constant="40" id="6HI-BQ-pxx"/>
|
||||
<constraint firstItem="gk8-xm-Hh5" firstAttribute="top" secondItem="GGC-rX-Pyw" secondAttribute="bottom" constant="30" id="6fZ-aH-GOz"/>
|
||||
<constraint firstItem="GGC-rX-Pyw" firstAttribute="leading" secondItem="ppi-HI-rj1" secondAttribute="leading" constant="10" id="Go0-Ui-etR"/>
|
||||
<constraint firstItem="ugr-Tf-Y1l" firstAttribute="centerY" secondItem="gk8-xm-Hh5" secondAttribute="centerY" constant="10" id="Mqx-zA-KmU"/>
|
||||
<constraint firstItem="GGC-rX-Pyw" firstAttribute="centerY" secondItem="lRy-nX-Xia" secondAttribute="centerY" constant="25" id="NmB-T5-Lvq"/>
|
||||
<constraint firstItem="lRy-nX-Xia" firstAttribute="height" secondItem="ppi-HI-rj1" secondAttribute="height" multiplier="0.208333" id="Slx-Jj-1Nl"/>
|
||||
<constraint firstAttribute="trailing" secondItem="qS4-gX-qTX" secondAttribute="trailing" constant="10" id="YH1-ZC-Y0B"/>
|
||||
<constraint firstItem="qS4-gX-qTX" firstAttribute="top" secondItem="ppi-HI-rj1" secondAttribute="top" id="Z3W-nR-aoM"/>
|
||||
<constraint firstItem="lRy-nX-Xia" firstAttribute="centerX" secondItem="ppi-HI-rj1" secondAttribute="centerX" id="ZMq-Za-1eg"/>
|
||||
<constraint firstItem="Ehe-Th-asW" firstAttribute="height" secondItem="ppi-HI-rj1" secondAttribute="height" multiplier="0.208333" id="bYM-Cl-mWm"/>
|
||||
<constraint firstItem="yuF-d6-Tag" firstAttribute="top" secondItem="qS4-gX-qTX" secondAttribute="bottom" constant="19.999999999999943" id="ZgC-j6-kZn"/>
|
||||
<constraint firstItem="gk8-xm-Hh5" firstAttribute="leading" secondItem="ppi-HI-rj1" secondAttribute="leading" constant="10" id="c7p-1g-qdM"/>
|
||||
<constraint firstItem="yuF-d6-Tag" firstAttribute="top" secondItem="Ehe-Th-asW" secondAttribute="bottom" constant="40" id="dOG-0I-sH8"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Ehe-Th-asW" secondAttribute="trailing" constant="10" id="h6R-gj-t8n"/>
|
||||
<constraint firstItem="lRy-nX-Xia" firstAttribute="centerY" secondItem="qS4-gX-qTX" secondAttribute="centerY" constant="50" id="cWc-Gp-h6H"/>
|
||||
<constraint firstItem="ugr-Tf-Y1l" firstAttribute="leading" secondItem="gk8-xm-Hh5" secondAttribute="trailing" constant="55" id="iiR-AX-YQG"/>
|
||||
<constraint firstItem="Ehe-Th-asW" firstAttribute="top" secondItem="ppi-HI-rj1" secondAttribute="top" constant="-10" id="rPo-rh-Nry"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="-2" translatesAutoresizingMaskIntoConstraints="NO" id="LYo-Uy-0nM" userLabel="More">
|
||||
@@ -419,13 +431,13 @@
|
||||
<color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="t3E-Cj-I2d" firstAttribute="top" secondItem="ppi-HI-rj1" secondAttribute="top" constant="20" id="0ma-6s-cY3"/>
|
||||
<constraint firstItem="Ehe-Th-asW" firstAttribute="leading" secondItem="t3E-Cj-I2d" secondAttribute="trailing" id="1lg-KO-GFR"/>
|
||||
<constraint firstItem="jdZ-WQ-xcr" firstAttribute="trailing" secondItem="vdl-cu-G32" secondAttribute="trailing" id="1om-dS-PtT"/>
|
||||
<constraint firstItem="kzE-UE-7KK" firstAttribute="top" secondItem="sf9-me-n7i" secondAttribute="bottom" constant="30" id="2cv-dI-9b7"/>
|
||||
<constraint firstItem="xgH-t8-LiX" firstAttribute="trailing" secondItem="vdl-cu-G32" secondAttribute="trailing" id="55h-eD-07b"/>
|
||||
<constraint firstItem="jdZ-WQ-xcr" firstAttribute="leading" secondItem="vdl-cu-G32" secondAttribute="leading" id="5lp-Gk-fkY"/>
|
||||
<constraint firstItem="s5k-HV-Zkc" firstAttribute="leading" secondItem="rkf-MW-5IL" secondAttribute="trailing" constant="15" id="6G7-em-SiG"/>
|
||||
<constraint firstItem="Qfe-q3-rbY" firstAttribute="top" secondItem="vdl-cu-G32" secondAttribute="top" constant="5" id="6TP-Kg-skA"/>
|
||||
<constraint firstItem="vdl-cu-G32" firstAttribute="trailing" secondItem="t3E-Cj-I2d" secondAttribute="trailing" constant="105" id="7TO-IK-CxZ"/>
|
||||
<constraint firstItem="edI-4n-4AY" firstAttribute="height" secondItem="UEh-jl-IQp" secondAttribute="height" multiplier="0.13412" id="9la-bJ-w4R"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ppi-HI-rj1" secondAttribute="bottom" id="Ahn-Nf-O3r"/>
|
||||
<constraint firstItem="rkf-MW-5IL" firstAttribute="leading" secondItem="vdl-cu-G32" secondAttribute="leading" constant="10" id="B4I-l7-DMO"/>
|
||||
@@ -477,6 +489,7 @@
|
||||
<outlet property="moreStack" destination="LYo-Uy-0nM" id="Ea6-hD-ZEj"/>
|
||||
<outlet property="nameLabel" destination="tQN-s8-9SK" id="GIQ-nv-8rM"/>
|
||||
<outlet property="notificationBtnn" destination="b3F-hf-9c8" id="elI-0K-6uE"/>
|
||||
<outlet property="shopView" destination="qS4-gX-qTX" id="AhW-nP-2Hd"/>
|
||||
<outlet property="webSeriesView" destination="GGC-rX-Pyw" id="ZJt-XZ-15X"/>
|
||||
<outlet property="welcomeLabel" destination="dnl-w0-q5K" id="ePX-F9-APX"/>
|
||||
<outletCollection property="star" destination="XTn-ID-1Yb" collectionClass="NSMutableArray" id="8Fh-RB-UOY"/>
|
||||
|
||||
@@ -30,6 +30,7 @@ class ThemeOneVC: UIViewController {
|
||||
@IBOutlet weak var bottomArrow: UIImageView!
|
||||
@IBOutlet weak var gamesView: UIView!
|
||||
@IBOutlet weak var karaokeView: UIView!
|
||||
@IBOutlet weak var shopView: UIView!
|
||||
|
||||
var timer: Timer?
|
||||
|
||||
|
||||
@@ -152,6 +152,15 @@ class ThemeOneVM{
|
||||
vc.navigationController?.pushViewController(vcPush, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
vc.shopView.addTapGesture {
|
||||
ViewButtonAnimation.sharedInstance.btnTapped(in: self.vc, view: self.vc.shopView) { [weak self] in
|
||||
guard let self else{return}
|
||||
let sb = UIStoryboard(name: K.StoryBoard.shop, bundle: nil)
|
||||
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Shop.shopListingVC) as! ShopListingVC
|
||||
vc.navigationController?.pushViewController(vcPush, animated: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Animate Clouds and LiveTV
|
||||
|
||||
@@ -26,6 +26,11 @@ class SeasonCategoryCell: UICollectionViewCell {
|
||||
selectDeselect(isSelected: iselected)
|
||||
}
|
||||
|
||||
func setSubCategory(data : ShopSubCategoryDM.ResultData, isSelected : Bool){
|
||||
self.categoryTitle.text = data.subCategoryName
|
||||
selectDeselectsubCategory(isSelected: isSelected)
|
||||
}
|
||||
|
||||
func selectDeselect(isSelected : Bool){
|
||||
if isSelected{
|
||||
outerView.backgroundColor = #colorLiteral(red: 0.4495816827, green: 0.2344398499, blue: 0.8120074868, alpha: 1)
|
||||
@@ -35,4 +40,14 @@ class SeasonCategoryCell: UICollectionViewCell {
|
||||
categoryTitle.textColor = .black
|
||||
}
|
||||
}
|
||||
|
||||
func selectDeselectsubCategory(isSelected : Bool){
|
||||
if isSelected{
|
||||
outerView.backgroundColor = #colorLiteral(red: 0.03529411765, green: 0, blue: 0.3647058824, alpha: 1)
|
||||
categoryTitle.textColor = .white
|
||||
}else{
|
||||
outerView.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
|
||||
categoryTitle.textColor = .black
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user