Software – MBPower Tools https://www.mbpowertools.net Software Developer Mon, 20 Dec 2021 18:23:07 +0000 en-US hourly 1 https://wordpress.org/?v=5.8.2 https://www.mbpowertools.net/wp-content/uploads/2021/12/cropped-ios-32x32.png Software – MBPower Tools https://www.mbpowertools.net 32 32 iOS Developer Interviews: Questions and Assignments https://www.mbpowertools.net/ios-developer-interviews-questions-and-assignments/ Sat, 06 Nov 2021 00:37:55 +0000 https://ultraland.themetags.com/?p=1382 In this article, we've collected questions and assignments that are common in iOS developer interviews.

The post iOS Developer Interviews: Questions and Assignments appeared first on MBPower Tools.

]]>
In this article, we’ve collected questions and assignments that are common in iOS developer interviews.

Optional

What is optional? What are some ways to deploy optional you know? What is an implicitly deployed optional?

The optional type in Swift is an enum that can have one of two values: None or Some(T), where T is any data type. You can use it to protect yourself from trying to access a nil value.

Multithreading .

You can read about it in the article about GCD and Dispatch Queues.

The difference between frames and bounds

This is one of the favorite questions in iOS interviews. A bounds rectangle is referenced from its coordinate system and a frame is referenced from the container it is in (superview).

Weak Links

When should we use weak links? What’s the difference between weak and unowned?

Weak links do not increase the link count like unowned ones. The difference between unowned and weak links is that they are not optional. Weak is used when we know that a link can be nil. Unowned is when we know that the link will never be nil.

The life cycle of an application

  • Not running: the application has not started or has been terminated by the system.
  • Not active: the application is running, but is not currently responding to events (But can execute code). This state is usually short-lived and in-between.
  • Active: The application is running and responding to events.
  • In Background: The application is running in the background. Most applications do not stay in this state for very long before being suspended. However, an application that has requested additional time in the background may remain in this state for some time. Some applications may run in the background most of the time.
  • Suspended: the application is in the background and not executing code. The system puts applications in this state automatically, without prior notification. In this state, the application is still in memory, but cannot execute code. If a memory shortage occurs, the system may clear suspended applications without prior notification to free up more space for active suggestions.

ViewController lifecycle

  • loadView: is used when a controller is created in code. loadView is called by the controller when its current view is nil.
  • viewDidLoad: is called once per controller lifetime. The method is called when all views are loaded.
  • viewDidLayoutSubviews: Called when any view is changed.
  • viewDidAppear: Called when a view appears on the screen.
  • viewDidDisappear: is called when a controller’s view is removed.

Access modifiers

  • public and open – open allows you to inherit and overload classes and class members inside and outside a module. public – only inside module.
  • internal – access within the module.
  • fileprivate – access within a file.
  • private – access within the entity where the object is defined.

Which works faster: an NSArray search or an NSSet search?

NSSet searches will be faster because sets, like dictionaries, use hashes.

The post iOS Developer Interviews: Questions and Assignments appeared first on MBPower Tools.

]]>
How to Start Developing iOS Apps: FAQ and Useful Links https://www.mbpowertools.net/how-to-start-developing-ios-apps-faq-and-useful-links/ Sat, 31 Jul 2021 00:38:51 +0000 https://ultraland.themetags.com/?p=1384 In this article, you will find answers to frequently asked questions about iOS development and useful links for those who want to start developing iOS apps.

The post How to Start Developing iOS Apps: FAQ and Useful Links appeared first on MBPower Tools.

]]>
In this article, you will find answers to frequently asked questions about iOS development and useful links for those who want to start developing iOS apps.

Requirements

You will need:

  • buy a mac\install macOS in a virtual machine.
  • Install Xcode.

After that, you will be able to run the HelloWorld template app on the iOS device simulator right away.

You need the latest version of macOS to adapt your apps to the latest versions of the iPhone, so choose devices that are still receiving updates.

If you’re just getting started with programming, read our article on programming for beginners.

Where to Start Learning

First and foremost, learn the Swift language and its core libraries UIKit and Foundation.

Where to ask questions

First, try searching for a solution on Google and Stack Overflow. If you can’t find an answer, you can use our selection of Russian-language chat rooms for programmers.

What is an iOS developer certificate? How to get it?

Apple Developer Certificate is a certificate without which Apple will not allow you to put apps on the App Store. Currently costs $99 per year. Learn more about getting a certificate in this article.

Can I develop iOS apps on a Hackintosh\Virtual Machine?

