Application versioning is crucial when we want to define changelog history or compare two version of the same app and say which one is newer or contains specific features. Many company has it’s own versioning standard but I most often I encounter with three components separated by dot
The first one and most important points the slowest and the biggest changes. It’s never resets and can be only increased. Changes are significant and can entirely refresh user interface or add new module in flow.
This should be changed after add new features or implement bigger improvements to existing one. …
Asynchronous work is common in iOS architecture. I’m sure You’ve already used GDC before. Sometimes you want to cancel async operation because you no longer need the result or you just want to stop current work. It can be done by using
The biggest problem is that You have to use work item inside it’s work method. It’s provide to store object by using optional property that sometime isn’t proper solution.
There is no other build-in method to cancel task from the outside when action is actually running without using
The very first day of my iOS adventure I’ve learned how to add subviews to view. It is the most basic UI operation. After a while I realized that subviews can change their parent size, It’s pretty obvious, bigger content = bigger container. I encountered situations when I needed to know when exactly it happens and to achieve it I had to add tons of code in many views.
I found the solution how to be notify about frame changes only when it’s really happens.
Now instead of using UIView, you can use or wrap existing view in ResizableView…
Many times I needed to save some data in protocol or class extensions. By default Swift doesn’t allow us to do this, but there is simple workaround using runtime manipulation. If you try add computed property in standard way, You will probably see compile error
Extensions must not contain stored properties
By using objc_getAssociatedObject and objc_setAssociatedObject we can attach additional object to any other object.
There is no limit to the amount of properties stored this way. From the perspective of use, associated object property doesn’t differ from standard property, but under the hood magic happens. But hey! What…
Many magnificent apps have a problem with very few ratings in AppStore. The main reason is that users have no incentive to do it or even don’t know how to do this. An application can ask users for their opinion about the App, but it should be done at the right moment. No one will rate five stars right after the first launch. To gain best feedback user should use the app a couple of days, and be able to postpone our question.
What app should do? We need to make some assumptions:
- save first launch date
- count each…
As all we know, Multi-Threading is an execution of multiple operations on one processor at the same time. With multicore CPU we are able to run code fastest in a more efficient way and take advantage of the power of the device. In iOS Multi-Threading is possible in many ways eg. GDC, NSOperationQueue, NSThread.
If you’re long enough in Swift community, you’ve probably had contact with GDC. Even if you never heard this word I’m sure you’ve been using DispatchQueue all the time. Two most popular use-case and the easiest:
- use DispatchQueue.global.async() to do some complicated operation in background
As we all know iOS app can be in different states depends on user activity. Is easy to manage it and observe changes in AppDelegate but UIViewController (or any other object) doesn’t have this callbacks by default.
We can change it!
At the beginning we need to know what event can we observe. I’ve already done the research and found all available options.
Now we should define base protocol that shows us what we can do with our ‘manager’. It’s good practice to always define protocols for such things. …
Very often — just before app release — client realizes that he needs to trace user activity and collect events, or when the app is already released he wants to change analytics tool. There are many tools for collecting analytics in the mobile app. Some are more extensive, some are just for creating reports, but most of them work the same way — You create event object and call one function to save them and the library does all dirty work for you. It looks simple, but think a moment, what if You have 40 screens and You have to…
Mocking is a technique when we replace real data in an application with some generated or static fake data to handle a specific test case.
In this article, I’ll try to show You how to create and use simple service to Mock data (not the services).
Why do we want to mock something? Mocking is pretty useful when we write tests or when we don’t have complete Backend but we know the structure or even when we develop UI and we need some filling. …
Show info is deprecated and will be ignored after September 25, 2018
As we all know,
showinfo parameter has been depreciated in 2018 and since then there is no way to remove header from embedded YouTube video. We can remove controls or related videos, but we will always see disturbing buttons at the top.