I Left Objective-C and I’m Staying With Swift



It’s been 5 months since the last time I posted a blog post here. I was so very busy, actually until now I am busy, that there’s no word that can describe how busy I was and I am. Anyway, I am handling multiple projects using Swift. The last time I used objective-c in an iOS project was last April, before I left the deteriorating company (just kidding). So yeah, here I am today, doing my very best to write another blog post about my experience with the awesome Swift. By the way, I will try my best to make some new tutorials, like how to properly integrate PayPal to your iOS project SERVER-LESS!

Swift is just awesome, I began using Swift when I entered to a new company last April (2016) (read: http://www.prettyitgirl.com/2016/05/1st-day-of-work-in-new-company-as-ios.html). I used to cursed Swift for being weird because of its optionals features, I hated it so much, just like when I hated objective-c when I first used it last September 2015. When I first used objective-c, I told myself that if only objective-c is C#, I would be awesome using it, objective-c for me back then was an alien-dedicated programming language, I mean the syntax is for the alien people. Now, back to the Swift, when I first used it, darn, I was like: “What the heck is this optional thing? Is this necessary?”

I would to share someone’s opinion on Swift (he’s an objective-c user)



I fully understand the man above, I disliked Swift, I used to. Well, not anymore! I’m here to promote Swift. Swift is a young programming language and Apple has been in effort of improving this, from the first version of Swift up to the latest 3.0. Swift is the future! Open source community has been working hard to make the server side frameworks made in Swift to make them stable for production.

156th Day As An iOS Developer - CoreData Is Awesome

photo from Udemy

April 21, 2016 - 156th Day As An iOS Developer

THURSDAY - Finally! I got the time to try out and practice using the Core Data. I've been wanting to create a simple app that implements this for so long, I just couldn't find enough time to do it. I found a nice tutorial on Youtube how to implement Core Data to your application. But the thing is, the tutorial is quite out dated. By the way:
    Core Data is an object graph and persistence framework provided by Apple in the OS X and iOS operating systems. It was introduced in Mac OS X 10.4 Tiger and iOS with iPhone SDK 3.0. It allows data organised by the relational entity–attribute model to be serialized into XML, binary, or SQLite stores.
I'm typing this post as a backlog, I actually made an app called: GPhoneBook app and I modified how it stores the data, thus I integrated the Core Data functionality. The data in this app originally is temporary. Just like what I've said, this post is a backlog, the GPhoneBook app was left in my old MacBook Pro in the office. I will try my best to make another one tonight using SWIFT! Alright! I will just make an update to this post as soon as I finish the version 2 of the GPhoneBook app.

FIN.

--- EDIT: I take back my word that I will be making the version 2 of the GPhoneBook app using Swift. I realised that I need to make a sample app for my up coming seminar/talk next weekend made in Objective-c, this will serve as a demo.

155th Day As An iOS Developer - Stackoverflow Is Addictive

My Current Reputation On Stackoverflow

April 20, 2016 - 155th Day As An iOS Developer

WEDNESDAY - I got nothing to share about my work for today because I did nothing important in the office but learned so many things. Even though I am not good in iOS yet, answering questions on Stackoverflow becomes more and more addictive. I am helping the others solve their problems and I am learning things at the same time.

I just love the feeling when the one who posted a question selected your answer as the answer of the post. Take a look at this SO Question about Fabric. The only answer and the selected answer came from yours truly. Integrating Crashlytics and other Frameworks of Fabric is easy by the way. So the question is just about Crashlytics. The OP (or the TS - topic starter) was wondering if he can use and integrate Crashlytics to his project without importing the Fabric framework. I answered him no because Crashlytics is under the Fabric framework, that's the straight answer. No more, no less.

The OP had a follow up question. The Fabric has many Frameworks like Digits, MoPub, and etc... He asked how to remove those since he needs to import the Fabric itself. I told him that he does not need to worry about that. I learned in Harvard's iOS subject lecture video that the #import statement is smart enough to determine what part of a framework is or are needed in your project. While the #include in C programming language will literally import all the stuff to your program.

I just love the community in SO. Learning is constant and is never ending, if you want to know another way to have fun in programming while learning, go to Stackoverflow and join the helping community.

FIN.

154th Day As An iOS Developer - The Day I Learned About IDFA

IDFA

April 19, 2016 - 154th Day As An iOS Developer

TUESDAY - This is the day that I learned about this IDFA stuff - Identification For Advertisers. Well, I learned this when I handled the old app of the company called PINOY CPA. I gave support for the latest iOS Devices to the 20 apps of this project, the 10 apps of this project are all lite versions and therefore has limited features as well as annoying adverts that popup to infuriate you. Going on, when I submitted those 20 apps to the App Store, the 10 full versions got accepted and the 10 lite versions got rejected. The reason was about this IDFA.

Apple gave me hints why the lite version apps got rejected. They told me to give them some instructions how to make the adverts popup/show. Well, that was easy. They just don't  know how to reproduce the apps. So what I did was I gave them the step by step procedure on how to reproduce the adverts - meaning, how to make those popup. After that, I re-submitted the 10 apps just to be sure that they will review the apps as soon as possible.

FIN.

152nd Day As An iOS Developer - Answering Posts On Stackoverflow


April 15, 2016 - 152nd Day As An iOS Developer

FRIDAY - Oh backlogs! I'm typing my Friday's post today, Saturday inside a dental clinic. The good thing is, I got a free film, currently while typing this post, I am watching a film called: "Always be my maybe". The movie will certainly make you laugh. Anyway, let's talk about iOS now. Today is the day that I began answering posts on Stackoverflow.

So talking about Stackoverflow, even though I am not very experienced in iOS App Development yet, I got hooked up helping others in objective-c. You can find me lurking around the SO posts with objective-c tags. Sometimes I get lucky in posting my answers, I get first to answer then I get the chance to get my Answer be selected and marked as the answer to the question - meaning, plus reputation!

It feels good, it really does. It freshen up my mind too, additional practice. Anyway, today is Friday and I am happy that another weekend is coming.

151st Day As An iOS Developer - The Day When I Met UIStackView


April 14, 2016 - 151st Day As An iOS Developer

THURSDAY - I just had a great day, not so stressful. Just fixed some minor easy-to-fix bugs. Then I studied iOS 9 Swift - UIStackView. I just watched a 10-minute tutorial about this stuff, it is only for iOS 9 though, if you need to implement this for iOS 8 and below, I found a third party library that mimics this, it is called: OAStackView. Here is the repository of the project: https://github.com/oarrabi/OAStackView

When using this UIStackView, implementing constraints is necessary. As soon as I get a free time, I will make a sample project and use this. I just wonder though how to use UIStackView programmatically. There are really lots of things that I need to learn and practice. Sorry for the short post.

FIN.

150th Day As An iOS Developer - Never Trust Your Simulator


April 13, 2016 - 150th Day As An iOS Developer

WEDNESDAY - Well I learned that you should never trust your simulator. If you use simulator, be sure to import your assets to xcassets. Assets that are outside of that xcassets can be sometimes not found when using simulator, at least in my experience in iPhone 6s+ simulator. Aside from that, I found out on Stackoverflow that your In App Purchase functionality may sometimes work fine in your simulator but if you test your app's IAP when it is already on App Store, it won't work.

I don't usually use my simulator, but using it makes your development convenient. I mean, less hassle. Less wire. Well, just like what I mentioned, I don't usually use simulator unless I really have to.

First, I hate using it because my laptop provided by the company is freakin' slow. It's a Macbook Pro Mid 2012, 4GB Ram, and has a Intel Core i5. Pretty cool, but they do not have time to format this machine and do not provide any effort to upgrade its memory. Second reason is that it does not work 100% like a real device, and as far as I know, you can't turn off its wifi functionality. Funny.

FIN.

149th Day As An iOS Developer - I Just Got Code Reviewed


April 12, 2016 - 149th Day As An iOS Developer

TUESDAY - The title says it all. I just got code reviewed for the second time. Remember the post where I mentioned that I did an evaluation app? That's right. Our new head of software development in the company instructed the part time senior iOS developer to review my codes in the evaluation app. Well, my codes in that app is so dirty and has discrimination. It's because when the former project manager instructed us to do this evaluation test app, I just go infuriated.

Long story short, I was mad during the day I was developing the app. Again, the codes are not so organised - I'll rate it myself like 7/10. I didn't know that they would review my codes. So yeah. Have I had a valid reason to make my codes like crap? No. Honestly, I feel like I was being so immature.

After that surprised code review, I continued working on the old project. I'm longing for a new project this time. Ughh. After that, my colleagues and I went to buy a dinner at a local store and then we talked. We talked about some certain stuff.

Talking about iOS, uhmmm, I don't have anything to share today. So yeah, I'm ending this post.

FIN.

147th Day As An iOS Developer - The Manager Strikes Again


April 8, 2016 - 147th Day As An iOS Developer

FRIDAY - First of all, I am typing this blog post inside Trinoma - again? Yes! I can't believe that I only spent almost 1 hour in typing to complete 10 backlogs (blog posts)! Woo!

So here's my stuff to share what happened to me this April 8, 2016 and stuff about my evaluation exam.

I wasn't able to finish the app that I need to revise. I am so lazy today, because first it is Friday and second, I have no new project. So anyway, yesterday, I had my evaluation exam. Basically that exam is for the mobile developers in the office. There are two non-senior mobile developers in the office. I - as an iOS Developer, and my friend named Ms. T as our Android developer. The exam tells us that we need to make a client app of Krave. Krave is a gay app that is already published on App Store - yes, it is similar to Grindr app. So going on, Krave client - but with extra features. Like changing the background color of the home screen by letting the users input some RGB values to three textfields. There should be two sliding Menus, for both left and right.

The manager in the office was the one who made this nonsense evaluation exam. It also uses a web view. One of the things I find it hard to do in this exam is the search function and the collection view. Ughhh! How was I suppose to resize the collection view cells depending on the inputs of the user?

Our manager is the most annoying person in the company ever. He told me and my Android developer friend he gave this exam to their former OJTs / interns and they finished the app in just 4 freakin hours! Oh come on! My fists are shaking while I am typing this. How the 'F' did they finish this kind of nonsense app within 4 hours? Are you kidding me, mr manager? Oops! This is too much I think.

So here's the thing, my backend / web developer colleague-friend found out that that manager did the exam last March 2016. The interns that he was probably talking about finished their duties last year 2015 before I entered the company. So yeah, I call BS. I hope you read this. *laughs*.

Long story short, in the end, I didn't finished the exam. It has login with Facebook too. So nonsense. However, the CEO thought that I actually completed the exam, where in fact, I wasn't able to implement Search Function and Resizing of Collection View Cells function. Only two functions left. We left the office at 11 PM - I firmly believe that if only I stayed until like 2AM, I would be able to complete the project 100%.

FIN!

146th Day As An iOS Developer - The Day I Had My Evaluation Exam

A Ruby Gem

April 7, 2016 - 146th Day As An iOS Developer - The Day I Had My Evaluation Exam


THURSDAY - So I made a project today. Remember I mentioned yesterday in my blog post that I will be having an evaluation exam today? I decided to have pods for easy integrating of pods, yeah Pods. Thanks to this. Updating the third party libraries is now easy. I just love pods. I learned having pods from sir P. But I think, the CTO and other senior developers do not use Pods.

I have a stuff to share, this is how you install pods in your machine. To start using pods, use these commands in your Terminal. I think my pods or ruby gems were deleted when I updated my OS to El Capitan.

$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ pod --version
0.38.2

I think I will just share what happened to me today in my evaluation exam tomorrow in my next blog post (Friday). Please read it :)

