50th Day As An iOS Developer With No Experience

November 9, 2015 - 50th Day As A iOS Developer With No Experience Before

MONDAY - Alright! Another day today. I am typing this blog entry on my laptop - windows Acer Laptop. This baby used to be my gaming laptop before, before I entered the company as an iOS Dev. It has a 15.6" screen, I have finished playing Batman Asylum, Batman Arkham City, and etc... Dota2? I could barely play Dota2 on that laptop. Anyways, using this laptop after training my brain to adapt to Mac, it's hard you know. Grrr, I can't take this any longer. I'm going to cut this post for now, and will continue typing this post tomorrow - using macbook!

Okay, so I'm back now, and I am using my macbook again. We bought (my partner and I) the windows laptop I was using yesterday, well I guess I will just give that to my mom. I'm planning to buy my own macbook pro as soon as we finish paying our own house. Yay!

So going to my experience yesterday, experience related to iOS, I learned that when using this library (ALAssetsLibrary+CustomPhotoAlbum), you should instantiate it in your viewDidLoad. Ughhh!!! That's all folks! :) I'll make many tutorials this coming Christmas break! Stay tuned!

How To Make A Custom Album in iOS Programmatically

Today, I'm going to give you out an example: how to make a custom album in iOS Programmatically using objective-c. It's pretty easy, you can copy-paste this code below inside your button's selector or method, or even in ViewDidLoad of your viewcontroller.


    ALAssetsLibrary* libraryFolder = [[ALAssetsLibrary alloc] init];

    [libraryFolder addAssetsGroupAlbumWithName:@"My Album" resultBlock:^(ALAssetsGroup *group)

    {

        NSLog(@"Adding Folder:'My Album', success: %s", group.editable ? "Success" : "Already created: Not Success");

    } failureBlock:^(NSError *error)

    {

        NSLog(@"Error: Adding on Folder");

    }];



Pretty easy, right? If you find it helpful, please subscribe. Cheers!

Saving Your Video And Photo Assets To A Custom Album iOS

Hello, welcome to my 2nd tutorial. How to save your video and photo assets to a custom album in iOS using Objective-C. If you are following my blogs, you already know that I am blogging everyday about my work, my projects, basically my adventure in iOS Software Development.

So let's begin this tutorial. During the making of my main project, I learned by myself how to save an asset to a custom album. By default, taking a video and photo using the iOS ImagePicker Camera Source will let you automatically save your asset to Camera Roll. Without anymore further ado, let's begin.

I am using the ALAssetsLibrary+CustomPhotoAlbum library by Martin Todorov. See the library's GitHub Repository by clicking the link. I tried my best to study the library (well, I didn't really study it, just did trial and error), and after few hours, I finally got to save my assets to my custom album!

Ohhh, I'm afraid this is not the tutorial you are looking for, I'm just going to show you what Martin Todorov has written in his Github repository. In order to use this library, you will need to catch or get the url of your capture Video or Photo. It's pretty easy you know, once you get yourself familiar with objective-c.

Here we go, here are the instructions and codes to save your assets:

SAVING PHOTO ASSET:

To save your image, call this method:

- (void)saveImage:(UIImage *)image
          toAlbum:(NSString *)albumName
       completion:(ALAssetsLibraryWriteImageCompletionBlock)completion
          failure:(ALAssetsLibraryAccessFailureBlock)failure;

Parameters of saveImage Method:
//   |videoUrl|: The target video to be saved
//  |albumName|: Custom album name
// |completion|: Block to be executed when succeed to write the image data
//               to the assets library (camera roll)
//    |failure|: Block to be executed when failed to add the asset to the
//               custom photo album



SAVING VIDEO ASSET:

Call this method to save your video.

- (void)saveVideo:(NSURL *)videoUrl
          toAlbum:(NSString *)albumName
       completion:(ALAssetsLibraryWriteImageCompletionBlock)completion
          failure:(ALAssetsLibraryAccessFailureBlock)failure;

Parameters of saveVideo Method:
//   |videoUrl|: The target video to be saved
//  |albumName|: Custom album name
// |completion|: Block to be executed when succeed to write the image data
//               to the assets library (camera roll)
//    |failure|: Block to be executed when failed to add the asset to the
//               custom photo album

Look, I just found out that this super cool, awesome library has also the power to save METADATA to your image asset! WOW!


WRITING THE IMAGE ASSET TO ASSETS LIBRARY (CAMERA ROLL) WITH META DATA:

Call this method to save your image with meta data.

- (void)saveImageData:(NSData *)imageData
              toAlbum:(NSString *)albumName
             metadata:(NSDictionary *)metadata
           completion:(ALAssetsLibraryWriteImageCompletionBlock)completion
              failure:(ALAssetsLibraryAccessFailureBlock)failure;

Parameters of saveVideo Method:
//  |imageData|: The image data to be saved
//  |albumName|: Custom album name
//   |metadata|: Meta data for image
// |completion|: Block to be executed when succeed to write the image data
//    |failure|: block to be executed when failed to add the asset to the custom photo album

UPDATE: I learned that you need to initiate/instantiate this library before you can use it.

16th Day As An iOS Developer With No Experience



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

Thursday - I had a talk with Ms. K, one of our Q.A in the office. She told me that our senior Ms. R. stayed at the company, stayed beside kind sir CTO years before the company became stable. She stayed here during the rough times, and now the company earns so much now. So much projects.

Anyway, what I have learned today (actually I learned this last night) is to use ImagePicker for video recording. And how to save it of course. Stay tune, subscribe, to check out my easy tutorials for newbies in the future. I just can't find some time to allocate for posting tutorials on this blog. How about when my company hires another iOS Developer? Okay, that will be a deal.

14th Day As An iOS Developer With No Experience

www.howtomakechocolatecake.org

September 22, 2015 - 14th Day As An iOS Developer With No Experience

What a nice day I had. First, another free cake after lunch (we had chocolate cake last night - 13th day). Second I successfully implemented the CLImage Editor functions to my project. Thank you yackle. Tackle is from the github, the author of such amazing open source app. Third, I learned today how to save UIImage object (yes, again, this time I really know how) to a custom album I prefer, not only that, thanks to my senior, let’s name her as Kind Ma’am R. She taught me or rather gave me an idea how to implement the functions of that open source project. Like how to get the method of the cancel button in the CameraSourceType. Woo!

Alright, I will stop counting. Next thing that I have learned today is how to add an ‘ADD [+]’ button to the navigation bar. I’m implementing an add button for my gallery viewer. To add new album, you know. Programmatically, yes, no brainer actually. Another one is showing an alert view with input.

Above all these good news, I like the fact that I successfully implemented the CLImage Editor to the project. Next time, I will try to make a post that will enumerate the open source camera app that I have tried, rate and review them.