Skip to content

Commit

Permalink
fix migration to Swift 5, updated README.md, fix #149
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Oct 24, 2019
1 parent 29e4474 commit 10b42f2
Show file tree
Hide file tree
Showing 59 changed files with 270 additions and 136 deletions.
116 changes: 116 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

252 changes: 131 additions & 121 deletions .idea/workspace.xml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Because of [Flutter AndroidX compatibility](https://flutter.dev/docs/development
If you are starting a new fresh app, you need to create the Flutter App with `flutter create -i swift` (see [flutter/flutter#13422 (comment)](https://github.com/flutter/flutter/issues/13422#issuecomment-392133780)), otherwise, you will get this message:
```
=== BUILD TARGET flutter_inappbrowser OF PROJECT Pods WITH CONFIGURATION Debug ===
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2, 5.0. This setting can be set in the build settings editor.
```

If you still have this problem, try to edit iOS `Podfile` like this (see [#15](https://github.com/pichillilorenzo/flutter_inappbrowser/issues/15)):
Expand All @@ -38,7 +38,7 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0' # required by simple_permission
config.build_settings['SWIFT_VERSION'] = '5.0' # required by simple_permission
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
Expand Down Expand Up @@ -70,8 +70,8 @@ See the online [docs](https://pub.dartlang.org/documentation/flutter_inappbrowse
### `InAppWebView` class
Flutter Widget for adding an **inline native WebView** integrated into the flutter widget tree.

[AndroidView](https://docs.flutter.io/flutter/widgets/AndroidView-class.html) and [UiKitView](https://docs.flutter.io/flutter/widgets/UiKitView-class.html) are not officially stable yet!
So, if you want use it, you can but you will have some limitation such as the inability to use the keyboard!
The plugin relies on Flutter's mechanism (in developers preview) for embedding Android and iOS native views: [AndroidView](https://docs.flutter.io/flutter/widgets/AndroidView-class.html) and [UiKitView](https://docs.flutter.io/flutter/widgets/UiKitView-class.html).
Known issues are tagged with the [platform-views](https://github.com/flutter/flutter/labels/a%3A%20platform-views) label in the [Flutter official repo](https://github.com/flutter/flutter).

To use `InAppWebView` class on iOS you need to opt-in for the embedded views preview by adding a boolean property to the app's `Info.plist` file, with the key `io.flutter.embedded_views_preview` and the value `YES`.

Expand Down Expand Up @@ -121,7 +121,7 @@ class _MyAppState extends State<MyApp> {
padding: EdgeInsets.all(20.0),
child: Text("CURRENT URL\n${ (url.length > 50) ? url.substring(0, 50) + "..." : url }"),
),
(progress != 1.0) ? LinearProgressIndicator(value: progress) : null,
(progress != 1.0) ? LinearProgressIndicator(value: progress) : Container(),
Expanded(
child: Container(
margin: const EdgeInsets.all(10.0),
Expand Down
Empty file modified example/ios/Flutter/AppFrameworkInfo.plist
100644 → 100755
Empty file.
Empty file modified example/ios/Flutter/Debug.xcconfig
100644 → 100755
Empty file.
Empty file modified example/ios/Flutter/Release.xcconfig
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappbrowser/example"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios-release"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
2 changes: 1 addition & 1 deletion example/ios/Podfile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['SWIFT_VERSION'] = '4.0'
config.build_settings['SWIFT_VERSION'] = '5.0'
end
end
end
6 changes: 2 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = PFP8UV45Y6;
LastSwiftMigration = 1100;
LastSwiftMigration = 1020;
};
};
};
Expand Down Expand Up @@ -256,7 +256,7 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
"${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/flutter_inappbrowser/flutter_inappbrowser.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand Down Expand Up @@ -447,7 +447,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down Expand Up @@ -475,7 +474,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.pichillilorenzo.flutter_inappbrowserExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down
Empty file.
Empty file.
Empty file modified example/ios/Runner.xcworkspace/contents.xcworkspacedata
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified example/ios/Runner/AppDelegate.swift
100644 → 100755
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified example/ios/Runner/Assets.xcassets/Contents.json
100644 → 100755
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file modified example/ios/Runner/Base.lproj/LaunchScreen.storyboard
100644 → 100755
Empty file.
Empty file modified example/ios/Runner/Base.lproj/Main.storyboard
100644 → 100755
Empty file.
Empty file modified example/ios/Runner/Info.plist
100644 → 100755
Empty file.
Empty file modified example/ios/Runner/Runner-Bridging-Header.h
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion example/lib/inline_example.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class _InlineExampleScreenState extends State<InlineExampleScreen> {
),
Container(
padding: EdgeInsets.all(10.0),
child: progress < 1.0 ? LinearProgressIndicator(value: progress) : null
child: progress < 1.0 ? LinearProgressIndicator(value: progress) : Container()
),
Expanded(
child: Container(
Expand Down
Empty file modified ios/.gitignore
100644 → 100755
Empty file.
Empty file modified ios/Assets/.gitkeep
100644 → 100755
Empty file.
Empty file modified ios/Classes/FlutterWebViewController.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/FlutterWebViewFactory.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/InAppBrowserFlutterPlugin.h
100644 → 100755
Empty file.
Empty file modified ios/Classes/InAppBrowserFlutterPlugin.m
100644 → 100755
Empty file.
Empty file modified ios/Classes/InAppBrowserOptions.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/InAppBrowserWebViewController.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/InAppWebView.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/InAppWebViewOptions.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/MyCookieManager.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/Options.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/SafariBrowserOptions.swift
100644 → 100755
Empty file.
Empty file modified ios/Classes/SafariViewController.swift
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions ios/Classes/SwiftFlutterPlugin.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
let tmpController = UIViewController()
let baseWindowLevel = UIApplication.shared.keyWindow?.windowLevel
self.tmpWindow?.rootViewController = tmpController
self.tmpWindow?.windowLevel = UIWindow.Level(baseWindowLevel!.rawValue + 1)
self.tmpWindow?.windowLevel = UIWindow.Level(baseWindowLevel!.rawValue + 1.0)
self.tmpWindow?.makeKeyAndVisible()

let browserOptions: InAppBrowserOptions
Expand Down Expand Up @@ -466,7 +466,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
let tmpController = UIViewController()
let baseWindowLevel = UIApplication.shared.keyWindow?.windowLevel
self.tmpWindow?.rootViewController = tmpController
self.tmpWindow?.windowLevel = UIWindow.Level(baseWindowLevel!.rawValue + 1)
self.tmpWindow?.windowLevel = UIWindow.Level(baseWindowLevel!.rawValue + 1.0)
self.tmpWindow?.makeKeyAndVisible()

let browserOptions: InAppBrowserOptions
Expand Down Expand Up @@ -536,7 +536,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
DispatchQueue.main.async(execute: {() -> Void in
if webViewController != nil {
let baseWindowLevel = UIApplication.shared.keyWindow?.windowLevel
self.tmpWindow?.windowLevel = UIWindow.Level(baseWindowLevel!.rawValue + 1)
self.tmpWindow?.windowLevel = UIWindow.Level(baseWindowLevel!.rawValue + 1.0)
self.tmpWindow?.makeKeyAndVisible()
UIApplication.shared.delegate?.window??.makeKeyAndVisible()
self.tmpWindow?.rootViewController?.present(webViewController!, animated: true, completion: nil)
Expand Down
Empty file modified ios/Storyboards/WebView.storyboard
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion ios/flutter_inappbrowser.podspec
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ A new Flutter plugin.
s.dependency 'Flutter'

s.ios.deployment_target = '8.0'
s.swift_version = '4.0'
s.swift_version = '5.0'
end

0 comments on commit 10b42f2

Please sign in to comment.