FIN.

145th Day As An iOS Developer - Another Old Project To Revise

photo from: google images
April 6, 2016 WEDNESDAY - So I began revising an existing iOS app on App Store. Name of the app is: CPA Pinoy. I'm quite worried that they might find out this blog by mentioning that name of the project. YOLO! Now this app has so many versions, and the old developers, the way they did the versioning of the project sucks! I mean, even the senior developers in the office condemned the way those developers designed the repository.

So going on with that project, the repository has a total of 10GB plus size - I only estimated that. Oh wait, I'll double check it and see if my estimate is near to the actual size. Wait a minute. OH!!! Guess what? I'm correct.


Funny, I was right. So I was darn right in leaving this laptop in the office to download the whole repository to somehow maintain its ridiculous repository format.

Oh, one more important thing: Tomorrow is our evaluation test. so excited, and I continued making my Gphonebook app. I learned using predicate for NSArray without keys.

144th Day As An iOS Developer - All About My PHoneBook iOS App And The Power Of Storyboard

April 5, 2016 - 144th Day As An iOS Developer


TUESDAY - Hooray! The manager is not here, yesterday he didn't report to the office, and I hope today he won't be here too. Just kidding ;). So I began practicing GIT, making an app using Storyboard by making a PhoneBook App, which I called and named: GPhoneBook. You can find it on GitHub. One of the things I learned in using Storyboard is that you need to prepare for segue when doing a push or present view controller.

