Skip to content

Commit b409f0f

Browse files
[camera] Regenerate iOS example with Swift (#11283)
Updates the iOS example app for `camera_avfoundation` to a Swift app. Rather than edit in place, this replaces the example app with a fresh copy to minimize drift from current template: - The existing ios/ directory was deleted - A new copy was created with `flutter create --platforms=ios --org=dev.flutter .` - The RunnerTest code was restored (other than unused files; see #11240), and the placeholder file removed. - The important Info.plist entries were restored. - The special logic to bypass app launch plugin registration during unit tests was moved from main.m, which no longer exists, to the delegate callback where registration would be done. I also did some minor test file cleanup I noticed while validating everything in Xcode again: - Remove some stale references to and usage of the `FLT` prefix (missed during Swift migrations). - Added some missing headers that local compilation complained about. This is part of an overall modernization of the example apps; most packages have already been converted to Swift examples. ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 3e15247 commit b409f0f

55 files changed

Lines changed: 567 additions & 471 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.build/
9+
.buildlog/
10+
.history
11+
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# The .vscode folder contains launch configuration and tasks you configure in
22+
# VS Code which you may wish to be included in version control, so this line
23+
# is commented out by default.
24+
#.vscode/
25+
26+
# Flutter/Dart/Pub related
27+
**/doc/api/
28+
**/ios/Flutter/.last_build_id
29+
.dart_tool/
30+
.flutter-plugins-dependencies
31+
.pub-cache/
32+
.pub/
33+
/build/
34+
/coverage/
35+
36+
# Symbolication related
37+
app.*.symbols
38+
39+
# Obfuscation related
40+
app.*.map.json
41+
42+
# Android Studio will place build artifacts here
43+
/android/app/debug
44+
/android/app/profile
45+
/android/app/release
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "ff37bef603469fb030f2b72995ab929ccfc227f0"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
17+
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
18+
- platform: ios
19+
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
20+
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
**/dgph
2+
*.mode1v3
3+
*.mode2v3
4+
*.moved-aside
5+
*.pbxuser
6+
*.perspectivev3
7+
**/*sync/
8+
.sconsign.dblite
9+
.tags*
10+
**/.vagrant/
11+
**/DerivedData/
12+
Icon?
13+
**/Pods/
14+
**/.symlinks/
15+
profile
16+
xcuserdata
17+
**/.generated/
18+
Flutter/App.framework
19+
Flutter/Flutter.framework
20+
Flutter/Flutter.podspec
21+
Flutter/Generated.xcconfig
22+
Flutter/ephemeral/
23+
Flutter/app.flx
24+
Flutter/app.zip
25+
Flutter/flutter_assets/
26+
Flutter/flutter_export_environment.sh
27+
ServiceDefinitions.json
28+
Runner/GeneratedPluginRegistrant.*
29+
30+
# Exceptions to above rules.
31+
!default.mode1v3
32+
!default.mode2v3
33+
!default.pbxuser
34+
!default.perspectivev3

packages/camera/camera_avfoundation/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,5 @@
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
23-
<key>UIRequiredDeviceCapabilities</key>
24-
<array>
25-
<string>arm64</string>
26-
</array>
2723
</dict>
2824
</plist>

packages/camera/camera_avfoundation/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 333 additions & 310 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreviewsEnabled</key>
6+
<false/>
7+
</dict>
8+
</plist>

packages/camera/camera_avfoundation/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
buildConfiguration = "Debug"
4545
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4646
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4748
shouldUseLaunchSchemeArgsEnv = "YES">
4849
<MacroExpansion>
4950
<BuildableReference
@@ -56,10 +57,11 @@
5657
</MacroExpansion>
5758
<Testables>
5859
<TestableReference
59-
skipped = "NO">
60+
skipped = "NO"
61+
parallelizable = "YES">
6062
<BuildableReference
6163
BuildableIdentifier = "primary"
62-
BlueprintIdentifier = "03BB76672665316900CE5A93"
64+
BlueprintIdentifier = "331C8080294A63A400263BE5"
6365
BuildableName = "RunnerTests.xctest"
6466
BlueprintName = "RunnerTests"
6567
ReferencedContainer = "container:Runner.xcodeproj">
@@ -71,6 +73,7 @@
7173
buildConfiguration = "Debug"
7274
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7375
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
76+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
7477
launchStyle = "0"
7578
useCustomWorkingDirectory = "NO"
7679
ignoresPersistentStateOnLaunch = "NO"
@@ -88,16 +91,9 @@
8891
ReferencedContainer = "container:Runner.xcodeproj">
8992
</BuildableReference>
9093
</BuildableProductRunnable>
91-
<AdditionalOptions>
92-
<AdditionalOption
93-
key = "NSZombieEnabled"
94-
value = "YES"
95-
isEnabled = "YES">
96-
</AdditionalOption>
97-
</AdditionalOptions>
9894
</LaunchAction>
9995
<ProfileAction
100-
buildConfiguration = "Release"
96+
buildConfiguration = "Profile"
10197
shouldUseLaunchSchemeArgsEnv = "YES"
10298
savedToolIdentifier = ""
10399
useCustomWorkingDirectory = "NO"

packages/camera/camera_avfoundation/example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreviewsEnabled</key>
6+
<false/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)