携程玩乐事业部怎么样_我创建了一个WatchOS应用,这是我在玩乐中学到的

携程玩乐事业部怎么样

Let me start by saying that the app world is already saturated with millions of apps that can do whatever you can imagine. So why then, would I decide to write an app for the App Store?

首先,我要说的是,应用程序世界已经充满了数百万个可以完成您想像的应用程序。 那么,为什么要决定为App Store编写应用程序呢?

Quarantine and some personal curiosity! This might sound opportunistic, but I needed a nice hobby to keep me busy during the last few months of quarantine, mostly because by this point I had already created paintings for every wall in my house and built every puzzle I had. As a middleware developer by profession, User Interfaces and apps are far away from my daily dose of code, so for me writing an app was the equivalent to ‘having some fun’, and I must say after completing my little project, I did have fun!

隔离和一些个人好奇心! 这听起来可能是机会主义的,但是我需要一个很好的嗜好,以使我在隔离的最后几个月中保持忙碌,这主要是因为到那时为止,我已经为房屋中的每堵墙都创作了绘画,并建立了自己遇到的每个难题。 作为专业的中间件开发人员,用户界面和应用程序与我每天的代码工作相去甚远,因此对我而言,编写应用程序相当于“玩得开心”,我必须说,在完成我的小项目之后,我确实好玩!

Let me explain some of the things I ran into, some of the challenges that I faced, and intentionally avoid code snippets. To assist me I’ll use the maxim of my old mentor that still resonates with me, being, ‘There are things you want to do, and things you have to do’. It sucks to be reminded of this all the time, but when writing any kind of tool/system/application, you need to be cognizant of this maxim.

让我解释一下我遇到的一些事情,遇到的一些挑战,并有意避免使用代码片段。 为了帮助我,我将使用仍然与我共鸣的老导师的格言,即“有些事情要做,而有些事情要做”。 一直让人想起这很糟,但是在编写任何类型的工具/系统/应用程序时,您需要意识到这一准则。

灵感的背景 (The background to inspiration)

I started thinking about building a watchOS app when I got my own Apple Watch in December last year. I immediately fell in love with the design and the ability to break away from the iPhone, partly due to my inclination towards minimalism and partly due to my love of tech. (These two things I understand are juxtaposed, but what would minimalism be without excess).

去年12月获得自己的Apple Watch时,我开始考虑构建watchOS应用程序。 我立即爱上了设计和脱离iPhone的能力,部分原因是我对极简主义的偏爱,部分原因是我对技术的热爱。 (我理解的这两件事并列,但是没有多余的极简主义是什么)。

The first thing that struck me after immediately opening the App Store and trying to find a new app for my watch was the lack of apps! There were in total, maybe 20 apps for the Apple Watch on my iPhones App Store?! I had to ask myself how this was even possible? There are supposedly millions of apps on the App Store? Did Apple not sell 30 million+ of these watches already?

立即打开App Store并尝试为我的手表找到新应用后,令我震惊的第一件事是缺少应用! 我的iPhone App Store上总共有20个Apple Watch应用程序? 我不得不问自己这怎么可能? 据说App Store上有数百万个应用程序? 苹果公司已经没有卖出超过3000万只这些手表吗?

Something was obviously not right. Well, it turns out that if you want to find apps for your watch, you need to go to the App Store on the watch, there you can find a bunch of WatchOS apps. They are there, they are just a little harder to find. I do hope that our friends at Apple are thinking about adding a category for Watch Apps in the bigger App Store.

显然是不对的。 好吧,事实证明,如果您想为手表找到应用程序,则需要转到手表上的App Store,在那里您可以找到许多WatchOS应用程序。 他们在那里,他们很难找到。 我确实希望我们在Apple的朋友正在考虑在更大的App Store中为Watch Apps添加类别。

Over and above this, Apple has again developed a stellar product in the Apple Watch and of course, the built-in apps cover all the basics, plus some, and there is ever a calculator that feels like my 80’s watch calculator. So what do you add to the watch that makes it ‘special’?

除此以外,Apple再次在Apple Watch中开发了一款出色的产品,当然,内置的应用程序涵盖了所有基础知识,再加上一些功能,并且永远都拥有一个像我80年代手表计算器的计算器。 那么,您在手表上添加了什么使其“特别”呢?

Games are always a great place to start, but playing on your watch is awkward, and dare is say it feels a little weird. Then we have the meditation, breathing and medical apps, these make much more sense, as you have less interaction with the watch, and it supports your activity. But what will I add to the eco-system of a million apps?

