Skip to main content

Tech

Improving Fastlane

1 min read

One of the problem I had was with Fastlane's new increment_version_number and increment_build_number, is that they use Apple's agvtool to increment the required values, but I use a script that already increments the CFBundleVersion and the CFBundleShortVersionString in my plist, and there's no way to update the CURRENT_PROJECT_VERSION from the project's setting, that agvtool uses.

Continue reading →

Fastlane Fastfile #2

2 min read

Last time I stopped at build incrementation. Let's continue with better lanes:

# From
lane :release do
  build_app 'Release'
end
 
# To
lane :release_patch do # | :release_minor | :release_patch | :release_quick_fix
  release :major # | :minor | :patch | :quick_fix
end
Continue reading →

Fastlane Fastfile

3 min read

I previously wrote that I can't wait to start using Fastlane full-time, but I never really got to it, since I lost about a day or so and didn't manage to get the provisioning and signing to work.

Since then quite a few updates were issued and things got easier, so I finally managed to make the switch. I will walk through the process in a few posts.

First things first, our release process is more or less release to Hockey with a debug build until a desired state has been reached, release again to Hockey with a release build and make sure everything is working properly, then release to the App Store.

Continue reading →

Highlighting TODOs, FIXMEs, ERRORs

45 sec read

I found krakendev's idea quite interesting.

There are two downsides:

  • it will highlight all ERRORs, even in this case:
NSLog(@"ERROR: Reason here");
  • it will highlight code inside frameworks as well.

Sadly, I'm not good with bash, so I don't really know how to improve these downsides, but you might find it helpful, nonetheless. Keeping it for future reference, as well.

SnippetsLab

25 sec read

I personally use Dash (more for the text expanding capabilities and the documentation), but SnippetsLab looks quite interesting as well, just for collecting your snippets - awesome interface with different themes, support for over 100 languages, and a menu bar icon for quick access.

I'm a sucker for clean, dark themes.

[EP] Improving the iCloud sync

45 sec read

When I wrote about iCloud sync, I said the sync logic is the shittiest ever, so this is the first attempt at improving it.

Firstly, the migrateOldData got an update:

let event = EPEvent(
  id: Events.last?.id ?? 0 + 1,
  ...
)
 
EPEvent.data.append(event)
 
init(...) {
  modificationTime = Date.timeIntervalSinceReferenceDate()
}
 
modifyEventInAnyWay() {
  modificationTime = Date.timeIntervalSinceReferenceDate()
}

Then the sync.

Continue reading →

Gitsh

45 sec read

I saw this little thing today, by the guys from thoughtbot. sh$ gitsh then simply type commands without git:

status
add .
commit -m "Message"
push

Be sure to check their newest iOS open source, as well, Tropos.

[EP] iCloud sync

45 sec read

I already love Swift 2.0.

First, defer, to never forget to enableUpdates for the query:

query.disableUpdates()
defer { query.enableUpdates() }
// Do stuff.

Secondly, for x in y where condition loops:

for iCloudEvent in document.data {
  // I know, I know, worst sync ever; I will try to improve it at some point.
  for localEvent in Events where localEvent.name == iCloudEvent.name {
    // Update local events.
  }
  // Append to local events.
}

Speaking of protocols

45 sec read

Here is another nice read about protocols; method overriding, in particular. Some examples:

// Our generic class.
class DBStore<T> {
  
  func store(a: T) {
    store T
  }
  
}
 
protocol Storeable { }
protocol Interim { }
 
// Hello, generic Method Overloading by Protocol:
class DBStore<T> {
  
  func store<T: Storeable>(a: T) {
    // Store T.
  }
  
  func store<T: Interim>(a: T) {
    // Compress T.
  }
    
  // And more advanced:  
  func store<T: Storeable>(a: T) where T: Equatable {
    // Store T.
  }
  
}

OOP is POP, POP is OOP

45 sec read

While watching session 408, about Protocol oriented programming, I kept asking myself why Dave appeared to leave the impression that POP is something different from OOP. Today I read a nice article about it, by Marcel Weiher, here.

[...] the idea was really to first get him all excited about not needing OOP, and then turn around and show him that all the things I had just shown him in fact were OOP. And still are, as a matter of fact. Always have been.
[...] The simple fact is that actual Object Oriented Programming is Protocol Oriented Programming, where Protocol means a set of messages that an object understands.

I think it's really worth the read.