Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Fix crash on select segment at index. Swift 4.2 (#361)
Browse files Browse the repository at this point in the history
Swift 4.2 has improved hash functions so on a bool type it doesn't return 1 or 0 anymore
  • Loading branch information
akantsevoi authored and hebertialmeida committed Sep 25, 2018
1 parent 788a0f3 commit 707aee3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/FolioReaderFontsMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class FolioReaderFontsMenu: UIViewController, SMSegmentViewDelegate, UIGestureRe
dayNight.tag = 1
dayNight.addSegmentWithTitle(self.readerConfig.localizedFontMenuDay, onSelectionImage: sunSelected, offSelectionImage: sunNormal)
dayNight.addSegmentWithTitle(self.readerConfig.localizedFontMenuNight, onSelectionImage: moonSelected, offSelectionImage: moonNormal)
dayNight.selectSegmentAtIndex(self.folioReader.nightMode.hashValue)
dayNight.selectSegmentAtIndex(self.folioReader.nightMode ? 1 : 0)
menuView.addSubview(dayNight)


Expand Down

0 comments on commit 707aee3

Please sign in to comment.