Comments (7)
After I remove 'override' ,it can run. But in iOS13, the sdk has no effect.
from flutter_home_indicator.
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.
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.
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.
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.
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.
Thanks very much
from flutter_home_indicator.
Related Issues (10)
- The plugin `home_indicator` uses a deprecated version of the Android embedding. HOT 1
- Plugin not working HOT 2
- Lexical or Preprocessor Issue (Xcode): 'home_indicator-Swift.h' file not found HOT 3
- Build fail / Missing file: home_indicator-Swift.h HOT 3
- update kotlin version in android/build.gradle HOT 2
- 'home_indicator/home_indicator-Swift.h' file not found HOT 4
- I can't use this plugin HOT 3
- Add null safety support HOT 4
- Migration to Android V2 embedding HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_home_indicator.