A fancy hexagonal layout for displaying data like your Apple Watch

Related tags

UI Hexacon
Overview

Travis Status CocoaPods compatible Carthage compatible

Hexacon is a new way to display content in your app like the Apple Watch SpringBoard

Highly inspired by the work of lmmenge. Special thanks to zenly for giving me the opportunity to do this

DemoInstallationPropertiesMethodsProtocolsLicense

Demo

You can also use the example provided in the repository or use pod try Hexacon

How to use

Like a UITableView!

add it as a subview

override func viewDidLoad() {
    super.viewDidLoad()

    let hexagonalView = HexagonalView(frame: self.view.bounds)
    hexagonalView.hexagonalDataSource = self

    view.addSubview(hexagonalView)
}

Then use the dataSource protocol

extension ViewController: HexagonalViewDataSource {

    func numberOfItemInHexagonalView(hexagonalView: HexagonalView) -> Int {
        return data.count - 1
    }

    func hexagonalView(hexagonalView: HexagonalView, imageForIndex index: Int) -> UIImage? {
        return data[index]
    }
}

Installation

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

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

github "gautier-gdx/Hexacon"

Cocoapods

CocoaPods is a dependency manager for Cocoa projects.

You can install it with the following command:

$ gem install cocoapods

To integrate Hexacon into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!

pod 'Hexacon'

Properties

The HexagonalView has the following properties:

weak var hexagonalDataSource: HexagonalViewDataSource?

An object that supports the HexagonalViewDataSource protocol and can provide views or images to configures the HexagonalView.

 weak var hexagonalDelegate: HexagonalViewDelegate?

An object that supports the HexagonalViewDelegate protocol and can respond to HexagonalView events.

public var lastFocusedViewIndex: Int 

The index of the view where the HexagonalView is or was centered on.

public var itemAppearance: HexagonalItemViewAppearance

the appearance is used to configure the global apperance of the layout and the HexagonalItemView

Appearance

public struct HexagonalItemViewAppearance {

    public var needToConfigureItem: Bool // used to circle image and add border, default is false
    public var itemSize: CGFloat
    public var itemSpacing: CGFloat
    public var itemBorderWidth: CGFloat
    public var itemBorderColor: UIColor

    //animation
    public var animationType: HexagonalAnimationType
    public var animationDuration: NSTimeInterval
}

The default appearance is:

 itemAppearance = HexagonalItemViewAppearance(
    
    needToConfigureItem: false,
    itemSize: 50,
    itemSpacing: 10,
    itemBorderWidth: 5,
    itemBorderColor: UIColor.grayColor(),

    animationType: .Circle,
    animationDuration: 0.2)

Animation

There is three types of animation available (more to come)

public enum HexagonalAnimationType { case Spiral, Circle, None }

Methods

func reloadData() 

This function load or reload all the view from the dataSource and refreshes the display

func viewForIndex(index: Int) -> HexagonalItemView?

Return a view at given index if it exists

Protocols

There is Two protocols in hexacon, HexagonalViewDataSource and HexagonalViewDelegate

dataSource

func numberOfItemInHexagonalView(hexagonalView: HexagonalView) -> Int

Return the number of items the view will contain

func hexagonalView(hexagonalView: HexagonalView,imageForIndex index: Int) -> UIImage?

Return a image to be displayed at index

func hexagonalView(hexagonalView: HexagonalView,viewForIndex index: Int) -> UIView?

Return a view to be displayed at index, the view will be transformed in an image before being displayed

NB: all of this methods are optional and you will have to choose whether you want to display a view or an image otherwise the image will be chosen in priority

delegate

func hexagonalView(hexagonalView: HexagonalView, didSelectItemAtIndex index: Int)

This method is called when the user has selected a view

func hexagonalView(hexagonalView: HexagonalView, willCenterOnIndex index: Int)

This method is called when the HexagonalView will center on an item, it gives you the new value of lastFocusedViewIndex

License