游戏总是一个很好的起点,但是在手表上玩游戏很尴尬,而且敢说感觉有点奇怪。 然后,我们有了冥想,呼吸和医疗应用程序,它们变得更加有意义,因为您与手表的互动减少了,并且可以支持您的活动。 但是,我将为一百万个应用程序的生态系统增加什么呢?

Image for post
Photo by Markus Spiske on Unsplash
Markus Spiske在Unsplash上​​拍摄的照片

我疯狂的零承诺简单原则 (My crazy simple principle of zero commitment)

Note, you can choose to add a comma after crazy, but only after you read this

请注意,您可以选择在疯了之后添加逗号,但前提是您必须先阅读以下内容

While I was thinking about all of this, the world was suddenly and quite inconveniently stuffed into quarantine, and all of us ended up locked inside with it our seriously under-developed hobby and activity skillsets. Life became one long rainy day, and to some, it even started to resemble Groundhog Day. People started to lose their minds and before we knew if we had Tic-Tok and all of us were medical experts, washing our hands a hundred times a day. I think the term agoraphobic suited most of us during this time.

当我考虑所有这些问题时,整个世界突然变得非常不便,被隔离所隔离,我们所有人最终都被锁定在里面,这是我们严重欠发达的业余爱好和活动技能所致。 生活变成了一个漫长的雨天,在某些情况下,它甚至开始类似于土拨鼠日 。 人们开始失去理智,在我们不知道自己是否有Tic-Tok并且我们所有人都是医学专家之前,每天洗手一百次。 我认为在此期间,“ 恐惧症”这个词适合我们大多数人。

