maximkotliar / bartinter Goto Github PK
View Code? Open in Web Editor NEWDynamically changes status bar style depending on content behind it
License: MIT License
Dynamically changes status bar style depending on content behind it
License: MIT License
It would be cool if you had an example project showing how Bartinter works
As the title says - dark mode appears to break the color-change functionality.
Tested via enabling / disabling dark mode on device and temporarily solved by forcing the app to always run in Light mode.
I'm getting a crash on the following line
let image = UIGraphicsGetImageFromCurrentImageContext()
It happens rarely but I'm wondering if it happens since it's background thread running some mainthread-like functions, any thoughts?
EXC_BAD_ACCESS
Rogue memory write has corrupted memory.
closure #1 in Bartinter.calculateStatusBarAreaAvgLuminance(_:)
private func calculateStatusBarAreaAvgLuminance(_ completion: @escaping (CGFloat) -> Void) {
let scale: CGFloat = 0.5
let size = UIApplication.shared.statusBarFrame.size
throttler.throttle { [weak self] in
guard let strongLayer = self?.parent?.view.layer else { return }
UIGraphicsBeginImageContextWithOptions(size, false, scale)
guard let context = UIGraphicsGetCurrentContext() else { return }
strongLayer.render(in: context) <--- crashes
let image = UIGraphicsGetImageFromCurrentImageContext()
guard let averageLuminance = image?.averageLuminance else { return }
UIGraphicsEndImageContext()
DispatchQueue.main.async {
completion(averageLuminance)
}
}
}
I am getting the following error on pod install
Analyzing dependencies
[!] Unable to find a specification for Bartinter
if I add version
[!] Unable to find a specification for Bartinter (~> 0.0.3)
Tried both for
platform :ios, '9.0'
and
platform :ios, '10.2'
The first view controller in my UINavigationController
has a transparent UINavigationBar
(by setting the background image to UIImage()
) with a dark image underneath - the status bar is set to lightContent
correctly.
The second view controller sets the UINavigationBar
background image to nil
, and sets the background to light grey (in the viewWillAppear()
lifecycle method) but the status bar remains lightContent
, when it should display as the default black.
Is this desired behaviour for this module?
Hi,
For iOS projets it's will be great to make your component Carthage compatible
Take a look at these articles:
On your README.md
add on top and add section for the installation with Carthage.
calculateStatusBarAreaAvgLuminance throw error Thread 8: EXC_BAD_ACCESS (code=1, address=0x20) at line 74
layer.render(in: context)
but I checked both layer and context and they are not nil.
I have a view covers the full screen, including the status bar, I guess that's might be the reason.
It would be cool if you added a gif showcasing your library
not relevant
How to make "Modal View Present" also working?
when some view controller present - dismiss action, crashed!
@objc func swizzledLayoutSubviews() {
self.swizzledLayoutSubviews() <--- here
...
}
Trying to quick scroll for top bounce triggers a false color change. Added a video for more context. A UIImageView added to top scrollView for the sticky effect.
Implementation is as in the example, without Swizzling.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.