Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

qazyn951230/StartPoint

Repository files navigation

StartPoint

It's a experimental framework. Do not use in product environment.

Currently, the "xpm" branch can not build automatically, because it depend on "xpm" (Xcode package manager) which is not available yet.


JSON

Available on iOS, macOS

Unlike other Swift JSON framework, It's implement a UTF-8 (only) JSON decoder. (Because I hate NSJSONSerialization and NSNull)

// Decode a JSON String:
let json = try! JSON.parse("{\"foobar\": 1}")
print(json["foobar"].int == 1)
// true

FlexLayout

Available on iOS

A "flexible box" layout engine written in Swift.

let box = FlexLayout()
    .alignItems(.center)
    .justifyContent(.center)
let child = FlexLayout()
    .width(.length(10))
    .height(.length(10))
box.append(child)
box.calculate(width: 100, height: 100, direction: .ltr)
box.print(options: .layout)
//<div layout="width: 100.0; height: 100.0; top: 0.0; left: 0.0; " >
//  <div layout="width: 10.0; height: 10.0; top: 45.0; left: 45.0; " ></div>
//</div>

Element

Available on iOS

A Texture like UI interface layer, built top of "FlexLayout".

let child = ViewElement()
    .backgroundColor(UIColor.blue)
    .style { flex in
        flex.size(width: 10, height: 10)
    }
let box = ViewElement(children: [child])
    .backgroundColor(UIColor.green)
    .style { flex in
        flex.alignItems(.center).justifyContent(.center)
    }
box.layout(width: 100, height: 100)
let view: UIView = box.buildView()

Permission

Available on iOS

Supported Permissions:

  • Camera
  • Contact
  • Location
  • Notification
  • Photo
  • Health
  • Motion

Other kinds of permission may add in the future.

// Check the status of health permission
let status: Driver<Permission> = Permission.status(.health)
status.drive(onNext: { permission in
    // ...
})

Router

Available on iOS

Stream

Available on iOS, macOS

Special thanks

This framework heavily inspired by following projects:

About

A start point for iOS, macOS apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published