While working in building iOS I needed external helpers, control, etc..
Here are some of the most rich places to find helpers and controls for iOS development :
Thoughts on software development
While working in building iOS I needed external helpers, control, etc..
Here are some of the most rich places to find helpers and controls for iOS development :
Enumerations in Swift are very powerful tool, here are some of their advantages over normal Objective C enums :
The best way to show all these features is some examples :
In my current project we have a big constants file, It have two main things :
1- A lot of #define which defines constants used in all of the application.
2- A lot of #define also but have some functions inside it, something like
#define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
Since we are trying to convert to Swift we have a problem :
Some of these defines are convertible to Swift like normal string constant defines.
but other more complicated ones are not converted (like IS_OS_8_OR_LATER I mentioned earlier)
also BOOL defines are not converted, something like :
#define TestingBool TRUE
So I made a decision to convert this defines to Swift, then I got the second problem,
Continue reading “Converting #define from Objective C to Swift”
One of the best things about Swift now that it is getting more and more support from the community, now you find very interesting helper libraries written in Swift.
In my current project I needed data structure which supports both fast search and fast insertion and have no duplicated values so I found the this great Swift library swift-algorithm-club which has lot of data structures and algorithms.
Happily I found the one data structure I was looking for : “Ordered Set” which satisfied all my need.
So I used the library in my project and it worked very well initially, but …
As an relatively old iOS developer, I now see always the debate about which is better, Objective C or Swift.
Here is my thoughts about the subject :
Continue reading “Objective C and Swift, the past and the future”
It have become now the De Facto standard for getting any code published as open source, also for developers it is the first place to look for helper libraries.
Saying that, there are thousands of repos containing great code on github, so how you can find the best ones suitable for your needs ?
Here is the procedure I follow :
for example here I am looking for good animation library to use in ios project
As I think specialization is very important, both for your career and for the software industry as a whole, extending your perspective is also very important.
Continue reading “Why you should learn new programming language”
I love to hear podcasts.
Here is my favorite list for software engineering
One of the best podcasts I have listened to, Continue reading “Podcasts for software engineers”
Today I faced a very strange bug in our code,
The instruments shows a huge number of leaks originated from JSON parsing (using swiftyJSON).
At first I thought it was a normal retain cycle, since the problem only shows when setting the data source array with the result of parsing the json coming from the server, but unfortunately this wasn’t the problem.
After two days of inspecting the code I found that specific line of code which cause the problem
dataObject.content = content
where content is the defined as
let content = dic["content"]
and dic is NSDictionary
After another round of search I found the following post in swift mailing list describing similar problem
http://comments.gmane.org/gmane.comp.lang.swift.user/898
so I changed my code to this
let swiftContent = content as! [Dictionary<String, AnyObject>] newsItem.NewsItem_content = swiftContent
and changed how the initial json dictionary created
so instead of
let dicItem = newsElementDict.dictionaryObject
I did
let dicItem = newsElementDict.rawValue as! NSDictionary
which have worked fine, And know I don’t get those leaks.
بسم الله الرحمن الرحيم
This is my first post in the blog 🙂