Day 16 at Mobile Makers (NSNotification Center)

Today was the last day of official classes with the structured schedule we have been following. Next week we will get an assignment to build an app that is already in the app store and we only have until Thursday to finish it. It should be a blast, working every second possible to get the project done. The point of doing that is to show us and get accustomed to a client coming to us with a big project with a deadline. After that, we break up into groups for the big final project for the last three weeks. Vik, Aaron and myself are teaming up on the final project and we are doing something we think is really cool. We are going to code our final project in both Objective-C and Swift. I am really excited to dive into Swift more while continuing to expand my knowledge of Objective-C.

We had our group photo today and after that, mostly everyone left for the day. It ended up being only Vik and I at Mobile Makers so we decided to do a project together, to hopefully submit to the app store. We decided to do a project called “SeeNote.” The concept is that the user can take a photo anywhere they are and then write text associated with it. Then they can view all their photos and texts together in a tableView with the date they took it and a tag associated with it. Then they will also be able to view where the photo was taken on a map as well as seeing where all their photos on a map are. We got a really good start on it last night and I ended up working on it at Mobile Makers until 1am. It was a long 17 hour day but very productive and our app is looking great so far. The cool thing about our app is that it isn’t using a backend server like Parse, we are using core data to store everything and this is giving us great practice with core data, since it was such a hard topic from this past week. I am going to spend the weekend working on SeeNote while reviewing earlier concepts and diving into Swift a little bit.

The code below is awesome…

– (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGRect frame = self.floatingView.frame;
frame.origin.y = scrollView.frame.origin.y +440;
self.floatingView.frame = frame;

[self.view bringSubviewToFront:self.floatingView];
}

– I wrote it and it allows a “floating” button to be on a table view and it scrolls with the table view at the botton so it never disappears.

-Blake

Day 15 at Mobile Makers (Core Data, Relationships(code related))

Today I learned a lot but some things that really stuck are that viewDidLoad only gets called once. So if you go to another view controller and come back to the original one, then viewDidLoad will not be called. So then if you need to reload data or anything else back in the original view controller, you need to put those methods in the viewWillAppear. ViewWillAppear gets called each time the view “appears.”

self.items = [[self.managedObjectContext executeFetchRequest:request error:nil] mutableCopy];

The code above is really cool because it makes a mutableCopy of the array returned and sets it as self.items. This allows us to go from a NSArray to a NSMutableArray because originally, fetch request returns an array.

Don showed us this super awesome thing…

cell.detailTextLabel.text = @(adventurer.raid.count).description;

In the code above, the super awesome thing is in the (). Basically this expression that starts with @(code here). This expression allows us to turn anything into an object and call a description method on it. So you can turn a integer into a NSNumber or whatever else you like.

Today was really challenging for everyone, from simple mistakes with naming to anything else you can think of, we all struggled. I barely made it to the second step out of six from the MVP and that was right in line with half the class and the other half didn’t even make it that far.

I’m trying to picture how core data ties into using backend databases like Parse. I am thinking that we can save images we get sent on our own device so that we can still view them offline and then we get new images and items from the Parse backend or whatever else when we are online by using things such as pull to refresh etc…

“It’s not about what you know, it’s about what you know you can do”

-Blake

Day 14 at Mobile Makers (Core Data, NSFetchRequest, NSManagedObjects

Persistence is preserving data from one application load to the next time it is loaded, a way to save data offline and this is also how our topic today, core data, ties into everything. Core data is a way to save data each time the user uses the app so that the next time they open it, that same data is still there. The key thing to remember with this is to check the core data box when making your new project in the master template. Then you can make a new entity and with this entity you can give it attributes with specific types like string or int. Then you can reference these attributes because they are key/value pairs.

This week is really challenging and my mind is on overload with the announcement of swift as well. I have dived into swift some already and once I become a little more familiar with it, I think I am going to love it. Some of the main things I noticed are that you don’t have to specify variable types, which is really neat. Also, everything you type shows up on the right side so you can see what is happening as you are typing.

Don showed me a neat trick today using animations. The code is below and then I will explain it.

– (IBAction)onTextFieldTapped:(id)sender

{

[UIViewanimateWithDuration:0.5

delay:1.0

options: UIViewAnimationCurveEaseIn

animations:^{

self.containingView.center = CGPointMake(self.containingView.center.x, (self.containingView.center.y -50);

//way to set this to the center of the view?

}

completion:^(BOOL finished){

}];

}

This code above is an action that is tied into each textField on a view controller. All these textFields are in their own view, separate from the main view. Every time a textField is exited, the code above runs and after a 1 second delay, it moves the view as a whole down the y axis by 50 pixels. This is pretty cool because as the user moves down from a textField to the next, the whole view moves up with it and this ensure that the keyboard is never covering any of the textfields.

Kevin gave a really awesome github tutorial today and it cleared a lot of things up for me. He showed us a example of two people working on a project and showed us how to do a project from start to near completion. He showed us best practices to ensure that we did not run into merge errors as well. I will go more in depth on his tutorial in a future blog post after working with it more. Next week we form groups and that will be our first chance to really dig into using push and pull requests along other developers and seeing how the whole process works.

-Blake

Day 13 at Mobile Makers (Persistence, NSUserDefaults)

Today was a huge day not only for us at Mobile Makers but all developers. Apple announced at the WWDC that iOS 8 would be out in the fall and that they have a new programming language to use to build iphone apps called Swift. At first this really made me nervous that I am learning Objective-C now and then in the fall Swift will be introduced but the more I thought about it, the more excited I got. It is going to be a great opportunity for me to be on the same level as all other developers. No one is going to have 20 years of experience on me with Swift because we are all going to be new to it at the same time. I have already downloaded the 500 page Swift iBook and am going to read it daily. I couldn’t be more excited. Aside from that, Apple introduced some truly amazing features like continuity across all iOS devices and it should be an amazing experience when they are officially released.

I was the “driver” today in class. Meaning, that I was in charge of typing everything the instructor said. Kevin was our instructor today for the first time as Max is in SF for the WWDC. Kevin did a great job and I learned a lot of cool tricks like when initializing an array I can do NSMutableArray *array = [NSMutableArray array]; instead of the whole alloc]init]; It’s little short cuts like this that are going to save me a lot of time in the future.

We did data persistence today and I am still trying to wrap my head around it. It is basically a way to store data when the iphone is offline. I am going to need more time to work with it and really see how it works. For now, I am going to go code more and start reading some about Swift.

-Blake