A cross-platform library of Swift utils to ease your iOS | macOS | watchOS | tvOS and Linux development.

Overview

Mechanica: Swift Utils

Mechanica

GitHub release

A library of Swift utils to ease your iOS, macOS, watchOS, tvOS and Linux development.

Requirements

Swift 5.2 Platforms Xcode

Carthage Compatible CocoaPods Compatible

Documentation

Documentation is available online.

http://www.alessandromarzoli.com/Mechanica/

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build Mechanica 1.0.0+.

To integrate Mechanica into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'Mechanica', '~> 2.2.0'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Mechanica into your Xcode project using Carthage, specify it in your Cartfile:

github "alemar11/Mechanica" ~> 2.2.0

Run carthage update to build the framework and drag the built Mechanica.framework into your Xcode project.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Once you have your Swift package set up, adding Mechanica as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/alemar11/Mechanica.git", .upToNextMajor(from: "3.1.0"))
]

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate Mechanica into your project manually.

Embedded Framework

  • Open up Terminal, cd into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:
$ git init
  • Add Mechanica as a git submodule by running the following command:
$ git submodule add https://github.com/alemar11/Mechanica.git
  • Open the new Mechanica folder, and drag the Mechanica.xcodeproj into the Project Navigator of your application's Xcode project.

    It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.

  • Select the Mechanica.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target.

  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.

  • In the tab bar at the top of that window, open the "General" panel.

  • Click on the + button under the "Embedded Binaries" section.

  • You will see two different Mechanica.xcodeproj folders each with two different versions of the Mechanica.framework nested inside a Products folder.

    It does not matter which Products folder you choose from, but it does matter whether you choose the top or bottom Mechanica.framework.

  • Select the top Mechanica.framework for iOS and the bottom one for macOS.

    You can verify which one you selected by inspecting the build log for your project. The build target for Mechanica will be listed as either Mechanica iOS, Mechanica macOS, Mechanica tvOS or Mechanica watchOS.

License

License MIT

Mechanica is released under the MIT license. See LICENSE for details.

Contributing

Pull requests are welcome!
Show your with a ★

You might also like...
OTAtomics - Multi-platform Swift thread-safe atomics library

OTAtomics Multi-platform Swift thread-safe atomics library. The library has full

A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.
A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.

ZamzamKit ZamzamKit is a Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and othe

A quick and "lean" way to swizzle methods for your Objective-C development needs.

Swizzlean A quick and "lean" way to swizzle methods for your Objective-C development needs. Adding Swizzlean to your project Cocoapods CocoaPods is th

LanguageList for SwiftUI supporting iOS/macOS/tvOS

LanguageList for iOS, macOS and tvOS LanguageList is created and maintaned with ❥ by Sascha Muellner. What? This is a SwiftUI package with support for

A Flutter plugin (platform channel with Swift) to get the current app name and also bring our app to the front.

window_to_front A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package th

IOS-Bootcamp-Examples - Learn to Swift while building apps - With IOS Development Bootcamp
IOS-Bootcamp-Examples - Learn to Swift while building apps - With IOS Development Bootcamp

IOS-Bootcamp-Examples Learn to Swift while building apps - With IOS Development

Personally useful Swift Extensions for iOS Development

Useful-Swift-Extensions Personally useful Swift Extensions for iOS Development; cobbled together from a variety of development projects and StackOverf

A collection of common tools and commands used throughout the development process, customized for Kipple projects.

KippleTools A collection of common tools and commands used throughout the development process, customized for Kipple projects. ⚠️ The code in this lib

Helpful extensions for iOS app development 🚀
Helpful extensions for iOS app development 🚀

ExtensionKit includes many extensions, from getting the user location with a deterministic Combine API to a shimmer loading animation, to keyboard notification updates, bottom sheet and much much more. Check out the docs below or install the library with SPM to try it out.

