Xcode bundled with iOS Simulators has got powerful tools and options. In few cases we need to go beyond those options - via terminal commands. In this article I listed couple of them & You can expect me to keep updating. To show gestures in simulator //Note: Restart simulator after executing command for immediate effect > defaults write com.apple.iphonesimulator ShowSingleTouches 1 To record video in the simulator //Note : Close simulator and run command > xcrun simctl io booted recordVideo ~/Desktop/record_file_name.mp4 Delete all unused simulators to free up mammoth Space > xcrun simctl delete unavailable Bonus : To show hidden files in the mac > defaults write com.apple.finder AppleShowAllFiles YES
Recently I published a countdown app . At one point of development - I have to show a timer on a UILabel which ticks on each seconds. As usual I started setting text to a label object - self .timerLabel.text = someString Easy piece of cake right !? But wait ... it won't take much user attention when timer ticks on every seconds. So I decided to make use of a simple animation while label gets text update. I found there are dozens of ways to animate a label. In this short article, I listed 3 best way you can animate text on a label. ( Spoiler Alert 👀- I decided to go with 3rd option) 1. Fade In - Fade out animation : CATransition class has got transition type `fade`. With timing function of CATransition - I was able to see the below result. let animation: CATransition = CATransition () animation.timingFunction = CAMediaTimingFunction (name: CAMediaTimingFunctionName .easeInEaseOut) animation.type = CATransitionType .fade animation.subtype = C...