Copyright (c) 2015 Gautier Gédoux

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Fix path to .xcodeproj in ExaconExample.xcworkspace file

    Fix path to .xcodeproj in ExaconExample.xcworkspace file

    This commit changes an absolute path to a realtive one. After this operation it is possible to launch the example by opening ExaconExample.xcworkspace file.

    opened by albinekcom 1
  • In a pop reply there is no text, only pic

    In a pop reply there is no text, only pic

    New bug reported in 📱 Wizz iOS. More details available on bug's link: https://app.shakebugs.com/wizz/user-feedback/8IS2DOMS/148

    Tags bug

    screenshot.jpg

    Granted permissions ✅ Access to media library ✅ Access to microphone ✅ Access to photo library

    ALL OTHER PERMISSIONS WERE EITHER DENIED OR NOT REQUESTED.


    Reporter Not available

    OS iOS 16.1.1

    Device iPhone 13 Pro

    App version 6.0.3 (2)

    Network WiFi

    Current view DiscussionMessageViewController


    Timezone Europe/Helsinki

    Locale en-FI


    Battery status 61% • Unplugged

    Used storage 40% • 95.3 out of 238.3 GB

    Authentication to unlock device Required


    Resolution 2532 ✕ 1170 px

    Orientation Portrait


    Shake SDK version 15.3.0


    Metadata Not available

    opened by gautier-gdx 0
  • For Alyona

    For Alyona

    New bug reported in 📱 Wizz iOS. More details available on bug's link: https://app.shakebugs.com/wizz/user-feedback/8IS2DOMS/147

    Tags bug

    screenshot.jpg

    Granted permissions ✅ Access to media library ✅ Access to photo library

    ALL OTHER PERMISSIONS WERE EITHER DENIED OR NOT REQUESTED.


    Reporter Not available

    OS iOS 16.1.1

    Device iPhone 13 Pro

    App version 6.0.3 (2)

    Network WiFi

    Current view PopAnswersTableViewController


    Timezone Europe/Helsinki

    Locale en-FI


    Battery status 77% • Unplugged

    Used storage 40% • 95.5 out of 238.3 GB

    Authentication to unlock device Required


    Resolution 2532 ✕ 1170 px

    Orientation Portrait


    Shake SDK version 15.3.0


    Metadata Not available

    opened by gautier-gdx 0
  • Lots of bugs with red badges. When you come from a push notif, answer the message, the tabbar shows a red badge even if nothing is unread.

    Lots of bugs with red badges. When you come from a push notif, answer the message, the tabbar shows a red badge even if nothing is unread.

    New bug reported in 📱 Wizz iOS. More details available on bug's link: https://app.shakebugs.com/wizz/user-feedback/8IS2DOMS/146

    Tags bug

    Screenshot Not available

    Granted permissions ✅ Access to camera ✅ Access to media library ✅ Access to photo library

    ALL OTHER PERMISSIONS WERE EITHER DENIED OR NOT REQUESTED.


    Reporter [email protected]

    OS iOS 16.1

    Device iPhone 13 mini

    App version 6.0.3 (2)

    Network Cellular 4G • BOUYGUES Telecom

    Current view PopAnswersTableViewController


    Timezone Europe/Paris

    Locale en-FR


    Battery status 66% • Unplugged

    Used storage 23% • 109.1 out of 476.7 GB

    Authentication to unlock device Required


    Resolution 2340 ✕ 1080 px

    Orientation Portrait


    Shake SDK version 15.3.0


    Metadata Not available

    opened by gautier-gdx 0
  • No badge on tabbar

    No badge on tabbar

    New bug reported in 📱 Wizz iOS. More details available on bug's link: https://app.shakebugs.com/wizz/user-feedback/8IS2DOMS/145

    Tags bug

    screenshot.jpg

    Granted permissions ✅ Access to camera ✅ Access to media library ✅ Access to photo library

    ALL OTHER PERMISSIONS WERE EITHER DENIED OR NOT REQUESTED.


    Reporter [email protected]

    OS iOS 16.1

    Device iPhone 13 mini

    App version 6.0.3 (2)

    Network Cellular 4G • BOUYGUES Telecom

    Current view FriendsDiscussionViewController


    Timezone Europe/Paris

    Locale en-FR


    Battery status 55% • Unplugged

    Used storage 23% • 108.7 out of 476.7 GB

    Authentication to unlock device Required


    Resolution 2340 ✕ 1080 px

    Orientation Portrait


    Shake SDK version 15.3.0


    Metadata Not available

    opened by gautier-gdx 0
  • I received messages but I dont see the badge on the tabbar

    I received messages but I dont see the badge on the tabbar

    New bug reported in 📱 Wizz iOS. More details available on bug's link: https://app.shakebugs.com/wizz/user-feedback/8IS2DOMS/144

    Tags bug

    screenshot.jpg

    Granted permissions ✅ Access to camera ✅ Access to media library ✅ Access to photo library

    ALL OTHER PERMISSIONS WERE EITHER DENIED OR NOT REQUESTED.


    Reporter [email protected]

    OS iOS 16.1

    Device iPhone 13 mini

    App version 6.0.3 (2)

    Network Cellular 5G

    Current view PopAnswersTableViewController


    Timezone Europe/Paris

    Locale en-FR


    Battery status 55% • Unplugged

    Used storage 23% • 108.7 out of 476.7 GB

    Authentication to unlock device Required


    Resolution 2340 ✕ 1080 px

    Orientation Portrait


    Shake SDK version 15.3.0


    Metadata Not available

    opened by gautier-gdx 0
  • Sending a massage is decrementing my counter by 2 and not by 1

    Sending a massage is decrementing my counter by 2 and not by 1

    New bug reported in 📱 Wizz iOS. More details available on bug's link: https://app.shakebugs.com/wizz/user-feedback/8IS2DOMS/143

    Tags bug

    Screenshot Not available

    Granted permissions ✅ Access to camera ✅ Access to media library ✅ Access to microphone ✅ Access to photo library

    ALL OTHER PERMISSIONS WERE EITHER DENIED OR NOT REQUESTED.


    Reporter Not available

    OS iOS 16.0.3

    Device iPhone15,2

    App version 6.0.0 (2)

    Network Cellular 4G • Bouygues Telecom ISP

    Current view FriendsDiscussionViewController


    Timezone Europe/Paris

    Locale en-FR


    Battery status 39% • Unplugged

    Used storage 81% • 96.4 out of 119.1 GB

    Authentication to unlock device Required


    Resolution 2532 ✕ 1170 px

    Orientation Portrait


    Shake SDK version 15.3.0


    Metadata Not available

    opened by gautier-gdx 0