Well, that is only necessary if you are passing a data to the view controller that will be pushed or presented. Unlike when you do it programmatically, you just have to make a custom init of the new view controller - which is much cooler to me I think. Storyboard makes your life way much easier ughhh! Next time, I promise, that when I have a new project that does not require complex User Interfaces, I will definitely use Storyboard.

Next paragraph, to clean up the blog post, what about the individual Xibs? I won't use that, I believe. Using Storyboard is much cleaner. I mean, imagine populating your project with lots of Xibs, instead of compiling them in one file - which is the Storyboard.

FIN.

143rd Day As An iOS Developer - Preparing To Be A Future Speaker

photo from: waybeyondordinary

April 4, 2016 - 143rd Day As An iOS Developer

MONDAY - Another old the same project. I was invited to speak in front of other developers. Most of them are student. So I must change my mindset from now on, I mean, I think I need to lessen the procrastination when I am at work. I need to lessen everything that is not contributing to my career growth (e.g Facebook while working).

Also, starting from today, I will study everyday, actually I already began making an app as part of my study, and this app will be my very demo in front of those students that will attend the Meetup. The name of the group (I just found this group on Facebook by the way,) is: ProgrammersDevelopers - not so cute name, I mean funny name.

What you can find in this group is mostly the mostly lazy students - people who don't know, apparently, how to google, and how to enter the keywords on any search engines that they need to enter in order for them to find appropriate answers to their almost-absurd questions.

