sensors-swift
PinLayout
sensors-swift | PinLayout | |
---|---|---|
1 | 4 | |
54 | 2,291 | |
- | 0.8% | |
0.0 | 4.5 | |
5 months ago | about 1 month ago | |
Swift | Swift | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sensors-swift
-
Show HN: CycleQuest – Indoor Cycling game with steering
- Comes with ready-to-use models and textures
To generate roads, I downloaded .gpx files from my Strava activities, then implemented a parser to take coordinates and elevations and build roads in-game using EasyRoads3D. These tools combined worked quite well but required some manual work. I had to go over the entire length of the road to smoothen it up (due to GPS noise in .gpx files). The terrain also didn’t always perfectly align with the road, so I had to manually modify it.
I figured that steering would be a good way to keep the user engaged in the gameplay, instead of just sitting on the bike and pedalling. With required steering, you need to be engaged to not drive off the road.
There are some solutions to virtual steering in other smart trainer games, but they are hardware-based - e.g., for Zwift, you need to buy their hardware controller. I really wanted to keep it as simple and inexpensive as possible, so I used a smartphone mounted to the handlebars as a steering controller.
I implemented native apps for both iOS and Android. They use the gyroscope to get the steering value and broadcast it as a BLE peripheral. Implementing Bluetooth in Unity was a little tricky as there is no built-in solution. The implementation depends on the platform the game is running on. It boils down to writing a native plugin for each platform you support.
For macOS, there is an open-source library written in Swift - https://github.com/codeinversion/sensors-swift. It already has the necessary services and characteristics implemented. I had to modify it a little and compile it into a Unity plugin.
For Windows, there also is a library - https://github.com/adabru/BleWinrtDll, but it wasn’t working too well. Because I targeted UWP, I was able to implement my own Bluetooth logic in C# and compile it directly in Unity.
Overall, it was a really fun project to work on. I’m particularly happy that I was able to release it starting from scratch in just a couple of months, and I hope to continue working on it.
PinLayout
- A lightweight wrapper for lazily initializing UIViews
- Auto layout made simple.
-
Awesome macOS Libraries List
PinLayout - Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. Language: Swift.
-
Hey guys, does anyone know Objective-C course (paid or free) for building apps without storyboards? (without storyboard is important)
I guess it's two different things. First of all, you can get an udacity course "objective-c-for-swift-developers" and then just find a lib for layouting (e.g. PinLayout supports objective-c and doesn't use an autolayout)
What are some alternatives?
SnapKit - A Swift Autolayout DSL for iOS & OS X
FlexLayout - FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation. Concise, intuitive & chainable syntax.
LayoutKit - LayoutKit is a fast view layout library for iOS, macOS, and tvOS.
PureLayout - The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.
FDTemplateLayoutCell - Template auto layout cell for automatically UITableViewCell height calculating
MarkupKit
Layoutless - Write less UI code
BrickKit - DEPRECATED - BrickKit For IOS
SwiftBox - Flexbox in Swift, using Facebook's css-layout.
Tails - Declarative Auto Layout in Swift, clean and simple
Masonry - Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout
EasyPeasy - Auto Layout made easy