Giter Site home page Giter Site logo

maximkotliar / bartinter Goto Github PK

View Code? Open in Web Editor NEW
1.7K 22.0 85.0 4.25 MB

Dynamically changes status bar style depending on content behind it

License: MIT License

Swift 74.09% Ruby 25.91%
status bar tint uikit uistatusbar automatically content-dependent

bartinter's People

Contributors

maximkotliar avatar uiapplicationmain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bartinter's Issues

Not changing status bar colour for UINavigationController

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?

Dark Mode Breaks Functionality

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.

Example project

It would be cool if you had an example project showing how Bartinter works

Example GIF

It would be cool if you added a gif showcasing your library

App crashed in function calculateStatusBarAreaAvgLuminance

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.

self.swizzledLayoutSubviews() crashed

How to make "Modal View Present" also working?

when some view controller present - dismiss action, crashed!

@objc func swizzledLayoutSubviews() {
self.swizzledLayoutSubviews() <--- here
...
}

2018-07-13_09-35-43

UIGraphicsGetImageFromCurrentImageContext Crash

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)
        }
    }
}

Pod install error

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.