From b0c2a301eb17176184e6a70886200baa0b885468 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 30 Apr 2024 12:32:15 -0400 Subject: [PATCH 1/7] Digital ACT191 story ONEAPP-7592 - Color Updates to allow strings or hash --- MVMCoreUI/Categories/UIColor+MFConvenience.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.m b/MVMCoreUI/Categories/UIColor+MFConvenience.m index 77700413..259ba747 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.m +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.m @@ -299,6 +299,10 @@ } + (nullable UIColor *)mfGetColorForString:(nullable NSString *)string { + if ([string hasPrefix:@"#"]) { + return [self mfGetColorForHex:string]; + } + static NSDictionary *stringColorMapping; static dispatch_once_t once; dispatch_once(&once, ^{ From c5fa1a251543944461c9895a243de3a446d44d43 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 30 Apr 2024 13:11:39 -0400 Subject: [PATCH 2/7] Digital ACT191 story ONEAPP-7592 - icon updates --- .../externalLink.imageset/Contents.json | 24 ++++++------------ .../externalLink.imageset/Vector.svg | 3 +++ .../externalLink.imageset/exportBlack.png | Bin 345 -> 0 bytes .../externalLink.imageset/exportBlack@2x.png | Bin 589 -> 0 bytes .../externalLink.imageset/exportBlack@3x.png | Bin 869 -> 0 bytes .../nav_back.imageset/Contents.json | 18 ++++--------- .../nav_back.imageset/Vector.svg | 3 +++ .../nav_back.imageset/nav_back.png | Bin 220 -> 0 bytes .../nav_back.imageset/nav_back@2x.png | Bin 302 -> 0 bytes .../nav_back.imageset/nav_back@3x.png | Bin 394 -> 0 bytes .../nav_close.imageset/Close-1.png | Bin 435 -> 0 bytes .../nav_close.imageset/Close-2.png | Bin 631 -> 0 bytes .../nav_close.imageset/Close.png | Bin 257 -> 0 bytes .../nav_close.imageset/Contents.json | 18 ++++--------- .../nav_close.imageset/Vector.svg | 3 +++ 15 files changed, 27 insertions(+), 42 deletions(-) create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Vector.svg delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/Vector.svg delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close-1.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close-2.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Vector.svg diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json index 07a5a9f8..702db438 100644 --- a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json @@ -1,23 +1,15 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "exportBlack.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "exportBlack@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "exportBlack@3x.png", - "scale" : "3x" + "filename" : "Vector.svg", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true } -} \ No newline at end of file +} diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Vector.svg b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Vector.svg new file mode 100644 index 00000000..bcdaef29 --- /dev/null +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Vector.svg @@ -0,0 +1,3 @@ + + + diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png deleted file mode 100644 index 34f6d7e9c930cfd3b15aa1fd6be1e88c0e281a28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 345 zcmV-f0jBPx$6G=otR5%gMk}*yLK@3GFhz__y1QnspDN^PFTp_38DAdpqr9z^BGE$T}%YPov z?wSm%DJZb?$6kMr*JC@SK{`x3FfKSG_gUq$XVa`u7`PWXB0WgIU=Oj*{8U|^!x^py z=}Hm3_fl4sjc-PqA;Ge-tqu#tTdY?n&sTlBLo z?S-ZACVU9Df(Z#~J$E`NHjG)I%RH#=e7oiRO`e=!;#=Y1-&Dnx*c!A}Px%2T4RhR9Fe^mpM|zFc3v&fC~_D2#6sfnRKe)8eD`ka1TNPa&kBX5EDVw(66np zl5LH=%o@0>+Pz7wuhwFFKC9CT^UN6K9>Zu}iOMP6i$vEiN@m5LcLHI&GkH(Sx$NeN)yQE z`(H+vWD1wYtT+S!m1gd9b9eV+QEJj_ZA%FhJHA8|%a=|N2TB!tV7J+fqsPE49-8sW zlAI^QvmKridz4BNkUa$1h8Y4a_~!pHhLi-!*^4_{uMZlPh`Wr=@5W5?!#EydM(#@~ z67_LJ7=05plW3YC^NX}^BHED*;WsE;fG zQU3^NYv)y&6Dc6P{vcj7eCY8S)F-H^ZPM~=t3m=oUhNT$dSePpNi0jcKeEA*&Ts2S z6&69JX{gX?>S*e_0K{(@U`Ej{_s|4rR0X;^O-nXasH*~9@$??z7Tq;uCV77L$$&l_-Z00000NkvXXu0mjf1aSuz diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png deleted file mode 100644 index 15f13e3249cc453310cf2b87eed836add51186f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 869 zcmV-r1DgDaP)Px&A4x<(RA>e5SUYkQF%Y%E0faV*Q;vW+fD>~9LZ5+z09W}41SC{(4k8je;Q+u% zFjWMOTm}8c^R&HEOEc1FXLq*LRdQ=v-TnF_&5U(;VADTaypo<^YH1x)$6D;xo>0T$ z<%@@gI~Rks2z{sE8*_o&Uw^bLk2Yx;i#7;C3A#X!M1aYaTCk=cdp&d!V4ZO^)!qZv z*JREy=R6nyd2fN z|1E+SGH|GHxDHr*%*_WM7Df_4I;X;s)gRxkXvcd_m`gkS)+`j<7i-`OO;ZbwT${ue@I1DV{PhFgE3&M57Mk<9E@h7!cVd1 z0UwopDIS5yHwH!ka1gU|6ADWBmq(x7UmwVUaqE8*$#-RtGkp-{Prbnp;jd);l7Tlu zK**%V83Pb}f&0`|tJc;B05U-dU;9Y>T?5Pl(mf?RVvB9*)XZ$J5orU96edsH%9vNLh;}Puq%e8n{VgLO#OHYhNoq%Z;fvUO z_axnoTdei9Jq|5XYwTSLiZeKNDO21o?DK + + diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png deleted file mode 100644 index 895fade7109e9e7ea5b937adaa25e3a8111788aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#LQfaRkP61PQ}1#%81S^5pKp7W_s)SmJHzfC z@im!b!`T$NPUJ27^&pP&Eha2Kq$hW$?OVyhGHJ$lg@7~m32}4JxNcp=bkA7EyH?Q6 zIl=!*W5<*UInHi23w8zyC&X8L`^+T7wA=HFOSW>>(eEm}Gx@D;FDkRIS9!t+w4A}y L)z4*}Q$iB}lgCHV diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@2x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@2x.png deleted file mode 100644 index e699cb47470c1e6084ce5374ae7d6d3f49ed5612..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 302 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?2=RS;(M3{v?36l5$8 za(7}_cTVOdki(Mh=%-{4AGgf7Ut8`G{k`18yk^Hgs|7Zn<zopr0GEVw6#xJL diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png deleted file mode 100644 index 96e839ed04085187d59f599dc2a822c227b6b3b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 394 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!oCO|{#S9FJ79h;%I?XTvD9BhG zE))=%ok5&U^q~kv+SntXN@y&9@qGMHa$DL zqvV;ZeWKs6>I+R;F_-=cgn6=`%!pz zM7Mp!6{R5jC`2g;1xdL-lK9Yh$wr9%WWA=KrWP7HtNgabI7a6KdyFq5!-1X#ilqF@_H8`DvTMfWH4Fm85 zFxAGhTgs5Lq(Ap+{tDcjjiLw072MM17QkU;*McWGN~f*q2T@_^p_^Qgk?sTeU`2 zmT2mGuy5;VfE$}kxm@{>y&n_fpqGZzhBSfGgfxTGf;5HGfHa3=L%M*YdU^@M@^%Hs zsNoJyx|T~g$(nBAq-wi{lgQv6t~E=|wC_grtC=*1TS0El+|tH_*t2T@o?Qd* d?CKj3zz38L+0W2kewF|L002ovPDHLkV1gc>zia>i diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close-2.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Close-2.png deleted file mode 100644 index 3cbe291bc07a9ab4e5c50ff9d7e41c3d2f3c4756..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 631 zcmeAS@N?(olHy`uVBq!ia0vp^At21b1|(&&1r7o!&H|6fVg?39a}Z`Uj+kG?z`&&G z>EaktG3V`_hq=uL0;~^;)laCUw)C9gkX(3IMS6$RqM%lVqvtmNeOKY{^tW-+?%z{{ z9QZV!=WyxCZ#v?(-~oq-Okrgez;cJ3uxSl*Rd-#Iw zoKxk_iN2q;CzM8>KYYfnysUnGegC(+#pli+)1Ak4^?cSp$GhC3%Qmjv7oGU7-frT0 zr}oUA(~|y+f|6!kYk%a-UiHah*PCjCb^c44bpHe`a#_k~TX<_rxzAJQtDUtQv{hrP z_zrz(dc}2_d6l(KS;+JmXIA7HMh3+hkT#5jEGh8O*)!6jh#` zh&ztis>`M*1wBynXM>RIm7!Zrg`SfX)W%Z*V-{+5*ocJXWp<2R_coSZ_4Ea PrX&VWS3j3^P62BR0px|at z7sn8f&bwg;c^edX_E<40@Az-h_kbfO;4+JlqwvCBab-^V%=bP!rwNC$7VCy=^B3qk zp{1nBl_SwsYPrFBjdTNR3WIb*iQVj*)1nP{vU4r04oR(uyQJRpvW4TO?!xIMCh9x} zveJ4NQ%s${KhoM8&J$PY`s7{kr;G=@D_4iVJp6mM>e8;ZTVhv^E$=gX^@%)0aPBjmQH!pTX1B&t;ucLK6Us Ca$k!8 diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Contents.json b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Contents.json index ffda34e6..702db438 100644 --- a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Contents.json +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Contents.json @@ -1,23 +1,15 @@ { "images" : [ { - "filename" : "Close.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "Close-1.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "Close-2.png", - "idiom" : "universal", - "scale" : "3x" + "filename" : "Vector.svg", + "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true } } diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Vector.svg b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Vector.svg new file mode 100644 index 00000000..1aece044 --- /dev/null +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/Vector.svg @@ -0,0 +1,3 @@ + + + From 895f0181ecdfc2340c9f3787d30679afe78c2488 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 30 Apr 2024 16:03:48 -0400 Subject: [PATCH 3/7] Digital PCT265 story ONEAPP-7592 - Updates to tile container to allow custom colors. --- .../Atomic/Atoms/Views/TileContainerModel.swift | 3 ++- .../Atomic/Extensions/VDS-Enums+Codable.swift | 6 +++++- .../H1/HeadersH1NoButtonsBodyTextModel.swift | 6 +++--- MVMCoreUI/Categories/UIColor+Extension.swift | 6 ++++++ MVMCoreUI/Categories/UIColor+MFConvenience.m | 14 +++++++------- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift index 895bb027..2a6d98aa 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift @@ -8,6 +8,7 @@ import Foundation import VDS +import MVMCore open class TileContainerModel: TileContainerBaseModel, ParentMoleculeModelProtocol, MoleculeModelProtocol { @@ -36,7 +37,7 @@ open class TileContainerModel: TileContainerBaseModel TitleLockupModel { guard let headline = headlineBody.headline else { throw ModelRegistry.Error.decoderOther(message: "headline is required for this use case.") } - var body = headlineBody.body + let body = headlineBody.body switch headlineBody.style ?? defaultStyle { case .landingHeader: headline.fontStyle = Styler.Font.RegularTitle2XLarge @@ -103,13 +103,13 @@ public struct DeprecatedHeadlineBodyHelper { headline.fontStyle = Styler.Font.RegularTitleXLarge body?.fontStyle = Styler.Font.RegularTitleMedium } - let model = try TitleLockupModel(title: headline, subTitle: body) + let model = TitleLockupModel(title: headline, subTitle: body) model.id = headlineBody.id return model } public func createHeadlineBodyModel(titleLockup: TitleLockupModel) -> HeadlineBodyModel { - var headlineBody = HeadlineBodyModel(headline: titleLockup.title) + let headlineBody = HeadlineBodyModel(headline: titleLockup.title) headlineBody.body = titleLockup.subTitle headlineBody.id = titleLockup.id return headlineBody diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index f4ef0f7f..1d2158a6 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -230,6 +230,12 @@ extension UIColor { return UIColor(named: name, in: MVMCoreUIUtility.bundleForMVMCoreUI(), compatibleWith: nil)! } + /// Returns a color corresponding to the passed in color name. + @objc + public static func mvmCoreUIColor(with name: String) -> UIColor? { + return UIColor.names[name]?.uiColor + } + /// Convenience to get a grayscale UIColor where the same value is used for red, green, and blue. public class func grayscale(rgb: Int, alpha: CGFloat = 1.0) -> UIColor { diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.m b/MVMCoreUI/Categories/UIColor+MFConvenience.m index cd809509..f33b71b0 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.m +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.m @@ -7,6 +7,7 @@ // #import "UIColor+MFConvenience.h" +#import @import MVMCore.MVMCoreDispatchUtility; @implementation UIColor (MFConvenience) @@ -298,6 +299,10 @@ } + (nullable UIColor *)mfGetColorForString:(nullable NSString *)string { + if ([string hasPrefix:@"#"]) { + return [self mfGetColorForHex:string]; + } + static NSDictionary *stringColorMapping; static dispatch_once_t once; dispatch_once(&once, ^{ @@ -327,14 +332,9 @@ UIColor *color = nil; if (string && string.length > 0) { - color = [stringColorMapping objectForKey:string]; - if (!color){ - color = [UIColor blackColor]; - } - } else { - color = [UIColor blackColor]; + color = [stringColorMapping objectForKey:string] ?: [UIColor mvmCoreUIColorWith:string]; } - return color; + return color ?: [UIColor blackColor]; } + (nonnull UIColor *)mfGetColorForHex:(nonnull NSString *) hexString { From a0168d6e38ccaab86dde7031fc3b464b985d9bb6 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 30 Apr 2024 16:13:25 -0400 Subject: [PATCH 4/7] Digital PCT265 story ONEAPP-7592 - Warning fixes --- .../Item Dropdown/BaseItemPickerEntryField.swift | 2 +- .../Atoms/FormFields/TextFields/TextEntryField.swift | 2 +- .../VerticalCombinationViews/HeadlineBodyModel.swift | 4 ++-- MVMCoreUI/Behaviors/GetContactBehavior.swift | 8 ++++---- MVMCoreUI/Categories/UIStackView+Extension.swift | 3 ++- MVMCoreUI/Managers/SubNav/SubNavManagerController.swift | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/BaseItemPickerEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/BaseItemPickerEntryField.swift index 65c4448b..22a18b94 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/BaseItemPickerEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/BaseItemPickerEntryField.swift @@ -74,7 +74,7 @@ extension BaseItemPickerEntryField { @objc open override func setAccessibilityString(_ accessibilityString: String?) { - var accessibilityString = accessibilityString ?? "" + let accessibilityString = accessibilityString ?? "" textField.accessibilityTraits = .staticText textField.accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "textfield_picker_item") textField.accessibilityLabel = "\(accessibilityString) \(textField.isEnabled ? "" : MVMCoreUIUtility.hardcodedString(withKey: "textfield_disabled_state") ?? "")" diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift index a3780846..9d030d0f 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift @@ -397,7 +397,7 @@ extension TextEntryField { @objc open override func setAccessibilityString(_ accessibilityString: String?) { - var accessibilityString = accessibilityString ?? "" + let accessibilityString = accessibilityString ?? "" textField.accessibilityLabel = "\(accessibilityString) \(textField.isEnabled ? "" : MVMCoreUIUtility.hardcodedString(withKey: "textfield_disabled_state") ?? "")" } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyModel.swift index 093528d1..c8c1a633 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyModel.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyModel.swift @@ -94,7 +94,7 @@ open class HeadlineBodyModel: ParentMoleculeModelProtocol { public extension HeadlineBodyModel { func createHeaderTitleLockupModel(defaultStyle: Style = .header) throws -> TitleLockupModel { guard let headline = headline else { throw ModelRegistry.Error.decoderOther(message: "headline is required for this use case.") } - var body = self.body + let body = self.body switch style ?? defaultStyle { case .landingHeader: headline.fontStyle = Styler.Font.RegularTitle2XLarge @@ -106,7 +106,7 @@ public extension HeadlineBodyModel { headline.fontStyle = Styler.Font.RegularTitleXLarge body?.fontStyle = Styler.Font.RegularTitleMedium } - let model = try TitleLockupModel(title: headline, subTitle: body) + let model = TitleLockupModel(title: headline, subTitle: body) model.id = id return model } diff --git a/MVMCoreUI/Behaviors/GetContactBehavior.swift b/MVMCoreUI/Behaviors/GetContactBehavior.swift index 6f9a3cd4..755c5706 100644 --- a/MVMCoreUI/Behaviors/GetContactBehavior.swift +++ b/MVMCoreUI/Behaviors/GetContactBehavior.swift @@ -35,16 +35,16 @@ public class PageGetContactBehavior: PageVisibilityBehavior { CNContactStore().requestAccess(for: .contacts) { [weak self] (access, error) in guard access, error == nil, - let rootMolecules = self?.delegate?.moleculeDelegate?.getRootMolecules() else { return } + let rootMolecules = delegateObject?.moleculeDelegate?.getRootMolecules() else { return } // Iterate models and provide contact self?.getContacts(for: rootMolecules) // Tell template to update - MVMCoreDispatchUtility.performBlock(onMainThread: { + Task { @MainActor in // TODO: move to protocol function instead - guard let controller = self?.delegate?.moleculeDelegate as? ViewController else { return } + guard let controller = delegateObject?.moleculeDelegate as? ViewController else { return } controller.handleNewData() - }) + } } } diff --git a/MVMCoreUI/Categories/UIStackView+Extension.swift b/MVMCoreUI/Categories/UIStackView+Extension.swift index b6bc1b05..e6ed0dda 100644 --- a/MVMCoreUI/Categories/UIStackView+Extension.swift +++ b/MVMCoreUI/Categories/UIStackView+Extension.swift @@ -7,6 +7,7 @@ // import Foundation +import MVMCore extension UIStackView: MVMCoreViewProtocol { public func updateView(_ size: CGFloat) { @@ -16,7 +17,7 @@ extension UIStackView: MVMCoreViewProtocol { } /// A convenience function for updating molecules. If model is nil, view is hidden. - open func updateContainedMolecules(with models: [MoleculeModelProtocol?], _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + public func updateContainedMolecules(with models: [MoleculeModelProtocol?], _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { for (index, item) in arrangedSubviews.enumerated() { if let model = models[index] { (item as? MoleculeViewProtocol)?.set(with: model, delegateObject, additionalData) diff --git a/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift b/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift index 2c2e4ae7..2bde433a 100644 --- a/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift +++ b/MVMCoreUI/Managers/SubNav/SubNavManagerController.swift @@ -404,7 +404,7 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol, public func update(percentage: CGFloat) { guard customInteractor?.interactive == true, - let index = index else { return } + let _ = index else { return } // tabs.progress(from: tabs.selectedIndex, toIndex: index, percentage: percentage) } } From 16cd1601ba2e80de2247625cb4671593bc72c79d Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 1 May 2024 14:47:37 -0400 Subject: [PATCH 5/7] Digital ACT191 story ONEAPP-7459 - Update back to Vivid Red --- MVMCoreUI/Categories/UIColor+Extension.swift | 4 ++-- MVMCoreUI/Categories/UIColor+MFConvenience.m | 2 +- .../Categories/colors.xcassets/red.colorset/Contents.json | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 6f994254..3cf8609e 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -19,7 +19,7 @@ extension UIColor { /// Dictionary to access brand approved colors by name. public static let names: [String: ColorHexTuple] = ["black": (.mvmBlack, "#000000"), "white": (.mvmWhite, "#FFFFFF"), - "red": (.mvmRed, "#F50A23"), + "red": (.mvmRed, "#EE0000"), "pink": (.mvmPink, "#D90368"), "pink33": (.mvmPink33, "#F2ABCD"), "pink66": (.mvmPink66, "#E6589B"), @@ -88,7 +88,7 @@ extension UIColor { // MARK: - Red //-------------------------------------------------- - /// HEX: ##F50A23 + /// HEX: #EE0000 @objc public static let mvmRed = UIColor.assetColor(named: "red") diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.m b/MVMCoreUI/Categories/UIColor+MFConvenience.m index 259ba747..d10672a8 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.m +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.m @@ -77,7 +77,7 @@ #pragma mark - legacy + (nonnull UIColor *)mfRedColor { - return [UIColor colorWithRed:.804 green:.016 blue:.043 alpha:1.0]; + return [UIColor mvmRed]; } + (nonnull UIColor *)mfDarkerRedColor { diff --git a/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json index 5f3b4048..3a204689 100644 --- a/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x23", - "green" : "0x0A", - "red" : "0xF5" + "blue" : "0x00", + "green" : "0x00", + "red" : "0xEE" } }, "idiom" : "universal" From 6f92282a1d7ac023db1b7bb28e434863cfb78d00 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Fri, 3 May 2024 12:54:17 -0400 Subject: [PATCH 6/7] Digital ACT191 defect - Carousel indicator disappearing fix. --- .../CarouselIndicatorModel.swift | 2 +- .../Atomic/Organisms/Carousel/Carousel.swift | 35 +++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift index 3631bfc0..11bcdd8d 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift @@ -26,7 +26,7 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro /// Sets the current Index to focus on. public var currentIndex: Int = 0 public var animated: Bool = true - public var hidesForSinglePage: Bool = false + public var hidesForSinglePage: Bool = true public var inverted: 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 diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index c4f7d825..5be4f6bb 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -69,7 +69,7 @@ open class Carousel: View { public var delegateObject: MVMCoreUIDelegateObject? private var size: CGFloat? - + // Updates the model and index. public func updateModelIndex() { (model as? CarouselModel)?.index = pageIndex @@ -90,12 +90,29 @@ open class Carousel: View { showPeaking(false) // Go to current cell. layoutIfNeeded is needed otherwise cellForItem returns nil for peaking logic. The dispatch is a sad way to ensure the collection view is ready to be scrolled. - guard let model = model as? CarouselModel, !model.molecules.isEmpty, - (model.paging == true || loop == true) else { return } + guard let model = model as? CarouselModel, !model.molecules.isEmpty else { return } + guard (model.paging == true || loop == true) else { + DispatchQueue.main.async { [self] in + updatePagerVisibility() + } + return + } DispatchQueue.main.async { [self] in collectionView.scrollToItem(at: IndexPath(row: currentIndex, section: 0), at: itemAlignment, animated: false) collectionView.layoutIfNeeded() showPeaking(true) + updatePagerVisibility() + } + } + + /// Updates if the pager is visible or not. + private func updatePagerVisibility() { + guard let pagingView = pagingView else { return } + let shouldHidePager = collectionView.contentSize.width < bounds.width + if (shouldHidePager && !pagingView.isHidden) || (!shouldHidePager && pagingView.isHidden) { + pagingView.isHidden = shouldHidePager + pagingBottomPin?.isActive = !shouldHidePager + delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self) } } @@ -140,16 +157,6 @@ open class Carousel: View { (cell as? MVMCoreViewProtocol)?.updateView(size) } layoutCollection() - - // Check must be dispatched to main for the layout to complete in layoutCollection. - DispatchQueue.main.async { [self] in - let shouldHidePager = molecules?.count ?? 0 < 2 || collectionView.contentSize.width < bounds.width - if let pagingView = pagingView, shouldHidePager != pagingView.isHidden { - pagingView.isHidden = shouldHidePager - pagingBottomPin?.isActive = !shouldHidePager - delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self) - } - } } //-------------------------------------------------- @@ -244,7 +251,7 @@ open class Carousel: View { var pagingView: (MoleculeViewProtocol & CarouselPageControlProtocol)? = nil if let molecule = molecule, - (!molecule.hidesForSinglePage || numberOfPages > 1) { + (numberOfPages > 1 || molecule.hidesForSinglePage) { pagingView = ModelRegistry.createMolecule(molecule, delegateObject: delegateObject) as? (MoleculeViewProtocol & CarouselPageControlProtocol) pagingMoleculeName = molecule.moleculeName } else { From 1c953bcccbe7cc66a42fe07c6adc7855295d6d00 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Fri, 3 May 2024 15:02:06 -0400 Subject: [PATCH 7/7] Digital ACT191 defect - fix logic flip --- MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index 5be4f6bb..18d65559 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -251,7 +251,7 @@ open class Carousel: View { var pagingView: (MoleculeViewProtocol & CarouselPageControlProtocol)? = nil if let molecule = molecule, - (numberOfPages > 1 || molecule.hidesForSinglePage) { + (numberOfPages > 1 || !molecule.hidesForSinglePage) { pagingView = ModelRegistry.createMolecule(molecule, delegateObject: delegateObject) as? (MoleculeViewProtocol & CarouselPageControlProtocol) pagingMoleculeName = molecule.moleculeName } else {