This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
About
I have been working with OpenGL ES related stuff in iOS. With Metal taking over iOS GPU rendering, it seems not too smart to start learning if you are very new, however, regardless OpenGL, Metal, they are both doing the similar stuff, which is GPU grapical rendering. If you knew one, you will easily know the other.
This is not a tutorial, it is more like a reference book for myself and u the reader.
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
The only reason that I wrote this short quick note is that, the answers on the internet is somewhat misleading.
If we are running sleep()usleep() or [NSThread sleepForTimeInterval:] in your main app, there should not be any difference. Because the first two functions are just functions that from c and the third one is from objective-c.
However,
You probably should NOT call them in your main app, because for delay operations you should more use (in Swift)
I was required to test some files that have to be hosted under a HTTPS server. Although at the end of the day, I used Azure to deploy a simple webservice, but the process to create a local HTTPS server is still interesting enough to let me write it down.
Notice before you start
There are two things you need to keep in mind before u keep doing this:
Although we will be using openssl to create a certificate, it is not a trusted certificate, I don't know if this will fulfil your need of HTTPS or not.
It will require sudo, make sure you are admin of your machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iOS/MacOS Tricks to Debug/Detecting Ambiguous Auto Layouts Issues
#iOSBySheldon #AutoLayout
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
This time I will bring you some tricks directly from Apple’s document regarding the ways to debug / detecting ambiguous warning (⚠️) for Auto Layouts in iOS and MacOS.
To kick things off, I do want mention that Ambiguous Warning for Auto Layout means that the configuration you add into your storyboard or xib file has no conflicts (otherwise it will show ❗️in storyboard). However, it has multiple ways to fulfill your auto layout, so that the system will randomly choose a fine solution to render your view, which maybe correct, maybe wrong, in other words, very inconsistent.
“There are a few methods you can call to help identify ambiguous layouts. All of these methods should be used only for debugging. Set a breakpoint somewhere where you can access the view hierarchy, and then call one of the following methods fr
How to sort a List<Object> in JAVA in a better way / the best way?
This is some notes written by Sheldon. I mainly focused on iOS programming but I also do JAVA and C# backend, you can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
High order functions with lambda is very easy in Swift (see article Here) but not that easy in languages like Objective-C or C++. In JAVA we can do it but since JAVA has too many versions, there are a lot different ways to do it, and there is always a better one you can choose.
Apple always encourage us as iOS developers to try to maintain our apps running with a 60 frames per second rate (60 FPS) to make sure the best user experience.
Most of the time, this comes for free because the hardwares are getting better and better.
But in some cases you may need to dig deeper if your app as a significant frame drops to fix it for the users, which leads to my post today - the basic of CPU and GPU in iOS.
Whenever I encounter this kind of question, I always want to find the answer directly from Apple’s official document. I was able to find this article here. I mean this article is written mainly for #Metal and iOS game developers but I found all the info that we need. As always, I will try to summarize the best part of the article.