Comments
  • Bump tzinfo from 1.2.3 to 2.0.5

    Bump tzinfo from 1.2.3 to 2.0.5

    Bumps tzinfo from 1.2.3 to 2.0.5.

    Release notes

    Sourced from tzinfo's releases.

    v2.0.5

    • Changed DateTime results to always use the proleptic Gregorian calendar. This affects DateTime results prior to 1582-10-15 and any arithmetic performed on the results that would produce a secondary result prior to 1582-10-15.
    • Added support for eager loading all the time zone and country data by calling either TZInfo::DataSource#eager_load! or TZInfo.eager_load!. Compatible with Ruby On Rails' eager_load_namespaces. #129.
    • Ignore the SECURITY file from Arch Linux's tzdata package. #134.

    TZInfo v2.0.5 on RubyGems.org

    v2.0.4

    • Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.

    TZInfo v2.0.4 on RubyGems.org

    v2.0.3

    • Added support for handling "slim" format zoneinfo files that are produced by default by zic version 2020b and later. The POSIX-style TZ string is now used calculate DST transition times after the final defined transition in the file. #120.
    • Fixed TimeWithOffset#getlocal returning a TimeWithOffset with the timezone_offset still assigned when called with an offset argument on JRuby 9.3.
    • Rubinius is no longer supported.

    TZInfo v2.0.3 on RubyGems.org

    v2.0.2

    • Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
    • Fixed warnings when running on Ruby 2.8. #113.

    TZInfo v2.0.2 on RubyGems.org

    v2.0.1

    • Fixed "SecurityError: Insecure operation - require" exceptions when loading data with recent Ruby releases in safe mode. #100.
    • Fixed warnings when running on Ruby 2.7. #109.
    • Added a TZInfo::Timezone#=~ method that performs a regex match on the time zone identifier. #99.
    • Added a TZInfo::Country#=~ method that performs a regex match on the country code.

    TZInfo v2.0.1 on RubyGems.org

    v2.0.0

    Added

    • to_local and period_for instance methods have been added to TZInfo::Timezone. These are similar to utc_to_local and period_for_utc, but take the UTC offset of the given time into account.
    • abbreviation, dst?, base_utc_offset and observed_utc_offset instance methods have been added to TZInfo::Timezone, returning the abbreviation, whether daylight savings time is in effect and the UTC offset of the time zone at a specified time.
    • A TZInfo::Timestamp class has been added. It can be used with TZInfo::Timezone in place of a Time or DateTime.
    • local_time, local_datetime and local_timestamp instance methods have been added to TZInfo::Timezone. These methods construct local Time, DateTime and TZInfo::Timestamp instances with the correct UTC offset and abbreviation for the time zone.
    • Support for a (yet to be released) version 2 of tzinfo-data has been added, in addition to support for version 1. The new version will remove the (no longer needed) DateTime parameters from transition times, reduce memory consumption and improve the efficiency of loading timezone and country indexes.
    • A TZInfo::VERSION constant has been added, indicating the TZInfo version number.

    Changed

    • The minimum supported Ruby versions are now Ruby MRI 1.9.3, JRuby 1.7 (in 1.9 or later mode) and Rubinius 3.
    • Local times are now returned using the correct UTC offset (instead of using UTC). #49 and #52.
    • Local times are returned as instances of TimeWithOffset, DateTimeWithOffset or TZInfo::TimestampWithOffset. These classes subclass Time, DateTime and TZInfo::Timestamp respectively. They override the default behaviour of the base classes to return information about the observed offset at the indicated time. For example, the zone abbreviation is returned when using the %Z directive with strftime.
    • The transitions_up_to, offsets_up_to and strftime instance methods of TZInfo::Timezone now take the UTC offsets of given times into account (instead of ignoring them as was previously the case).
    • The TZInfo::TimezonePeriod class has been split into two subclasses: TZInfo::OffsetTimezonePeriod and TZInfo::TransitionsTimezonePeriod. TZInfo::OffsetTimezonePeriod is returned for time zones that only have a single offset. TZInfo::TransitionsTimezonePeriod is returned for periods that start or end with a transition.

    ... (truncated)

    Changelog

    Sourced from tzinfo's changelog.

    Version 2.0.5 - 19-Jul-2022

    • Changed DateTime results to always use the proleptic Gregorian calendar. This affects DateTime results prior to 1582-10-15 and any arithmetic performed on the results that would produce a secondary result prior to 1582-10-15.
    • Added support for eager loading all the time zone and country data by calling either TZInfo::DataSource#eager_load! or TZInfo.eager_load!. Compatible with Ruby On Rails' eager_load_namespaces. #129.
    • Ignore the SECURITY file from Arch Linux's tzdata package. #134.

    Version 2.0.4 - 16-Dec-2020

    • Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.

    Version 2.0.3 - 8-Nov-2020

    • Added support for handling "slim" format zoneinfo files that are produced by default by zic version 2020b and later. The POSIX-style TZ string is now used calculate DST transition times after the final defined transition in the file. #120.
    • Fixed TimeWithOffset#getlocal returning a TimeWithOffset with the timezone_offset still assigned when called with an offset argument on JRuby 9.3.
    • Rubinius is no longer supported.

    Version 2.0.2 - 2-Apr-2020

    • Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
    • Fixed warnings when running on Ruby 2.8. #113.

    Version 2.0.1 - 24-Dec-2019

    • Fixed "SecurityError: Insecure operation - require" exceptions when loading data with recent Ruby releases in safe mode. #100.
    • Fixed warnings when running on Ruby 2.7. #109.
    • Added a TZInfo::Timezone#=~ method that performs a regex match on the time zone identifier. #99.
    • Added a TZInfo::Country#=~ method that performs a regex match on the country code.

    Version 2.0.0 - 26-Dec-2018

    ... (truncated)

    Commits
    • d9b289e Preparing v2.0.5.
    • 264c763 Add v0.3.61 and v1.2.10 from the 0.3 and 1.2 branches.
    • ca29f34 Fix relative path loading tests.
    • c4f177c Add a top level eager_load! method for Rails compatibility.
    • 94be919 Support preloading all data from a DataSource.
    • fe7ad26 Clarify that both files and directories are excluded.
    • d2883cf Tidy up of security file ignoring.
    • 6a4766e Merge pull request #133.
    • 5d53b59 Workaround for 'Permission denied - NUL' errors with JRuby on Windows.
    • 83450a1 ignore SECURITY file for Arch tzdata package
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(3.1.0)
Collection of native Swift extensions to boost your development. Support tvOS and watchOS.

