How to render just part of the Sprite - objective-c

I want to make some simple tutorial in my game by showing pop-up animation. My problem occur when moving sprites get out of the tutorialView but keep being rendered. I need to show just those parts that are on the animation view.
I need to hide the white "path" which goes out of the tutorial view
This is what happens

It was actually very easy just took screenshot of the screen and cropped the middle so that I could put it in front of the tutorial and everything that went out of it was hidden underneath.

Related

React native scroll over interactive content

I watched this presentation and there's a section on how to build an IOS Maps like UI. When dragging from the bottom to top, it drags to the top, and after it reaches the top, it continues scrolling up. Also, when scrolling down, when it reached the top content of the ScrollView, it continues to drag down.
It is suggested that it can be done using ScrollView by adding an empty transparent cell as the first element on the ScrollView. I have tried implementing the same which can be found in this snack. In my case, instead of Maps, I am using another ScrollView.
But the problem is that the first element (transparent element) does not allow to interact with the First ScrollView elements. I have tried with pointerEvents inside the first transparent view and even in its parent ScrollView. But this does not help. Has anyone tried implementing this kind of use case with react-native? All I found was this library, but I think it's not maintained properly.
you need to set the z-index of the transparent view to send it under/behind the interactive content, here is a good resource:
https://philipwalton.com/articles/what-no-one-told-you-about-z-index/
Edit: Actually I could not accomplish it, it seems like everything inside a scrollview will always be behind or in front of other elements, it seems like you can't have part of the scrollview behind something else and another part in front of something else.

View containers move around and change sizes

I have the same component in multiple screens, which I navigate to through React navigation. I'm using Tabnavigator.
On the first screen, the View containers move around if the text is too long. I have a fixed flex-size on my view containers, but it doesn't take that into consideration. The strange is, it's only on the first screen. A gif to show you what I mean.
https://gfycat.com/KaleidoscopicEasygoingApisdorsatalaboriosa
I have linked a Snack to show you my code:
https://snack.expo.io/#cronnay/show-inconsistency
I've checked if it's because of the scrollview I have, and I was inconsistent with my design on the scrollviews. but they all have the same styling.
What the heck is going on?
EDIT: Uploaded new gif that shows that I navigate to same component through two different ways. And it makes the design screw up.
https://gfycat.com/HappyPracticalAustralianfreshwatercrocodile

swift adding zoom to container view

I have a page view controller embedded inside a container view in order to swipe between images. But now I am trying to add a touch that will make the image go full screen "lightbox" with zoom available and also swipe through the images while in full screen mode.
I can get it to work, and messing around with auto layout seems to be much work consider I have a lot of other stuff in that VC.
So does anyone know a good image slider from github written in swift? - without the need of cocopods.
thanks!
It's easy enough to write one yourself. In full-screen mode, use another UIPageViewController, because it already has the swipe left & right support built in.

Best way to create floating notification iOS

I've got a tabbed iPad application with just about each tab running a UIWebView. I'm getting all sorts of callbacks, like when a user tries to leave the corporate site (which only displays the company site to users). In this case, I pop up a "toast" style window that tells them to click a button to open the page in Safari. I also pop it up with a spinner and no text to indicate that a page is loading. The approximate look that I'm going for is used in lots of applications, but you can see it best when changing the volume on the iPhone or iPad. It's just a translucent rounded square that fades in and out.
Right now I've got it implemented on one of my tabs, and I did it by creating the objects (a spinner, a label, and a UIImage with the square) and then programmatically hiding and showing them using [UIView beginAnimations] and changing the label's text. It works perfectly but I've got these nagging things hovering over my interface in Xcode, and it takes a lot of setup to accomplish if I wanted it to be in another tab, which I do. I can't help but think that there's a better way to accomplish this. I thought about making and adding a subview, but that would leave a white background to the toast. What I'm thinking is creating some sort of object that I can allocate in a tab's view controller whenever it's needed.
What are your guys ideas, or have you done this in the past? I see it in a lot of prominent applications, like Reeder, so I'm sure it's been done more eloquently than I have done it.
Matt Gallagher has a great class called LoadingView here Showing message over iPhone Keyboard. I use it.
MBProgressHUD is a popular library for this, as well.

Swipe effect for uiimageviews

I have a little question. I've made a little image gallery with a swipe effect to skip through the uiimageviews. That works fine but I want to improve it. The next or previous picture is shown not until the swipe has finished. But I want it to behave like the photo library for example or the home screen, that the imageview 'follows' the touch and skips to the next or previous picture when a certain point is reached.
I hope I've made myself clear :-)
It's just that I want to simulate the swipe effect of the photo library.
The easiest by far is to use an UIScrollView and to enable paging like that:
myScrollView.pagingEnabled = YES;
See here for details.