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.
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.
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.
Let's say we have a textField with an UIPickerView as its inputView.
The first problem is that we want the textField to not be editable, because we populate it with the value picked from the picker. This is the simple part:
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
return emailTextField == textField
}The second problem is that the textField is still tappable, it still gets focus and the caret is still visible.
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.
for iCloudEvent in document.data {
var addEvent = trueI found krakendev's idea quite interesting.
There are two downsides:
ERRORs, even in this case:NSLog(@"ERROR: Reason here");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.
I saw this little thing today, by the guys from thoughtbot. sh$ gitsh then simply type commands without git:
status
add .
commit -m "Message"
pushBe sure to check their newest iOS open source, as well, Tropos.
This is the last post about how we use fastlane, and it will present the Deliverfile.
default_language "de-DE"
email itc-username
automatic_release false
skip_pdf true
hide_transporter_output
screenshots_path "../../../../Google Drive/iTunes Assets/images"
if ENV["VERSION_NUMBER"]
version ENV["VERSION_NUMBER"]
end
changelog(
"en-US" => File.read("../../../../Google Drive/iTunes Assets/changelog/en.txt"),
"de-DE" => File.read("../../../../Google Drive/iTunes Assets/changelog/de.txt"),
"fr-FR" => File.read("../../../../Google Drive/iTunes Assets/changelog/fr.txt"),
"it-IT" => File.read("../../../../Google Drive/iTunes Assets/changelog/it.txt")
)In the previous post we stopped at incrementing the build number. Now let's talk about the completion. The process is a bit big, but we'll go through it, step by step:
after_all do |lane|
# Sometimes I just want to test some stuff, so I don't want to post anything on slack
if lane == :test; clean; next; end
type = lane == :hockey_debug ? 'Debug' : 'Release'
# time = Time.nowLast 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