iOS Unit-Test Tips & Tricks
Jan 24, 2021, 3:00 AM
After few years working with iOS Unit-Test I conducted some tips & tricks to help to write a reliable & effectively unit-test. Time-out should be 0.1 rather than 1 or 3 waitForExpectations(timeout: 0.1) { _ in } wait(for:...
iOS UITextView for Flutter
Aug 14, 2020, 3:00 AM
Currently there is no TextView for Flutter, so we have to have an injection native TextView from iOS & Android to Flutter project. PlaformView & PlaformChannel...
Transfer decelerating of UIScrollView to another UIScrollView
May 6, 2020, 3:00 AM
When the dragging of Outer UIScrollView is ended, and it continues decelerating, we want to transfer that decelerating to the Nested UIScrollView to make users feel they’re only one UIScrollView Decelerator I was inspired by this nice...
Generate Test Coverage by Feature (Folder) with Slather
Mar 27, 2020, 3:00 AM
Continue with Slather to generate test coverage reports for Xcode projects & hook it into CI, and from time to time you wonder how to generate the test for only your features which are contributed by you or your team. Get all test...
0.1 over 3 seconds for Unit Test asynchronous time-out
Mar 18, 2020, 3:00 AM
0.1 over 3 seconds! Unit! Not Integration Just remind that we’re writing a UNIT test, which means test within a method, a small piece of code, we’re not trying to make an integration test to test multiple levels of code so it should not...
Open deeplink in iOS UI Test
Sep 21, 2019, 3:00 AM
UI testing is the best way to verify how your iOS application working in Production environments and how it looks like when integrating with other services! There is an important feature that every e-commerce mobile applications need to...
How to get an iOS application's Scheme URL?
Sep 21, 2019, 3:00 AM
From time to time we have to implement a feature that we have to open external apps from our apps! So here are some steps to extract an iOS application’s scheme URL Step 1: Download the partner’s iOS app to your iPhone Step 2: On your...
Reduce iOS app's loading time by using 'staticlib' with CocoaPods
Aug 6, 2019, 3:00 AM
In many of us, we’re iOS developers who are desire to reduce your app’s loading time. Many and many articles were written to gave you some tricks & tips to improve it, you can check it here Slow App Startup Times, Someday I go through...
Way to approach Unit Tests in iOS development
Apr 20, 2019, 3:00 AM
🌡 Unit Tests I and you and many developers are too familiar with this level of testing, someone might know, someone might doing it everyday. But how to do it productivity? How to do it in a saving time? then it gonna need you practice a...
Mocking for tests in iOS development
Apr 3, 2019, 3:00 AM
🧪 Mocking We might have some best practices from Way to approach Unit Tests in iOS development. Now we go to the details of mocking 🥳 What is Mocking? Mocking is creating objects that simulate the behavior of real objects! The mocking...
How to render images and videos for App Review in iTunes Connect
Mar 3, 2019, 3:00 AM
🏞 Render images screenshot App Review with simulator 📱 ➡️ You’re able to use ⌘ + S with Simulators. ➡️ Or you can use io in simctl, following these commands: xcrun simctl io booted screenshot 🎞 Render videos with simulator 📱 Steps: 1️⃣ Launch...
App crashes 'NSInternalInconsistencyException' while calling 'reloadRows(at:with:)'
Feb 28, 2019, 3:00 AM
⚡️ Problems Sometime I got a lot of crashes related to reloadRows(at:with:) due to the unsync between current data in UITableView and the data from dataSource Fatal Exception: NSInternalInconsistencyException Invalid update: invalid number...
0x8badf00d - "ate bad food" 🤮
Oct 15, 2018, 3:00 AM
Someday you go to the office and immediately you get a message from you boss that telling you the app got some weird crashes with the logs look like below: Exception Type: EXC_CRASH (SIGKILL) Exception Codes: 0x0000000000000000,...
How to measure loading time for iOS app?
Oct 11, 2018, 3:00 AM
There is a simple trick to show your app loading time included dylib loading time, rebase/binding time, ObjC setup time, initializer time, …
Here how to setup:
1: Edit scheme
2: Add new Environment Variables with...
Translating 'hidden' symbol names back to their original names by using atos + dSYM?
May 3, 2018, 3:00 AM
Problems As we know that sometimes we got a crash with its stack trace which contains only the address on memories of some objects or some methods, without any line number of your implementation, then how we can indicate which part in your...
How to mock a completion block in OCMock?
Mar 5, 2018, 3:00 AM
Problems My dependency has a completion block, and inside the implementation of that block I do some logics, so how my test needs to make sure it calls all the logics? - (void)doSomething { [self.myService...
How to catch the crash's stack trace?
Feb 21, 2018, 3:00 AM
Problems How to log down the crash trace for investigation? 2018-03-20 04:09:03.858000000 410 30735 [2]: Collection <__NSArrayM: 0x13d5493c0> was mutated while being enumerated. 2018-03-20 04:09:03.864000000 410 30735 [2]: Stack...
How to test C/C++ functions by using Objective-C?
Dec 17, 2017, 3:00 AM
Problems I guess that you already saw some C/C++ functions like these get called in Objective-C :] int status; change_network_status(status) or even GCD: dispatch_async(queue, ^{ //... }); The problem here is how you can make sure that the...
How to Find Bigger Number Without Using If/else or Switch/case Statements?
Aug 12, 2017, 3:00 AM
Suppose we have 2 positive integer numbers: a and b Now print out which number is the bigger? Note that without using if/else, switch/case or comparing operations! 😎 For example: a = 5, b = 7 The bigger is: b It’s: ((a + b) + abs(a - b)) /...
How to Record, Detect Faces, Overlay Video at Real-time Using Swift?
Jun 14, 2017, 3:00 AM
This post will show the way how to record, detect faces, overlay video at real-time using AVFoundation via Swift3: 1. Create your recorder view: import AVFoundation import ImageIO final class RecorderView: UIView { //Your next steps will...
Swapping Without Temporary Variable in Swift
May 29, 2017, 3:00 AM
Using a temporary is normal way, try something new :] Using + and -: var a = 5 var b = 6 a = a + b b = a - b a = a - b Using tuple: var a = 5 var b = 6 (a, b) =...