PHLivePhoto Not Playing On UICollectionViewCell - ios

I have created a UICollectionView that will display live photo's, the live photos are stored in an array and are working fine, except when i try to display them on the UICollectionViewCell's. They just wont play.
Here's what i tried : Added a UIView and changed its class to PHLivePhotoView, i've also tried adding an UIImageView and changing it's class just in case. I tried playing the live photos programmatically with:
cell.livePhotoView.startPlaybackWithStyle(PHLivePhotoViewPlaybackStyle.Full)
Which didn't work. Tried checking if my preview image was on top of the PHLivePhotoView, it wasn't the case.
If i take this route everything works fine
let livePhotoView = PHLivePhotoView(frame: self.previewImage.frame)
self.view.addSubview(livePhotoView)
livePhotoView.startPlaybackWithStyle(PHLivePhotoViewPlaybackStyle.Full)
The above works as expected.
Has anyone experienced the same issue? I don't know what i have overlooked.

Related

Cropping Video from scrollview swift

I would like to implement functionality like below. i have used scrollView and based on zoom scale I tried to crop video but didn’t able to get same result. Can any one help me with this?
Link for the functioanlity which I want : https://drive.google.com/file/d/1dqGPTS494JwMktjGyPbzbIz5TG8RdyV1/view?usp=share_link
Reference url from where I tried to implement such functionality : https://www.kodeco.com/6236502-avfoundation-tutorial-adding-overlays-and-animations-to-videos
Result which I am getting :
https://drive.google.com/file/d/14D82rGPOiJBStNipXu7r-gaeosIYJz0U/view?usp=share_link
Video which I used for sample:
https://drive.google.com/file/d/14D82rGPOiJBStNipXu7r-gaeosIYJz0U/view?usp=share_link

iOS 9 CollectionView slowing down

I have been developing my app for iOS8, and haven't really had any issues regarding the scrolling speed. The moment I have upgraded to iOS9 the collectionView became very jumpy and staggering. I cant point out to any specific reason why. In my collection view, I have items with images that uses 3rd party library (SDWebImage) and I also use a custom layout library to achieve double column layout. Is there any obvious reason why this could be happening?
We were experiencing the same issues with collection views with iOS 9. The cells also contained images from SDWebImage including animated GIFs. It turned out not to be an issue with SDWebImage but with auto layout. If you have layout constraints with <= or >= inside your UICollectionViewCells (particularly on UITextViews, but still visible on UILabels, iOS 9 just chugs. Hope this helps someone.
In this case the problem was about handling fallback images on the imageView.
Briefly, each item in the CollectionView has an UIImageView. Each UIImageView has a fallback image in case the actual image doesnt resolve (the url is broken for example). So, the way these fallback images set was wrong in my app! I have set images every time a collectionview item is rendered in the viewport.
UIImageView * fallback = [UIImage imageNamed:#"imageName"];
was called everytime, which makes the scroll staggered. Interestingly it wasnt an issue on iOS8 but only in iOS9.
So when I started reading from a precreated dictionary of images instead of creating a new one every time, the scroll view started become smooth again.
Hope this helps to those having the same issue.

Size classes don't work for extensions on iOS8/XCode Beta 7

I'm following the exact steps from this video (from 7:49 onwards): http://youtu.be/IwSTXY0awng?t=7m49s
The UIButton I'm adding to my view when changing the size class to, for example, portrait iPhone, always shows up. Note: only acts this way in extension mode (building a custom keyboard for example). When using a storyboard/view controller/app (exactly like the video), it works as expected.
Is this a bug or expected behaviour? Any work arounds?

Adding "stretchable" images to and image selected from gallery

Im trying to make an app for planning out where you want to put "shelves" on a wall (sounds strange i know ;) )
i have got it so the image is picked from the UIImagePickerController then loaded in a new ViewController i also have a button at the bottom of the ViewController that i want to open a list of images to select from that once selected the user can move around then stretch the required size if they don't like, delete and once they are happy i want my second button to save the image and put it into an email ready for sending.
I have looked at a few ways but none of them seem to be "adequate" would be so grateful anyone could suggest any ways or even help me with some code, I'm very new to this and this is my first app.
Im not too sure on the code you'd need to see as none of what is written yet is relevant to this part of the app
This is a 2 part so the first is, what way do i go about it?, the second is what code?
Thanks
-(UIImage *)GetStreachableImage
{
UIImage *takephotoButtonImagenormal = [UIImage imageNamed:CHOOSE_TAKE_NORMAL_IMAGE];
UIImage *strechableButtonImageNormal1 = [takephotoButtonImagenormal stretchableImageWithLeftCapWidth:takephotoButtonImagenormal.size.width/2 topCapHeight:takephotoButtonImagenormal.size.height/2];
takephotoButtonImagenormal=nil;
return strechableButtonImageNormal1;
}
try this

iAD on iPAD is transparent but clickable (Monotouch)

I am using monotouch 4.0.7 and was able to get iAd to show up sucessfully on iPhone(normal) and iPhone(retina).
It seems that the iPad version is loaded successfully, clickable but it's completely empty. In the emulator it has the mousedown color too.
I've tried extending the frame of both the view controller and the view to 1024x768 but it's still not showing up.
Is this normal behavior in Portrait mode? I am using ADBannerContentSizeIdentifierPortrait.
By the way, AdLoaded is getting called and there are no warnings in application output.
I've been looking into the issue, the problem (I'm guessing) is that you're using "ADBannerContentSizeIdentifierPortrait" as the identifier in your "RequiredContentSizeIdentifiers" set. The problem is that the string is not the same as the identifier. You should instead use the class properties on ADBannerView which are ADBannerView.SizeIdentifierPortrait or ADBannerView.SizeIdentifierLandscape.
Let me know if this sorts out your issue,
ChrisNTR

Resources