Comments (7)
You access the selected stack and remove all the images. Although ImagePicker is intended to keep reference for a while, in a composer for example, when you are building a post, and not be used as a general thing that you keep reference to. You can though.
let imagePickerController = ImagePickerController()
imagePickerController.stack.assets = []
Edit: You could also extend ImageStack and build a method to remove all the assets. That's up to you.
from imagepicker.
@RamonGilabert thanks! :)
from imagepicker.
Simply calling imagePickerController.stack.assets = []
doesn't refresh the existing UI elements (the old images are still showing as selected, the count still shows as x, etc...)
from imagepicker.
@olivierlesnicki just resetting assets won't work.
There is a method intended for that purpose:
public func resetAssets(assetsArray: [PHAsset])
so, just try:
picker.stack.resetAssets([PHAsset]())
This design is related to some lower-level issues with property observers and notifications. Using the function I've provided the notification will be posted and all UI components should update their state automatically.
from imagepicker.
@olivierlesnicki did @richardoti's suggestion work for you?
from imagepicker.
@zenangst haven't tried yet
from imagepicker.
This has been taken care of in #162.
from imagepicker.
Related Issues (20)
- [BUG]the backgroud music is stoped HOT 1
- Unselecting image returns nil array HOT 2
- AVCaptureDevice device Type HOT 3
- on iOS 14 capture put images to camera roll but shutter counter and picture preview are not updated HOT 1
- Cannot unselecting image when setting "imageLimit" to 1. HOT 4
- If shot button pressed too frequently image might loss on old iPhones HOT 1
- AVCaptureStillImageOutput' was deprecated in iOS 10.0: Use AVCapturePhotoOutput instead HOT 1
- 'flashMode' and 'isflashMode' was deprecated in iOS 10.0: Use AVCapturePhotoSettings.flashMode instead. HOT 1
- Gallery In Full Screen Mode HOT 2
- SPM support HOT 8
- When I select photos, I have no way of knowing which photos I chose.
- Camera does not rotate HOT 1
- The ultra wide angle does not work with the camera HOT 1
- Doesn't compile in XCode 13 HOT 9
- Is there a camera only mode? HOT 1
- using callback instead of delegate
- Is this project officialy "stopped" ?
- doneButtonDidPress not working
- Ultra Wide Angle Functionality Support HOT 1
- Multiple image Select but Not getting While using delegate also
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 imagepicker.