How To Fix Missing Required Module In Your iOS Unit Test Target?




Starting TDD (Test-Driven Development)? Following a tutorial in Unit Testing? Testing your service functions? Whatever your case is, sometimes starting a unit test in Xcode if you have dependencies via Cocoapods.
I’ve started practicing TDD in my personal project some weeks ago and here I find myself doing Unit Testing in another project but I encountered this error:
Missing required module ‘Firebase’
As usual, the first step in figuring out what to do: search on Google. Next step I did was check out my project in which I did my very first TDD. One of the links that can help you before proceeding is this thread on Github.
If none of the solutions you found on Google worked and if you’re using Firebase, then continue reading and follow these steps:
  • Making your test target inherit the search paths of your main target.
Check out my podfile and see that the tests target is under the main target.


  • Add a search path in your Header Search Paths
In your Tests target’s Build Settings, search for Header Search Paths and add these two new search paths:
  1. $(SRCROOT)/Pods (recursive)
  2. ${PODS_ROOT}/Firebase/Core/Sources (non-recursive)
And… that’s it! You should be able to do your unit test. Sample unit test code?

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.

9th Month As An iOS Developer - My Productivity Is Directly Proportional To Ambient Temperature


It's my 9th month working as an iOS developer, I feel compelled to write this post down since I've been very busy with my work and with my freelance project. This post will be about everything I wanna share, starting from the 2nd week of my work in the office up to today, Sunday - June 5, 2016.

My progress in learning Swift has been good. I become more and more confident in coding using Swift, and as the time goes by, it seems that I inadvertently neglect to remember my good old days with Objective-C. Past is past, it's up to me if I am going to deal with that past again. We all need to move on.

I also notice that the APIs made by one of the bosses in my current company are better than the APIs written by someone in my past company. I believe that the latter is so vulnerable to attacks, since the programmer is not utilising the use of authentications and headers, and other stuff in dealing with API requests. I am learning so many things in my current job, I will never stop learning and sharing, I am happy with what I'm getting from the experiences the company is giving me, thanks be to them and to the Lord.

As much as I want to be productive this afternoon, the blaze of the Sun is eating my perseverance. Two things that hold me back from being productive: the temperature in a location where I am working at, and the table and chair that I am using, never mind that coffee. Today, I'm transferring my self and my things to a new apartment unit near my company, I'm so excited. This post might be pointless to my readers, but it is important for me to put what I feel like to put on this blog. I need to stop writing this now, no, stop, alright I'm closing this post now. I need to hit the gym.

P.S. I already tried what I've been wanting to do: drinking wine while coding. Don't do it. Alcohol will ruin your capability to think, it won't help improve your logic - or is it just me?

Implementing SideNavigationController Using Storyboard And CosmicMind/Material



CosmicMind/Material is a third-party open source library, hosted on GitHub, started by Daniel Dahan. It provides lots of support to make your iOS or MacOS apps more beautiful, thus enhances user experience.

Disclaimer: I am new in open source world - therefore in software development too, I respect the contributors and especially Daniel. I meant no offence to this blog post, I have edited my words. It's just that, this library is not for someone noob, like me. I got a huge respect to people contributing to the open source community.

Yesterday, I tried this Material library, my day off. I got a project in the office, and a freelance project too, that both require to implement a Side Menu/Drawer Menu. I got a cool library already for that and successfully implemented it but got an annoying bug that when you swipe the side menu fast, it bounces a bit. My boss saw that and he wants no other library but only Material's SideNavigationController. 

I just spent more than 5 straight hours how to freakin' implement this SideNavCon of Material. They provided samples for both programmatically and storyboard implementation. However, they failed to explain how to include a Navigation Controller. So I went on and try it myself.

Again, here are the problems what I spent 5 damn plus hours on configuring this library.

1. SideNavigationController's sample has no NavigationController.

2. Assigning and a NavigationController to the Main Screen gives you a headache, quite complex at first, since I'm new to Swift.

3. If you assign a NavCon programmatically, you will have a hard time in configuring and adding Bar Button Items. You can try to use CosmicMind/Material's library too in adding Bar Button items but for me it's *annoying, or it is just for me? Cos you have to setup everything, this is not for everyone*. The icons/buttons in your NavBar is not proportional! The best way to add NavBar items is using the Interface Builder, hence the storyboard.

4. And many more, believe me :)  

Let's go ahead and implement the SideNavigationController using Storyboard, but let's keep it they way they implement it in their samples.

First: Make two screens in your storyboard.

You can have both TableViewController or NavigationController, it's up to you.



Second step: Make two classes for those 2 screens.

This step is no brainer. You make two new classes and subclass whatever type of screen you want (e.g TableViewController or ViewController)


Third step: Give them Ids.

Don't forget to assign the two classes you made for them. Checking these "Use Storyboard ID" is optional. It will just allow the Xcode to determine what ID should be used for Identity.

TAKE NOTE: We will skip the part where we will add a button in our main screen. You can just look up to their sample, contact me if you have a problem in running their sample project.




Fourth step: Setting up the SideNavigationController in your AppDelegate.


So as you can in the code snippet, both screens have no navigation controllers. and the side navigation controller or the side menu has no status bar. Now, we're going to the purpose of this blog post: Modifying the sample to put a navigation controller in our main screen using storyboard and prevent the up/down bug when we swipe the side menu.

Now, you embed a Navigation Controller in your main screen. Click on the Root View Controller screen and click the EDITOR at the top of your Xcode and EMBED IN -> Navigation Controller.


Next, click the newly embedded Navigation Controller and assign a Storyboard ID, and make a new class and make that as a subclass of UINavigaionController.

After the steps above, we will now have to modify our AppDelegate. Finally, check out the code below.

Basically, we have just init our root navigation controller and assigned a root view controller to it, which is our main screen. Then assign that navigation controller to the SideNavigationController and modify the side menu a bit to prevent a bug and make it swipe-able.


***currently running the sample app in a simulator, to provide a screenshot, even though I'm running out of time, I got plenty of tasks and appointment to do and attend... Wooo!***


So that's pretty much all the steps you need to implement a navigation controller to the CosmicMind/Material's Side Menu. If you got any questions or clarifications, post your comment below.

CHEERS!

Torn Between Several Companies... And Asking A Break From iOS-Swift


Time check first: 2:06AM - May 6, 2016. I am typing this blog post for my 2nd day at work. I just wanna say first that I ate a Yakisoba spicy chicken and currently drinking Nescafe Espresso Roast in can, a ready to drink coffee. I just wanna say that I wanna puke right now and I just wanna say that I will stop entering nonsense phrases in this blog post.

Everything went fine yesterday, May 5, 2016 - my second day of work as an iOS Developer in Swift. I worked on some easy tasks such as client change requests in the interface of a certain project and fixed some bugs of that app. Note that all of the company's iOS projects are written in Swift, and not in Objective-C (I really wanna puke now.). So, going on, I was doing fine in the office until my CTO shared a new task to me. That project was about stocks exchange, and lots of data are involve in that app. He just wanted me to help him in making the app's data processing more efficient. After an hour of inspecting the codes, I still couldn't make my brain accept the fact that I am not with Objective-C anymore. I'm with Swift, and I believe I will be with that thing for a long time. I couldn't understand the task, I mean, I just couldn't figure out where to start! I could have asked for help, but no, I needed to try to focus first on this and see what will happen.

Time passed by, I remember that I am being invited to an interview at Samsung in Taguig tomorrow afternoon. It's now Friday, so technically the interview will be held later. No, I didn't apply to Samsung directly, if I did, I believe I wouldn't be noticed. I applied via Yondu. This company has a client, and that is Samsung. Yondu is seeking for iOS developers for Samsung. After I had my phone interview with Yondu last week, the recruiter forwarded my profile and application to Samsung, and now I am being invited to an interview.

During my short break (while doing the complex task for the stocks exchange project), I sneaked into my Mail app, I mean I opened up my Mail app and then sent an email to the recruiter from Yondu - who interviewed me last week and told me last day to go to the interview this Friday. Actually, she requested to Samsung to re-schedule the interview and make it Friday just for me - it was supposed to be this Thursday, and they did. So now I became much more confused. Anyway, I sent her some questions about the job. Like how much of my expected salary did she mentioned to Samsung?

Before I proceed, I told the recruiter last Tuesday to wait for my feedback because I might leave my current company if they don't agree to meet my expected salary - hence the rescheduling of the interview. This morning, I mean, this Thursday morning, the CEO and I had a talked about my job offer. He didn't meet my expected salary but he raised it and added an allowance to somehow meet my targeted NET salary. So I'm all set now somehow.

The offer in Samsung is almost twice of what I will be receiving in my current company! However, I do not pass the interview yet, so the offer might not be true. I want to attend the interview, but for what purpose? I already signed the contract with my current company!

I really want to attend the interview, but if I pass and I get the highest offer I'll ever get so far in my whole career - what's next? Should I bite the offer and work in Samsung and exhaust my self since I will surely be an R&D (research and development) person there and the job might be more complex that what I am having right now, if they're using Swift too. Should I work in Samsung and fight with the poor filipinos riding in MRT every damn morning? Should I leave my current company hanging since I already signed the contract? The interview was rescheduled just for me, why should not I come?

Going back to my story in the stocks exchange app, the CTO assigned to me a simple yet very mind boggling task, at least for a someone with mediocre mind - like me. After exchanging emails with the recruiter and talking to my partner what I should do next, I decided to talk to my CEO.

I told him all the truths. Including the compliments, that I really like the company. All in all, the company is an ideal company for me. Nice compensation package for a someone inexperienced in Swift like me, the nearest mobile-app development company to my house, and I have the technical bosses. I told him all that, and I told him that I was thinking that I should go. I should go and leave the company for a while. At that moment, I haven't signed the contract yet. I need a break to relieve some stress and pressure. I need time to practice myself in Swift and with that, I won't be pressured next time and be confident with my Swift-skills. I told him not to worry about me having no resource of my budget, because I have a part time job - an iOS job too. He then told me that he understands me and that he has no right to stop me, he then called for the CTO. This man is also my lead/senior.

Talking with my CTO changed all the plans. Long story short, he freakin convinced me to sign the contract post-dated. I was very glad though because I think they really want me to stay, cause if not, they'd let me go easily. They even negotiated with me about my request in meeting my expected salary. He told me to sign the contract just to be sure that I will return to their company - coz I told them that I will return after my long break, which was supposedly to be a 2 to 4 weeks break, but he convinced me that 2 to 4 weeks is too long. He told me that a 1 week break for practicing Swift is enough. At first he was trying to change my mind and pushing me to be their part time or contractor instead just to give myself more time in relaxing. Again, I signed the contract post-dated, I will start next next week - May 16, 2016. Long story short, I felt happy and important.

About the interview? - I HONESTLY STILL DON'T KNOW WHAT TO DO WITH THAT. I should pray and contact the technical recruiter later. I just hate myself sometimes.

FIN.

1st Day Of Work In A New Company As An iOS Developer Using Swift - From Objective-C To Swift

Swift Logo/Trademark
Time check first: 11:59PM. Actually, the day that I first used Swift in a small app was yesterday.  I had my interview and a two practical exams, the last exam was a hands-on with Swift. I was required to make a PhoneBook App using Swift programming language connected to Firebase - Firebase is the source of my data. I need to fetch the data from Firebase (it was my first time too to use Firebase). Bonus point: Add an add contact function.

I have been practicing by making a phonebook app too, but using objective-c as the programming language, and Core Data as my database. The hands-on exam though has no database requirement.

So today was my first day at my new company. In this company, they're using Swift and Storyboards. I was a bit culture shocked - if that's the right term. I freakin' hated Swift during my work. My tasks though was to document the service requests used in their one project, and to improve the code of the another project - not necessarily to make the code more efficient. I just made the code cleaner in format. I'm no computer science graduate, so I'm not really good in code efficiency stuff.

Going on with my story about my work, I hated the Swift so much. I told myself, that if these projects were written in Objective-C, I'll freakin' finish these! Tomorrow will be my second day and I will be doing some client change requests to the last project I mentioned above. So yeah, I hated Swift until I went to the mall near in the terminal where I take a cab to my way home. I went to that mall to eat and to watch the video clips I downloaded from Youtube. - Realm to Swift tutorial. I hated Realm too when I was at the office. Why not Core Data? Ughh. So after I watched the video clips, I learned to love Swift (a bit) and to love Realm (than Core Data? Lets see in the next days).

----
P.S. I haven't signed the contract yet with the company, so if they won't give my expected salary tomorrow, I might leave the company the same day - the CEO said that (he's a technical CEO, cool! and I have a technical manager too! Cool!) he will come back to me tomorrow about my request to make the offer match my expected salary. And that's sad.

FIN.