July 4, 2016, when iPic hit the Mac App Store, was an easy date to remember: Independence Day, but I forgot. A few days ago, a bank debit message reminded me. At first, I felt strange: I haven’t bought software on MAS recently. Later a check just know: here iPic advanced version of the second year deduction SMS.

Git history shows that the iPic project was established on May 19, 2016. In fact, because so much time has passed and I can’t remember every bit of iPic along the way, it’s hard to summarize it as systematically as Klib. Here are some key points to recall, or what I find interesting, to share with you.

It’s a long article, and I don’t know if you’ll need a few minutes to read it; If you don’t like reading long articles, you can turn it off now and find something that interests you more.

————- long article begins the cordon —————-

IPic brings me pride

I’m most proud of iPic for creating the macOS bed tool category. Before iPic, you couldn’t find a similar tool in macOS, but after iPic, there were a succession of apps, including Windows versions. There was a time when you could search for “iPic” in the Mac App Store, and there were several similar products. Using “iPic” as a search term was their way of paying homage to me. But now it’s gone, because I reported it to Apple, and apple emailed them lawyers, and they took it out.

If you find a better mapping tool on macOS than iPic, let me know.

Swift’s embarrassment

Swift was released in mid-2014 and iPic was launched in early 2016. It’s been over a year, but it’s still too short for a programming language. The main problem: immaturity, resulting in very limited vendor support for Swift. For example, iPic needs to integrate the interfaces provided by each map bed. For some more mature languages, such as JavaScript, Python, and so on, manufacturers can directly provide SDK, just need to call a simple interface, you can realize the operation of image uploading.

For such a young language as Swift, there is no SDK for sure, which requires me to integrate THE REST API of each service provider one by one, which is quite tedious. Much of that time was spent implementing OAuth. However, the good news is that OAuth is a relatively standard thing, and the implementations are roughly the same, with more support for several graph beds and more reusable code.

In addition, there are advantages to doing something that is relatively low-level compared to the SDK. For example, more understanding of OAuth; When designing the Klib back-end interface, you can also refer to this industry-level REST API design specification. And so on.

In fact, there will be a lot of interesting discoveries in this process, for example, Ali Cloud’s OSS interface is basically copied Amazon S3, even the parameter name is the same. Amazon S3 is really enterprise-level, the permissions system is very complicated and difficult for ordinary people to figure out, while ali Cloud is more friendly for small and medium users. Of course, there’s nothing wrong with just copying the interface, but it’s always a little less flattering: don’t copy some of the bad designs in S3 😂

During this period, I also experienced Swift 2.2 > 3.0 upgrade. I feel that most of the changes are in the syntax level, and even in the variable names. Personally, I’m willing to give Swift a little more consideration: it’s a hassle, but it’s better than inaction.

BTW, all my products are Swift pure: Klib, iPic, iPic Mover, iPaste, iTimer, iHosts

I don’t want to add an extra option

First, make fun of the interface of the seven cows.

In the beginning, Qiniu only had several regions (north China and East China, I forgot), and each region had a different picture uploading address. Later, Seven Cattle added new areas, and each area has a new upload address. The key problem is that the Bucket name cannot be repeated in each region, but Seven Cows does not provide an interface to query the region based on the Bucket name. This means that in iPic’s graph bed configuration, the user needs to specify an additional location for the Bucket. It seems to me rather silly. I believe that many users do not remember the location of the Bucket after the result is created, which makes it extra difficult to configure the graph bed.

I really didn’t want to add this setting, so I actually did it this way: the user didn’t need to specify the locale, iPic automatically tried all the locale. If other information about the graph bed, such as Key, is correct, the correct locale can be found. The only problem with this scheme was that iPic would have to try one more area once Seven Cows opened another. At the very least, iPic needs to get a list of all seven cow regions from the server side, a little more maintenance work. However, it is worth it to reduce one setup item on the interface.

In fact, not only qiniu, other chart beds also have similar problems. Better, though. For example, if Amazon S3 chooses the wrong region to upload, the result will contain the correct region.