What I will introduce to the students this coming Meetup of ProgrammersDevelopers group are these:

- Xcode
- Objective C (and probably a quick refresh to C programming language)
- iOS
- Core Data

FIN.

141st Day As An iOS Developer - Shortest Review Of Xcode 7.3 Ever!

March 31, 2016 - 141st Day As An iOS Developer

THURSDAY - I fixed my MAC. It became amazingly fast by adding 100GB free space, I did that by removing completely the Bootcamp and repartition the HDD. So yeah, just like what I've said in my yesterday blog post, I did upgrade my OS to El Capitan. Hooray! It's quite fast now, and I can run Xcode 7.2 now and so build apps to the latest iOS devices (iOS 9.3). Well, annoyingly and inevitably, it took me hours to complete all these installations and setup and cleaning process. But I really have to clean up complete this machine in the future by re-formatting it and installing fresh the El Capitan.

What I noticed in Xcode is that it automatically detects the properties you declared in your class when you're about to use it. I mean, we all know that the auto @synthesize already began in Xcode 5 or something, now in Xcode 7.2, I noticed that it automatically shows the property in underscore notation when intellisense functionality detects what you need to put in your code. So it means that you don't have to type the world self.

Look at this example below:
@property (nonatomic, strong) NSString *aStringObject;

