A Swift 4 Framework for checking for new releases of open source tvOS / iOS / macOS applications, released using GitHub.
Installation
Cocoapods
Using cocoapods is the most common way of installing frameworks. Add something similar to the following lines to your Podfile. You may need to adjust based on your platform, version/branch etc.
How often a check for new releases should be performed
daily
Version checking and reporting will happen automatically whenever the interval has passed and the user will be prompted to download the latest release.
In order you test, you could change the interval to 10 seconds (TimeInterval(exactly: 10))
Internationalization / i18n
Add the following strings to your Localizable.strings file(s):
/* GHKit - release alerts */
"New release available" = "New release available";
"You are %i releases behind" = "You are %i releases behind";
"Version '%@' is available for download at '%@'.\n\n%@" = "Version '%@' is available for download at '%@'.\n\n%@";
How does it work?
GHKit will SwizzleUIViewController‘s viewDidLoad method to check for new releases if the interval has passed. It uses the application bundle’s version to check against the available GitHub releases and notify the end user if a new version is available. Note that GHKit only reports that a new release is available; it does not download or install anything!
Contributing to GHKit
Before sending a pull request, make sure you used the same coding style and that you have linted your code using the most recent SwiftLint release:
$ swiftlint
...
Done linting! Found 0 violations, 0 serious in 11 files.
License
See the accompanying LICENSE for more information.
Copyright 2018 Jeroen Wesbeek
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
GHKit - GitHub Kit
A Swift 4 Framework for checking for new releases of open source tvOS / iOS / macOS applications, released using GitHub.
Installation
Cocoapods
Using cocoapods is the most common way of installing frameworks. Add something similar to the following lines to your
Podfile
. You may need to adjust based on your platform, version/branch etc.Swift Package Manager
Add the following entry to your package’s dependencies:
Setup
GHKit
was built to work automatically after the initial configuration by running whenever a view controller did load.All you need to do is configure
GHKit
in yourAppDelegate
‘sapplication:didFinishLaunchingWithOptions:
. The one method you need to configure isBundle.main
)Version checking and reporting will happen automatically whenever the interval has passed and the user will be prompted to download the latest release.
Example
Debugging
In order you test, you could change the interval to 10 seconds (
TimeInterval(exactly: 10)
)Internationalization / i18n
Add the following strings to your
Localizable.strings
file(s):How does it work?
GHKit
will SwizzleUIViewController
‘sviewDidLoad
method to check for new releases if the interval has passed. It uses the application bundle’s version to check against the available GitHub releases and notify the end user if a new version is available. Note thatGHKit
only reports that a new release is available; it does not download or install anything!Contributing to GHKit
Before sending a pull request, make sure you used the same coding style and that you have linted your code using the most recent SwiftLint release:
License
See the accompanying LICENSE for more information.