All Projects → soffes → X

soffes / X

Licence: mit
Easier cross platform Mac & iOS development with Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to X

Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-41.48%)
Mutual labels:  tvos, watchos, carthage
TermiNetwork
🌏 A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.
Stars: ✭ 80 (-70.37%)
Mutual labels:  tvos, watchos, carthage
Cocoalumberjack
A fast & simple, yet powerful & flexible logging framework for Mac and iOS
Stars: ✭ 12,584 (+4560.74%)
Mutual labels:  tvos, watchos, carthage
BlockiesSwift
Unique blocky identicons generator for Swift
Stars: ✭ 53 (-80.37%)
Mutual labels:  tvos, watchos, carthage
Mechanica
A cross-platform library of Swift utils to ease your iOS | macOS | watchOS | tvOS and Linux development.
Stars: ✭ 27 (-90%)
Mutual labels:  tvos, watchos, carthage
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-48.89%)
Mutual labels:  tvos, watchos, carthage
Cache
Swift caching library
Stars: ✭ 210 (-22.22%)
Mutual labels:  tvos, watchos, carthage
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+3865.19%)
Mutual labels:  tvos, watchos, carthage
SwiftVer
Easily Manage Versioning in MacOS, iOS, watchOS, and tvOS projects.
Stars: ✭ 23 (-91.48%)
Mutual labels:  tvos, watchos, carthage
Dots
Lightweight Concurrent Networking Framework
Stars: ✭ 35 (-87.04%)
Mutual labels:  tvos, watchos, carthage
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (-51.11%)
Mutual labels:  tvos, watchos, carthage
Datez
📆 Breeze through Date, DateComponents, and TimeInterval with Swift!
Stars: ✭ 254 (-5.93%)
Mutual labels:  tvos, watchos, carthage
Sqift
Powerful Swift wrapper for SQLite
Stars: ✭ 119 (-55.93%)
Mutual labels:  tvos, watchos, carthage
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (-46.3%)
Mutual labels:  tvos, watchos, carthage
Diff
Simple diff library in pure Swift
Stars: ✭ 110 (-59.26%)
Mutual labels:  tvos, watchos, carthage
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (-34.44%)
Mutual labels:  tvos, watchos, carthage
Mixpanel
Unofficial Swift Mixpanel client
Stars: ✭ 93 (-65.56%)
Mutual labels:  tvos, watchos, carthage
Sdwebimagewebpcoder
A WebP coder plugin for SDWebImage, use libwebp
Stars: ✭ 101 (-62.59%)
Mutual labels:  tvos, watchos, carthage
Iso8601
ISO8601 date parser and writer
Stars: ✭ 213 (-21.11%)
Mutual labels:  tvos, watchos, carthage
Columbus
A feature-rich country picker for iOS, tvOS and watchOS.
Stars: ✭ 23 (-91.48%)
Mutual labels:  tvos, watchos, carthage

X

Version Swift Version Carthage compatible

Easier cross platform Mac and iOS development with Swift 5.1. X was abstracted out of Redacted and Whiskey.

Xcode 11.1 or higher is required.

Installation

Carthage is the recommended way to install X. Add the following to your Cartfile:

github "soffes/X"

Usage

X provides several typealiases to make dealing with AppKit/UIKit types that are similar. Currently, X includes:

Name UIKit AppKit
Color UIColor NSColor
ContentMode UIViewContentMode N/A
EdgeInsets UIEdgeInsets NSEdgeInsets
Font UIFont NSFont
GestureRecognizerStateType UIGestureRecognizerState NSGestureRecognizerState
Image UIImage NSImage
Screen UIScreen NSScreen
ViewType UIView NSView

If you wanted to use a color on both platforms, you could write something like this:

let blueColor = Color(red:0.298, green:0.757, blue:0.988, alpha: 1.0)

View

View inherits from ViewType (so either UIView or NSView) and adds some platform specific functionality. This makes methods like layoutSubviews work on both platforms. The UIKit API is cleaner, so NSView has methods added in View to make it behave more like UIView.

Here's the current list of bridged methods that work on both:

var wantsLayer: Bool      // On iOS, this doesn't do anything and always returns `true`.
func didMoveToWindow()    // Bridged from `viewDidMoveToWindow`
func didMoveToSuperview() // Bridged from `didMoveToSuperview`
func layoutSubviews()     // Bridged from `layout`

Core Graphics

There are several extensions for CGPoint, CGSize, and CGRect that help with converting to and from strings since UIKit and AppKit have different function names. The UIKit function names are aliased on Mac. There are also initializers and computed properties you can use instead of the functions.

Enjoy.

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].