Yes, however, you need the right hardware to install a Hackintosh, and a virtual machine needs lots of RAM and enough SSD space. And even this does not guarantee that everything will work correctly and will not slow down too much.

Which IDE to choose?

XCode is the only official Apple IDE where the whole cycle of iOS application development is done.

Will I need an iPhone?

You can test apps in the simulator, however, the camera and some other features are not available.

What do I need to learn to pass my Junior interview?

  • Xcode & Interface Builder
  • Using CocoaPods
  • Understanding MVC
  • Push Notifications
  • UIKit
  • CoreData
  • Auto Layout
  • Debugging in Xcode
  • In-App Purchase

The post How to Start Developing iOS Apps: FAQ and Useful Links appeared first on MBPower Tools.

]]>
One task and 10 minutes to hire an iOS developer https://www.mbpowertools.net/one-task-and-10-minutes-to-hire-an-ios-developer/ Thu, 06 May 2021 00:33:24 +0000 https://ultraland.themetags.com/?p=1380 Imagine you come to a company for a job and find yourself on the Facebook app development team. Your first task concerns the feed.

The post One task and 10 minutes to hire an iOS developer appeared first on MBPower Tools.

]]>
Imagine you come to a company for a job and find yourself on the Facebook app development team. Your first task concerns the feed. A feed is an endless list of content: the user scrolls through it, reaches the end, new content is loaded here, and so on to infinity. Technically, the ribbon is a UITableView. And the problem is that the ribbon is slow. You need to speed it up.

What will you do as a developer: first, second, third to solve this problem?

Solution

First, let’s check if the developer understood the task itself. The word “slow” can mean a lot of things. It can mean different things to the user and the developer. If the developer doesn’t check for proper understanding, he can solve a completely different problem. So, the first question I expect the developer to ask is, “What does it mean to slow down?” “Slow” can mean both that the user expects the application to do some operation faster, or that the interface is “laggy,” that is, it responds to user actions intermittently. Technically, these are completely different things, and they need to be handled differently.

Next. Consider the braking.

Slowness can occur if:

  • something is slow in the application;
  • something is slow outside the application, but the application is waiting for a result;
  • there are blockages in the process;
  • all of the above.

If something in the application is slow, how do you know what it is? The surest solution is to use a profiler. We then discuss with the candidate the most frequent causes:

  • Incorrect UITableViewCell reuse;
  • heavy cell constructor or configurator;
  • heavy logic calculations in the main thread;
  • picture conversion, JSON parsing, and other nonsense.

It’s not uncommon for candidates to just guess and offer expensive solutions at random in terms of implementation and support. For example, most want to throw out Autolayout and rewrite it on the frame themselves. And now many people consider it to be a silver bullet, although there are a lot of cases where it won’t fit or won’t help.

If it slows down outside of the application, it could be the network. Here it is necessary to look at the requests: the number, frequency, server response size, response time, the presence and size of the cache. You can play with the channel width, HTTP version and look in this direction.

If we consider blocking, for example, the application may not cache data but make a blocking request to the server every time it goes to the beginning of the feed. The user has accessed the page and always sees the load indicator spinning. It gives the impression that the application is slow, because you always have to wait. There can also be an interesting issue here if the application is doing a large operation consisting of many asynchronous operations. And the user gets a wait with an indicator after each click on any button. Each of them can last a second, but if after each sneeze the application hangs for a second, after 6-7 such operations there is a dense feeling of lags.

Consider lags. This is a narrower case, which can be treated by unloading the main thread and taking heavy things into secondary threads. This is a good place to discuss synchronization tools for threads, what code should and should not be moved to where and why.

The post One task and 10 minutes to hire an iOS developer appeared first on MBPower Tools.

]]>
Why do I need reactive programming in Swift? https://www.mbpowertools.net/why-do-i-need-reactive-programming-in-swift/ Mon, 12 Apr 2021 00:30:57 +0000 https://ultraland.themetags.com/?p=1374 This is not a tutorial article on a particular library for reactive programming in Swift. Instead, the author wants to figure out why and in what scenarios it's worth using.

The post Why do I need reactive programming in Swift? appeared first on MBPower Tools.

]]>
This is not a tutorial article on a particular library for reactive programming in Swift. Instead, the author wants to figure out why and in what scenarios it’s worth using.

Improving code readability

Everyone knows about the nightmarish closures in Swift. Because of the nature of mobile development, asynchronous processes must be called in time. This used to be done with closures. Some of you may still use closures to do this, and that’s fine.