Instead of typing this:
self.aStringObject = @"Hello to the most beautiful iOS Developer in the Philippines!...";

The latest Xcode can suggest to you through its intellisense this:
_aStringObject

 which is equivalent to the self object above.

140th Day As An iOS Developer - The Super RoadBlock At Work


March 30, 2016 - 140th Day As An iOS Developer

WEDNESDAY - Super roadblock, I had today. I wasn't able to do my tasks properly because my Macbook pro has out of date operating system : Yosimite, with that being said, I couldn't run Xcode 7.2 and so I wasn't able to build any app to iOS 9.3 devices. The tasks I was doing requires those, updated OS, Xcode, and I needed to run the build in an iOS 9.3 device to reproduce the bug that the QA team found in the project I am handling.

I still didn't install my El Capitan to my machine though, I just did my task in my colleague's machine that is running on El Capitan OS. But darn, it took me a couple of hours to complete the installation of Xcode 7.2 on that machine. So yeah, super roadblock. Thanks to the management for not taking the responsibility to format the machine. Well, I think it is my responsibility.

Tomorrow, I will try to update my OS and clean up the darn Bootcamp - Annoying, ughhh! Who needs windows in a Mac?

FIN.

138th Day As An iOS Developer V2 - Assign The New Project To Me Please!

March 28, 2016 - 138th Day As An iOS Developer Version 2.0

MONDAY - There are two new iOS projects in the company. One of those projects is already being planned, the another project is currently being designed by our Creatives Team. Guess what? They didn't assign to me the new project. I don't know why. Probably because the deadline is near (April 16 something). So the CTO is taking such app. He's the master of the masters of iOS development in the whole company. The second reason I can think of is that I still currently solving the bugs of my very first project - I mean, the very first iOS app that was submitted to the App Store. These reasons are quite valid for me though. If there is one thing that I can complain about not assigning the project to me, it's the fact that the CTO chose to assign the coding of UI to their Q.A named Ms. K - she's a former iOS developer.

So we had our meeting today - one of the topics discussed in that meeting is the new projects I mentioned above. After that meeting, someone called me - little did I know, the company that contacted me is a freakin' agency. When I say agency, it is a recruitment agency that outsources someone to their clients, with that being said, your salary will be deducted - A LOT!. Their client is PointWest. The manager of that company is not that so smart, as well as their senior technical recruiter. They need lots of iOS Developers so bad but they didn't accept me. Haha! Well, I know the Lord has still plans for me. I firmly believe in that. Faith. Yes.

Fin.

136th Day As An iOS Developer - Never Ending Provisioning Profile Problems

March 22, 2016 - 136th Day As An iOS Developer

TUESDAY - I would like to say that sometimes I hate summer! It's annoyingly hot tonight. I just officially ended doing the G-project (let's just call this G-Project). I submitted my final build to the QA team of the client, not really our client, but partner of our company. This is the third iOS App that I will include in my portfolio and resume. I feel so happy!

But before everyone experience the happy ending, having bad moments is so inevitable. Meaning, before I successfully sent my final build to the QA team, I experienced, ughh yes - again, problems in Provisioning Profile. Perhaps I just forgot how to correctly setup everything in submitting build, after messing up with the provisioning profiles of the production app - which of course does not have any effect to the live app.

I now present to you the quick steps on debugging the invalid Provisioning Profiles and Code Signing issues:

1. Check the Bundle Identifier of your project and make sure that it is 100% equals to the App Id saved on developer.apple.com

