From f4a824763457f01ce969391eda53436b69fa99e2 Mon Sep 17 00:00:00 2001 From: Andrew Brogdon Date: Wed, 9 Oct 2019 09:25:03 -0700 Subject: [PATCH] Maintenance updates for platform_view_swift (#151) --- MAINTENANCE.md | 2 +- platform_view_swift/.gitignore | 7 +- platform_view_swift/.metadata | 10 + platform_view_swift/README.md | 37 +++- .../assets/flutter-mark-square-64.png | Bin 482 -> 0 bytes platform_view_swift/ios/.gitignore | 44 ---- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- .../ios/Flutter/Debug.xcconfig | 1 - .../ios/Flutter/Release.xcconfig | 1 - platform_view_swift/ios/Podfile | 65 ------ .../ios/Runner.xcodeproj/project.pbxproj | 207 +++++++++++------- .../xcshareddata/xcschemes/Runner.xcscheme | 4 +- .../contents.xcworkspacedata | 3 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../ios/Runner/AppDelegate.swift | 64 +++--- .../AppIcon.appiconset/Contents.json | 6 + .../Icon-App-1024x1024@1x.png | Bin 0 -> 10932 bytes .../LaunchImage.imageset/Contents.json | 23 ++ .../LaunchImage.imageset/LaunchImage.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@2x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@3x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/README.md | 5 + .../Runner/Base.lproj/LaunchScreen.storyboard | 22 +- .../ios/Runner/Base.lproj/Main.storyboard | 122 +---------- platform_view_swift/ios/Runner/Info.plist | 6 +- .../ios/Runner/PlatformViewController.swift | 50 ++--- .../ios/Runner/PlatformViewController.xib | 66 ++++++ .../ios/Runner/Runner-Bridging-Header.h | 2 +- platform_view_swift/ios/Runner/ic_add.png | Bin 86 -> 0 bytes platform_view_swift/lib/main.dart | 114 +++++----- platform_view_swift/pubspec.lock | 58 ++++- platform_view_swift/pubspec.yaml | 11 +- platform_view_swift/test/widget_test.dart | 9 + platform_view_swift/test/widgets_test.dart | 11 - 34 files changed, 492 insertions(+), 468 deletions(-) create mode 100644 platform_view_swift/.metadata delete mode 100644 platform_view_swift/assets/flutter-mark-square-64.png delete mode 100644 platform_view_swift/ios/.gitignore delete mode 100644 platform_view_swift/ios/Podfile create mode 100644 platform_view_swift/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 platform_view_swift/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png create mode 100644 platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json create mode 100644 platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png create mode 100644 platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png create mode 100644 platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png create mode 100644 platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md create mode 100644 platform_view_swift/ios/Runner/PlatformViewController.xib delete mode 100644 platform_view_swift/ios/Runner/ic_add.png create mode 100644 platform_view_swift/test/widget_test.dart delete mode 100644 platform_view_swift/test/widgets_test.dart diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 0593cb6ef..7df6b8d99 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -15,7 +15,7 @@ match any new language/SDK features, etc.). | material_studies/shrine | | | | place_tracker | | | | platform_design | johnpryan | 10/7/19 | -| platform_view_swift | | | +| platform_view_swift | redbrogdon | 10/7/19 | | provider_counter | | | | provider_shopper | | | | veggieseasons | | | diff --git a/platform_view_swift/.gitignore b/platform_view_swift/.gitignore index 07488ba61..2ddde2a5e 100644 --- a/platform_view_swift/.gitignore +++ b/platform_view_swift/.gitignore @@ -15,8 +15,10 @@ *.iws .idea/ -# Visual Studio Code related -.vscode/ +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ # Flutter/Dart/Pub related **/doc/api/ @@ -59,6 +61,7 @@ **/ios/Flutter/app.flx **/ios/Flutter/app.zip **/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh **/ios/ServiceDefinitions.json **/ios/Runner/GeneratedPluginRegistrant.* diff --git a/platform_view_swift/.metadata b/platform_view_swift/.metadata new file mode 100644 index 000000000..aeb01ee24 --- /dev/null +++ b/platform_view_swift/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f + channel: stable + +project_type: app diff --git a/platform_view_swift/README.md b/platform_view_swift/README.md index 44b2c0129..14d56e4ea 100644 --- a/platform_view_swift/README.md +++ b/platform_view_swift/README.md @@ -1,10 +1,33 @@ -# Example of switching between full-screen Flutter and Platform View +# platform_view_swift -This project demonstrates how to bring up a full-screen iOS view from a full-screen -Flutter view along with passing data back and forth between the two. +A Flutter sample app that combines a native iOS UIViewController +with a full-screen Flutter view. -On iOS we use a CocoaPods dependency to add a Material Design button, and so -`pod install` needs to be invoked in the `ios/` folder before `flutter run`: +## Goals for this sample + +* Show a simple technique for combining native and Flutter views. + +## The important bits + +### `lib/main.dart` + +The Flutter part of the application is quite simple, and all the action +takes place in a single file. + +### `ios/Runner/PlatformViewController.swift` and `AppDelegate.swift` + +These files contain the Swift code repsonsible for setting up a platform +channel, launching a native UIViewController, and returning control to +Flutter when finished. + +## Questions/issues + +If you have a general question about Flutter, the best places to go are: + +* [The FlutterDev Google Group](https://groups.google.com/forum/#!forum/flutter-dev) +* [The Flutter Gitter channel](https://gitter.im/flutter/flutter) +* [StackOverflow](https://stackoverflow.com/questions/tagged/flutter) + +If you run into an issue with the sample itself, please file an issue +in the [main Flutter repo](https://github.com/flutter/flutter/issues). -pushd ios/ ; pod install ; popd -flutter run diff --git a/platform_view_swift/assets/flutter-mark-square-64.png b/platform_view_swift/assets/flutter-mark-square-64.png deleted file mode 100644 index 56f22d5bd8f4a90724fcd9aca3a0ec85932c4a48..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 482 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7T#lEU|i|x;uuoF`1Z2ugcwJGV;|p6 z=ni)jO-nO7y=V2ICr!s!^v(QOS^8?m8P&kV5BJt^?KqcXA$#u8o}as3UH)A6f7SB? zPp>{KSXli&>dLdr8;Y$S>6-c-)_L&xQvu z98wQbTSPu6HMxNV_H-=ZjEmz!=r$12SI%gi&KPyYV(MDis-vgRf9-qmWSZcb|Ht_E zJxN{YwyZ!uxa5G5)}dSf()Z{DoECW%_~Ty+L$T7Dmz76O-?{43ShmdL{&fa5mx#On z8m7DPd9a%G+A=}A2j$0S`b{@ry`_5YpWrmt zS-M=`IVU6vPLls`%O)tm2ttrBt*_x}KfIUy@9U-0TlteyfpN#+>FVdQ&MBb@01H0d A0ssI2 diff --git a/platform_view_swift/ios/.gitignore b/platform_view_swift/ios/.gitignore deleted file mode 100644 index 2a8c8b606..000000000 --- a/platform_view_swift/ios/.gitignore +++ /dev/null @@ -1,44 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/app.flx -/Flutter/app.zip -/Flutter/flutter_assets/ -/Flutter/App.framework -/Flutter/Flutter.framework -/Flutter/Generated.xcconfig -/ServiceDefinitions.json - -Pods/ diff --git a/platform_view_swift/ios/Flutter/AppFrameworkInfo.plist b/platform_view_swift/ios/Flutter/AppFrameworkInfo.plist index 9367d483e..6b4c0f78a 100644 --- a/platform_view_swift/ios/Flutter/AppFrameworkInfo.plist +++ b/platform_view_swift/ios/Flutter/AppFrameworkInfo.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) CFBundleExecutable App CFBundleIdentifier diff --git a/platform_view_swift/ios/Flutter/Debug.xcconfig b/platform_view_swift/ios/Flutter/Debug.xcconfig index c16872744..592ceee85 100644 --- a/platform_view_swift/ios/Flutter/Debug.xcconfig +++ b/platform_view_swift/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ #include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" \ No newline at end of file diff --git a/platform_view_swift/ios/Flutter/Release.xcconfig b/platform_view_swift/ios/Flutter/Release.xcconfig index 2bd06e776..592ceee85 100644 --- a/platform_view_swift/ios/Flutter/Release.xcconfig +++ b/platform_view_swift/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ #include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" \ No newline at end of file diff --git a/platform_view_swift/ios/Podfile b/platform_view_swift/ios/Podfile deleted file mode 100644 index dcc6b981d..000000000 --- a/platform_view_swift/ios/Podfile +++ /dev/null @@ -1,65 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '9.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; - end - pods_ary = [] - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) { |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - pods_ary.push({:name => podname, :path => podpath}); - else - puts "Invalid plugin specification: #{line}" - end - } - return pods_ary -end - -target 'Runner' do - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - - # Flutter Pods - generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') - if generated_xcode_build_settings.empty? - puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first." - end - generated_xcode_build_settings.map { |p| - if p[:name] == 'FLUTTER_FRAMEWORK_DIR' - symlink = File.join('.symlinks', 'flutter') - File.symlink(File.dirname(p[:path]), symlink) - pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) - end - } - - # Plugin Pods - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.map { |p| - symlink = File.join('.symlinks', 'plugins', p[:name]) - File.symlink(p[:path], symlink) - pod p[:name], :path => File.join(symlink, 'ios') - } - - pod 'MaterialControls' -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end diff --git a/platform_view_swift/ios/Runner.xcodeproj/project.pbxproj b/platform_view_swift/ios/Runner.xcodeproj/project.pbxproj index 3f94bad1a..f509ccfcc 100644 --- a/platform_view_swift/ios/Runner.xcodeproj/project.pbxproj +++ b/platform_view_swift/ios/Runner.xcodeproj/project.pbxproj @@ -8,20 +8,18 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2788264B20CF7D710075B10E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2788264A20CF7D710075B10E /* AppDelegate.swift */; }; - 2788264D20CF7D790075B10E /* PlatformViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2788264C20CF7D790075B10E /* PlatformViewController.swift */; }; - 2DAF064E1ED4224F00716BEE /* ic_add.png in Resources */ = {isa = PBXBuildFile; fileRef = 2DAF064D1ED4224F00716BEE /* ic_add.png */; }; + 26CDDD6B234BE139004C7A30 /* PlatformViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26CDDD69234BE139004C7A30 /* PlatformViewController.swift */; }; + 26CDDD6C234BE139004C7A30 /* PlatformViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 26CDDD6A234BE139004C7A30 /* PlatformViewController.xib */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - ECB86F1A0B90276D0AEF4169 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6E6555FD3971FC12A9802782 /* libPods-Runner.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -42,13 +40,12 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2788264920CF7D700075B10E /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 2788264A20CF7D710075B10E /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 2788264C20CF7D790075B10E /* PlatformViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlatformViewController.swift; sourceTree = ""; }; - 2DAF064D1ED4224F00716BEE /* ic_add.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_add.png; sourceTree = ""; }; + 26CDDD69234BE139004C7A30 /* PlatformViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlatformViewController.swift; sourceTree = ""; }; + 26CDDD6A234BE139004C7A30 /* PlatformViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PlatformViewController.xib; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 6E6555FD3971FC12A9802782 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -67,20 +64,12 @@ files = ( 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - ECB86F1A0B90276D0AEF4169 /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 5A56E2F315C4CB64895375DA /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -100,8 +89,6 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 5A56E2F315C4CB64895375DA /* Pods */, - E9007A48891C669D010E4F3D /* Frameworks */, ); sourceTree = ""; }; @@ -116,26 +103,26 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( - 2788264C20CF7D790075B10E /* PlatformViewController.swift */, - 2788264A20CF7D710075B10E /* AppDelegate.swift */, - 2DAF064D1ED4224F00716BEE /* ic_add.png */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 2788264920CF7D700075B10E /* Runner-Bridging-Header.h */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + 26CDDD69234BE139004C7A30 /* PlatformViewController.swift */, + 26CDDD6A234BE139004C7A30 /* PlatformViewController.xib */, ); path = Runner; sourceTree = ""; }; - E9007A48891C669D010E4F3D /* Frameworks */ = { + 97C146F11CF9000F007C117D /* Supporting Files */ = { isa = PBXGroup; children = ( - 6E6555FD3971FC12A9802782 /* libPods-Runner.a */, ); - name = Frameworks; + name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ @@ -145,14 +132,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - BE1F6A680926BCE299C7F0C1 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 23ADFA8256C517EB939E4349 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -169,19 +154,18 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0830; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = 7H6KECYDM2; - LastSwiftMigration = 0940; + LastSwiftMigration = 0910; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -202,37 +186,18 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2DAF064E1ED4224F00716BEE /* ic_add.png in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + 26CDDD6C234BE139004C7A30 /* PlatformViewController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 23ADFA8256C517EB939E4349 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -261,24 +226,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - BE1F6A680926BCE299C7F0C1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -286,9 +233,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2788264B20CF7D710075B10E /* AppDelegate.swift in Sources */, + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 26CDDD6B234BE139004C7A30 /* PlatformViewController.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - 2788264D20CF7D790075B10E /* PlatformViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -314,6 +261,83 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.samples.platformViewSwift; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 4.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; @@ -324,14 +348,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -372,14 +404,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -399,6 +439,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -410,24 +451,25 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = 7H6KECYDM2; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.FullPlatformViewSwift; + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.samples.platformViewSwift; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; + VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; }; @@ -437,23 +479,24 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = 7H6KECYDM2; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.FullPlatformViewSwift; + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.samples.platformViewSwift; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; + VERSIONING_SYSTEM = "apple-generic"; }; name = Release; }; @@ -465,6 +508,7 @@ buildConfigurations = ( 97C147031CF9000F007C117D /* Debug */, 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -474,6 +518,7 @@ buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/platform_view_swift/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/platform_view_swift/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 1c9580788..a28140cfd 100644 --- a/platform_view_swift/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/platform_view_swift/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - diff --git a/platform_view_swift/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/platform_view_swift/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/platform_view_swift/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/platform_view_swift/ios/Runner/AppDelegate.swift b/platform_view_swift/ios/Runner/AppDelegate.swift index 705e86dbd..e4cf4b61b 100644 --- a/platform_view_swift/ios/Runner/AppDelegate.swift +++ b/platform_view_swift/ios/Runner/AppDelegate.swift @@ -8,36 +8,36 @@ import Flutter @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate, PlatformViewControllerDelegate { - var flutterResult: FlutterResult? - - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - GeneratedPluginRegistrant.register(with: self) - let controller: FlutterViewController = window?.rootViewController as! FlutterViewController - let channel = FlutterMethodChannel.init(name: "samples.flutter.io/platform_view_swift", binaryMessenger: controller) - - channel.setMethodCallHandler({ - (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in - if ("switchView" == call.method) { - self.flutterResult = result - - let platformViewController = controller.storyboard?.instantiateViewController(withIdentifier: "PlatformView") as! PlatformViewController - platformViewController.counter = call.arguments as! Int - platformViewController.delegate = self - - let navigationController = UINavigationController(rootViewController: platformViewController) - navigationController.navigationBar.topItem?.title = "Platform View" - controller.present(navigationController, animated: true, completion: nil) - } else { - result(FlutterMethodNotImplemented) - } - }); - - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } - - func didUpdateCounter(counter: Int) { - flutterResult?(counter) - } + var flutterResult: FlutterResult? + + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + GeneratedPluginRegistrant.register(with: self) + let controller: FlutterViewController = window?.rootViewController as! FlutterViewController + let channel = FlutterMethodChannel.init(name: "dev.flutter.sample/platform_view_swift", binaryMessenger: controller.binaryMessenger) + + channel.setMethodCallHandler({ + (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in + if ("switchView" == call.method) { + self.flutterResult = result + + let platformViewController = PlatformViewController(nibName: "PlatformViewController", bundle: nil) + platformViewController.counter = call.arguments as! Int + platformViewController.delegate = self + + let navigationController = UINavigationController(rootViewController: platformViewController) + navigationController.navigationBar.topItem?.title = "Platform View" + controller.present(navigationController, animated: true, completion: nil) + } else { + result(FlutterMethodNotImplemented) + } + }); + + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } + + func didUpdateCounter(counter: Int) { + flutterResult?(counter) + } } diff --git a/platform_view_swift/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/platform_view_swift/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d22f10b2a..d36b1fab2 100644 --- a/platform_view_swift/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/platform_view_swift/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -107,6 +107,12 @@ "idiom" : "ipad", "filename" : "Icon-App-83.5x83.5@2x.png", "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" } ], "info" : { diff --git a/platform_view_swift/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/platform_view_swift/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9ada4725e9b0ddb1deab583e5b5102493aa332 GIT binary patch literal 10932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p%>X~AU1ay+EKWcFdif{% z#4!4aoVVJ;ULmkQf!ke2}3hqxLK>eq|-d7Ly7-J9zMpT`?dxo6HdfJA|t)?qPEVBDv z{y_b?4^|YA4%WW0VZd8C(ZgQzRI5(I^)=Ub`Y#MHc@nv0w-DaJAqsbEHDWG8Ia6ju zo-iyr*sq((gEwCC&^TYBWt4_@|81?=B-?#P6NMff(*^re zYqvDuO`K@`mjm_Jd;mW_tP`3$cS?R$jR1ZN09$YO%_iBqh5ftzSpMQQtxKFU=FYmP zeY^jph+g<4>YO;U^O>-NFLn~-RqlHvnZl2yd2A{Yc1G@Ga$d+Q&(f^tnPf+Z7serIU};17+2DU_f4Z z@GaPFut27d?!YiD+QP@)T=77cR9~MK@bd~pY%X(h%L={{OIb8IQmf-!xmZkm8A0Ga zQSWONI17_ru5wpHg3jI@i9D+_Y|pCqVuHJNdHUauTD=R$JcD2K_liQisqG$(sm=k9;L* z!L?*4B~ql7uioSX$zWJ?;q-SWXRFhz2Jt4%fOHA=Bwf|RzhwqdXGr78y$J)LR7&3T zE1WWz*>GPWKZ0%|@%6=fyx)5rzUpI;bCj>3RKzNG_1w$fIFCZ&UR0(7S?g}`&Pg$M zf`SLsz8wK82Vyj7;RyKmY{a8G{2BHG%w!^T|Njr!h9TO2LaP^_f22Q1=l$QiU84ao zHe_#{S6;qrC6w~7{y(hs-?-j?lbOfgH^E=XcSgnwW*eEz{_Z<_Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/platform_view_swift/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/platform_view_swift/ios/Runner/Base.lproj/LaunchScreen.storyboard b/platform_view_swift/ios/Runner/Base.lproj/LaunchScreen.storyboard index ebf48f603..f2e259c7c 100644 --- a/platform_view_swift/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ b/platform_view_swift/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,8 @@ - + - + @@ -10,13 +10,20 @@ - - + + - - + + + + + + + + + @@ -24,4 +31,7 @@ + + + diff --git a/platform_view_swift/ios/Runner/Base.lproj/Main.storyboard b/platform_view_swift/ios/Runner/Base.lproj/Main.storyboard index ba4a4bfd5..3e2b56dae 100644 --- a/platform_view_swift/ios/Runner/Base.lproj/Main.storyboard +++ b/platform_view_swift/ios/Runner/Base.lproj/Main.storyboard @@ -1,11 +1,11 @@ - - + + - + @@ -18,127 +18,13 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/platform_view_swift/ios/Runner/Info.plist b/platform_view_swift/ios/Runner/Info.plist index 3f06bd49a..83cff7fe1 100644 --- a/platform_view_swift/ios/Runner/Info.plist +++ b/platform_view_swift/ios/Runner/Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion - 1 + $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/platform_view_swift/ios/Runner/PlatformViewController.swift b/platform_view_swift/ios/Runner/PlatformViewController.swift index dd1e8039a..1b992269e 100644 --- a/platform_view_swift/ios/Runner/PlatformViewController.swift +++ b/platform_view_swift/ios/Runner/PlatformViewController.swift @@ -6,32 +6,32 @@ import UIKit import Foundation protocol PlatformViewControllerDelegate { - func didUpdateCounter(counter: Int) + func didUpdateCounter(counter: Int) } class PlatformViewController : UIViewController { - var delegate: PlatformViewControllerDelegate? = nil - var counter: Int = 0 - - @IBOutlet weak var incrementLabel: UILabel! - - override func viewDidLoad() { - super.viewDidLoad() - setIncrementLabelText() - } - - func handleIncrement(_ sender: Any) { - self.counter += 1 - self.setIncrementLabelText() - } - - func switchToFlutterView(_ sender: Any) { - self.delegate?.didUpdateCounter(counter: self.counter) - dismiss(animated:false, completion:nil) - } - - func setIncrementLabelText() { - let text = String(format: "Button tapped %d %@", self.counter, (self.counter == 1) ? "time" : "times") - self.incrementLabel.text = text; - } + var delegate: PlatformViewControllerDelegate? = nil + var counter: Int = 0 + + @IBOutlet weak var incrementLabel: UILabel! + + override func viewDidLoad() { + super.viewDidLoad() + setIncrementLabelText() + } + + @IBAction func handleIncrement(_ sender: Any) { + self.counter += 1 + self.setIncrementLabelText() + } + + @IBAction func switchToFlutterView(_ sender: Any) { + self.delegate?.didUpdateCounter(counter: self.counter) + dismiss(animated:false, completion:nil) + } + + func setIncrementLabelText() { + let text = String(format: "Button tapped %d %@", self.counter, (self.counter == 1) ? "time" : "times") + self.incrementLabel.text = text; + } } diff --git a/platform_view_swift/ios/Runner/PlatformViewController.xib b/platform_view_swift/ios/Runner/PlatformViewController.xib new file mode 100644 index 000000000..2846ab577 --- /dev/null +++ b/platform_view_swift/ios/Runner/PlatformViewController.xib @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform_view_swift/ios/Runner/Runner-Bridging-Header.h b/platform_view_swift/ios/Runner/Runner-Bridging-Header.h index 308a2a560..7335fdf90 100644 --- a/platform_view_swift/ios/Runner/Runner-Bridging-Header.h +++ b/platform_view_swift/ios/Runner/Runner-Bridging-Header.h @@ -1 +1 @@ -#import "GeneratedPluginRegistrant.h" +#import "GeneratedPluginRegistrant.h" \ No newline at end of file diff --git a/platform_view_swift/ios/Runner/ic_add.png b/platform_view_swift/ios/Runner/ic_add.png deleted file mode 100644 index 23bf119211e02b139ad2e0961bc71662ce1caf1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1Sx* _MyHomePageState(); + _HomePageState createState() => _HomePageState(); } -class _MyHomePageState extends State { +class _HomePageState extends State { static const MethodChannel _methodChannel = - MethodChannel('samples.flutter.io/platform_view_swift'); + MethodChannel('dev.flutter.sample/platform_view_swift'); int _counter = 0; - void _incrementCounter() { - setState(() { - _counter++; - }); - } - - Future _launchPlatformCount() async { + Future _launchPlatformCount() async { final int platformCounter = await _methodChannel.invokeMethod('switchView', _counter); - setState(() { - _counter = platformCounter; - }); + setState(() => _counter = platformCounter); } @override - Widget build(BuildContext context) => Scaffold( - appBar: AppBar( - title: Text(widget.title), - ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'Button tapped $_counter time${_counter == 1 ? '' : 's'}.', - style: const TextStyle(fontSize: 17.0), - ), - Padding( - padding: const EdgeInsets.all(18.0), - child: RaisedButton( - child: const Text('Continue in iOS view'), - onPressed: _launchPlatformCount), - ), - ], - ), - ), - ), - Container( - padding: const EdgeInsets.only(bottom: 15.0, left: 5.0), - child: Row( - children: [ - Image.asset('assets/flutter-mark-square-64.png', scale: 1.5), - const Text( - 'Flutter', - style: TextStyle(fontSize: 30.0), + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Home page'), + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Button tapped $_counter time${_counter == 1 ? '' : 's'}.', + style: Theme.of(context).textTheme.subtitle, + ), + SizedBox(height: 18), + RaisedButton( + child: const Text('Continue in iOS view'), + onPressed: _launchPlatformCount, ), ], ), ), - ], - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), - ); + ), + Container( + padding: const EdgeInsets.only(bottom: 15, left: 5), + child: Row( + children: [ + FlutterLogo(), + Text( + 'Flutter', + style: Theme.of(context).textTheme.headline, + ), + ], + ), + ), + ], + ), + floatingActionButton: FloatingActionButton( + onPressed: () => setState(() => _counter++), + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } } diff --git a/platform_view_swift/pubspec.lock b/platform_view_swift/pubspec.lock index bf43643ad..13809e8e0 100644 --- a/platform_view_swift/pubspec.lock +++ b/platform_view_swift/pubspec.lock @@ -1,6 +1,20 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.10" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.2" async: dependency: transitive description: @@ -29,6 +43,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.14.11" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" flutter: dependency: "direct main" description: flutter @@ -39,6 +74,13 @@ packages: description: flutter source: sdk version: "0.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" matcher: dependency: transitive description: @@ -61,12 +103,19 @@ packages: source: hosted version: "1.6.4" pedantic: - dependency: "direct dev" + dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted version: "1.8.0+1" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" quiver: dependency: transitive description: @@ -135,5 +184,12 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.5.0" sdks: dart: ">=2.5.0 <3.0.0" diff --git a/platform_view_swift/pubspec.yaml b/platform_view_swift/pubspec.yaml index 1e61ce7c6..dbc2c0560 100644 --- a/platform_view_swift/pubspec.yaml +++ b/platform_view_swift/pubspec.yaml @@ -1,4 +1,8 @@ name: platform_view_swift +description: A new Flutter project. + +version: 1.0.0+1 + environment: sdk: ">=2.5.0 <3.0.0" @@ -6,12 +10,13 @@ dependencies: flutter: sdk: flutter + cupertino_icons: ^0.1.2 + dev_dependencies: flutter_test: sdk: flutter - pedantic: ^1.7.0 flutter: + uses-material-design: true - assets: - - assets/flutter-mark-square-64.png + diff --git a/platform_view_swift/test/widget_test.dart b/platform_view_swift/test/widget_test.dart new file mode 100644 index 000000000..52ad35664 --- /dev/null +++ b/platform_view_swift/test/widget_test.dart @@ -0,0 +1,9 @@ +// Copyright 2018, the Flutter project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('This test always passes', (tester) async {}); +} diff --git a/platform_view_swift/test/widgets_test.dart b/platform_view_swift/test/widgets_test.dart deleted file mode 100644 index f1181b0c4..000000000 --- a/platform_view_swift/test/widgets_test.dart +++ /dev/null @@ -1,11 +0,0 @@ -// This is a basic Flutter widget test. -// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter -// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to -// find child widgets in the widget tree, read text, and verify that the values of widget properties -// are correct. - -import 'package:flutter_test/flutter_test.dart'; - -void main() { - testWidgets('This test always passes', (tester) async {}); -}