diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 637655a2..c079b212 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -68,10 +68,6 @@ 01EB369423609801006832FA /* HeadlineBodyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368D23609801006832FA /* HeadlineBodyModel.swift */; }; 01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A03123A4498200D954D8 /* CaretLinkModel.swift */; }; 0A1214A022C11A18007C7030 /* ActionDetailWithImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A12149F22C11A17007C7030 /* ActionDetailWithImage.swift */; }; - 0A14F69323E349EF00EDF7F7 /* CarouselIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A14F69223E349EF00EDF7F7 /* CarouselIndicator.swift */; }; - 0A14F6A523E4803A00EDF7F7 /* StackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A14F6A423E4803A00EDF7F7 /* StackView.swift */; }; - 0A14F6A923E8750300EDF7F7 /* CarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A14F6A823E8750300EDF7F7 /* CarouselIndicatorModel.swift */; }; - 0A14F6B423E8C29700EDF7F7 /* NumericIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A14F6B323E8C29700EDF7F7 /* NumericIndicatorView.swift */; }; 0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7BAFA2232BE63400FB8E22 /* CheckboxLabel.swift */; }; 0A21DB7F235DECC500C160A2 /* EntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A21DB7E235DECC500C160A2 /* EntryField.swift */; }; 0A21DB83235DFBC500C160A2 /* MdnEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A21DB82235DFBC500C160A2 /* MdnEntryField.swift */; }; @@ -88,13 +84,17 @@ 0A21DB8E235E06EF00C160A2 /* MFDigitTextField.xib in Resources */ = {isa = PBXBuildFile; fileRef = D29DF24A21E6A177003B2FB9 /* MFDigitTextField.xib */; }; 0A21DB91235E0EDB00C160A2 /* DigitBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8321AE2355FE9500CB7F00 /* DigitBox.swift */; }; 0A21DB94235E24ED00C160A2 /* DigitEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A21DB93235E24ED00C160A2 /* DigitEntryField.swift */; }; + 0A30D3E32432741A00124AF0 /* BarsCarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A30D3DD2432741A00124AF0 /* BarsCarouselIndicatorModel.swift */; }; + 0A30D3E42432741A00124AF0 /* NumericCarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A30D3DE2432741A00124AF0 /* NumericCarouselIndicatorModel.swift */; }; + 0A30D3E52432741A00124AF0 /* NumericIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A30D3DF2432741A00124AF0 /* NumericIndicatorView.swift */; }; + 0A30D3E62432741A00124AF0 /* BarsIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A30D3E02432741A00124AF0 /* BarsIndicatorView.swift */; }; + 0A30D3E72432741A00124AF0 /* CarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A30D3E12432741A00124AF0 /* CarouselIndicatorModel.swift */; }; + 0A30D3E82432741A00124AF0 /* CarouselIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A30D3E22432741A00124AF0 /* CarouselIndicator.swift */; }; 0A41BA6E2344FCD400D4C0BC /* CATransaction+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A41BA6D2344FCD400D4C0BC /* CATransaction+Extension.swift */; }; 0A41BA7F23453A6400D4C0BC /* TextEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A41BA7E23453A6400D4C0BC /* TextEntryField.swift */; }; - 0A4253AF23F5C2C100554656 /* BarsIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A4253AE23F5C2C000554656 /* BarsIndicatorView.swift */; }; 0A5D59C223AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A5D59C123AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift */; }; 0A69F611241BDEA700F7231B /* RuleAnyRequiredModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A69F610241BDEA700F7231B /* RuleAnyRequiredModel.swift */; }; 0A6BF4722360C56C0028F841 /* BaseDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A6BF4712360C56C0028F841 /* BaseDropdownEntryField.swift */; }; - 0A7918F523F5E7EA00772FF4 /* ImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7918F423F5E7EA00772FF4 /* ImageView.swift */; }; 0A7BAD74232A8DC700FB8E22 /* HeadlineBodyButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7BAD73232A8DC700FB8E22 /* HeadlineBodyButton.swift */; }; 0A7BAFA1232BE61800FB8E22 /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7BAFA0232BE61800FB8E22 /* Checkbox.swift */; }; 0A7EF85B23D8A52800B2AAD1 /* EntryFieldModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7EF85A23D8A52800B2AAD1 /* EntryFieldModel.swift */; }; @@ -105,8 +105,6 @@ 0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7EF86423D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift */; }; 0A7EF86723D8B0AE00B2AAD1 /* DateDropdownEntryFieldModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7EF86623D8B0AE00B2AAD1 /* DateDropdownEntryFieldModel.swift */; }; 0AA33B3A2398524F0067DD0F /* Toggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA33B392398524F0067DD0F /* Toggle.swift */; }; - 0AAF8E2A240EA57D008DD263 /* BarsCarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAF8E29240EA57D008DD263 /* BarsCarouselIndicatorModel.swift */; }; - 0AAF8E2C240EA594008DD263 /* NumericCarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAF8E2B240EA594008DD263 /* NumericCarouselIndicatorModel.swift */; }; 0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */; }; 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */; }; 0AE14F64238315D2005417F8 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE14F63238315D2005417F8 /* TextField.swift */; }; @@ -469,17 +467,18 @@ 01EB368D23609801006832FA /* HeadlineBodyModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeadlineBodyModel.swift; sourceTree = ""; }; 01F2A03123A4498200D954D8 /* CaretLinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaretLinkModel.swift; sourceTree = ""; }; 0A12149F22C11A17007C7030 /* ActionDetailWithImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionDetailWithImage.swift; sourceTree = ""; }; - 0A14F69223E349EF00EDF7F7 /* CarouselIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselIndicator.swift; sourceTree = ""; }; - 0A14F6A423E4803A00EDF7F7 /* StackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackView.swift; sourceTree = ""; }; - 0A14F6A823E8750300EDF7F7 /* CarouselIndicatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselIndicatorModel.swift; sourceTree = ""; }; - 0A14F6B323E8C29700EDF7F7 /* NumericIndicatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumericIndicatorView.swift; sourceTree = ""; }; 0A209CD223A7E2810068F8B0 /* UIStackViewAlignment+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackViewAlignment+Extension.swift"; sourceTree = ""; }; 0A21DB7E235DECC500C160A2 /* EntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntryField.swift; sourceTree = ""; }; 0A21DB82235DFBC500C160A2 /* MdnEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MdnEntryField.swift; sourceTree = ""; }; 0A21DB93235E24ED00C160A2 /* DigitEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DigitEntryField.swift; sourceTree = ""; }; + 0A30D3DD2432741A00124AF0 /* BarsCarouselIndicatorModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarsCarouselIndicatorModel.swift; sourceTree = ""; }; + 0A30D3DE2432741A00124AF0 /* NumericCarouselIndicatorModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumericCarouselIndicatorModel.swift; sourceTree = ""; }; + 0A30D3DF2432741A00124AF0 /* NumericIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumericIndicatorView.swift; sourceTree = ""; }; + 0A30D3E02432741A00124AF0 /* BarsIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarsIndicatorView.swift; sourceTree = ""; }; + 0A30D3E12432741A00124AF0 /* CarouselIndicatorModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarouselIndicatorModel.swift; sourceTree = ""; }; + 0A30D3E22432741A00124AF0 /* CarouselIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarouselIndicator.swift; sourceTree = ""; }; 0A41BA6D2344FCD400D4C0BC /* CATransaction+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CATransaction+Extension.swift"; sourceTree = ""; }; 0A41BA7E23453A6400D4C0BC /* TextEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextEntryField.swift; sourceTree = ""; }; - 0A4253AE23F5C2C000554656 /* BarsIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarsIndicatorView.swift; sourceTree = ""; }; 0A5D59C123AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleGuidelinesProtocol.swift; sourceTree = ""; }; 0A69F610241BDEA700F7231B /* RuleAnyRequiredModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuleAnyRequiredModel.swift; sourceTree = ""; }; 0A6BF4712360C56C0028F841 /* BaseDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseDropdownEntryField.swift; sourceTree = ""; }; @@ -497,8 +496,6 @@ 0A8321AE2355FE9500CB7F00 /* DigitBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DigitBox.swift; sourceTree = ""; }; 0AA33B33239813C50067DD0F /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = ""; }; 0AA33B392398524F0067DD0F /* Toggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toggle.swift; sourceTree = ""; }; - 0AAF8E29240EA57D008DD263 /* BarsCarouselIndicatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BarsCarouselIndicatorModel.swift; sourceTree = ""; }; - 0AAF8E2B240EA594008DD263 /* NumericCarouselIndicatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumericCarouselIndicatorModel.swift; sourceTree = ""; }; 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateDropdownEntryField.swift; sourceTree = ""; }; 0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemDropdownEntryField.swift; sourceTree = ""; }; 0AE14F63238315D2005417F8 /* TextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = ""; }; @@ -879,17 +876,18 @@ path = FormUIHelpers; sourceTree = ""; }; - 0A14F6B023E8C27A00EDF7F7 /* CarouselIndicator */ = { + 0A30D3DC2432741A00124AF0 /* CarouselIndicator */ = { isa = PBXGroup; children = ( - 0A14F6A823E8750300EDF7F7 /* CarouselIndicatorModel.swift */, - 0A14F69223E349EF00EDF7F7 /* CarouselIndicator.swift */, - 0AAF8E29240EA57D008DD263 /* BarsCarouselIndicatorModel.swift */, - 0A4253AE23F5C2C000554656 /* BarsIndicatorView.swift */, - 0AAF8E2B240EA594008DD263 /* NumericCarouselIndicatorModel.swift */, - 0A14F6B323E8C29700EDF7F7 /* NumericIndicatorView.swift */, + 0A30D3DD2432741A00124AF0 /* BarsCarouselIndicatorModel.swift */, + 0A30D3DE2432741A00124AF0 /* NumericCarouselIndicatorModel.swift */, + 0A30D3DF2432741A00124AF0 /* NumericIndicatorView.swift */, + 0A30D3E02432741A00124AF0 /* BarsIndicatorView.swift */, + 0A30D3E12432741A00124AF0 /* CarouselIndicatorModel.swift */, + 0A30D3E22432741A00124AF0 /* CarouselIndicator.swift */, ); - path = CarouselIndicator; + name = CarouselIndicator; + path = ../../../../../../../mvmrc_ios/mvm_core_ui/MVMCoreUI/Atoms/Views/CarouselIndicator; sourceTree = ""; }; 0A5D59C323AD488600EFD9E9 /* Protocols */ = { @@ -1520,7 +1518,7 @@ D29DF17D21E69E26003B2FB9 /* Views */ = { isa = PBXGroup; children = ( - 0A14F6B023E8C27A00EDF7F7 /* CarouselIndicator */, + 0A30D3DC2432741A00124AF0 /* CarouselIndicator */, 9445890B2385BCE300DE9FD4 /* ProgressBarModel.swift */, 01509D922327ECFB00EF99AA /* ProgressBar.swift */, 9445890D2385C3F800DE9FD4 /* MultiProgressModel.swift */, @@ -1711,7 +1709,6 @@ 0AE14F63238315D2005417F8 /* TextField.swift */, D2755D7A23689C7500485468 /* TableViewCell.swift */, 0A5D59C323AD488600EFD9E9 /* Protocols */, - 0A14F6A423E4803A00EDF7F7 /* StackView.swift */, 0A7918F423F5E7EA00772FF4 /* ImageView.swift */, ); path = BaseClasses; @@ -1967,7 +1964,6 @@ D2A92884241ACB25004E01C6 /* ProgrammaticScrollViewController.swift in Sources */, 0A21DB7F235DECC500C160A2 /* EntryField.swift in Sources */, D2E2A99F23E07F8A000B42E6 /* PillButton.swift in Sources */, - 0A4253AF23F5C2C100554656 /* BarsIndicatorView.swift in Sources */, D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */, D29DF12E21E6851E003B2FB9 /* MVMCoreUITopAlertView.m in Sources */, D29DF2CF21E7C104003B2FB9 /* MFLoadingViewController.m in Sources */, @@ -1989,6 +1985,7 @@ D22D8395241FB41200D3DF69 /* UIStackView+Extension.swift in Sources */, 52B201D324081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift in Sources */, 525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */, + 0A30D3E72432741A00124AF0 /* CarouselIndicatorModel.swift in Sources */, D2E2A99A23D8D6B4000B42E6 /* HeadlineBodyButtonModel.swift in Sources */, D202AFE6242A6A9C00E5BEDF /* UICollectionViewScrollPosition+Extension.swift in Sources */, 8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */, @@ -2000,7 +1997,6 @@ 0103B84E23D7E33A009C315C /* HeadlineBodyToggleModel.swift in Sources */, D2755D7B23689C7500485468 /* TableViewCell.swift in Sources */, 0A21DB85235E06EF00C160A2 /* MFTextField.m in Sources */, - 0AAF8E2C240EA594008DD263 /* NumericCarouselIndicatorModel.swift in Sources */, 014AA72623C501E2006F3E93 /* ContainerModelProtocol.swift in Sources */, AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */, 01EB369223609801006832FA /* MoleculeStackModel.swift in Sources */, @@ -2017,6 +2013,7 @@ D29E28D823D21AB800ACEA85 /* StringAndMoleculeView.swift in Sources */, 01EB369023609801006832FA /* MoleculeListItemModel.swift in Sources */, D28A838323CCBD3F00DFE4FC /* CircleProgressModel.swift in Sources */, + 0A30D3E82432741A00124AF0 /* CarouselIndicator.swift in Sources */, D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */, DBEFFA04225A829700230692 /* Label.swift in Sources */, D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */, @@ -2058,7 +2055,6 @@ 01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */, 0A7BAFA1232BE61800FB8E22 /* Checkbox.swift in Sources */, 011B58F023A2AA980085F53C /* ListItemModelProtocol.swift in Sources */, - 0A14F6A923E8750300EDF7F7 /* CarouselIndicatorModel.swift in Sources */, D22479962316AF6E003FCCF9 /* HeadlineBodyLink.swift in Sources */, D29DF2AE21E7B3A4003B2FB9 /* MFTextView.m in Sources */, 0A41BA7F23453A6400D4C0BC /* TextEntryField.swift in Sources */, @@ -2075,7 +2071,6 @@ 017BEB7F23676E870024EF95 /* MoleculeObjectMapping.swift in Sources */, D274CA332236A78900B01B62 /* FooterView.swift in Sources */, D29DF2BF21E7BEA4003B2FB9 /* MVMCoreUITabBarPageControlViewController.m in Sources */, - 0A14F69323E349EF00EDF7F7 /* CarouselIndicator.swift in Sources */, 014AA72423C501E2006F3E93 /* MoleculeContainerModel.swift in Sources */, D29DF28321E7AB24003B2FB9 /* MVMCoreUICommonViewsUtility.m in Sources */, 011B58F223A2AE2C0085F53C /* DropDownListItemModel.swift in Sources */, @@ -2083,6 +2078,7 @@ 94C2D9842386F3F80006CF46 /* LabelAttributeModel.swift in Sources */, 944589212385D6E900DE9FD4 /* DashLineModel.swift in Sources */, D2E2A99623D8CF85000B42E6 /* HeadlineBodyLinkToggleModel.swift in Sources */, + 0A30D3E52432741A00124AF0 /* NumericIndicatorView.swift in Sources */, C6FA7D5323C77A4A00A3614A /* StringAndMoleculeStack.swift in Sources */, 011D958524042432000E3791 /* RulesProtocol.swift in Sources */, 94AF4A3F23E9D13900676048 /* MFCaretButton.m in Sources */, @@ -2098,7 +2094,6 @@ 011D95A5240455DC000E3791 /* FormGroupRule.swift in Sources */, D2A6390522CBCE160052ED1F /* MoleculeCollectionViewCell.swift in Sources */, D2A6390122CBB1820052ED1F /* Carousel.swift in Sources */, - 0A14F6B423E8C29700EDF7F7 /* NumericIndicatorView.swift in Sources */, D29DF2C721E7BF57003B2FB9 /* MFTabBarInteractor.m in Sources */, C7F8012123E8303200396FBD /* ListRVWheel.swift in Sources */, D29DF29521E7ADB8003B2FB9 /* MFProgrammaticScrollViewController.m in Sources */, @@ -2111,6 +2106,7 @@ 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */, 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, + 0A30D3E42432741A00124AF0 /* NumericCarouselIndicatorModel.swift in Sources */, D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */, 525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */, 0AE98BB323FF0934004C5109 /* ExternalLinkModel.swift in Sources */, @@ -2140,6 +2136,7 @@ D29DF29821E7ADB8003B2FB9 /* MFScrollingViewController.m in Sources */, D28A839323CE828900DFE4FC /* HeadlineBodyCaretLinkImageModel.swift in Sources */, D29770C821F7C4AE00B2F0D0 /* TopLabelsView.m in Sources */, + 0A30D3E32432741A00124AF0 /* BarsCarouselIndicatorModel.swift in Sources */, D260105F23D0BFFC00764D80 /* StackItem.swift in Sources */, 9432A79F23DB47BA00719041 /* EntryFieldContainer.swift in Sources */, 01EB369323609801006832FA /* HeaderModel.swift in Sources */, @@ -2167,6 +2164,7 @@ D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */, D2E2A9A323E096B1000B42E6 /* DisableableModelProtocol.swift in Sources */, D29DF11821E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.m in Sources */, + 0A30D3E62432741A00124AF0 /* BarsIndicatorView.swift in Sources */, 94C2D9A323872C110006CF46 /* LabelAttributeStrikeThroughModel.swift in Sources */, D28A838523CCCA8900DFE4FC /* ScrollerModel.swift in Sources */, D29DF26C21E6AA0B003B2FB9 /* FLAnimatedImage.m in Sources */, @@ -2177,7 +2175,6 @@ D29770FC21F7C77400B2F0D0 /* MVMCoreUITextFieldView.m in Sources */, 52267A0723FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift in Sources */, C003506123AA94CD00B6AC29 /* Button.swift in Sources */, - 0A14F6A523E4803A00EDF7F7 /* StackView.swift in Sources */, DBC4391B224421A0001AB423 /* CaretLink.swift in Sources */, 0198F7A82256A80B0066C936 /* MFRadioButton.m in Sources */, 0A6BF4722360C56C0028F841 /* BaseDropdownEntryField.swift in Sources */, @@ -2208,7 +2205,6 @@ C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */, 01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */, 0105618D224BBE7700E1557D /* FormValidator.swift in Sources */, - 0AAF8E2A240EA57D008DD263 /* BarsCarouselIndicatorModel.swift in Sources */, 01509D912327ECE600EF99AA /* CornerLabels.swift in Sources */, D22D1F1B220341F60077CEC0 /* MVMCoreUICheckBox.m in Sources */, C695A69823C990C200BFB94E /* DoughnutChartView.swift in Sources */, diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsCarouselIndicatorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsCarouselIndicatorModel.swift new file mode 100644 index 00000000..89369987 --- /dev/null +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsCarouselIndicatorModel.swift @@ -0,0 +1,49 @@ +// +// BarsCarouselIndicatorModel.swift +// MVMCoreUI +// +// Created by Kevin Christiano on 3/3/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import UIKit + + +open class BarsCarouselIndicatorModel: CarouselIndicatorModel { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public class override var identifier: String { + return "barsCarouselIndicator" + } + + public var currentIndicatorColor: Color = Color(uiColor: .mvmBlack) + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + + private enum CodingKeys: String, CodingKey { + case currentIndicatorColor + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + + public required init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + + if let currentIndicatorColor = try typeContainer.decodeIfPresent(Color.self, forKey: .currentIndicatorColor) { + self.currentIndicatorColor = currentIndicatorColor + } + + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(currentIndicatorColor, forKey: .currentIndicatorColor) + } +} diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift new file mode 100644 index 00000000..5724a76e --- /dev/null +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -0,0 +1,172 @@ +// +// BarIndicatorView.swift +// MVMCoreUI +// +// Created by Kevin Christiano on 2/3/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import UIKit + + +open class BarsIndicatorView: CarouselIndicator { + //-------------------------------------------------- + // MARK: - Stored Properties + //-------------------------------------------------- + + public let stackView: StackView = { + let stackView = StackView() + stackView.axis = .horizontal + stackView.alignment = .bottom + stackView.distribution = .equalSpacing + stackView.spacing = 6 + stackView.heightAnchor.constraint(lessThanOrEqualToConstant: BarsIndicatorView.indicatorBarHeight.selected).isActive = true + return stackView + }() + + public var barReferences: [(view: View, constraint: NSLayoutConstraint)] = [] + + // Dimensions are based on InVision Design Guidelines. + public static let indicatorBarWidth: CGFloat = 24 + public static let indicatorBarHeight: (selected: CGFloat, unselected: CGFloat) = (selected: 4, unselected: 1) + + /// Convenience to access the model. + public var barsCarouselIndicatorModel: BarsCarouselIndicatorModel? { + return model as? BarsCarouselIndicatorModel + } + + //-------------------------------------------------- + // MARK: - Computed Properties + //-------------------------------------------------- + + open override var isEnabled: Bool { + didSet { + barReferences.forEach { view, _ in + view.backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor + } + } + } + + private(set) var _currentIndicatorColor: UIColor = .black + + /// Colors the currently selected index, unique from other indicators + public var currentIndicatorColor: UIColor { + get { return _currentIndicatorColor } + set (newColor) { + _currentIndicatorColor = newColor + barsCarouselIndicatorModel?.currentIndicatorColor = Color(uiColor: newColor) + + if !barReferences.isEmpty { + barReferences[currentIndex].view.backgroundColor = newColor + } + } + } + + public override var indicatorColor: UIColor { + get { return _indicatorColor } + set (newColor) { + super.indicatorColor = newColor + + for (i, barTuple) in barReferences.enumerated() where i != currentIndex { + barTuple.view.backgroundColor = newColor + } + } + } + + //-------------------------------------------------- + // MARK: - Initializers + //-------------------------------------------------- + + public init() { + super.init(frame: .zero) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //-------------------------------------------------- + // MARK: - Setup + //-------------------------------------------------- + + open override func setupView() { + super.setupView() + + addSubview(stackView) + isUserInteractionEnabled = false + + NSLayoutConstraint.activate([ + stackView.heightAnchor.constraint(equalToConstant: 4), + heightAnchor.constraint(equalTo: stackView.heightAnchor), + stackView.centerXAnchor.constraint(equalTo: centerXAnchor), + stackView.leadingAnchor.constraint(equalTo: leadingAnchor), + stackView.topAnchor.constraint(equalTo: topAnchor), + bottomAnchor.constraint(equalTo: stackView.bottomAnchor), + trailingAnchor.constraint(equalTo: stackView.trailingAnchor) + ]) + } + + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + + func generateBars() { + + var bars = [(View, NSLayoutConstraint)]() + + for i in 0..= touchPoint_X && $0.0.frame.minX <= touchPoint_X } ?? 0 + } + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.set(with: model, delegateObject, additionalData) + + guard let model = model as? BarsCarouselIndicatorModel else { return } + + currentIndicatorColor = model.currentIndicatorColor.uiColor + } + + //-------------------------------------------------- + // MARK: - IndicatorViewProtocol + //-------------------------------------------------- + + public override func reset() { + super.reset() + barReferences.forEach { $0.view.removeFromSuperview() } + barReferences = [] + } + + public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) { + + guard !barReferences.isEmpty else { + generateBars() + return + } + + let expression = { + self.barReferences[previousIndex].view.backgroundColor = self.indicatorColor + self.barReferences[newIndex].view.backgroundColor = self.currentIndicatorColor + self.barReferences[previousIndex].constraint.constant = BarsIndicatorView.indicatorBarHeight.unselected + self.barReferences[newIndex].constraint.constant = BarsIndicatorView.indicatorBarHeight.selected + self.layoutIfNeeded() + } + + isAnimated ? UIView.animate(withDuration: 0.3) { expression() } : expression() + } +} diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift new file mode 100644 index 00000000..1e4db496 --- /dev/null +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -0,0 +1,235 @@ +// +// CarouselIndicator.swift +// MVMCoreUI +// +// Created by Kevin Christiano on 1/30/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + + +open class CarouselIndicator: Control, CarouselPageControlProtocol { + //-------------------------------------------------- + // MARK: - Constraints + //-------------------------------------------------- + + public var topConstraint: NSLayoutConstraint? + public var bottomConstraint: NSLayoutConstraint? + + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public var uiGestures: Set = [] + + /// Convenience to access the model. + public var carouselIndicatorModel: CarouselIndicatorModel? { + return model as? CarouselIndicatorModel + } + + /// Set this closure to perform an action when a different indicator was selected. + /// Passes through oldInde and newIndex, respectively. + public var indicatorTouchAction: ((CarouselPageControlProtocol) -> ())? + + open override var isEnabled: Bool { + didSet { + isUserInteractionEnabled = isEnabled + } + } + + //-------------------------------------------------- + // MARK: - Computed Properties + //-------------------------------------------------- + + private(set) var previousIndex = 0 + private var _currentIndex = 0 + + public var currentIndex: Int { + get { return _currentIndex } + set (newIndex) { + carouselIndicatorModel?.currentIndex = newIndex + previousIndex = _currentIndex + _currentIndex = newIndex + performAction() + if previousIndex != newIndex { + updateUI(previousIndex: previousIndex, newIndex: newIndex, totalCount: numberOfPages, isAnimated: carouselIndicatorModel?.isAnimated ?? true) + } + } + } + + private var _numberOfPages = 0 + + /// Holds the total number of pages displayed by the carousel. + /// Updating this property will potentially update the UI. + public var numberOfPages: Int { + get { return _numberOfPages } + set (newTotal) { + guard _numberOfPages != newTotal else { return } + carouselIndicatorModel?.numberOfPages = newTotal + _numberOfPages = newTotal + + isHidden = carouselIndicatorModel?.hidesForSinglePage ?? false && newTotal <= 1 + updateUI(previousIndex: previousIndex, newIndex: currentIndex, totalCount: newTotal, isAnimated: carouselIndicatorModel?.isAnimated ?? true) + } + } + + public var disabledIndicatorColor: UIColor { + return carouselIndicatorModel?.disabledIndicatorColor.uiColor ?? .mvmCoolGray3 + } + + private(set) var _indicatorColor: UIColor = .black + + public var indicatorColor: UIColor { + get { return _indicatorColor } + set (newColor) { + carouselIndicatorModel?.indicatorColor = Color(uiColor: newColor) + } + } + + //-------------------------------------------------- + // MARK: - Initializers + //-------------------------------------------------- + + override init(frame: CGRect) { + super.init(frame: frame) + } + + convenience override init() { + self.init(frame: .zero) + } + + required public init?(coder: NSCoder) { + super.init(coder: coder) + } + + //-------------------------------------------------- + // MARK: - Lifecycle + //-------------------------------------------------- + + public override func initialSetup() { + super.initialSetup() + + isAccessibilityElement = true + accessibilityTraits = .adjustable + } + + open override func setupView() { + super.setupView() + + setupGestures() + } + + //-------------------------------------------------- + // MARK: - UITouch + //-------------------------------------------------- + + private func setupGestures() { + + let tap = UITapGestureRecognizer(target: self, action: #selector(indicatorTapped)) + let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeLeft)) + let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeRight)) + + leftSwipe.direction = .left + rightSwipe.direction = .right + + addGestureRecognizer(tap) + addGestureRecognizer(leftSwipe) + addGestureRecognizer(rightSwipe) + + uiGestures.insert(tap) + uiGestures.insert(leftSwipe) + uiGestures.insert(rightSwipe) + } + + func incrementCurrentIndex() { + currentIndex = min(currentIndex + 1, numberOfPages - 1) + } + + func decrementCurrentIndex() { + currentIndex = max(0, currentIndex - 1) + } + + /// Increments the currentIndex value. + @objc func swipeLeft() { + incrementCurrentIndex() + } + + /// Decrement the currentIndex value + @objc func swipeRight() { + decrementCurrentIndex() + } + + /// Handles tap logic for Indicator + @objc func indicatorTapped(_ tapGesture: UITapGestureRecognizer?) { + + let touchPoint = tapGesture?.location(in: self) + let touchPoint_X = touchPoint?.x ?? 0.0 + + assessTouchOf(touchPoint_X) + } + + func assessTouchOf(_ touchPoint_X: CGFloat) { } + + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + + open func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) { } + + public func performAction() { + + sendActions(for: .valueChanged) + indicatorTouchAction?(self) + } + + public func scrollViewDidScroll(_ collectionView: UICollectionView) { } + + //-------------------------------------------------- + // MARK: - MoleculeViewProtocol + //-------------------------------------------------- + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.set(with: model, delegateObject, additionalData) + + guard let model = model as? CarouselIndicatorModel else { return } + + indicatorColor = model.indicatorColor.uiColor + currentIndex = model.currentIndex + isEnabled = model.isEnabled + + if let accessibleValue = MVMCoreUIUtility.hardcodedString(withKey: model.accessibilityHasSlidesInsteadOfPage ? "MVMCoreUIPageControlslides_currentpage_index" : "MVMCoreUIPageControl_currentpage_index") { + accessibilityValue = String(format: accessibleValue, currentIndex + 1, numberOfPages) + } + } + + //-------------------------------------------------- + // MARK: - Accessibility + //-------------------------------------------------- + + open override func accessibilityIncrement() { + + accessibilityAdjust(toPage: currentIndex + 1) + } + + open override func accessibilityDecrement() { + + accessibilityAdjust(toPage: currentIndex - 1) + } + + func accessibilityAdjust(toPage index: Int) { + + if (index < numberOfPages && index >= 0) || carouselIndicatorModel?.alwaysSendAction ?? false { + carouselIndicatorModel?.isAnimated = false + previousIndex = currentIndex + currentIndex = index + performAction() + } + } + + func setTopBottomSpace(constant: CGFloat) { + + bottomConstraint?.constant = constant + topConstraint?.constant = constant + } +} diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift new file mode 100644 index 00000000..75e5ed58 --- /dev/null +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift @@ -0,0 +1,126 @@ +// +// CarouselIndicatorModel.swift +// MVMCoreUI +// +// Created by Kevin Christiano on 2/3/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + + +open class CarouselIndicatorModel: CarouselPagingModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public class var identifier: String { + return "" + } + + public var backgroundColor: Color? + public var moleculeName: String? + + /// The maxmum count of pages before the indicatorView forces a Numeric Indicator in place of Bar. + public var numberOfPages: Int = 0 + + // Sets the current Index to focus on. + public var currentIndex: Int = 0 + public var isAnimated: Bool = true + public var hidesForSinglePage: Bool = false + /// Set true to make the accessibility value as "Slide #currentPage of #totalPage", otherwise will be "Page #currentPage of #totalPage", default is false + public var accessibilityHasSlidesInsteadOfPage: Bool = false + public var isEnabled: Bool = true + public var disabledIndicatorColor: Color = Color(uiColor: .mvmCoolGray3) + public var indicatorColor: Color = Color(uiColor: .mvmBlack) + public var position: Float? + + /// Allows sendActions() to trigger even if index is already at min/max index. + public var alwaysSendAction = false + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + + private enum CodingKeys: String, CodingKey { + case moleculeName + case backgroundColor + case currentIndex + case numberOfPages + case alwaysSendAction + case isAnimated + case hidesForSinglePage + case accessibilityHasSlidesInsteadOfPage + case isEnabled + case disabledIndicatorColor + case indicatorColor + case currentIndicatorColor + case position + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + moleculeName = try typeContainer.decodeIfPresent(String.self, forKey: .moleculeName) + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) + + if let numberOfPages = try typeContainer.decodeIfPresent(Int.self, forKey: .numberOfPages) { + self.numberOfPages = numberOfPages + } + + if let currentIndex = try typeContainer.decodeIfPresent(Int.self, forKey: .currentIndex) { + self.currentIndex = currentIndex + } + + if let alwaysSendAction = try typeContainer.decodeIfPresent(Bool.self, forKey: .alwaysSendAction) { + self.alwaysSendAction = alwaysSendAction + } + + if let position = try typeContainer.decodeIfPresent(Float.self, forKey: .position) { + self.position = position + } + + if let isAnimated = try typeContainer.decodeIfPresent(Bool.self, forKey: .isAnimated) { + self.isAnimated = isAnimated + } + + if let hidesForSinglePage = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidesForSinglePage) { + self.hidesForSinglePage = hidesForSinglePage + } + + if let accessibilityHasSlidesInsteadOfPage = try typeContainer.decodeIfPresent(Bool.self, forKey: .accessibilityHasSlidesInsteadOfPage) { + self.accessibilityHasSlidesInsteadOfPage = accessibilityHasSlidesInsteadOfPage + } + + if let isEnabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .isEnabled) { + self.isEnabled = isEnabled + } + + if let disabledIndicatorColor = try typeContainer.decodeIfPresent(Color.self, forKey: .disabledIndicatorColor) { + self.disabledIndicatorColor = disabledIndicatorColor + } + + if let indicatorColor = try typeContainer.decodeIfPresent(Color.self, forKey: .indicatorColor) { + self.indicatorColor = indicatorColor + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(moleculeName, forKey: .moleculeName) + try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encode(numberOfPages, forKey: .numberOfPages) + try container.encode(currentIndex, forKey: .currentIndex) + try container.encode(alwaysSendAction, forKey: .alwaysSendAction) + try container.encode(isAnimated, forKey: .isAnimated) + try container.encodeIfPresent(hidesForSinglePage, forKey: .hidesForSinglePage) + try container.encodeIfPresent(accessibilityHasSlidesInsteadOfPage, forKey: .accessibilityHasSlidesInsteadOfPage) + try container.encode(isEnabled, forKey: .isEnabled) + try container.encode(disabledIndicatorColor, forKey: .disabledIndicatorColor) + try container.encode(indicatorColor, forKey: .indicatorColor) + try container.encodeIfPresent(position, forKey: .position) + } +} diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericCarouselIndicatorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericCarouselIndicatorModel.swift new file mode 100644 index 00000000..2b454fc8 --- /dev/null +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericCarouselIndicatorModel.swift @@ -0,0 +1,19 @@ +// +// NumericCarouselIndicatorModel.swift +// MVMCoreUI +// +// Created by Kevin Christiano on 3/3/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import UIKit + +open class NumericCarouselIndicatorModel: CarouselIndicatorModel { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public class override var identifier: String { + return "numericCarouselIndicator" + } +} diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift new file mode 100644 index 00000000..8cd9e05c --- /dev/null +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift @@ -0,0 +1,131 @@ +// +// NumericIndicatorView.swift +// MVMCoreUI +// +// Created by Kevin Christiano on 2/3/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import UIKit + + +open class NumericIndicatorView: CarouselIndicator { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + + /// Text to display the current count of total pages for viewing. + open var pageCount: Label = { + let label = Label.commonLabelB2(true) + label.setContentCompressionResistancePriority(.required, for: .vertical) + label.textAlignment = .center + return label + }() + + let leftArrow: Arrow = { + let arrow = Arrow(model: ArrowModel(), degrees: 180) + arrow.pinHeightAndWidth() + return arrow + }() + + let rightArrow: Arrow = { + let arrow = Arrow(model: ArrowModel()) + arrow.pinHeightAndWidth() + return arrow + }() + + //-------------------------------------------------- + // MARK: - Computed Properties + //-------------------------------------------------- + + open override var isEnabled: Bool { + didSet { + pageCount.textColor = isEnabled ? indicatorColor : disabledIndicatorColor + leftArrow.tintColor = isEnabled ? indicatorColor : disabledIndicatorColor + rightArrow.tintColor = isEnabled ? indicatorColor : disabledIndicatorColor + } + } + + /// Sets the color for pageCount text, left arrow and right arrow. + public override var indicatorColor: UIColor { + get { return _indicatorColor } + set (newColor) { + super.indicatorColor = newColor + + if isEnabled { + pageCount.textColor = newColor + leftArrow.tintColor = newColor + rightArrow.tintColor = newColor + } + } + } + + //-------------------------------------------------- + // MARK: - Initializers + //-------------------------------------------------- + + public override init(frame: CGRect) { + super.init(frame: .zero) + } + + public convenience init() { + self.init(frame: .zero) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //-------------------------------------------------- + // MARK: - Lifecycle + //-------------------------------------------------- + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + pageCount.updateView(size) + } + + //-------------------------------------------------- + // MARK: - Setup + //-------------------------------------------------- + + open override func setupView() { + super.setupView() + + isUserInteractionEnabled = false + addSubview(pageCount) + addSubview(leftArrow) + addSubview(rightArrow) + + NSLayoutConstraint.activate([ + pageCount.centerXAnchor.constraint(equalTo: centerXAnchor), + pageCount.topAnchor.constraint(equalTo: topAnchor), + bottomAnchor.constraint(equalTo: pageCount.bottomAnchor), + leftArrow.centerYAnchor.constraint(equalTo: centerYAnchor), + rightArrow.centerYAnchor.constraint(equalTo: centerYAnchor), + leftArrow.leadingAnchor.constraint(equalTo: leadingAnchor), + pageCount.leadingAnchor.constraint(equalTo: leftArrow.trailingAnchor, constant: PaddingOne), + rightArrow.leadingAnchor.constraint(equalTo: pageCount.trailingAnchor, constant: PaddingOne), + trailingAnchor.constraint(equalTo: rightArrow.trailingAnchor) + ]) + } + + public override func assessTouchOf(_ touchPoint_X: CGFloat) { + + if touchPoint_X > bounds.width / 2 { + incrementCurrentIndex() + } else { + decrementCurrentIndex() + } + } + + //-------------------------------------------------- + // MARK: - IndicatorViewProtocol + //-------------------------------------------------- + + open override func updateUI(previousIndex oldIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) { + + pageCount.text = "\(newIndex + 1)/\(totalCount)" + layoutIfNeeded() + } +} diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index 107e15e5..b79cbc03 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -179,7 +179,7 @@ open class Carousel: View { var pagingView: (UIView & CarouselPageControlProtocol)? = nil if let molecule = molecule { - pagingView = MoleculeObjectMapping.shared()?.createMolecule(molecule, delegateObject: delegateObject) as? (UIView & MVMCoreUIPagingProtocol) + pagingView = MoleculeObjectMapping.shared()?.createMolecule(molecule, delegateObject: delegateObject) as? (UIView & MVMCoreUIPagingProtocol) as! (UIView & CarouselPageControlProtocol) } addPaging(view: pagingView, position: (CGFloat(molecule?.position ?? 20))) diff --git a/MVMCoreUI/BaseClasses/StackView.swift b/MVMCoreUI/BaseClasses/StackView.swift deleted file mode 100644 index 4ca167c6..00000000 --- a/MVMCoreUI/BaseClasses/StackView.swift +++ /dev/null @@ -1,100 +0,0 @@ -// -// File.swift -// MVMCoreUI -// -// Created by Kevin Christiano on 1/31/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - - -open class StackView: UIStackView, ModelMoleculeViewProtocol { - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - - open var json: [AnyHashable: Any]? - open var model: MoleculeModelProtocol? - - private var initialSetupPerformed = false - - //-------------------------------------------------- - // MARK: - Initialization - //-------------------------------------------------- - - public override init(frame: CGRect) { - super.init(frame: .zero) - initialSetup() - } - - public convenience init() { - self.init(frame: .zero) - } - - public required init(coder: NSCoder) { - super.init(coder: coder) - initialSetup() - } - - public func initialSetup() { - if !initialSetupPerformed { - initialSetupPerformed = true - setupView() - } - } - - //-------------------------------------------------- - // MARK: - ModelMoleculeViewProtocol - //-------------------------------------------------- - - open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { - self.model = model - if let backgroundColor = model.backgroundColor { - self.backgroundColor = backgroundColor.uiColor - } - } - - open class func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? { - return model?.moleculeName - } - - open class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return nil - } - - open class func requiredModules(_ molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer?) -> [String]? { - return nil - } -} - -// MARK:- MVMCoreViewProtocol -extension StackView: MVMCoreViewProtocol { - - open func updateView(_ size: CGFloat) {} - - /// Will be called only once. - open func setupView() { - translatesAutoresizingMaskIntoConstraints = false - insetsLayoutMarginsFromSafeArea = false - MVMCoreUIUtility.setMarginsFor(self, leading: 0, top: 0, trailing: 0, bottom: 0) - } -} - -// MARK:- MVMCoreUIMoleculeViewProtocol -extension StackView: MVMCoreUIMoleculeViewProtocol { - - open func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { - self.json = json - - if let backgroundColorString = json?.optionalStringForKey(KeyBackgroundColor) { - backgroundColor = UIColor.mfGet(forHex: backgroundColorString) - } - } - - open func reset() { - backgroundColor = .clear - } - - open func setAsMolecule() { } -}