Skip to content

Releases: MoveUpwards/Sejima

Small MUToast buttons refactoring

01 Jul 09:45
Compare
Choose a tag to compare

Remove index in button tap callback

toast.add(view: cancel) { view in
    print("Button did tap cancel")
}
toast.add(view: okay) { view in
    print("Button did tap ok")
    toast.hide()
}

Add MUToast buttons

27 Jun 15:34
Compare
Choose a tag to compare

usage

First you can define the layout basics using UIAppearance

MUToast.appearance().displayDuration = 0
MUToast.appearance().cornerRadius = 4
MUToast.appearance().titleColor = .white
MUToast.appearance().backgroundColor = .black
MUToast.appearance().indicatorColor = .red
MUToast.appearance().indicatorWidth = 10
MUToast.appearance().detailColor = .white

MUButton.appearance().borderWidth = 2
MUButton.appearance().cornerRadius = 4.0

Then you customize your toast view

let toast = MUToast()
toast.icon = #imageLiteral(resourceName: "reddit")
toast.buttonHeight = 30.0
toast.spacing = 8
toast.buttonSpacing = 16
toast.displayPosition = .bottom
toast.title = "Sorry, can't reach Reddit"
toast.titleFont = .boldSystemFont(ofSize: 18)
toast.detail = "Add multiple line detail text if needed"
toast.detailFont = .systemFont(ofSize: 14)

Then init buttons objects you want to add in your toast

let cancel = MUButton()
cancel.title = "CANCEL"
cancel.titleFont = .boldSystemFont(ofSize: 14)
cancel.buttonBackgroundColor = .clear
cancel.borderColor = .orange

let okay = MUButton()
okay.title = "OKAY"
okay.titleFont = .boldSystemFont(ofSize: 14)
okay.buttonBackgroundColor = .red
okay.borderColor = .red

Add button along with an options closure that will be triggered every time the button get tapped

toast.add(view: cancel) { (button, index) in
    print("Button at index \(index) did tap")
}
toast.add(view: okay) { (button, index) in
    print("Button at index \(index) did tap")
}

Then show your toast

toast.show(in: vc, onTap: {
    print("toast has been tapped")
}, completion: { dismiss in
    print("toast has been dismissed > ", dismiss)
})

Fix content compression + hugging

03 Jun 10:41
Compare
Choose a tag to compare

MUCircularProgress

31 May 09:10
Compare
Choose a tag to compare
  • Add progress type MUCircularProgressType .indeterminate and .determinate
/// Define the type of the circular progress.
public enum MUCircularProgressType: Int {
    /// Circular progress with min and max value
    case determinate
    /// Circular progress with indeterminate loading
    case indeterminate
}
  • Add rotation for .indeterminate type.
/// Define the progress style
open var progressType: MUCircularProgressType = .determinate

/// Specifies the animation duration for the indeterminate rotation of the progress line.
@objc open dynamic var rotateDuration: TimeInterval = 1.0

Add new components

16 May 08:08
681ffec
Compare
Choose a tag to compare

Add realtime graph view #66

Swift 5

13 May 09:37
Compare
Choose a tag to compare
0.5.5

Migrate to swift 5

Update MUToast display duration

10 May 09:30
Compare
Choose a tag to compare

Change display duration logic.

If you specify a negative value or 0, the toast will not hide automatically once animation end.

Improve MURadarGraph

07 May 14:24
Compare
Choose a tag to compare

Documentation

Update overall documentation to reach 100% coverage

MURadarGraph

Provide text vertical and horizontal offset to tweak graph legend

MUToast improvements

02 Apr 12:47
Compare
Choose a tag to compare

Fix layout expected size #65

Improve MUToast

02 Apr 11:01
ff5717b
Compare
Choose a tag to compare

Add marker view to give some visual information with color
Make title vertical centered when no detail test given
Title and Detail text font can't be modified using UIAppearance due to layout calculation issue