I realised at this point while chatting to some friends, that there is a need for me, an established and experienced introvert, to share my principle of zero commitment, maximum reward with other people. The premise for the principle is simple, you take your week and you write a list of Monday to Sunday (or Sunday to Saturday if your a Gregorian calendar using crazy person, (I know it’s the standard, but I don't have to like it!)) and you add stuff that you want to do, like your hobbies or activities to each day. Then you stick it on the fridge and look at it every now and again.

在这一点上,我与一些朋友聊天时意识到,我需要一个既定且经验丰富的内向型人,与其他人分享我的零承担,最大回报的原则。 原理的前提很简单,您花费一周时间,然后写下周一至周日的清单(如果您使用疯狂的人使用阳历,则写周日至周六,(我知道这是标准,但我不必喜欢!)),然后添加您想做的事情,例如每天的爱好或活动。 然后,将其粘贴在冰箱上,不时查看。

This part is the important part, so stop making notes! Then you do nothing more than think about the activity on the day that you wanted to do it, this process is call inspiration. If Monday was Photography, you try to take a photo on Monday. If you do, then well done, you’re my hero. If you don’t then nothing, there is no reinforcement behavioural feedback loop that will punish you for not tracking and completing your goal. Inspiration is a safe place, well, at least it should be.

这部分很重要,所以不要做笔记了! 然后,您只需要考虑您想做的那一天的活动,这个过程就是灵感。 如果星期一是摄影,则尝试在星期一拍照。 如果这样做,那么做得很好,您就是我的英雄。 如果您什么都不做,那么就不会有强化行为反馈循环来惩罚您未跟踪和完成目标。 灵感是一个安全的地方,至少应该如此。

Afterwards, you simply go to the next day and look for inspiration there.

之后,您只需转到第二天并在那里寻找灵感。

我的设计理念 (My Design Philosophy)

As mentioned earlier I work in middleware, so I see lots of data and lots of terminal screens. I can tell you exactly what the ‘ps -ef’ is going on in all my servers without breaking a sweat. But you know us middleware guys get curious too, we also like to experiment and have some fun, especially if it’s in a safe environment.

如前所述,我在中间件中工作,因此我看到了很多数据和很多终端屏幕。 我可以准确地告诉您所有服务器中'ps -ef'的状态,而不会费力。 但是,您知道我们中间件公司也对此感到好奇,我们也喜欢尝试并享受一些乐趣,尤其是在安全的环境中。

So I decided that I wanted to add my simple principle to a tiny app for my Apple Watch, I never intended to ever put the app in the App Store, but things quickly get out of control when you have too much fun…

因此,我决定将我的简单原理添加到Apple Watch的一个微型应用程序中,我从未打算将其放入App Store,但是当您玩得开心时,事情很快就会失控……

I started by reading the Apple Developer docs on how to design your app based on the principles and guidelines from Apple. Now at this point, you must be thinking, this guy is a hack, no-one reads the manual before starting their app, and to be honest, I skimmed it. I had previously experienced the trials and tribulations of a client project not passing the app review and honestly, I did not want to lose momentum or hope because I had to rework my app at point 99.

我首先阅读了有关如何根据Apple的原则和准则设计应用程序的Apple Developer文档 。 现在,您必须要考虑的是,这个家伙是个黑客,在启动他们的应用程序之前没有人阅读过手册,老实说,我略读了一下。 我以前曾经历过一个客户项目的试验和磨难未通过应用程序审查,老实说,我不想失去动力或希望,因为我必须在99点重新设计我的应用程序。

Knowing that I wanted to keep this app super lite, I made some commandments that I wanted to follow:

知道我想让这个应用程序保持精简版之后,我做了一些要遵循的诫命:

  1. Keep everything on the watch — This meant not jumping to the first opportunity to build an API to get/store data

    随时注意一切—这意味着不要跳到构建API来获取/存储数据的第一个机会
  2. Avoid too many screen and circular workflows — KISS is much harder to follow when you try to apply it after the fact

    避免过多的屏幕和循环工作流程-事后尝试应用KISS时 ,很难遵循

  3. Keep the app notification to a minimum — Avoid spamming the users so much that they delete the app

    将应用程序的通知保持在最低限度—避免向用户发送过多垃圾邮件,以免他们删除应用程序
  4. Stay as far away from custom code as possible — Stick to the Swift implementations and avoid Objective-C when possible

    尽可能远离自定义代码—坚持使用Swift实现,并尽可能避免使用Objective-C
  5. Publish as soon as possible, even if you have doubts — No app will ever be perfect, so stop trying to build a unicorn when all you needed was a pointy stick

    即使您有疑问,也要尽快发布-没有任何应用程序会是完美的,所以当您需要的只是尖头棒时,不要尝试构建独角兽
Image for post
Photo by Daniel von Appen on Unsplash
Daniel von Appen在Unsplash上​​拍摄的照片

I’ll try to refer back to these commandments as I go along, and I know that these seem to invoke a feeling of lazy coding and oversimplification in an effort to save time and resources. But considering that I am a one-man coder, and I had to do everything from the icon work to the privacy policy and simple website, I think it’s worthwhile to set some limits.

我将在继续学习时尝试回看这些命令,并且我知道这些命令似乎会引起懒惰编码和过度简化的感觉,以节省时间和资源。 但是考虑到我是一个单人编码员,我不得不做所有事情,从图标工作到隐私策略和简单的网站,我认为有必要设定一些限制。

Remember I needed a pointy stick, not a unicorn. So now we can move to the maxim of things I wanted to do.

记住,我需要一个尖尖的棍子,而不是独角兽。 因此,现在我们可以将自己想做的事情最大化。

我想做的事情 (The things I wanted to do)

Playing with the user interface and views in Swift is super fun and super easy to do. I’m not even over exaggerating, Swift is the equivalent of coding in a padded room, and you’re going to have to try hard to break something. To me, this is what made it fun.

在Swift中使用用户界面和视图玩起来非常有趣,而且非常容易。 我什至不夸张地说,Swift相当于在一个有填充空间的代码,而您将不得不努力破坏一些东西。 对我来说,这就是让它变得有趣的原因。

I did not have to spend hours learning the language and all the syntactical kung-fu needed to get going, Xcode held my hand all the way, and even told me on occasions how to fix my issues. I’m amazed it did not tell me where to put stuff, but maybe that’s planned in the next release!

我不必花数小时来学习语言和入门所需的所有语法功夫,Xcode一直牵着我的手,甚至有时还告诉我如何解决问题。 我很惊讶它没有告诉我在哪里放东西,但是也许这是在下一个版本中计划的!

Back to Swift, and everything is a view, everything. Do you want a UI screen? You add a view. Do you want to import data from a .json file? You guessed it, another view! Add a data model to you .json file? Bazinga, another view! And to be honest, this greatly simplifies the whole process as there is only one version of the truth, and everything is easy enough to call from everywhere else.

回到Swift,一切都是视图,一切。 您是否需要UI屏幕? 您添加一个视图。 您是否要从.json文件导入数据? 您猜对了,另一种观点! 向您的.json文件添加数据模型? Bazinga,另一种观点! 老实说,由于只有一个版本的事实,这大大简化了整个过程,并且一切都很容易从其他地方调用。

Now here is my million-dollar advise, which I assume you won’t follow because I did exactly the opposite in the beginning. Ready? Watch the tutorials videos by this guy https://www.hackingwithswift.com/. I don’t know who he is, and I have no affiliation with him, but his videos are gold, don’t make the same mistake I did and just copy/paste the code snippets without watching the videos.

现在,这里是我的百万美元建议,我认为您不会遵循,因为我一开始的做法恰恰相反。 准备? 观看这个家伙的教程视频https://www.hackingwithswift.com/ 。 我不知道他是谁,并且我与他没有任何关系,但是他的视频是黄金,不要犯与我相同的错误,只复制/粘贴代码片段而不看视频。

Most of the web is full of tutorials on how to build a SwiftUI or Apple iPhone app, and that’s awesome, but you need to be cautious of some important points when you start coding away at your own project. Firstly stay away from any and every tutorial that uses IBOutlet like in this example:

网上大部分内容都包含有关如何构建SwiftUI或Apple iPhone应用程序的教程,这很棒,但是当您开始编写自己的项目时,您需要注意一些重要事项。 首先,远离本示例中使用IBOutlet的所有教程:

Image for post
An example of IBOutlet vars
IBOutlet变量的示例

The reason is that this will lead you into the strange world of storyboards and linking code to a visual interface which is a legacy practice of the previous version of Apple app coding called Objective-C. Rather get on the Swift bandwagon now, it may save you some effort in the future.

原因是,这将带您进入情节提要的陌生世界,并将代码链接到可视界面,这是Apple App编码以前版本称为Objective-C的传统做法。 宁可立即加入Swift潮流,也可以节省将来的精力。

The Swift guys who are backed by Apple have tried to break this practice from what I can see on the ‘interweb’, so if you do see a useful tutorial using the Objective-C method, try and find a Swift version before you go down that road.

苹果公司支持的Swift家伙试图从我在“ interweb”上看到的东西打破这种做法,因此,如果您确实看到了使用Objective-C方法的有用教程,请尝试在找到失败之前找到一个Swift版本。那条路。

One more thing on the Swift implementation, when you’re faced with an alarmingly complicated function, there is probably an easier way to do it using the Swift implementation. Do some more research and save yourself some pain, and specifically look out for WatchKit specific functions rather than the standard functions used for the iPhone.

Swift实现的另一件事是,当您面对一个令人震惊的复杂功能时,使用Swift实现可能是一种更简单的方法。 做更多的研究,减轻您的痛苦,尤其要注意WatchKit的特定功能,而不是iPhone所用的标准功能。

我要做的事情 (The things that I had to do)

This is where the action hero in the movie falls off the roof, shoots 10 guys and in the next scene, is back in his apartment cringing as soon as the pretty girl touches his wounds. My app was pretty cool at this point, but I found myself being the action hero in the second scene when I had to patch/kill all my bugs.

这是电影中的动作英雄从屋顶上掉下来,向10个男人射击的场景,在下一场景中,只要漂亮的女孩碰到伤口,他就会回到他的公寓里。 这时我的应用程序非常酷,但是当我不得不修补/杀死所有错误时,我发现自己是第二场景中的动作英雄。

How so? Well after struggling for hours, I finally had notifications up and running, and I was super proud of my accomplishment. The app scheduled ‘a’ notification for 10 am and proudly showed the alert in bright blue, and then nothing the next day. I had in my hubris never written the logic to make sure that the notifications were running every day, and showing the correct allocation for each day. I also forgot to cancel all the scheduled notifications before scheduling the next batches (breaking rule 3) and spammed my poor watch with duplicates!

为何如此? 经过数小时的努力,终于有了通知并开始运行,我为自己的成就感到非常自豪。 该应用程序在上午10点安排了“ a”通知,并自豪地将警报显示为亮蓝色,第二天则没有显示。 我自以为是,从来没有写过确保每天都运行通知并显示每天正确分配的逻辑。 我还忘记了在安排下一批(违反规则3)之前取消所有已安排的通知,并用重复的邮件给可怜的手表发送了垃圾!

Image for post
Photo by Med Badr Chemmaoui on Unsplash
Med Badr Chemmaoui摄于Unsplash

So my advice is, take a piece of paper and write down your apps work and life cycle and build your supporting mechanisms before you think you are done with a piece of code. As an enthusiast on the idea of Agile coding, I remind you that there is always time to relook existing parts of your project because, trust me, you probably missed something.

因此,我的建议是,在您认为自己完成一段代码之前,写一张纸并写下您的应用程序的工作和生命周期,并建立支持机制。 作为对敏捷编码思想的狂热爱好者,我提醒您,总是有时间重新查看项目的现有部分,因为相信我,您可能错过了一些东西。

But what about point 5 ‘Publish as soon as possible’? This one I leave to you to decide as to when a product is ready to ship is based on when you are ready to support the bugs/features that you built in your app. If you have a working day to day notification mechanism like in my case, then you have a pointy stick, and you should seriously consider publishing.

但是第5点“尽快发布”呢? 我要留给您的决定是,何时准备交付产品取决于您何时准备支持应用程序中内置的错误/功能。 如果您拥有像我这样的日常工作通知机制,那么您的建议就很棘手,您应该认真考虑发布。

I also had some pain with regards to the complications, because what is an Apple Watch App without complications showing my planned activity on my watch face! Here I had to build a mechanism to again refresh the complications, not only when the user exited the app, but every day, so that the correct allocation was showing on the correct day! Here is a nice tutorial if you want to look deeper into how to refresh your complications on in WatchOS.

关于并发症,我也有些痛苦,因为什么是没有并发症的Apple Watch App可以在表盘上显示我的计划活动! 在这里,我必须建立一种机制来重新刷新复杂性,不仅是在用户退出应用程序时,而且是每天退出,以便在正确的日期显示正确的分配! 如果您想更深入地了解如何在WatchOS上刷新并发症, 这是一个很好的教程

终于为商店做好准备 (Finally getting ready for the Store)

Now apart from having to write the code, you will also need to build numerous icons for each variation of the app sizes, build a simple website for your Privacy Policy and fill in a bunch of legal and agreement type documents. This might sound arbitrary, but without these, you simply can not publish into the App Store.

现在,除了必须编写代码之外,您还需要为应用程序大小的每个变化构建大量图标,为隐私政策构建一个简单的网站,并填写大量法律和协议类型的文档。 这听起来很武断,但是如果没有这些,您根本无法发布到App Store中。

A quick word on the App Store Connect feature called Test Flight. This is a feature that allows you to add internal and external tester to your team and have them test your app without having to force them to physically be on-site, or plug in their devices. It was not around when I first worked with iPad apps and development many moons ago, and if it was, it would have saved us hours of effort. It’s really useful for testing and getting feedback from your team/clients, so get signed up and running in there as soon as possible. The simulator on your Mac is simply not good enough.

关于App Store Connect功能的简短介绍,称为Test Flight 。 此功能使您可以向团队添加内部和外部测试仪,并让他们测试您的应用程序,而不必强迫他们实际在现场或插入其设备。 很多月前,我第一次使用iPad应用程序和开发时并没有出现,如果这样的话,它将为我们节省很多时间。 这对于测试和获得团队/客户的反馈非常有用,因此请尽快注册并开始运行。 Mac上的模拟器根本不够好。

As my app was designed to be fairly simple, and I have no external calls, the review process was straight forward and wrapped up in a day or so. I would venture that the ease of the process probably has a lot to do with sticking to the commandments declared earlier, so consider adding your own version of this type of list when you start.

由于我的应用程序设计得非常简单,而且没有外部电话,因此审核过程非常简单,一天左右就完成了。 我敢冒险,简化过程可能与遵守先前声明的诫命有很大关系,因此在开始时请考虑添加自己的此类列表类型。

Now to wait and see if I can break even, based on my expenditure on the app. My effort I consider to be free, and the only real expense I incurred was buying an Apple Developer Licence for €99. I pegged my app at around $1 or €1,09 worth per app, so that means about 100 downloads and I’m smiling!

现在,根据我在应用程序上的支出,看看我能否收支平衡。 我认为自己的努力是免费的,唯一的实际支出是花了99欧元购买了Apple Developer License。 我将应用程式的价格定为每个应用程式1美元左右或1,090欧元,所以这意味着大约100次下载,我在笑!

Here is the link to my App!

这是我的应用程序的链接!

B

翻译自: https://medium.com/macoclock/i-created-a-watchos-app-and-here-is-what-i-learned-while-having-fun-5081195b4b93

携程玩乐事业部怎么样

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值