2. Make sure that you have the correct developer profiles installed on your machine.

3. Check if the certificates (for debugging and adHoc or AppStore) are already on your machine.

4. Next, re-generate new provisioning profiles from developer.apple.com - How? Just edit your provisioning profiles and then save.

5. After the step #4, delete all the provisioning profiles on your machine via Xcode, and then download the new provisioning profiles you just generated from step #4.

6. After checking these steps above, be sure to restart your Xcode.

FIN.

135th Day As An iOS Developer - Fully Functional Search Function Plus Dynamic Cell Size

March 21, 2016 - 135th Day As An iOS Developer

MONDAY - Ah Monday, watch out! Long weekend is coming! This coming Thursday and Friday, our country is having its annual holidays called - Holy Week.

One important thing that I've learned today is how to dynamically adjust your TableView Cell or your CollectionViewCell based on its contents. I got the idea, sometimes it works and sometimes not, therefore it's not perfect yet. My part time senior iOS Dev informed me that our CTO has the right codes for it. I'm excited to check it out next week.

I just did some modifications, and enhancements (yep, again) to my project. This project, in fact, like what I've told you in my last post yesterday, is already done. I just feel like to do bug fixing and enhancements. You know what's the happiest moment of mine in developing this project? It happened today, it was when I successfully implemented (fully functional) a search function with relation to Core Data. Thank you sir P for helping me throughout this project.

By the way, another tip: I realised today that if you can't present an Alert Controller, and Xcode is giving you a warning and you find it weird because you are so certain that you're doing it right, you just have to do this: Dispatch it on the main thread!

134th Day As An iOS Developer - Storyboard and Core Data

March 18, 2016 - 134th Day As An iOS Developer

FRIDAY - Another last day of the week! Finally! I'm just doing bug fix for my current project. I'm so near to the end, and I'm just retouching the views and improving the functionalities of the app.

One thing hit me today, I realised that if the project will be composed of merely yourself, and you will never need a team to build the project, then do it using Storyboard. In that way, you would finish the app in next to no time and less coding. Although I really prefer doing the project all programmatically, I would use Storyboard in my next project. Why? The project that I'm doing today (the one that is near to be done), was made or being made programmatically, and it took me 3 weeks to complete it. - Yeah, given the fact that it was my first time in this project to use custom cells, collection views, and table views. There are many firsts that I experienced in this project. Thank you Lord! Thanks to the company for this opportunity.

Last thing I wanna share: I studied Core Data. Yes, finally, I got the time to study Core Data, yes, without using any 3rd party library like Magical Record. I enjoyed it. It's better compared to using SQLite directly. I'm excited to use Core Data again in my next project.

132nd Day As An iOS Developer - Dealing With QR Scanner And Video Preview

March 16, 2016 - 132nd Day As An iOS Developer

WEDNESDAY - Today, my partner and I celebrated our 33rd month as a couple. One great thing happened today to me is that I answered a certain question on Stackoverflow. It was my first time to do that. I would love to continue helping others through that forum and hopefully someday, this year, real students in person - in short, I hope I can teach in my alma matter.

Today I dealt again with the video and audio in iOS, as well as with the QR functionality. Actually, you can make your own QR Scanner using the framework in iOS.

I would also like to share one thing to you guys, and I'm hoping this blog post would help anyone in the future who's having the same problem. Just like what I've mentioned above, I worked with the QR and video/audio functionality of my current project, and having a bug is inevitable while doing your app. My video preview is not full screen when the app is being run in iPhone6 and iPhone 6 plus. I am using autolayout and base on my constraints, the video preview should fill the parent's height and width, but it didn't.

SOLUTION: Implement a method called: viewDidLayoutSubviews -- Inside that method, layout again your video preview layer. IMPORTANT!: Do not alloc init anything inside that method, just re-layout your views. After that, your video preview will fill the height and width of its parent, or whatever you've been targetting.