Comments (8)
The same crash will occur when attempting to add a new feature and there is more than one feature layer in the map. When there is more than one FL, an AlertController is displayed allowing the user to select which FL to add the feature two. The default configuration in the app has only one FL, so this crash would not happen in that case.
from data-collection-ios.
There are two separate instances of the crash with the UIAlertViewController
: image source selection and Feature Layer selection.
The first, image source selection can be solved by changing the type of the UIAlertController
to .alert
from .actionSheet
. There is no barButtonItem in this case as it's triggered by tapping on the AddAttachment
row in a table. Also, the display of the action sheet is many layers removed, code-wise, from the table view so that passing in a source view and rect is not practical. So in this case, .alert
is the best bet. It will look like this:
The second, feature layer selection, can be handled either by making the UIAlertController
an .alert
OR by passing in a UIBarButtonItem
(which the actionSheet would be presented from on an iPad). The bar button item case would involve passing the sender
from the @IBAction
for the "add feature" button to the func userRequestsAddNewFeature(_ sender: Any)
method in MapViewController+LocationSelection
extension. The two options look like this:
Alert (both iPhone and iPad look the same):
BarButtonItem:
iPhone (this is unchanged from the original code):
iPad:
@esreli @mikewilburn Do either of you have a preference between using .alert
vs. UIBarButtonItem
in how the UI is presented?
from data-collection-ios.
Thanks for the consideration @mhdostal, but my recommendation here would mean very little. I defer to @esreli!
from data-collection-ios.
From a UI perspective, it would be my preference to keep the alert controller configured as an .actionSheet
, specifying the UIBarButtonItem
's view geometry as the source rect.
@mhdostal what do you think?
from data-collection-ios.
@esreli I'm cool with keeping the .actionSheet
for the layer selection and passing in the UiBarButtonItem
.
For the image source selection alert controller it's not so easy. There is no UIBarButtonItem
, only the "Add Attachments" table view cell. In the call stack below, ImagePickerPermissions.request(options:)
is where the UIAlertController
is presented. The action is initiated by a tap on the "Add Attachments" row, so that's would require passing a sourceView
and sourceRect
down more than one level deep.
#0 0x0000000104d304e0 in ImagePickerPermissions.request(options:) at /Users/mark1113/Development/OpenSourceApps/data-collection-ios/data-collection/data-collection/Utilities/ImagePickerPermissions.swift:181
#1 0x0000000104db58e0 in RichPopupViewController.attachmentsViewControllerDidRequestAddAttachment(_:) at /Users/mark1113/Development/OpenSourceApps/data-collection-ios/data-collection/data-collection/View Controllers/Rich Popup View Controllers/Rich Popup View Controller/RichPopupViewController+RichPopupAttachmentsViewControllerDelegate.swift:41
#2 0x0000000104db60b8 in protocol witness for RichPopupAttachmentsViewControllerDelegate.attachmentsViewControllerDidRequestAddAttachment(_:) in conformance RichPopupViewController ()
#3 0x0000000104de6af8 in RichPopupAttachmentsViewController.tableView(_:didSelectRowAt:) at /Users/mark1113/Development/OpenSourceApps/data-collection-ios/data-collection/data-collection/View Controllers/Rich Popup View Controllers/Rich Popup View Controller/RichPopupAttachmentsViewController/RichPopupAttachmentsViewController+UITableViewDelegate.swift:74
So for the image source selection alert controller, I'd say we switch to the .alert
option.
from data-collection-ios.
The action is initiated by a tap on the "Add Attachments" row, so that's would require passing a
sourceView
andsourceRect
down more than one level deep.
I see now what you're saying.
So for the image source selection alert controller, I'd say we switch to the
.alert
option.
I thought we might be able to avoid presenting the user with the notion of an alert, which (to me, at least) implies the user has reached a barrier, in favor of prompting them to take an action. It also appears we have way to present a modal .actionSheet
in any other style than .popover
. Without some sort of UI anchor, it looks like UIKit has forced our hand on this one.
Admittedly, amidst the other tasks i'm attending to simultaneously, I didn't investigate the issue as thoroughly as I would have needed to. I'm sorry & i'll do better next time.
from data-collection-ios.
In iOS 13 presenting the image source selection alert controller no longer crashes when using .actionSheet
without a UIBarButtonItem
or setting a sourceView/sourceRect
.
from data-collection-ios.
Verified in the v1.1.2 release.
from data-collection-ios.
Related Issues (20)
- Resulting attachment size differs from selected PREFERRED SIZE HOT 6
- Removing a feature attachment still persists it in current app session HOT 1
- An attachment cannot be viewed the first time it is clicked HOT 1
- HEIC image attachments uploaded via iPhone improperly get a .jpg extension
- Possible regression? Closing the app gives the appearance of logging out the user HOT 2
- App doesn't validate attachment file name HOT 4
- Test app compiled with U6 HOT 2
- Migrate app to Swift 5.1 HOT 1
- Dispatch changes to reachability UI on main queue.
- Update AlamoFire NetworkReachabilityManager HOT 1
- Migrate app to iOS 13 HOT 1
- Some features can't be edited on iOS HOT 1
- Update bundle identifier
- Depreciation warnings for 100.7 build
- App crashes when run on device HOT 2
- remove app secrets from versioned source code
- Resizing Floating Panel in compact-width modes doesn't initiate resize immediately.
- Typo in root README HOT 1
- App Crashes on Login HOT 1
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 data-collection-ios.