Swiftpack.co - Package - alemar11/Mechanica

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 ★

Github

link
Stars: 15

Dependencies

Used By

Total: 0

Releases

3.1.0 - 2020-09-16 15:05:05

  • Xcode 12
  • Swift 5.2
  • Fixes

3.0.0 - 2019-04-02 15:39:17

  • Mechanica is now completely migrated to Swift 5. 🎉
  • Added more Bundle utils.

2.2.0 - 2019-01-28 09:57:20

  • Added more Sequence utils.
  • Added more UIImage utils.
  • Added more Collection utils.
  • Added UIStackView utils.
  • Added UIEdgeInsets utils.

2.1.0 - 2018-11-18 16:54:39

  • Added DispatchQueue utils.
  • Added more Sequence utils.
  • Added more Optional utils.
  • Added more Color utils.
  • Added more SignedInteger utils.
  • Added more NSPredicate utils
  • Added more Image utils
  • More tests.

2.0.0 - 2018-09-15 18:56:23

  • Mechanica is now completely migrated to Swift 4.2.
  • Added Date and Calendar utils. 📆
  • Refactor NSObjectProtocol Utilities.
  • Removed all the Random utils (implemented in Swift 4.2).
  • Removed shuffle utils (implemented in Swift 4.2).
  • NSAttributedString and NSMutableAttributedString utils now works on Linux.
  • UserDefaults utils now works on Linux.
  • Added Linux tests for Ubuntu 16.04.

1.7.0 - 2018-07-10 19:44:44

  • Added cURL representation.
  • Added UIImage utils (rounding and scaling).
  • More String utils.
  • More tests.
  • Bugfixes.

1.6.0 - 2018-03-31 14:12:12

  • Swift 4.1 🎉
  • Added CoreGraphics utils.
  • More Sequence utils.
  • Better performance in some RangeReplaceableCollection utils.
  • More tests.
  • Bugfixes.

1.5.0 - 2018-02-11 22:33:09

  • Added more UIView utils.
  • Added Font utils for bold and italic traits.
  • Added shuffling methods for collections and sequences.
  • Added more Optional utils.
  • Better random string generation methods.
  • Bugfixes.

1.4.0 - 2018-01-27 18:03:06

  • Better String subscription methods.
  • More URL utils.
  • More Character utils.
  • More ProcessInfo utils.
  • Bugfixes.

1.3.1 - 2017-12-22 22:00:39

  • Access level fixes.

1.3.0 - 2017-12-22 19:04:48

  • Added more utils.
  • More UIKit and AppKit tests.
  • Bugfixes.

1.2.0 - 2017-11-30 11:20:26

  • Added support for Linux (Stantard Library and Foundation Utils).
  • Better separation between Standard Library and Foundation utils.
  • Bugfixes.

1.2.0-RC.1 - 2017-11-30 11:11:16

1.1.0 - 2017-11-11 10:37:48

  • More UIKit utils.
  • More String utils (i.e. padding methods).
  • Better random functions.
  • Added Sequence utils.
  • Added Character and Unicode Utils.
  • Better library structure.

1.0.0 - 2017-09-14 07:14:03

  • Mechanica is now completely migrated to Swift 4. 🤓
  • Better Core Data API.
  • Added dictionary extensions.
  • Added NSAttributedString extensions.
  • Added % unary operator.
  • Added more UIKit extensions.
  • More tests.

0.4.2 - 2017-06-29 21:37:24

  • Bug fixes.
  • More tests.
  • Fixes on Core Data utils.
  • Removed unused API.

0.4.1 - 2017-06-03 11:22:45

  • added NibIdentifiable protocol tests.
  • better descriptions here and there.

0.4.0 - 2017-06-02 20:30:26

  • added SwiftLint.
  • more String extensions.
  • bugfixes.

0.3.1 - 2017-05-09 18:26:12

minor fixes

0.3.0 - 2017-04-18 17:19:05

0.3.0

  • Added protocol ValueAssociable.
  • Added Key enum.
  • UserDefaults extensions.

0.2.1 - 2017-04-02 17:14:35

  • Added Swift Package Manager support
  • Minor Bugfixes
  • Refactor Tests

0.2.0 - 2017-03-29 11:55:30

Initial version - 2017-03-20 09:53:36

🚀