SparrowKit Collection of native Swift extensions to boost your development. Support iOS, tvOS and watchOS. If you like the project, don't forget to pu

Ivan Vorobei 119 Dec 20, 2022
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift

Bow is a cross-platform library for Typed Functional Programming in Swift. Documentation All documentation and API reference is published in our websi

Bow 613 Dec 20, 2022
Generic Cross Platform Signal Handler

Signals Generic Cross Platform Signal Handler. Prerequisites Swift Swift Open Source swift-4.0.0-RELEASE toolchain (Minimum REQUIRED for latest releas

Kitura 91 Oct 2, 2022
Easy CBOR encoding and decoding for iOS, macOS, tvOS and watchOS.

CBORCoding CBORCoding is a lightweight framework containing a coder pair for encoding and decoding Codable conforming types to and from CBOR document

Joe Newton 23 Nov 8, 2022
Super powerful remote config utility written in Swift (iOS, watchOS, tvOS, OSX)

Mission Control Super powerful remote config utility written in Swift (iOS, watchOS, tvOS, OSX) Brought to you by Have you ever wished you could chang

appculture 113 Sep 9, 2022
Call Swift functions from Rust with ease!

swift-rs Call Swift functions from Rust with ease! Todo Swift class deallocation from rust (implementing Drop and using deallocate_{type} methods) Mor

null 69 Dec 30, 2022
Use this package in order to ease up working with Combine URLSession.

Use this package in order to ease up working with Combine URLSession. We support working with Codable for all main HTTP methods GET, POST, PUT and DELETE. We also support MultipartUpload

Daniel Mandea 1 Jan 6, 2022
XMachOViewer is a Mach-O viewer for Windows, Linux and MacOS

MachO file viewer/editor for Windows, Linux and macOS. Heuristic scan String viewer Hex viewer Disasm viewer(x86/64,ARM,PPC,m68k) Entropy viewer Hash

Hors 505 Dec 20, 2022
Versions tracker for your iOS, macOS, and tvOS app

VersionTrackerSwift VersionTrackerSwift is a versions / builds tracker to know which version has been installed by a user. Usage In your ApplicationDe

Tom Baranes 82 Oct 5, 2022
The sample implementation of zip-archived document for a macOS AppKit platform.

The sample implementation of zip-archived document for a macOS AppKit platform. You can implement NSDocument-based I/O of archived document in your application like .sketch or .key.

usagimaru 4 Nov 12, 2022