“Since childhood, we have heard our elders speak of idleness as if it were disgraceful. In fact, without our lazy people, I am afraid there would be no social progress. Without us lazy people, industrious people would face nothing but drudgery.” Here I introduce a sentence from the article “The wisdom of Laziness” I learned in primary school textbooks. I deeply believe that this sentence is the true portrayal of our programmer group. It is a little exaggerated to promote social progress, but it is necessary to improve production efficiency, which is also a little motivation for my record.

Why play with macOS when developing iOS? In the back of every iOS Developer’s mind is the urge to develop macOS. After all, the tools (MAC + Xcode) and the underlying technology (Objective-C, Swift) are already there. IOS apps need to be in the App store to be used, whereas MAC apps can even skip that step, making it much easier to spread around among friends.

Without further ado, today we talk about the latest development of macOS App Developer Blade App Store, Developer blade home page.

Features include:

  • Color palette (store color scheme)
  • Icon Generator (Generate iOS/macOS/Android multi-size icon files)
  • Image compression (TinyPng based)
  • Json to Model (JSON string to Swift model object)
  • Open source library set (Github open source library classification) and other functions
  • Supports automatic startup, global shortcut keys, automatic check and update, etc.

1. What was done from a technical point of view

1.1 Developed a macOS App

Swift4.2 is mainly used to write “Developer blade”, compared to OC, Swift’s advantages must be used by friends know.

The technical aspects of Developer’s Blade are as follows:

  • CocoaPodsManage third-party open source libraries
    • Alamofire Network framework
    • CocoaLumberjack/Swift logs
    • SnapKit automatic layout
    • Kingfisher network image loading cache
    • Fabric bug and user behavior analysis
    • LaunchAtLogin starts automatically upon startup
  • Global shortcut keys: mainly usedRegisterEventHotKeymethods
  • Python and Swift interaction: check out the previous articleMy first OSX app written in Xcode+ PythonKey words:Process
  • Local cache: no database is used. Local files are stored in JSON format. ObjectMapper library is used

For students who have no experience in MAC development, I recommend the “macOS Application Development Basics Tutorial”, getting started is completely no problem. Most of the techniques used in “Developer’s Blade” can be found in this book, and FROM having no experience in MAC App development to launching a complete App, I followed the contents of the book step by step, here I also thank the author.

1.2 Hit a server

The server built by Python’s Flask library has simple operation and comprehensive functions. IDE uses PyCharm.

Why use the word “smooth” here? There is no server-side development experience, in the netease cloud class to see a tutorial, operating the keyboard is dry. In the middle of the problem on Google, can not solve the direct around the past, so the final function is not perfect, nor system, but also barely enough to use. After all, I have limited energy and focus on improving functions, so systematic learning still has a long way to go.

The technical points of the server side are as follows:

  • PIP: Package management tool
    • Flask: A Web development microframework
    • SQLAlchemy: Database tool
    • Flask-migrate: database upgrade tool
  • HTTP requests, Web pages: Flask is easy to implement
  • Vue: Progressive JavaScript framework for quickly building Web pages

Half-baked are not server-side development, here is not to teach fish to swim, the basic function is probably as described above. Python Flask series (1) — Flask basics for Basic Learning. I feel that it is quite easy to understand and write a simple page is completely enough.

1.3 Cut several pictures

Graph can cut, aesthetic do not have to be serious.

As for the technology, there is no technology used (mainly I don’t know what technology exists, completely blinded), so here is a brief introduction of the tools used.

  • Sketch: Lightweight and easy to use vector design tool. Easy to use, easy to use, who knows.
  • Iconfont: vector icon management, communication platform. Free icon variety, can download the source file, also can specify the color, size download.
  • Tinypng: Intelligent lossy compression of pictures. “Developer blade” in the image compression function is the core of its services, compression rate is high, the compressed image almost invisible to the naked eye distortion.

2. Talk about why you want to make this App

As mentioned earlier, every iOSer has a MAC App in its heart, but to put it bluntly, every programmer has an urge to try new things in their heart.

Does address some of the pain points in development. The server throws a bunch of JSON to the client, and we get bored every time we build an object. Mechanically repeating code is a waste of our limited life and passion, so we came up with the idea of JSON to Model. The color value given by the design changed three times a day, and the background color and the basic font color were not uniform. They said, “This color is what I used before” and made me sad. After I designed a device, I forgot the color value, so I came up with the idea of color Plate. Github didn’t want to use star because there were so many of them that it was like looking for a needle in a haystack. So they came up with the idea of Open Source Library. To write an App by yourself, you have to go crazy by cutting images of various sizes and dragging them into the appropriate pits in Assets one by one. In short, there will always be some repetitive work during development, which can probably be handled by code.

Learning really makes people happy. When you first start to learn a new technology, the pleasure of acquiring knowledge is intense. Whether it is purely learning or simply wanting to show off your skills, learning something is always a very good result. Of course, there will be pain when digging deep technology, pain and happiness.

3. Make a brief summary

Technology:

  • MAC App development: Swift + Xcode
  • Web development: Python + PyCharm
  • Sketch: Iconfont + Sketch

Resources:

  • Developer blade home page
  • MacOS Application Development Basics tutorial
  • Python Flask Series (1) — Basics
  • iconfont
  • tinypng