After that, the configuration interfaces of Qiniu, Youpai, Ali Cloud OSS and Amazon S3 are exactly the same, which reduces the user cost and also makes me very satisfied.

Open image upload capability for iPicUploader

One of the more important scenarios in iPic is to insert images when writing articles using Markdown. Wouldn’t it be better to use the Markdown editor instead of using iPic as an extra App? In fact, though, only a few Markdown editors support graph bed functionality (like the MWeb I’m using), and most do not.

As it happens, the author of Typora contacted me, hoping to integrate with iPic, which hit it off.

So I took a good look at how apps communicate with each other within the Limitations of the macOS sandbox. In the end, I chose the “private Clipboard” option (a name I chose myself) to safely launch the Mac App Store without interfering with a user’s generic clipboard. In fact, they praised this approach when I introduced Bear (yes, the popular Markdown editor Bear of the past few days). Unfortunately, they don’t have access to iPic…

Specific steps:

  • Typora integrates iPicUploader, an open source iPic upload assistant
  • Markdown editors such as Typora, when the user uploads an image by drag-and-drop, etc., read the image information, write it to the “private clipboard”, and wait for the result to return
    • Note: The reason why Typora reads the image information is because iPic is in sandbox mode. If the client only sends a file path, iPic has no permission to read it
    • In addition, iPicUploader can also detect whether iPic is installed, whether it is currently running and so on
  • When iPic is running, it monitors the contents of the private Clipboard. Once you find an image that needs to be uploaded, upload it and write the image address back to the private clipboard
  • Typora gets the upload result, the HTTP address of the image, and updates the image link in Markdown

In fact, from the client’s point of view, the process is much simpler than described above: just integrate iPicUploader into your project and call it through an interface:

let imageFilePath = "/Path/to/the/pic.jpg"

