OK, actually, my title is a bit misleading. I just started learning Swift four months ago, and before that, I had little experience with programming. I had never developed native apps on any platform. Now that I think about it, I probably had no idea what I was doing. In order for everyone to understand "how" I do this, I must first explain clearly "why" I do this. Back in time I've always loved playing with computers. When I was about 8, my dad bought me a computer and I was hooked. It was a crappy computer running DOS and had a crappy CRT screen, but I could do whatever I wanted with it. It was so cool! Of course, I played games, but it also made me fall in love with everything computer-related. I gradually learned how computers worked, clicked everything I could in each program, and became what my friends called a "tech savvy." Fast forward to 1999. In 1999, we were using 56K dial-up and ADSL connections. When the Internet started to take off in Hungary, I still had a passion for computers. Almost every afternoon, you could find me in the school computer room, browsing Geocities. It was a great time, everyone was building websites and putting a little thing called "dancing baby animgif" on them, and I wanted to be part of this trend.
I started learning HTML and created my first website. Since it was 1999, I aptly named it "Zolee Site Millenium". My website was hosted on the school's server and could only be accessed through a Frankensteinian URL like this one: www.kkt.piar.school.gov.hu/~hosszu2 (note the nice wavy line). But I was part of the Internet, and I felt like I had conquered a new corner of the Word Wide Web. It was awesome. For the next few years, I continued to play games. I loved Counter-Strike. It was a huge game at the time, so I always had the opportunity to build websites for my team. I loved designing and building pages, but after a while, I started to focus on visual effects and usability. I continued to learn about graphics and user experience, and I also experienced the first wave of web development. Today, I work as a full-time UI designer in a Hungarian agency. I have no experience with the popular Node, Angular or Bootstrap frameworks. But it’s not a big deal for me. However, I still have some personal design projects, so I am still keeping an eye on the trends in HTML, CSS, and JavaScript. The creative source of GAget In 2011, my website had a huge opportunity. My web design was featured on DevianArt. I checked for new users every day, and I was excited when I found more. But I was also really unhappy. I wasn't unhappy about the amount of visitor data, but I was unhappy that there was no easy way to get it. I had two choices. Either I continued to fight Google Analytics, or I had to find a simple app to do it for me. I thought this was the purpose of OS X Dashboard widgets, so I started thinking about making one. But there were only two ready-made solutions, one was too simple and the other did not have enough data. So, as a designer, I came up with the best design I could think of and put it on Dribbble. I got some likes from people, which motivated me to keep going. I realized that widgets are mostly written in HTML and JavaScript, so I started to think more seriously about developing this stuff. I mean, these are the two languages I’m most familiar with, right? Within a few days, I had a prototype of the product on Dashboard. I named it GAget [pronounced the same as gadget] - it's an abbreviation of Google, Analytics and widget. It's a bit silly, but it's better than nothing. Two weeks later, in August 2011, I released the widget. After a while, I stopped updating the bookmarklet that recommended GAget... I was a bit surprised by the amount of feedback I got: MacStories, SwissMiss, and countless blogs recommended GAget. I was even mentioned in the Hungarian Computer World magazine. I had to give it my all! ###What to do next? Today, the widget has over 84,000 downloads and is used by tens of thousands of people every week. I even developed an iPhone version of GAget with a friend. So when Apple released the Yosemite update and announced that it would no longer support Dashcode, the future of GAget became uncertain. However, a blessing in disguise: Apple has opened the Notification Center to developers, and the Notification Center can display widgets. Good! Support! Awesome! There is hope! Maybe the success story of my little widget can continue! Pictures of the new design I posted on Instagram I started reading the official documentation about Today Extensions (Apple's name for widgets). However, it was all localized Objective-C code. What the hell! Compilers, memory leaks, multi-threaded processes... I don't want to do this at all. For someone who has never done this, these words are completely incomprehensible. But I made a decision that GAget must become a localized widget! The problem is, I don't even know where to start. Objective-C entanglement I bought a book about iPhone development with Objective-C but gave up after reading a few pages. To be honest, Objective-C is too difficult for someone who only knows a little bit of front-end language and PHP. Take a look at the following code:
What the hell are interface and property? What do the @ and * mean here? Well, the only thing I can understand is end! Thank you!
A faster way to program The tutorials in that book were completely inaccessible to me. After struggling for several months, localized widgets were still a mirage. Then I suddenly remembered that when Yosemite was released, Apple also introduced a new programming language called Swift. Swift was brand new to everyone, so many experts were thinking about how to make a big news before they even touched it, criticizing it and admonishing everyone to learn Objective-C. All this aroused my curiosity: I downloaded it and read its documentation. It felt like a spring breeze. The code started to look familiar, like a sophisticated version of JavaScript! I got the hang of Xcode and started following the tutorials. My goal is to develop an OS X widget, but most tutorials focus on the Swift language itself or iPhone app development, so "the road is long and arduous, and I will search up and down." I still have many questions that I haven't found answers to, such as: -How does a widget communicate with an application? (Core Data and app groups) -Can I use mouse hover interactions? (No) -How can I open only one row in a widget? (Autolayout, plus some manual height adjustments) The page about widgets in Apple's official documentation sent me to look for source code on GitHub and Stack Overflow, which took me countless hours to find the answer. I have collected some links that I found very useful. They may also be helpful if you are just starting to learn iOS or OS X development. I worked hard to find everything I needed, and I found that learning progressed faster than I expected: the Yosemite version of GAget began to take shape. Four months ago, I had no idea what MVC, multithreaded processes, app objects, view controllers, core data, etc. However, after spending countless nights with tutorials and Stack Overflow, I learned the basics of Swift and OS X development. Thanks to the 800 "strong men" who participated in the test, with their help, the test was very successful. My first localized app, GAget, is now available for download in the App Store. What else did I learn besides a new programming language? I found the amount of time I spent developing personal projects before Swift to be horrible. In personal projects, you can do what you want without having to worry about your boss or clients. You can add or remove features at will and work at your own pace. Deadlines However, I've found that giving yourself a deadline is a great way to motivate yourself. Every New Year's Eve, my wife and I sit down and write a list of things we want to accomplish in the coming year. This time I listed that I wanted to release a new version of GAget by the end of January: that was my deadline. Although I ended up missing the deadline by a month (due to Apple’s review process and a few other projects), I worked my butt off throughout January to accomplish this goal. Having something to do written down on paper was definitely a strong motivator. Learning cycle I also discovered that there are three stages in learning something new: the passion stage, the hesitation stage, and the solution stage.
1. Passion stage: It is always at this stage at the beginning. You have a new idea and start to learn new things. Everything seems good and you start to imagine what to do next. You are very motivated and your work is what you are familiar with and good at. But no matter what, you will always find that there is a bottleneck in your knowledge. 2. The hesitation stage: When you encounter the first practical problem, your passion and motivation begin to fade. You will feel helpless and at a loss. You may even feel desperate and go crazy searching Google for an answer. 3. Solution Phase: Finally! You finally found the answer to that annoying problem. You find yourself improving at a faster rate and regaining your passion and motivation. You return to the first phase. So, when the next cycle begins, you have to remember: the hesitation stage may be long and difficult, but one day you will ride the boat and reach the other side. And the process of finding the other side itself is the fun of life. |
<<: Are you still using Python 2? You’re about to be eliminated!
>>: Experts among the people: Cortana ported to the Android platform
On January 15, the first lecture of the new year ...
Xigua Video is an app owned by ByteDance. During ...
Over the years, you must have used more than one ...
The blue sky above our heads is not only a playgr...
Those preparing for CET-8, those preparing for po...
According to industry insiders, mini programs wil...
The elephants that once ran blindly have gradually...
From exploiting human nature to capturing people...
When it comes to business notebooks, every manufa...
Recently, the TV series "South to North"...
Some developers have found that in the new versio...
Review expert: Zhou Hongzhi, senior laboratory te...
Training course video content introduction: Easil...
At about 6:30 on June 4, 2023, the return capsule...
So far this year, three consumer product entrepre...