But one day you will run into nested closures. And the nightmare will begin. Reading and editing nested closures is a pain. Everyone understands that.

So how does reactive programming in Swift help reduce this pain?

You can chain observables using functions: map, flatMap and flatMapLatest. This way you can process queries simultaneously without bothering to read nested closures.

So it’s very useful to spend time making your code clearer and more readable.

This does not mean that you should stop using closures altogether. However, by using closures along with the reactive library of your choice, you can make your code more readable.

Help with event handling

In a general iOS development scenario, you need to react to events from different parts of the app. For example, someone changed their name in one controller, and you need to update it in another.

There are several scripts for such cases: delegates, notifications, and key-value pairs. Each of them works pretty well. But the reactive approach has a lot to offer.

First, reactive programming can simplify working with these scripts. All you need to do is create an observer or subject and subscribe to it. Then, every time the observer spawns an object, all the subscribers will know about it.

You can subscribe to the subject from the first controller anywhere in the program. And then use myObject for your own purposes. For example, you can skip the first two objects. You can use skip function to do that. And as I said before, you can combine the two objects using the merge and zip functions.

Make the code more modular

One of my any reactive programming features is to pass observable as variables. For example, you can pass a network request to another object and execute it when needed. This makes the code more readable and modular.

Let’s say you have controllers that need a specific type. You can use any network request with them whose observers spawn objects of the right type.

I always use this when I need overused controllers to display data to the user. Let’s take an application similar to Instagram, where you have a post object and a screen where those posts are displayed. You need to display posts from one user or the other on the same screen. Since this is most likely done with network requests, you can create the request as observable and pass it to the controller. The controller will do the rest.

Thus, the advantage here is modularity and versatility. This one controller can be reused any time you need to display a list of messages. And all you have to do is pass it to the controller. The controller will do the rest.

The post Why do I need reactive programming in Swift? appeared first on MBPower Tools.

]]>
What’s wrong with Xcode: bugs and performance issues https://www.mbpowertools.net/whats-wrong-with-xcode-bugs-and-performance-issues/ Wed, 27 Jan 2021 00:36:28 +0000 https://ultraland.themetags.com/?p=1378 In the 4 years since I first installed Xcode, the rating has barely changed. New versions of iOS have been released, Xcode has been updated, but the rating remains the same. In this article I will try to tell you what's wrong.

The post What’s wrong with Xcode: bugs and performance issues appeared first on MBPower Tools.

]]>
In the 4 years since I first installed Xcode, the rating has barely changed. New versions of iOS have been released, Xcode has been updated, but the rating remains the same. In this article I will try to tell you what’s wrong.

Performance

Apple’s IDE is getting slower. On the 2014 Macbook Air, Xcode (2017 version) sometimes slowed down in large projects. The 2018 version was already slowing down significantly on the 2017 Macbook Pro.

For example, Playground, which is positioned as a sandbox for quick experiments with code, took several minutes to load. For which you can find a web compiler for Swift on the Internet and do whatever you need on a machine with any operating system.

Limitations

  • Xcode only works on Mac OS, and updates to the IDE is strictly tied to versions of the operating system.
  • Xcode must be updated to support new devices.
  • The ability to use plugins has been disabled.
  • You cannot just put a new version of an application into the Appstore from another computer (the owner of the computer from which the application was originally installed must provide you with a certificate file for this purpose).
  • Xcode takes up a lot of space, which is especially noticeable on laptops. Xcode 12 requires at least 49 gigabytes of free space to install. To upgrade to a major version of the program, the same amount of space will be required.

Bugs

Here are the most annoying bugs, most of which appeared in Xcode 10 and have not yet been fixed:

  • Debugging over WiFi is extremely unstable.
  • Debugging over the wire works better, but there is often a situation where Xcode suddenly stops seeing the device.
  • Storyboard crashes. No matter how busy your Storyboard is, it can stop rendering. And then you only have to look for the element that broke everything.
  • Tying interface elements to code doesn’t work the first time 100% of the time.
  • The larger the project, the more likely it is that autocomplete code will start to fail.
  • The file tree lives its own life. After each program restart, the file tree often unfolds completely. There are no buttons to control it.
  • As of version 11, the file tree may not react spontaneously to file moves. That is, visually changes will occur, but nothing will change in the project folder.
  • Sometimes you just can not create a folder.

The post What’s wrong with Xcode: bugs and performance issues appeared first on MBPower Tools.

]]>