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!

130th Day As An iOS Developer

March 14, 2016 - 130th Day As An iOS Developer

MONDAY - Ah! Monday! I don't think that I have mentioned already last week that I just fell in love with the XIBs. It happened when I first made a custom cell for my UITableViewController last week for my new project. Laying out your views is pretty easy, I mean, so much easier than doing it programmatically - whether you use constraints or not or you use constraints with the help of a framework.

Another thing happened today, my manager implemented a new (ughh) protocol in the office. We will use a google form to post our daily scrums. Here in our company, the scrums are personally made. Made by the developers and not from a technical manager, well, my manager is not a technical - I mean, he does not do programming. Going on, the google form has a question: "Do you have a roadblock?" -- It's kinda funny for me, you know. There should be no roadblocks if there are seniors who supervises us junior developers. Forgive me if you're reading this and thinking that I have too many reasons, this is my blog, you know.

So yeah, I was targeting to start implementing QR Code Scanner functionalities into the new project that I have been doing but I failed. I realised I should've started the whole project using storyboard and not programmatically! Lesson learned.

12th Day As An iOS Developer With No Experience


September 18, 2015 - 12th Day As An iOS Developer With No Experience

Friday - Yissss! It’s Friday, Friday, gonna get out this Friday, been looking forward to the weekend, weekend. Haha! Is my lyrics correct? Anyway, Friday is my favourite day, not to mention the weekend cause I get the chance to meet my love, future better-half, I can take some rests, and go to church. I’m here in the office while typing this and while eating my lunch, yes I’m on my lunch break. :)

I remember that I need to tell you guys that I have learned how to use the software cornerstone. I can’t remember though if I already told you this. So anyway, Cornerstone is a software that lets you manage your local repositories as well as your cloud repositories. This versioning tool makes your life easier. You do not have to type your commands in the terminal. I’m loving this Cornerstone, thanks to our kind CTO for teaching me this technology.

Before I forget, I will, from now on, post here every knowledge that I will get every day. Today, I learned and discovered the following.

  • Adding Objects or Data to TableViewCell - Okay, so I decided not to make a tutorial of this yet. Maybe next time. But if anyone of my readers want me to, just contact me.


Again, from now on, I will be making too tutorials for every information and knowledge I get. This will be fun! Subscribe!

11th Day As An iOS Developer With No Experience


September 17, 2015 - 11th Day As An iOS Developer With No Experience

Thursday - Have I mentioned already in my past posts that I’m starting to have my self confidence, confidence that I will be able to finish the project before or on the deadline? Oh and I just realised that September 25 - my deadline - is actually a holiday in my country. I asked my project manager if the deadline will be moved to Monday instead, 28th of September. He answered me No. What the heck? Sir, you really are overestimating my power. lol. You see, I don’t have much enough knowledge to finish the project on Thursday next week. But I’m letting the Lord handle this, I will do my best and our God will do the rest. Amen!

I have made a big progress in my project. I can now see hope, yes! Thank you Lord! So let’s go to the technical part of software development:

I have successfully added some spaces in my UITableView’s cells. I’m not quite sure if I mentioned in my yesterday post that I was struggling in adding spaces to the cells, and it was time consuming, in fact I’ve spent so much time like 8 hours or so (what the heck, right?) in solving the problem. So what did I do to solve the spacing? We have the following steps to put some spaces to the cells WITH IMAGE, in my case I have 1 image per cell. Check out your iOS (iPhone’s or iPad’s) Gallery App, and specifically the Albums, you can see some spaces right?

  1. Subclass the UITableViewCell - quite long process, I mean short but quite long. Lol. Sorry for the confusion. You have to add new class files choosing UITableViewCell as the super class, and you’re gonna have to put a bit of coding to that class.
  2. OR you can add another cell, and then you’re gonna deal, in this case, with logics and algorithm.
  3. Lastly, this is the technique that I did: deal with indexPath.section of the cell instead of indexPath.row, see this solution:
#pragma mark - UITableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return self.groups.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 10.0f;
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *v = [UIView new];
    [v setBackgroundColor:[UIColor clearColor]];
    return v;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    
    ALAssetsGroup *groupForCell = self.groups[indexPath.section];
    CGImageRef posterImageRef = [groupForCell posterImage];
    UIImage *posterImage = [UIImage imageWithCGImage:posterImageRef];
    cell.imageView.image = posterImage;
    cell.textLabel.text = [groupForCell valueForProperty:ALAssetsGroupPropertyName];
    cell.detailTextLabel.text = [@(groupForCell.numberOfAssets) stringValue];
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 80.0f;
}



For the easy read, check the answer of the user ‘Obaid”: http://stackoverflow.com/questions/7189523/how-to-give-space-between-two-cells-in-tableview

In continuation of my story for the day, I, together with the two senior developers in the office, and our CTO, went a fancy restaurant. Of course the generous CTO paid for our dinner and drinks. Thank you very kind sir! I’m looking forward to more progress. Fin.

10th Day As An iOS Developer With No Experience


September 16, 2015 - 10th Day As An iOS Developer With No Experience.

Wednesday - Okay, so I just realised today that this kind of title “nth day as an iOS developer with no experience” should not be forever. You see, I already have an experience in iOS, for it is my 10th day today. Perhaps I will continue this count until my 365th day comes.

Anyway, one of the things that I have learned today was about the importance of the story board. I have modified and improved the graphical user interface of my project today. Such as the colours and names of the tabs and its tab controller, the navigation bar, and the navigation status. Their colours and their visibilities, and behaviours. Also, the very thing that ate my time in my work was the cells in my app. 

Cells are like table, a table with 1 column. I am using prototype cells for my gallery view. I can’t figured out or rather I can’t make my cells have spaces after one of them. I have been searching for solutions online. I can’t do subclassing UITableViewCell for now, for I am using, just like what I’ve mentioned before, a storyboard. I’m quite satisfied with my ui for the album/gallery viewer, but I really need to make it better.

Tomorrow I am planning to have an OT, yeah as usual. Just for me to learn more things while working. My OTs are not paid by the way. :) An overtime will only be paid if and only if approved by the bosses. I am quite busy this week and my deadline is near, September 25 is the freakin day, so I’m just gonna cut this post here and continue my work.