Eureka: iOS 13 Dark Mode

Created on 8 Jun 2019  路  6Comments  路  Source: xmartlabs/Eureka

There are some small changes that I have done while trying out dark mode, are the dev working on this already? Or should I make a pull request?

diff --git a/Pods/Eureka/Source/Core/Cell.swift b/Pods/Eureka/Source/Core/Cell.swift
index 697d364..380d932 100644
--- a/Pods/Eureka/Source/Core/Cell.swift
+++ b/Pods/Eureka/Source/Core/Cell.swift
@@ -124,7 +124,11 @@ open class Cell<T>: BaseCell, TypedCellType where T: Equatable {
     open override func update() {
         super.update()
         textLabel?.text = row.title
-        textLabel?.textColor = row.isDisabled ? .gray : .black
+        if #available(iOS 13.0, *) {
+            textLabel?.textColor = row.isDisabled ? .tertiaryLabel : .label
+        } else {
+            textLabel?.textColor = row.isDisabled ? .gray : .black
+        }
         detailTextLabel?.text = row.displayValueFor?(row.value) ?? (row as? NoValueDisplayTextConformance)?.noValueDisplayText
     }

diff --git a/Pods/Eureka/Source/Rows/TextAreaRow.swift b/Pods/Eureka/Source/Rows/TextAreaRow.swift
index a2ea3b3..f0bba1e 100644
--- a/Pods/Eureka/Source/Rows/TextAreaRow.swift
+++ b/Pods/Eureka/Source/Rows/TextAreaRow.swift
@@ -80,6 +80,7 @@ open class _TextAreaCell<T> : Cell<T>, UITextViewDelegate, AreaCell where T: Equ
         textView.font = .preferredFont(forTextStyle: .body)
         textView.textContainer.lineFragmentPadding = 0
         textView.textContainerInset = UIEdgeInsets.zero
+        textView.backgroundColor = .clear
         contentView.addSubview(textView)

         let placeholderLabel = UILabel()
@@ -133,7 +134,11 @@ open class _TextAreaCell<T> : Cell<T>, UITextViewDelegate, AreaCell where T: Equ
         textLabel?.text = nil
         detailTextLabel?.text = nil
         textView.isEditable = !row.isDisabled
-        textView.textColor = row.isDisabled ? .gray : .black
+        if #available(iOS 13.0, *) {
+            textView.textColor = row.isDisabled ? .tertiaryLabel : .label
+        } else {
+            textView.textColor = row.isDisabled ? .gray : .black
+        }
         textView.text = row.displayValueFor?(row.value)
         placeholderLabel?.text = (row as? TextAreaConformance)?.placeholder
         placeholderLabel?.isHidden = textView.text.count != 0

Most helpful comment

It is not released for now, but will be released soon

All 6 comments

I would also love to see dark mode support!

@ykphuah I do not know if the devs need help implementing it. I think a PR is the only real way to support them in my eyes though.

We have not started this yet. Pull requests are welcome.
From what I have seen only the default colors of the rows should change, right? @ykphuah diff looks good

thanks for the PR! is this included in the 5.0.1 ?

It is not released for now, but will be released soon

Released in 5.1.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sedwo picture sedwo  路  3Comments

Tomas1405 picture Tomas1405  路  3Comments

Tomas1405 picture Tomas1405  路  3Comments

abbasmousavi picture abbasmousavi  路  3Comments

jaylyerly picture jaylyerly  路  3Comments