Seems like #exist for #ios is updating #healthkit data in the background fairly regularly now. Fingers crossed it stays that way. After a little more testing to make sure the updating works well I’ll send it out to beta testers for the first round of #applehealth #sleep testing.
Today I did some overdue #support tickets instead though, and later tonight I set up macOS in a vm on my pc so I can build some #ios apps. I do have a macbook, but I’d rather be at my pc. I actually got that running with few issues, and I can build apps in xcode without it taking too long — performance seems decent. I’m going to have a go at learning #swift to build the #larder iOS app. I don’t really want to steal it from @belle, but she has enough on her plate already.
I’m halfway through Apple’s official #swift book. I’m amazed by the level of attention Swift gives to enumerations and switch cases; two things you can do without really. I’m no language expert, but if there was no static type system, Swift could unburden itself of Optionals.
Anyways, at least I’m happy that Xcode doesn’t crash on my new computer! I’m looking forward to learning iOS starting this January; it’ll probably take six months of weekends to get a working knowledge of it.
Here is my plan:
- Create a new file called
SegFaultDebugger.swiftin the project
- In this new class, define an extension to the class that’s giving problems
- Move a group of methods from the main file to
At this point, 1 of 4 things happens:
- Nothing. Too bad. Wait for it to happen again
- Segfault in the original file: Move the methods from
SegFaultDebugger.swiftback to the original file and move a different set of methods into
- Segfault in
SegFaultDebugger.swift: Great! Now use binary search to pin the segfault down to a specific method until I can figure out what construct is causing it
- Meaningful compiler errors: Great! Fix the errors. Once everything compiles, move the methods back into the original file
Sent a small update of #exist for #ios to the App Store for review today. Now I’m spending some time googling/fiddling with #xcode. I’ve noticed an issue lately where I keep getting an error in Xcode at least once per minute, that stops the code completion and syntax highlighting for a few seconds. It’s super frustrating and unproductive. I haven’t been able to figure it out, but I’m suspicious that it’s to do with using the #swift version of #Realm so I’m trying to dig into it a bit deeper now.
- I finally figured out the logic Trello. Now I have my order in my tasks. If you hold a month - I’ll write how it works.
- Spend the evening with family. Phone and tablet do not open. It makes me happy, like my family. #family
- The two previous days did more than last week (Yes, last week consisted of 3 days :))
- Learning #swift until stopped. I read the article, but do not. Looking forward to the weekend.
Finally fixed the #cocoapods problem I was wrestling with yesterday afternoon! My #littlelogs #Swift app wasn’t behaving the same as the original #objectivec one, and I couldn’t figure out why. I’m still not exactly sure, but I think maybe the cocoapod I was using wasn’t working because of how I’m subclassing in Swift. I don’t know enough about it to fully understand and fix that… but I did manage to recreate the same behaviour offered by the cocoapod all by myself! Turns out it wasn’t very complicated, I was just being lazy by using a library to do it for me 😏
Wrestled with my #swift version of #littlelogs for #ios this afternoon. I’ve realised I can use #objectivec #cocoapods libraries, so I’ve started adding in the ones I used in the #objectivec version of the app. For some reason, the one that lets me tap the background view to make the keyboard dismiss won’t work. I also tried another library that does the same thing, and even re-implemented it myself and still can’t get it to work. At that point I gave up and had a nap, because what a silly little thing to spend all afternoon on.
Yesterday/last night I did some more #swift coding. I’m still working on recreating my #ios #littlelogs app in swift, and it’s going okay! I still have a lot to learn (e.g. I get optionals in theory, but I haven’t got the hang of using them yet).
So yesterday I added a double-tap gesture to the Home screen, because I found in my #objectivec version of the app, it’s a bit slow to tap a log, wait for it’s detail view to load, then tap the heart to like it. So now I can double-tap to like a log!
I also started working on implementing the detail view for logs, so when you tap one, it opens a new screen with the log and its comments and a comment field. So far I have just the log content showing up.
Feeling quite tired today so didn’t want to get stuck into work first thing. Did some more #Swift learning on #Treehouse instead. Today I went over
structs, object-oriented stuff like classes, initializers, and subclassing, and the differences between value types and reference types.
Just three sections left to get through:
Still struggling with #Swift, so I went back to #Treehouse today and watched some of the videos. It definitely helps to have a mixture of actually writing code and reading/watching explanations and theory about it.
Trouble is, I always want to write code that’s way too far ahead of what I know so far, so I get frustrated. But anyway, I started a syntax cheat sheet of my own today while watching Treehouse videos, so I practised writing out some basic stuff like
tuples. Hopefully my own cheat sheet will make for a quick and useful reference while writing #Swift code.
Did a little more work on learning #Swift yesterday afternoon. It’s not getting any easier, or less frustrating. It annoys me that all my #Swift code has to be so safe, but according to @josh it’s actually no worse than #objectivec — only Obj-C lets me get away with doing naughty things more easily, like assuming the JSON response I receive will include all the variables I want.
Last night I played with #swift a bit more. I’m slowly porting my #littlelogs #ios app from #objectivec to #swift. It feels good to actually write some swift code, because the ideas really aren’t sticking in my brain just from reading about them. I’m really enjoying the syntax so far, but I’m a bit frustrated at the extra coercion needed to get swift to play nicely with #json, since I deal with #API results a lot. #laterlog
Made some better progress with #elm on #larder tonight. Got routing sorted out and am now officially manipulating the history when switching folders and viewing the add link form, which I also set up.
It’s been a challenge thinking about how to represent all the state and I worry about the best practices on how deep to go — should I represent the state of each input in my form (empty, filled in, validated, invalid)? Should the form itself have a state (in progress, submitted, invalid, complete)? I’ve no idea and I kind of wish it was already decided for me.
I’m definitely much more comfortable thinking about this from a server-side, OOP point of view, and I really miss being able to write and generate HTML from the server. I do love how snappy it is to click around my app without page refreshes, only reloading the bits that have changes, but on the other hand I would’ve been wayyyyyyy further ahead on this if I just did it all server-side in comfortable old #Django.
I guess it’s worth it? 😕
- Working more towards the backend always, I was not well versed with the MVC pattern though I was aware of it. Thanks to Stanford’s excellent course on iOS programming, I am getting a good idea of it. I started off with a need to learn OSX programming but I did not find any good tutorials to do so that used Swift. #Swift
- Meanwhile, I designed the on-boarding screens for Grelfie, probably my first proper design experience so far. Made me realise, how inefficient I am at using Illustrator and how much I enjoyed seeing the results. So this year, I am going to learn how to use Illustrator like a pro and be a better designer because it is fun. #Grelfie
- Another goal for this year, a fitter me. I did hit the gym last year but discontinued it after 2 months. I am going to go for it in full mode this year. #LifeIsAHitWhenYouAreFit
- I am learning Swift. The more I get to know this wonderful language, the more I appreciate it. At least syntactically, its that one language which is even friendlier than Python.
- Meanwhile, the next book is decided. Elon Musk recommends “The Machine Stops” so I am on it.
- Learning OSX programming is my agenda these days hence learning Swift.
Finished the knowledgebase front end, final task will be to add the ability to add/edit/delete articles.
A review of the courses I’m enrolled in shows that I’m not completing them. My goal is the complete at least one more before the end of the year.
10 projects in #angular 48%
10 projects in #node 24%
- rubyonrails 86%
- iOS8 & #swift - 15 apps 3%
complete web developer -14 websites 71%
ITIL foundation 12%
Projects in #css 100%
This list doesn’t include the other 4 that I haven’t started yet.
Did some solid #writing work on my first #Ghost magazine piece today, and got a better idea of what structure might work well thanks to a chat with @josh. Spent a couple of hours tonight doing #treehouse #swift tutorials to get a better feel for the syntax and common tasks, like setting up initializers. #code #ios
Started a new #ios project in #swift this morning. It took aaaages to write any code because not only is the syntax different, the way things work is often different. Found it really slow and difficult so I’m going to do the #treehouse swift course to get more comfortable with it before coming back to my project. #code
Worked on some custom #NSStoryboardSegue classes this afternoon, for view transitions in #Stump. Was aiming to get some quasi-iOS segue feeling transitions, and think i've mostly pulled it off (at least as well as Tweetbot has anyway) without using any third-party libraries.
This really has been an interesting experience, particularly when I get stuck on a problem. Starting to feel i'm one of only 5 people on the entire internet working on an #osx app in #swift... and that could be right ;) Certainly weird to not be able to find a #stackoverflow answer for every problem!
Mac app #secretproject work stalled a bit last night. Can't tell if I was just low on energy and enthusiasm, or simply confused with how many things work differently compared to #ios dev. Hopefully just a bad day, and will pick up again over the weekend.
I have a feeling that i've simply been spoiled by the wealth of #ios help there is on the net, compared to #osx, particularly in regard to #swift. Think I might just need to suck it up and try harder! #laterlog
I've started reading up on #Swift syntax so I can read more about how the language works and actually follow the code examples. I don't like some of the syntax choices which seem ugly (like backslashes before passing in a variable and arrows to show the return type) but there are some interesting features that are really different to #objectivec, like tuples.