Thursday, August 20, 2020

How To: Automation Export PNG in Inkscape V1.0

What's up? 



Been a while eh? Everyone is doing well avoiding Covid19 I see. To the fallen ones, RIP. Nobody lives forever. Those that goes on, keep up keeping up. 

Today I will be posting about how we can automate Inkscape export. I.. have...been.. doing... stupid... things.... for... 10 years. *SMACK HEAD*. Aw come on, everyone does stupid thing once in a while. Nobody is holy. What I mean, is for 10 years or more since I used Inkscape I have exported PNG for use in iOS apps this way:

Saturday, March 28, 2020

How To: Apply Steve Jobs Design Principle in Your Apps

Introduction

       Today, I want to write about a crucial topic in app development - software design. It is based on my own experience developing and designing softwares since 1990s. But let me indicate here that I do not have ANY computer subjects qualifications. I do not know a lot of computing terms, jargons, methodologies and I am not even well versed in deployment process, staging, unit tests, CID, blah blah yadda yadda. I was an Electrical & Electronics Engineering Major. But I have always find software development interesting and fun. To create something that people use and benefit from. But I think it is mostly due to the no-bullshit work environment. You cannot lie to your computer. And your computer cannot lie to you. If you input a = 1; There is no way in hell, your computer would say a = 2; Unless you told the computer to add a 1 to it. The honesty with coding, is satisfying.


Tuesday, December 31, 2019

Tutorial: Making a Platform Game Like Mario With SpriteKit (Part 1 - The Basics)

Another year is gone. I remember when I was a little boy, I'd be hyped when people talk about the "FUTURE". That time, circa 1980s, the "FUTURE" means anywhere in the year 2000+. The year 2020 is somewhat special though due to its nice number arrangement. 2020 itself sounds futuristic. But lo and behold, we are almost there now! 40 years have passed just like that. I have to admit when you reach 40, time seems to go by much more faster. It seems you have so much to do, but there isn't just enough time to do it. Get busy living, get busy dying.

20MHz Processor LMAO. 8 Grand 

Friday, August 30, 2019

How To: Use Cocoapods for Your XCode Projects

Hi guys. Been a while eh? As for me, been busy with updating my apps. I just updated one of my kids game Eggs Surprise With Friends. Improved on the graphics and gameplay based on user feedback back in 2016 HAHAH! First, an intro.


Human beings rely on blind beliefs to have a large-scale cooperation. We all believe in something that is not there physically. We believe in God (some of us not all of course). God is nowhere to be seen, cannot be measured, cannot be heard, cannot be touched. We believe in our country. Yet, a country is merely a make belief concept, and exists only in maps. We believe in the company we work in. But the company does not exist other than on papers. Our collective belief that the company exists, make us feel we belong to it, and therefore we can together work towards a common goal - be it increasing the company's profits for employees' benefits, or prospering a nation, or mass producing products. Belief in the unseen is important and needed for humanity, unless when it starts to oppress others.

How's that for an intro? :D

Wednesday, February 27, 2019

How To: Update Your old SpriteKit Game to be Compatible with iPhone X, XS, XR, XS Max

Yoooo wazaaaaapppppp...

Ok, first, a witty intro (again?).


We often hear people say do not disturb a developer or programmer. But often we do not understand why. It is not the same as disturbing someone who is doing a regular office job. When a programmer is coding, he is actually building a Millenium Falcon lego model in his head. All the parts are assembled in his head in groups. Once you disturb a programmer, all the groups that are built in his head (but not yet assembled), will crumble and he will have to start over from zero.

Take my advice: If you see programmer coding, DO NOT SAY ANYTHING TO HIM. DO NOT EVEN COME NEAR. 

Saturday, November 18, 2017

How To: Make an App That Uses Public API (Openweathermap.org) Using NSURLSession

I think I mentioned somewhere (and maybe everywhere) that I love JSON. I LOVE IT! JSON is basically like NSDictionary. Every entry has a key and a value. And you can go nesting too - like a dictionary of dictionary of dictionary. O_o

// this is a bird's nest

What we're going to make:
2.5MB GIF

JSON is structured and that is why many web service opts to this format for communication between a client and server. In the old days, or even now, some web service still use obscure format like user-defined text strings separated by pipes or commas (CSV). Something like:

Tuesday, November 7, 2017

More Contribution to XCode Community!

One of my friends asked me, you get a lot of revenue from writing tutorial blog? My answer is - NO. I get like 0.001 cents per day from my blog currently lol. My blog isn't famous like appcoda or raywenderlich. So why do I keep on doing it? Simple - I always view that anything I learn, is an inspiration that is meant to be shared to everyone. I do it because I love to share what I know. Often, I faced with a problem to do something in my own apps, and upon finding a solution I like to document it, because I am sure others might have the same problem or obstacle. By sharing what I found or created, we advance together.

Enough intro. Anyway this post is a short one. I just want to announce yet another contribution that I am making towards the XCode Community - MY FIRST EVER GITHUB REPO!!!! OMG! Sorry I am too excited for this.


First repo is a flexible Toolbar/Tabbar. I have added a list of my Github repo in the left bar for future reference. Well, that's about it for this blogpost. I am thinking to redo the Switchy object as a proper repo next. Stay tune. Or not. Whatever dude and dudette.

Ps. I forgot to put the link to my main GITHUB REPO: GENECODE GITHUB

Saturday, November 4, 2017

How To: Use Reusable Views Correctly (TableView, CollectionView, etc)

First, some short intro! :D My blog views has finally reached ONE MILLION!!!

Now if I get a dollar for a view. Phew! None the less, I am so happy with this view count- why? Because it means I helped quite many developers to create their apps (hopefully). And those apps will benefit mankind. Even if it's a fart app, hey, it cheers up people and that is good.

As noobs we tend to not getting the whole picture of a particular UI object. A label is simple, there is text property, you set it directly in Storyboard or programatically (label.text = @"hello";) and it shows immediately. Pretty straight forward. But for objects that uses Reusable Cells like TableView, there are multiple set ups that we need to do to use it properly and therefore prevent any weird and unwanted bugs and crashes. Anyway here's what we're gonna end up with at the end of the tutorial:


It's a 2.4MB GIF.


What does Reusable Views mean? 

It is basically a concept/method to display big amount of data in a scrollable area. In case of TableView,  the amount of cells being created by TableView is only a small quantity that is enough to fit the visible area of TableView.

For example, if you have TableView of height 300, and each cells height is 10, then at least 31 cells are created at runtime. And when you scroll down the table, the cell that is being pushed out of view

Thursday, September 7, 2017

Can you use Deprecated Functions?

Hey guys, I am making a few tutorials but all are in progress right now. Hope to publish them this weekend. Anyways, as a frequent StackOverflow visitor, I often read programmers wanting to change the functions they used that are deprecated. From their postings, I get that many programmers think that deprecated means "cut off" and therefore cannot be used indefinitely. This is, false.

Let us take a look at the meaning of the word first.


Basically, it means disapproved (or in layman terms, not advised to be used). It is not the same as totally cannot be used in which case the word is BANNED. Deprecated is not banned. It is only advisable not to use the function. BUT YOU CAN STILL USE IT.

In iOS developer terms, you can surely use a deprecated function, but you must start thinking/planning/coding of the new function to replace it in 4-5 years time. Deprecated functions normally are supported for a long time before they are removed. This is because often, Apple creates new and better frameworks for a thing. But there will be many apps that rely on that framework that are already in the App Store. So to immediately ban a function, is an act of oppression.

For example, NSURLConnection. It was introduced in iOS2.0. It's successor, the NSURLSession was introduced in iOS7.0. So since iOS7.0, NSURLConnection is therefore flagged as deprecated. But can you still use it in iOS10? YES IT STILL WORKS. In iOS11? Nobody knows (except the beta users right now). Given 3 versions of iOS has passed, you oughta change it by now.

But if it was *just* deprecated in iOS9 for example, no sweat because that function will definitely be available even in iOS11. So if you're doing a quick update of your apps, very old functions that are deprecated (like the ones intro'd in iOS2.0), should be replaced. But if the deprecation appear in iOS8 or 9, you're likely safe to leave it as it is for now.

Hope this post has been beneficial. Happy coding!


Saturday, July 8, 2017

How to: Basic of XCode Methods & Functions in Objective-C

Why ObjC?

Cause we're oldskool! :D


INTRODUCTION

When we start to code, what we need to do is write methods on top of the already available delegates (namely the View Lifecycles delegates like viewDidLoad or viewDidLayoutSubviews). A typical method that we quickly create is IBActions. These are automatically created when you drag an outlet in Storyboard to your header file.


-(IBAction)aButtonWasClicked:(id)sender {
  // your button was clicked by user
}

The aButtonWasClicked: is the name of the method. Note that I include the semicolon at the end. This indicates there is a parameter to be supplied to the method. So if you want to call this method elsewhere programatically, you need to write: