Stackoverflow Sucks
I asked the following question on stackoverflow about dark mode
I'm trying to implement dark mode in my IOS app. Is dark mode simply changing the background to black and the text to white? I'm using a webview.
People immediately closed the question. I’m trying to implement dark mode in iOS app and want to make sure I’m getting the styling correct. I might be a newbie but it’s not fair that people on stackoverflow keep closing relevant questions. Is it me or does stackoverflow suck?
(
15 comments
| 8 points
| on HN
)
Quite a lot of the existing content is outdated or unclear. Also good luck writing a question that is both acceptable and there’s someone who knows an answer…
The purpose of the site was never in helping people (as in answering every question). The original purpose of SO was in constructing a searchable database of question-answer pairs. With this in mind a question that was asked before, or is too complex, or too vague should be closed as off topic. I think something like this also happened with the question OP was trying to ask.
A quote from https://blog.codinghorror.com/what-does-stack-overflow-want-... :
Stack Overflow ultimately has much more in common with Wikipedia than a discussion forum. By this I mean questions and answers on Stack Overflow are not primarily judged by their usefulness to a specific individual, but by how many other programmers that question or answer can potentially help over time.
Given your frustration it seems that stack overlow‘s mission is at odds with your expectation, which is for sure facilitated by the fact that in the past , SO advertised to be a place to ask any programming related question, when this is not the case. (And had never been)
This is what ChatGPT says. No moderator to make your life more difficult. Hope this helps.
Implementing dark mode in an iOS app involves more than just changing the background to black and the text to white. It's about creating a color scheme that reduces eye strain and battery usage, especially in low-light conditions. To achieve this, you need to adjust not only the background and text colors but also other UI elements such as buttons, images, and navigation bars.
Since you're using a WebView in your iOS app, you need to handle dark mode in both the native iOS components and the web content displayed in the WebView.
Here's a high-level approach to implementing dark mode in your app:
Native iOS components: Set the appropriate appearance mode for your app by adding the following code to your app's Info.plist file:
xml
<key>UIUserInterfaceStyle</key> <string>Automatic</string> This tells your app to automatically switch between light and dark modes based on the user's system settings.
Next, use dynamic colors for native UI elements. Instead of hardcoding colors, use system-provided colors or create custom dynamic colors using UIColor's init(dynamicProvider:) method.
WebView content: To implement dark mode for the web content displayed in the WebView, you can use CSS media queries to detect the user's preferred color scheme and apply the appropriate styles.
Add the following CSS media query to your website's CSS:
css
@media (prefers-color-scheme: dark) { /* Add dark mode styles here / body { background-color: #000000; color: #ffffff; }
}You can customize the colors and styles as needed for your app's design.
Test and fine-tune: Test your app in both light and dark modes to ensure a smooth transition between the two color schemes. Adjust any colors or styles that don't look right or cause readability issues.
Remember that implementing dark mode effectively requires thoughtful design and attention to detail. Make sure to consider the specific needs of your app and its users when customizing your dark mode implementation.
I think they need to focus less on moderating questions and more on making sure that answers are high quality. Lots of low effort gate keeping with no intention of being helpful from the get go.
I haven't done iOS programming for maybe 5 years? The last time I did was in school for a project. So I am complete dummy when it comes to iOS programming.
Therefore, I went to google and typed: "how to create darkmode in ios app".
Second result: https://developer.apple.com/documentation/uikit/appearance_c...
Stackoverflow is like your experienced coworker(A) who has been programming for years and is tired of coworkers(B) who come up to him, interrupt his programming session that took 40 minutes to get into to ask "I can't figure xyz out".
Then:
A - *stares into a wall, trying to contain his rage* did you google it?
B - of course I did!
A - *googles it first result has an answer* here I will send you the link
Then the next day it happens again and again and again.
Until A is so dead inside he stops programming just to not be interrupted in his state of flow again.
SO allowed me to resolve literally 99% of my programming problems. I literally did not have a need to post a question on SO and I'm now writing some stuff in blazor, which is like a year old.