iPic.uploadImage(imageFilePath, handler: { (imageLink, error) in    
    if let imageLink = imageLink {
        // Image uploaded        

    } else if let error = error {
        // Some error happened}})Copy the code

Of course, I’m not doing this out of pure love for the open source world. I’m doing it out of selfishness: gold diggers. For example, a product of Bear’s level that integrates iPic is great for iPic. Unfortunately, most of the invitations were not feedback, the final product only Typora…

IPic Mover at Independence Hill

In addition to cooperating with Markdown editor, I also developed iPic Mover separately. The core function is to upload pictures in Markdown (including local or network pictures) to the new map bed through iPic and replace the picture addresses in Markdown.

Main usage scenarios:

  • Move the whole picture in the blog to the new picture bed
  • After editing the article with the Markdown editor, upload local images with one click

In fact, this function can be part of the iPic. In this way, at least the design Logo, operation and promotion of iPic Mover App alone can be saved. Still, I don’t want to complicate the iPic body with this niche feature. After all, most iPic users don’t need this feature. I don’t feel comfortable seeing this feature every day when I don’t need it.

No login is required to upload pictures to Weibo

IPic uploads pictures to weibo chart bed by default, and no login is required. Why do you have to do this without logging in? Mainly for “out of the box” effect. Imagine an international friend who, after downloading iPic, still needs to register a Weibo account to use it. The registration interface is ugly and hasn’t been updated for years.

In fact, iPic is a bit complicated to implement out of the box: that is, once installed, you can upload pictures to Weibo. However, strictly speaking, the use of weibo as a map bed itself is indeed morally indefensible, how to say it is suspected of abuse of weibo resources. For this reason, I will not go into details in the article, and you should not ask me in private letters, I will not answer. However, I feel better when I think about the weibo ads I often see, including App launch ads and women’s menstrual products.

IPic payment mode

The payment mode of iPic is:

  • The default map bed is free, and all iPic features are free
  • Custom chart bed charging, chart bed includes: qiniuyun, Youbaiyun, Ali Cloud OSS, Imgur, Flickr, Amazon S3 6 models, including the current mainstream chart bed, the charging mode is ï¿¥58 per year

In fact, the default weibo map bed is pretty good: free, unlimited data, CDN acceleration, stable and reliable, HTTPS support, etc. The main limitations are:

  • PNG format is not supported
  • The image will be visually compressed lossy
  • Unable to delete an uploaded picture
  • Unable to view or manage all your uploaded images
  • After all, relying on third-party services is risky, such as the collapse of Sina

On the other hand, if you can’t accept the limitations mentioned above, you can use a more flexible custom graph bed. For example, I myself use seven niu Tu bed. At first, qiniu offered a certain amount of free traffic, but later it was discovered that it was a trap: the free traffic did not support HTTPS, and my blog and product front page already fully support HTTPS. Although I only paid a small amount of data to Qiniu every month, I felt cheated. Had known so, I chose Ali Cloud OSS.

Here’s another catch: bucket custom field names are not supported. You might say: Yes? But in fact, only “converged cloud” is supported. However, CDN does have cache problems after all. For example, when I was doing Klib sharing, I did not want to cause great cache problems due to the speed increase (which would bring business problems, please refer to my introduction at that time). Finally, I used Ali Cloud OSS that supports self-defined domain names. For example, when you visit s.klib.me/share.html, you are actually accessing a file in Ali Cloud OSS.

About subscription Models

Subscriptions are still not accepted. Think about a year ago, subscriptions were even more resistant; But I still stick to being a crab eater. On the one hand, I want to try. On the other hand, I feel that subscription is developer-friendly, and therefore ecologically friendly. Imagine if developers couldn’t keep up, there would be no good software. The Windows ecosystem is a good example. I hear from time to time about developers giving up or not developing Windows apps for a big reason: rampant piracy. Many people take it for granted that Windows operating system charges are abnormal. OK, I can’t afford to make trouble, but I can afford to hide. Ultimately, the users themselves will suffer: there is no good software available.

One detail about Apple’s subscription system I’d like to share with you. For the first year of the subscription, Apple will take 30%, which means that out of the 58 you pay, I only get 58 * 0.7 = 40.6. 17.4 is plucked by Apple. In the second year and beyond, Apple’s cut is reduced to 15%, which means I get 8.7 yuan more. Not much, but mosquito legs are meat. More importantly, Apple’s support for developers and users’ affirmation of me.

Is one-year software expensive? Expensive, especially in the domestic software environment, is definitely expensive. Still, there are people willing to buy. I believe that people who buy are not fools, but smart choices that are well-balanced. One year is negligible in terms of the time saved by using iPic. Using money to buy efficiency is not the habit of all people, but the habit of highly effective people.

I was very happy to meet a group of efficient people through iPic. They recognized my efforts, my understanding of the product and the help iPic brought to them. They were willing to support me to continue with payment and put forward suggestions for improvement through wechat groups and emails. Thank you for your support.

About the future of iPic

In fact, as I’ve already mentioned in Klib, for a typical tool-based application like iPic, the ceiling is obvious: once the functionality is implemented, there’s little room for further imagination. This is the main reason WHY I didn’t update iPic for a long time because I didn’t know what was the right thing to do.

For example, some users mentioned support for other markup language formats, such as reST, in addition to Markdown. Such a demand must be justified. The problem is, it’s relatively niche. Listing both Markdown and reST in the list is a distraction for most users who only use Markdown because they probably don’t even know what reST is. Of course, you can configure in custom link formats. This makes sense, but adds to the difficulty of understanding the product.

For this kind of requirement, I have a hard time deciding whether to add. Do not add, will certainly lose part of the user; Add, can cause certain trouble to already user again. I’d rather not do anything for a while until I figure it out.

Of course, that doesn’t mean iPic won’t be updated. Like iPaste, which hasn’t been updated for a long time, this month will see a major update: support for Pin grouping and management. Similarly, with the evolution of people’s demand for graphic beds, once I figure out a point, I will naturally follow up in time.

The tail

This is a long article and hopefully you will get a return on your time. Otherwise, I wouldn’t be embarrassed…


0711 – On the first anniversary of iPic, say something about this product that makes me proud