All Projects → nangege → Cassowary

nangege / Cassowary

Licence: MIT license
High performance swift implement of constraint solving algorithm cassowary

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Cassowary

StoryboardConstraint
A simple way to use programmatically Autolayout Constraint created in Storyboard.
Stars: ✭ 25 (-44.44%)
Mutual labels:  autolayout
LocalSearchSolvers.jl
A Julia package to manage Constraint-Based Local Search (CBLS) solvers.
Stars: ✭ 18 (-60%)
Mutual labels:  constraint-solver
SimplexSolver
Python script that solves standard linear programs with the Simplex algorithm and outputs step-by-step LaTeX instructions.
Stars: ✭ 38 (-15.56%)
Mutual labels:  simplex-algorithm
EKR-SIMPLEX-PROBLEM-CALCULATOR
simplex problem calculator
Stars: ✭ 13 (-71.11%)
Mutual labels:  simplex-algorithm
optaplanner-quickstarts
OptaPlanner quick starts for AI optimization: many use cases shown in many different technologies.
Stars: ✭ 226 (+402.22%)
Mutual labels:  constraint-solver
StackableTableView
A UITableView subclass that enables setting an array of views for both headers and footers utilizing UIStackView
Stars: ✭ 72 (+60%)
Mutual labels:  autolayout
Ragrid
Intrinsic first auto-layout flexbox grid
Stars: ✭ 249 (+453.33%)
Mutual labels:  autolayout
Driftwood
Driftwood is a DSL to make Auto Layout easy on iOS, tvOS and macOS.
Stars: ✭ 14 (-68.89%)
Mutual labels:  autolayout
jasper
Haxe port of Kiwi's implementation of the cassowary algorithm.
Stars: ✭ 22 (-51.11%)
Mutual labels:  cassowary
Constrainable
simple declarative autolayout µframework based on Swift 4 KeyPath
Stars: ✭ 26 (-42.22%)
Mutual labels:  autolayout
iOSProjects
It's project that contains different applications developed with Swift 5.7 👨‍💻👩🏼‍💻🧑🏿‍💻
Stars: ✭ 122 (+171.11%)
Mutual labels:  autolayout
GoneVisible
GoneVisible is a UIView extension that uses AutoLayout to add "gone" state like Android.
Stars: ✭ 27 (-40%)
Mutual labels:  autolayout
minilp
A pure Rust linear programming solver
Stars: ✭ 61 (+35.56%)
Mutual labels:  simplex-algorithm
SBLayout
【一行代码搞定无论多复杂的约束】AutoLayout for iOS/macOS by swift
Stars: ✭ 46 (+2.22%)
Mutual labels:  autolayout
cuda-revised-simplex
An implementation of the revised simplex algorithm in CUDA for solving linear optimization problems in the form max{c*x | A*x=b, l<=x<=u}
Stars: ✭ 19 (-57.78%)
Mutual labels:  simplex-algorithm
SDCAutoLayout
A UIView category that simplifies dealing with Auto Layout
Stars: ✭ 23 (-48.89%)
Mutual labels:  autolayout
casso
A Go implementation of the Cassowary constraint solving algorithm.
Stars: ✭ 75 (+66.67%)
Mutual labels:  cassowary
UseAutoLayout
UseAutoLayout @propertyWrapper for Swift
Stars: ✭ 25 (-44.44%)
Mutual labels:  autolayout
VanillaConstraints
🍦 Simplified and chainable AutoLayout constraints for iOS.
Stars: ✭ 42 (-6.67%)
Mutual labels:  autolayout
memalloy
Memory consistency modelling using Alloy
Stars: ✭ 23 (-48.89%)
Mutual labels:  constraint-solver

Cassowary

Version Carthage compatible swiftpm compatible Swift 4.0

Cassowary is a swift implement of constraint solving algorithm Cassowary which forms the core of the OS X and iOS Autolayout . This project is start from a direct port of rhea,but after that ,a lot of optimization has been added to make it performent better.

Requirements

  • iOS 8.0+
  • Swift 4.2
  • Xcode 10

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. Install it with the following command:

$ gem install cocoapods

To integrate Cassowary into your Xcode project using CocoaPods, specify it to a target in your Podfile:

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

target 'MyApp' do
  # your other pod
  # ...
  pod 'SwiftCassowary'
end

Then, run the following command:

$ pod install

open the {Project}.xcworkspace instead of the {Project}.xcodeproj after you installed anything from CocoaPods.

For more information about how to use CocoaPods, see this tutorial.

Carthage

Carthage is a decentralized dependency manager for Cocoa application. To install the carthage tool, you can use Homebrew.

$ brew update
$ brew install carthage

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

github "https://github.com/nangege/Cassowary" "master"

Then, run the following command to build the Panda framework:

$ carthage update

At last, you need to set up your Xcode project manually to add the Cassowary framework.

On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk.

On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following content:

/usr/local/bin/carthage copy-frameworks

and add the paths to the frameworks you want to use under “Input Files”:

$(SRCROOT)/Carthage/Build/iOS/Cassowary.framework

For more information about how to use Carthage, please see its project page.

Swift Package Manager

To install Cassowary for use in a Swift Package Manager-powered tool, script or server-side application, add Cassowary as a dependency to your Package.swift file. For more information, please see the Swift Package Manager documentation.

.package(url: "https://github.com/nangege/Cassowary", from: "0.2.0")

Usage

import Cassowary

let v1 = Variable(),v2 = Variable, v3 = Variable()
let solver = SimplexSolver()
try? solver.add(v1 + v2 == 10)
try? solver.add(v1 - v2 == 2)
solver.solve()
print(solver.valueFor(v1)).  // 6
print(solver.valueFor(v2)).  // 4

Lisence

The MIT License (MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].