Code Monkey home page Code Monkey logo

tatsi's People

Contributors

aadjemonkeyrock avatar avdlee avatar igorkulman avatar kaidombrowski avatar karlis avatar marcbouchenoire avatar markseltenrijch avatar pallzoltan avatar renssies avatar rivera-ernesto avatar smaljaar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tatsi's Issues

Small 50x50 thumbnails on iOS 13 when modalPresentationStyle is fullscreen

iOS 13 change the default modalPresentationStyle. If you set it to .fullscreen on TatsiPickerViewController before presenting it, the thumbnails are too small, just 50x50px

Simulator Screen Shot - iPhone X - 2019-09-30 at 14 03 01

If you set it to .pageSheet it looks correct with 100x100 thumbnails

Simulator Screen Shot - iPhone X - 2019-09-30 at 14 01 43

It looks like it is caused by AssetsGridViewController.traitCollectionDidChange not being called with modalPresentationStyle = .fullscreen`.

I did some research and found this

If you rely on size changes to build adaptive layouts, you should review your code for iOS 13. UIKit now predicts the initial traits for a view so you cannot assume traitCollectionDidChange will be called when a view is first added to the view hierarchy.

Adding updateCollectionViewLayout() to AssetsGridViewController.viewDidLoad seems to help, but I am not sure it is the best solution.

iOS 13 Memory Issue

We can see a crash in our crash reports regarding Memory, happening in the AssetsGridViewController and 100% on iOS 13.

We still need to look into it but I have the feeling that this is caused by loading the previews for the first time, filling up the memory.

Any ideas?

Camera option not working properly

I have set the showCameraOption as true in the config. The camera option is there, but when I click a photo through, it does not get saved anywhere. Neither it is returned in the didPickAssets function. Is it a bug? Or am I missing something in the code?

PHAsset get info for show image

Hi,

I've try to read property of PHAsset, but I haven't understand how I can get information about image selected.

How can get NSURL or UIImage?

Update README.md

Add an icon to the README.md and improve existing screenshots.

Tatsi crashes on `PHImageManager.requestImage`

I'm getting some crashes while using the library.

From the logs i see that users have it when displaying Tatsi (modally).
Seems to be present only on iOS 13.3 by now.
Variety of devices.
Multiple com.apple.root.user-interactive-qos threads spawned, waiting to requestImage on libsystem_kernel.dylib __ulock_wait + 8.
Can't reproduce locally.

Crashed: com.apple.root.user-interactive-qos
0  libobjc.A.dylib                0x19f438fb0 objc_msgSend + 16
1  CoreFoundation                 0x19f5f9970 -[__NSDictionaryM objectForKeyedSubscript:] + 184
2  PhotoLibraryServices           0x1aa1a4304 PLDataStoreForClassIDAndLibraryID + 476
3  PhotoLibraryServices           0x1aa67d464 +[PLManagedAsset(RM) enumerateImageRequestHintData:assetWidth:assetHeight:libraryID:startingOffset:block:] + 332
4  Photos                         0x1aafb1e54 _presentResourcesFromHintsUntilStop + 376
5  Photos                         0x1aafb35d0 PHChooserListContinueEnumerating + 68
6  Photos                         0x1aaffbc00 -[PHImageResourceChooser presentNextQualifyingResource] + 1476
7  Photos                         0x1aaea6028 -[PHImageRequest startRequest] + 2120
8  Photos                         0x1aaebd41c -[PHMediaRequestContext _registerAndStartRequests:] + 1176
9  Photos                         0x1aaebbf68 -[PHMediaRequestContext start] + 260
10 Photos                         0x1ab04cb3c -[PHImageManager runRequestWithContext:] + 324
11 Photos                         0x1ab048498 -[PHImageManager requestNewCGImageForAsset:targetSize:contentMode:options:resultHandler:] + 1132
12 Photos                         0x1ab04c468 -[PHImageManager requestImageForAsset:targetSize:contentMode:options:resultHandler:] + 200
13 Tatsi                          0x1037e34ac (Missing)
14 Tatsi                          0x1037e3ef4 (Missing)
15 libswiftObjectiveC.dylib       0x1d536ed9c autoreleasepool<A>(invoking:) + 64
16 Tatsi                          0x1037e314c (Missing)
17 Tatsi                          0x1037ef968 (Missing)
18 libdispatch.dylib              0x19f3c8b7c _dispatch_call_block_and_release + 32
19 libdispatch.dylib              0x19f3c9fd8 _dispatch_client_callout + 20
20 libdispatch.dylib              0x19f3d8cfc _dispatch_root_queue_drain + 644
21 libdispatch.dylib              0x19f3d9384 _dispatch_worker_thread2 + 120
22 libsystem_pthread.dylib        0x19f42f690 _pthread_wqthread + 216
23 libsystem_pthread.dylib        0x19f4359e8 start_wqthread + 8

Images and Videos don't show up.

On the simulator and device,
config.supportedMediaTypes = [.image] or config.supportedMediaTypes = [.video]
The above configuartion doesn't show photos or videos.
But config.supportedMediaTypes = [.image, .video] shows up both image and video as expected.

Edit:
Never mind.
Fixed it by changing to guard self.supportedMediaTypes.contains(.image) || self.supportedMediaTypes.contains(.video) && self.supportedMediaSubTypes == nil else { return nil } in TatsiConfig.swift - line 112. Changed && to ||

Integration with SwiftUI

Hi, I am doing the library integration via SPM to my project in SwiftUI, but I have a problem because the Done at the top of the Tatsi view is not called and I can't get the selected images.

The code for the integration via UIViewControllerRepresentable is as follows:

import SwiftUI
import UIKit
// 1. Add Import Tatsi and Import Photos to your Swift
import Tatsi
import Photos

struct TatsiViewController: UIViewControllerRepresentable {
    
    @Binding var show: Bool
    
    func makeCoordinator() -> Coordinator {
        Coordinator(self)
    }
    
    func makeUIViewController(context: UIViewControllerRepresentableContext<TatsiViewController>) -> TatsiPickerViewController {
        
        // 2. (Optional) Create an instance of TatsiConfig and configure the settings.
        var config = TatsiConfig.default
        config.showCameraOption = false
        config.supportedMediaTypes = [.image]
        config.firstView = .userLibrary
        
        // 3. Create an instance of TatsiPickerViewController. TatsiPickerViewController(config:) allows you to use the config from the previous step
        let pickerViewController = TatsiPickerViewController(config: config)
        // 5. Set the pickerDelegate on TatsiPickerViewController
        pickerViewController.delegate = context.coordinator
        // 6. Present the TatsiPickerViewController
        return pickerViewController
    }
    
    func updateUIViewController(_ uiViewController: TatsiPickerViewController, context: UIViewControllerRepresentableContext<TatsiViewController>) {
        uiViewController.delegate = context.coordinator
    }
    
    // 4. Implement TatsiPickerViewControllerDelegate
    final class Coordinator: NSObject, TatsiPickerViewControllerDelegate, UINavigationControllerDelegate {
        
        var parent: TatsiViewController
        
        init(_ parent: TatsiViewController) {
            self.parent = parent
        }
        
        func pickerViewController(_ pickerViewController: TatsiPickerViewController, didPickAssets assets: [PHAsset]) {
            print("Picked assets: \(assets)")
            parent.show = false
        }
        
        func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
            picker.dismiss(animated: true, completion: nil)
            parent.show = false
        }
        
        func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
            picker.dismiss(animated: true, completion: nil)
            parent.show = false
        }
    }
}

What do I need to integrate in order to obtain the selected images? Thank you!

Picking finished imemdtiatelly when maximum set to 1

Interesting library, I am thinking about replacing my current implementation but I found one issue (for me). When I set config.maxNumberOfSelections = 1 and tap on some photo, the delegate fires immediately

if let maxSelection = self.config?.maxNumberOfSelections, maxSelection == 1 {
self.finishPicking(with: self.selectedAssets)
}

This is a problem in my use case (I sometimes allow the user to pick just 1 and sometimes an unlimited number of items) so I need the behavior to be consistent.

What about adding something like TatsiConfig.finishImmediatelyWithMaximumOfOne = true that I could be able to set to false?

Carthage support info

You should add info about Carthage as a method of installation to the README, because you have a shared target so Carthage works, I tried it.

video max duration

how can i set videoMaximumDuration using this library
as i need 1 minute video only from camera/photogallery

Link color configuration not completely implemented

With the color configuration I can set a link color. This works fine, except in the checkmark when you select images in the album. This checkmark always uses the default link color.

This can be seen in AssetCollectionViewCell.swift on line 65

  • iconView.tintColor = TatsiConfig.default.colors.link

This is either forgotten or skipped because in the AssetCollectionViewCell you don't have access to the configuration.

Reusable cell

Hi, I would love using the following library but the is a major issue when selecting a few images and then scrolling up and down the collection.

Some cells are being automatically selected.
I have a filling that setting the cell to selected = false in the prepare for reuse function will solve the issue.

selected images

This image getting URL:

Assets [<PHAsset: 0x11dc12570> 2E25AD2C-51D8-4431-882F-AC8CA2E8F65B/L0/001 mediaType=1/0, sourceType=1, (3024x4032), creationDate=2019-04-08 10:04:57 +0000, location=0, hidden=0, favorite=0 ]

This image not getting URL: (app will crash for data nil)

Assets [<PHAsset: 0x11dc065f0> 420A3B33-A758-4EC3-9DC1-D72AC88B98C9/L0/001 mediaType=1/4, sourceType=1, (1242x2208), creationDate=2019-04-11 07:14:37 +0000, location=0, hidden=0, favorite=0 ]

what are the difference b/w the above two Assets, How to resolve this issue ?

1.1.7 Cocoapods release

Hi there,
1.1.6 seems to be the latest on Cocoapods, could we get an update made available for 1.1.7 please?

Use with Swift 4

I tried adding the source files manually, and I'm stuck as to what I should do for the project to build at

guard let image = (info[UIImagePickerController.InfoKey.editedImage] as? UIImage) ?? (info[UIImagePickerController.InfoKey.originalImage] as? UIImage) else { return }

in the didFinishPickingMediaWithInfo delegate method in AssetsGridViewController

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.