Coder Social home page Coder Social logo

Comments (7)

iperfectapp avatar iperfectapp commented on September 26, 2024

After I remove 'override' ,it can run. But in iOS13, the sdk has no effect.

from flutter_home_indicator.

lynn avatar lynn commented on September 26, 2024

Hi, thanks for your report!

I struggled with the syntax here a little too while I was building the library. I think it has to do with different Swift versions requiring different syntaxes for properties.

In Swift version 4.2, which the product we made this for uses, this syntax seems to be valid. But in other versions, Swift expects:

override func prefersHomeIndicatorAutoHidden() -> Bool {
  ...
}

…overriding prefersHomeIndicatorAutoHidden as a function and not a property.

Try adding this to the bottom of your project's Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.2'   # <-- add this line
    end
  end
end

'4.0' would probably also work (not sure).

I'm actually not a Swift (or Objective-C) programmer at all, so I don't know the proper way to deal with this issue. Maybe if I figure out which version the syntax changed in, I can use #if swift(>=x.y) to support both versions.

I found this, which seems to say it was Swift 3.0 that introduced the syntax change. But all versions of Swift supported by Flutter are ≥ 3.0, so I'm not sure what the deal is. 🙁

from flutter_home_indicator.

lynn avatar lynn commented on September 26, 2024

After I remove 'override' ,it can run. But in iOS13, the sdk has no effect.

I assume that if you remove override, then the default behavior (= "never hide the home indicator") will, well, not get overridden. The code might compile, but it's probably just shadowing the thing it should be replacing in the super-super-class.

from flutter_home_indicator.

lynn avatar lynn commented on September 26, 2024

I changed the code to have: #if swift(>=4.2) (one syntax) #else (other syntax) #endif.

This is pushed as 1.1.3, and I can compile it with both config.build_settings['SWIFT_VERSION'] = '4.1' and config.build_settings['SWIFT_VERSION'] = '4.2' now, so I think the issue might be fixed 🙂.

Can you update to 1.1.3 and verify, @iperfectapp?

from flutter_home_indicator.

iperfectapp avatar iperfectapp commented on September 26, 2024

I update to 1.1.3,it fix my problem,thanks very much!!! I am in China, Can I buy your coffee?

from flutter_home_indicator.

andrewmd5 avatar andrewmd5 commented on September 26, 2024

Hi @iperfectapp -- we're not big coffee drinkers, though if you'd like to support our work I'd ask you donate to a charity on our behalf. One near and dear to my heart is CRY UK who could use support.

from flutter_home_indicator.

iperfectapp avatar iperfectapp commented on September 26, 2024

Thanks very much

from flutter_home_indicator.

Related Issues (10)

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.