Owner
Gautier Gédoux
Lead tech engineer 💽
Gautier Gédoux
:octocat:💧 A slider widget with a popup bubble displaying the precise value selected. Swift UI library made by @Ramotion

FLUID SLIDER A slider widget with a popup bubble displaying the precise value selected written on Swift. We specialize in the designing and coding of

Ramotion 1.9k Dec 23, 2022
StarryStars is iOS GUI library for displaying and editing ratings

StarryStars StarryStars is iOS GUI library for displaying and editing ratings Features StarryStars' RatingView is both IBDesignable and IBInspectable

Peter Prokop 175 Nov 19, 2022
A modern HUD inspired by Apple Music and Apple Podcasts

HUD A modern HUD inspired by Apple Music and Apple Podcasts. Appearance Light Dark HUD Activity Indicator HUD Requirements iOS 13+ Installation You ca

Bei Li 30 Nov 18, 2022
Windless makes it easy to implement invisible layout loading view.

Windless Windless makes it easy to implement invisible layout loading view. Contents Requirements Installation Usage Looks Credits Communication Licen

ArLupin 940 Dec 22, 2022
High performance Swift treemap layout engine for iOS and macOS.

Synopsis YMTreeMap is a high performance treemap layout engine for iOS and macOS, written in Swift. The input to YMTreeMap is a list of arbitrary numb

Yahoo 118 Jan 3, 2023
An alternative to UIStackView for common Auto Layout patterns.

StackLayout StackLayout builds on Auto Layout to make some of the most common layouts easier to manage. It creates the constraints that you need and a

Bridger Maxwell 76 Jun 29, 2022
A horizontal scroll dial like Instagram.

HorizontalDial Preview Requirements iOS 8.0+ Swift 5 Storyboard support Installation CocoaPods use_frameworks! pod "HorizontalDial" Manually To instal

Lee Sun-Hyoup 210 Nov 22, 2022
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.

PullToDismiss PullToDismiss provides dismiss modal viewcontroller function like Facebook Messenger by pulling scrollview or navigationbar with smooth

Suguru Kishimoto 479 Dec 5, 2022
RangeSeedSlider provides a customizable range slider like a UISlider.

RangeSeekSlider Overview RangeSeekSlider provides a customizable range slider like a UISlider. This library is based on TomThorpe/TTRangeSlider (Objec

WorldDownTown 644 Dec 12, 2022
SAHistoryNavigationViewController realizes iOS task manager like UI in UINavigationContoller. Support 3D Touch!

SAHistoryNavigationViewController Support 3D Touch for iOS9!! SAHistoryNavigationViewController realizes iOS task manager like UI in UINavigationConto

Taiki Suzuki 1.6k Dec 29, 2022
Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.

kishikawakatsumi/SpreadsheetView has moved! It is being actively maintained at bannzai/SpreadsheetView. This fork was created when the project was mov

Kishikawa Katsumi 34 Sep 26, 2022
🍞 Toast for Swift - Toaster Android-like toast with very simple interface

Toaster Android-like toast with very simple interface. (formerly JLToast) Screenshots Features Queueing: Centralized toast center manages the toast qu

Suyeol Jeon 1.6k Jan 3, 2023
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

YNSearch + Realm Support Updates See CHANGELOG for details Intoduction ?? Awesome search view, written in Swift 5.0, appears search view like Pinteres

Kyle Yi 1.2k Dec 17, 2022
A window arrangement manager for macOS like BetterSnapTool and Magnet

A window arrangement manager for macOS like BetterSnapTool and Magnet. You can split the foremost window to the left half of the screen, the left two-thirds, etc.

Takuto NAKAMURA (Kyome) 65 Dec 9, 2022
A SwiftUI bottom-up controller, like in the Maps app. Drag to expand or minimize.

SwiftUI Drawer A SwiftUI bottom-up controller, like in the Maps app. Drag to expand or minimize. Contents Add the Package Basic Usage Examples Credits

Michael Verges 695 Jan 3, 2023
Add the Notch on the menubar like the new MacBook Pro.

iNotch Add the Notch on the menubar like the new MacBook Pro. Installation This app works on macOS 11.0 or later. Download iNotch.zip from releases pa

Takuto NAKAMURA (Kyome) 8 Apr 3, 2022
Fully customizable Facebook reactions like control

Reactions is a fully customizable control to give people more ways to share their reaction in a quick and easy way. Requirements • Usage • Installatio

Yannick Loriot 585 Dec 28, 2022
Snapchat / Instagram Stories like progress indicator

SegmentedProgressBar A simple little control that animates segments like Snapchat or Instagram Stories. Requirements iOS 8.0+ Xcode 8 Installation Dra

Dylan Marriott 442 Dec 25, 2022