![]() Because every millisecond counted, they were making sure not to allocate too many objects, and using ring buffers of scalar types, and things like that… And they would look at the byte code to make sure everything was going well. And the Java programmers, they were really fighting the garbage collector all the time. You had the Java programmers, and the C++ programmers. So we were using, on the server side for these trading systems, that really needed high performance and low latency, we – the developers separated into two camps. So we were a team, doing sort of equity and derivatives trading, we had full stack development, server-side and UIs… And we were using various different languages. And at the time I was actually working in FinTech, I was working for a bank, working on trading systems. So I actually wasn’t a member of the team when Swift first launched. Yeah, so the way I like to introduce Swift is actually - I go back to when I first saw Swift, and what really got me into Swift. And that allows us to target new environments, but using the same language, with all of the same sort of high-level feeling features that you get with a regular piece of Swift code just a few things that need heavy runtime support, like reflection and things like that. That binary now strips away all of the dead code, and gets you down to the point where the binary for this little demo is just 15k, and 10k of that is actually the image of the Swift logo. A really tiny binary that bounces a Swift logo around an LCD screen… And up until recently, that involved statically -linking the entire Swift runtime into the binary that would end up being about 600k, which would fit on a lot of things, but not something that small. So if you look at the vision document, it actually has a video of us running on one of these STM32 boards, which have just one mega memory. One of the latest vision documents that we just officially approved was for something called embedded Swift, which is the ability to slightly subset down the language, to a point where you can build statically-linked binaries that are really tiny. So when we introduced concurrency a couple of releases ago, that started off with a vision document, and then individual pieces of the language get proposed as a part of that. There’s a sort of open process that we have on the forums that we run at we have these things called Vision Documents, that are kind of our vision of roadmaps that set out larger language features. So just in the last couple of weeks we introduced a vision document, with the language steering group that I’m a member of, that sets the direction for the language. I mean, we’re seeing recently some pretty exciting developments. This is done inside the Capabilities tab of your target's settings – find iCloud, then flick its switch to be On.I think so. There is one final, important thing to do: you need to enable iCloud for your app. With that prefix, MKiCloudSync will copy to iCloud only UserDefaults keys that start with sync – you can now choose what you want to sync just by naming your keys appropriately. The "sync" part is important, because chances are you won't want to sync everything to iCloud. Now open your AppDelegate.swift file, find the didFinishLaunchingWithOptions method, and add this line to it: MKiCloudSync.start(withPrefix: "sync") To actually use the library, open your new bridging header (it'll be called something like YourProject-Bridging-Header.h) and add this: #import "MKiCloudSync.h" Xcode will ask you if you want to create an Objective-C bridging header, and you should click "Create Bridging Header" - this is required because MKiCloudSync is written in Objective-C rather than Swift. Inside the zip file you'll find MKiCloudSync.h and MKiCloudSync.m, and you should drag them both into your Xcode project. To use it, go here and click Download Zip. It's open source and so easy to use you literally don't notice that it's there once you've added it to your app – it just silently syncs your UserDefaults values to and from iCloud. One such example is called MKiCloudSync and it's available from here. Fortunately, other developers have written simple wrappers around it so that you can forget about iCloud and focus on the interesting things instead – i.e., the rest of your app. IOS has a built-in iCloud sync system called NSUbiquitousKeyValueStore, but to be honest it's pretty unpleasant to work with. ![]() ![]() ![]() How to store UserDefaults options in iCloud ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |