IOS-2064 - refactor on uifont extension IOS-2064
authorMartin Brude
Wed, 05 Feb 2020 11:38:43 +0100
branchIOS-2064
changeset 116670eb248dd2759
parent 11636 fbb5660e1120
parent 11635 5f82a57dea18
child 11669 2384524ed8f1
IOS-2064 - refactor on uifont extension
Submodules/pEpIOSToolbox/pEpIOSToolbox/UIKit/UIFont+Extension.swift
pEpForiOS.xcodeproj/project.pbxproj
pEpForiOS/Info.plist
pEpForiOS/UI/Compose/Cells/BodyCell/BodyCell.swift
pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/NSAttributedString+RecipientTextUtils.swift
pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextViewModel+TextAttachment.swift
pEpForiOS/UI/EmailDisplay/EmailView/CellAndSections/MessageSenderCell.swift
pEpForiOS/UI/EmailDisplay/EmailView/CellAndSections/MessageSubjectCell.swift
pEpForiOS/UI/Fonts/SF/SFUIText-Bold.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-BoldItalic.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-Heavy.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-HeavyItalic.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-Light.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-LightItalic.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-Medium.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-MediumItalic.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-Regular.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-RegularItalic.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-Semibold.ttf
pEpForiOS/UI/Fonts/SF/SFUIText-SemiboldItalic.ttf
pEpForiOS/UI/Fonts/SFUIText-Regular.ttf
pEpForiOS/Util/Appearance.swift
pEpForiOS/Util/Extensions/NSAttributedString+pEp.swift
     1.1 --- a/Submodules/pEpIOSToolbox/pEpIOSToolbox/UIKit/UIFont+Extension.swift	Tue Feb 04 12:16:29 2020 +0100
     1.2 +++ b/Submodules/pEpIOSToolbox/pEpIOSToolbox/UIKit/UIFont+Extension.swift	Wed Feb 05 11:38:43 2020 +0100
     1.3 @@ -15,21 +15,37 @@
     1.4  /// System fonts automatically react to accessibility features like bold text and larger type.
     1.5  /// To add a new font, include the font files, add it on Info.plist, and add access methods here.
     1.6  extension UIFont {
     1.7 -    private static let name = "SFUIText-Regular"
     1.8 -    
     1.9 -    public static var pepBody: UIFont {
    1.10 -        return UIFont(name: name, size: preferredFontSize(for: .body))!
    1.11 -    }
    1.12 -    
    1.13 -    public static var pepCallout: UIFont {
    1.14 -        return UIFont(name: name, size: preferredFontSize(for: .callout))!
    1.15 -    }
    1.16 -    
    1.17 -    public static var pepFootnote: UIFont {
    1.18 -        return UIFont(name: name, size: preferredFontSize(for: .footnote))!
    1.19 +
    1.20 +    private static let medium = "SFUIText-Medium"
    1.21 +    private static let regular = "SFUIText-Regular"
    1.22 +    private static let semibold = "SFUIText-Semibold"
    1.23 +
    1.24 +    /// Retrieves the font for the provided style and type
    1.25 +    /// - Parameters:
    1.26 +    ///   - style: The style of the font.
    1.27 +    ///   - type: The type of the font.
    1.28 +    public static func pepFont(style : TextStyle, type : UIFont.Weight) -> UIFont {
    1.29 +        let name: String
    1.30 +        switch type {
    1.31 +        case .medium:
    1.32 +            name = medium
    1.33 +        case .regular:
    1.34 +            name = regular
    1.35 +        case .semibold:
    1.36 +            name = semibold
    1.37 +        default:
    1.38 +            name = regular
    1.39 +        }
    1.40 +        
    1.41 +        guard let font = UIFont(name: name, size: preferredFontSize(for: style)) else {
    1.42 +            return UIFont.systemFont(ofSize: preferredFontSize(for: style), weight: type)
    1.43 +        }
    1.44 +        return font
    1.45      }
    1.46      
    1.47      private static func preferredFontSize(for textStyle : TextStyle) -> CGFloat {
    1.48          return UIFont.preferredFont(forTextStyle: textStyle).pointSize
    1.49      }
    1.50  }
    1.51 +
    1.52 +
     2.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Tue Feb 04 12:16:29 2020 +0100
     2.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Wed Feb 05 11:38:43 2020 +0100
     2.3 @@ -399,7 +399,18 @@
     2.4  		49DCCD2621E8ABD300ABE487 /* nojavascript.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 49DCCD1F21E75BE300ABE487 /* nojavascript.pdf */; };
     2.5  		49DCCD2721E8ABD600ABE487 /* javascript.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 49079D9821E3867900D15A0D /* javascript.pdf */; };
     2.6  		49DCCD2821E8ABDF00ABE487 /* ScreenshotTestUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 495F689921E6600500A10C63 /* ScreenshotTestUtil.swift */; };
     2.7 -		5BC14ABB23E1BDC6005F0AF3 /* SFUIText-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14ABA23E1BDC6005F0AF3 /* SFUIText-Regular.ttf */; };
     2.8 +		5BC14ADC23EAC276005F0AF3 /* SFUIText-Heavy.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD023EAC275005F0AF3 /* SFUIText-Heavy.ttf */; };
     2.9 +		5BC14ADD23EAC276005F0AF3 /* SFUIText-Semibold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD123EAC275005F0AF3 /* SFUIText-Semibold.ttf */; };
    2.10 +		5BC14ADE23EAC276005F0AF3 /* SFUIText-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD223EAC275005F0AF3 /* SFUIText-BoldItalic.ttf */; };
    2.11 +		5BC14ADF23EAC276005F0AF3 /* SFUIText-LightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD323EAC275005F0AF3 /* SFUIText-LightItalic.ttf */; };
    2.12 +		5BC14AE023EAC276005F0AF3 /* SFUIText-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD423EAC275005F0AF3 /* SFUIText-Medium.ttf */; };
    2.13 +		5BC14AE123EAC276005F0AF3 /* SFUIText-HeavyItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD523EAC275005F0AF3 /* SFUIText-HeavyItalic.ttf */; };
    2.14 +		5BC14AE223EAC276005F0AF3 /* SFUIText-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD623EAC276005F0AF3 /* SFUIText-Light.ttf */; };
    2.15 +		5BC14AE323EAC276005F0AF3 /* SFUIText-MediumItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD723EAC276005F0AF3 /* SFUIText-MediumItalic.ttf */; };
    2.16 +		5BC14AE423EAC276005F0AF3 /* SFUIText-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD823EAC276005F0AF3 /* SFUIText-Bold.ttf */; };
    2.17 +		5BC14AE523EAC276005F0AF3 /* SFUIText-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14AD923EAC276005F0AF3 /* SFUIText-Regular.ttf */; };
    2.18 +		5BC14AE623EAC276005F0AF3 /* SFUIText-RegularItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14ADA23EAC276005F0AF3 /* SFUIText-RegularItalic.ttf */; };
    2.19 +		5BC14AE723EAC276005F0AF3 /* SFUIText-SemiboldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BC14ADB23EAC276005F0AF3 /* SFUIText-SemiboldItalic.ttf */; };
    2.20  		8B69E3991E30F80E0022959E /* Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B69E3981E30F80E0022959E /* Appearance.swift */; };
    2.21  		A1014DA71D1173CD00C472A8 /* UIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 436C5A8D1CFEDF59006A195F /* UIHelper.swift */; };
    2.22  		A1B50A841CD26FF100B1A997 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1B50A811CD26FF100B1A997 /* Constants.swift */; };
    2.23 @@ -915,7 +926,18 @@
    2.24  		49C34AF520E4F649009D11CC /* CellDetailTransition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellDetailTransition.swift; sourceTree = "<group>"; };
    2.25  		49D3BECB20F8F7330043E05D /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = "<group>"; };
    2.26  		49DCCD1F21E75BE300ABE487 /* nojavascript.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = nojavascript.pdf; sourceTree = "<group>"; };
    2.27 -		5BC14ABA23E1BDC6005F0AF3 /* SFUIText-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-Regular.ttf"; sourceTree = "<group>"; };
    2.28 +		5BC14AD023EAC275005F0AF3 /* SFUIText-Heavy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-Heavy.ttf"; sourceTree = "<group>"; };
    2.29 +		5BC14AD123EAC275005F0AF3 /* SFUIText-Semibold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-Semibold.ttf"; sourceTree = "<group>"; };
    2.30 +		5BC14AD223EAC275005F0AF3 /* SFUIText-BoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-BoldItalic.ttf"; sourceTree = "<group>"; };
    2.31 +		5BC14AD323EAC275005F0AF3 /* SFUIText-LightItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-LightItalic.ttf"; sourceTree = "<group>"; };
    2.32 +		5BC14AD423EAC275005F0AF3 /* SFUIText-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-Medium.ttf"; sourceTree = "<group>"; };
    2.33 +		5BC14AD523EAC275005F0AF3 /* SFUIText-HeavyItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-HeavyItalic.ttf"; sourceTree = "<group>"; };
    2.34 +		5BC14AD623EAC276005F0AF3 /* SFUIText-Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-Light.ttf"; sourceTree = "<group>"; };
    2.35 +		5BC14AD723EAC276005F0AF3 /* SFUIText-MediumItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-MediumItalic.ttf"; sourceTree = "<group>"; };
    2.36 +		5BC14AD823EAC276005F0AF3 /* SFUIText-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-Bold.ttf"; sourceTree = "<group>"; };
    2.37 +		5BC14AD923EAC276005F0AF3 /* SFUIText-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-Regular.ttf"; sourceTree = "<group>"; };
    2.38 +		5BC14ADA23EAC276005F0AF3 /* SFUIText-RegularItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-RegularItalic.ttf"; sourceTree = "<group>"; };
    2.39 +		5BC14ADB23EAC276005F0AF3 /* SFUIText-SemiboldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SFUIText-SemiboldItalic.ttf"; sourceTree = "<group>"; };
    2.40  		8B69E3981E30F80E0022959E /* Appearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Appearance.swift; sourceTree = "<group>"; };
    2.41  		A1B50A811CD26FF100B1A997 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
    2.42  		B70A3A62220065F500EDCE61 /* String+pEp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+pEp.swift"; sourceTree = "<group>"; };
    2.43 @@ -1817,7 +1839,7 @@
    2.44  			children = (
    2.45  				432E80FB2191AF5100359879 /* UniversLTStd.otf */,
    2.46  				432E80FC2191AF5100359879 /* UniversLTStd-Bold.otf */,
    2.47 -				5BC14ABA23E1BDC6005F0AF3 /* SFUIText-Regular.ttf */,
    2.48 +				5BC14AE823EAC287005F0AF3 /* SF */,
    2.49  			);
    2.50  			path = Fonts;
    2.51  			sourceTree = "<group>";
    2.52 @@ -2352,6 +2374,25 @@
    2.53  			path = Transitions;
    2.54  			sourceTree = "<group>";
    2.55  		};
    2.56 +		5BC14AE823EAC287005F0AF3 /* SF */ = {
    2.57 +			isa = PBXGroup;
    2.58 +			children = (
    2.59 +				5BC14AD823EAC276005F0AF3 /* SFUIText-Bold.ttf */,
    2.60 +				5BC14AD223EAC275005F0AF3 /* SFUIText-BoldItalic.ttf */,
    2.61 +				5BC14AD023EAC275005F0AF3 /* SFUIText-Heavy.ttf */,
    2.62 +				5BC14AD523EAC275005F0AF3 /* SFUIText-HeavyItalic.ttf */,
    2.63 +				5BC14AD623EAC276005F0AF3 /* SFUIText-Light.ttf */,
    2.64 +				5BC14AD323EAC275005F0AF3 /* SFUIText-LightItalic.ttf */,
    2.65 +				5BC14AD423EAC275005F0AF3 /* SFUIText-Medium.ttf */,
    2.66 +				5BC14AD723EAC276005F0AF3 /* SFUIText-MediumItalic.ttf */,
    2.67 +				5BC14AD923EAC276005F0AF3 /* SFUIText-Regular.ttf */,
    2.68 +				5BC14ADA23EAC276005F0AF3 /* SFUIText-RegularItalic.ttf */,
    2.69 +				5BC14AD123EAC275005F0AF3 /* SFUIText-Semibold.ttf */,
    2.70 +				5BC14ADB23EAC276005F0AF3 /* SFUIText-SemiboldItalic.ttf */,
    2.71 +			);
    2.72 +			path = SF;
    2.73 +			sourceTree = "<group>";
    2.74 +		};
    2.75  		B706C0EF1EA8C378006B2F6C /* StoryboardFiles */ = {
    2.76  			isa = PBXGroup;
    2.77  			children = (
    2.78 @@ -2730,23 +2771,34 @@
    2.79  				1526596C216230B1006A78DF /* ComposeData.plist in Resources */,
    2.80  				43980E341CBD0BCA00A7FC3C /* LaunchScreen.storyboard in Resources */,
    2.81  				155F2D9E20530798001B4B1C /* Reusable.storyboard in Resources */,
    2.82 +				5BC14AE123EAC276005F0AF3 /* SFUIText-HeavyItalic.ttf in Resources */,
    2.83 +				5BC14AE723EAC276005F0AF3 /* SFUIText-SemiboldItalic.ttf in Resources */,
    2.84 +				5BC14AE423EAC276005F0AF3 /* SFUIText-Bold.ttf in Resources */,
    2.85  				220DCE2F1E0AB544002FE716 /* MessageData.plist in Resources */,
    2.86 +				5BC14ADE23EAC276005F0AF3 /* SFUIText-BoldItalic.ttf in Resources */,
    2.87  				432E80FE2191AF5100359879 /* UniversLTStd-Bold.otf in Resources */,
    2.88  				43980E311CBD0BCA00A7FC3C /* Assets.xcassets in Resources */,
    2.89  				4307D5DA23575853004569C4 /* InfoPlist.strings in Resources */,
    2.90 +				5BC14AE223EAC276005F0AF3 /* SFUIText-Light.ttf in Resources */,
    2.91  				37F615CC238BE51F001AAE48 /* ManualAccountSetupView.xib in Resources */,
    2.92  				151DE7E41FC5D41600CDC273 /* FolderViews.storyboard in Resources */,
    2.93 +				5BC14ADF23EAC276005F0AF3 /* SFUIText-LightItalic.ttf in Resources */,
    2.94  				152A39D221905C3E00D9F8E4 /* AttachmentCell.xib in Resources */,
    2.95 +				5BC14ADD23EAC276005F0AF3 /* SFUIText-Semibold.ttf in Resources */,
    2.96  				B78309C81EAA09040051A2E0 /* AccountCreation.storyboard in Resources */,
    2.97  				37156E50234DD3FB00845A28 /* LoadingInterface.xib in Resources */,
    2.98  				433404CB2379789600E785F1 /* NothingSelected.storyboard in Resources */,
    2.99  				43C98AC3219C275E006418B0 /* Localizable.strings in Resources */,
   2.100 +				5BC14AE623EAC276005F0AF3 /* SFUIText-RegularItalic.ttf in Resources */,
   2.101 +				5BC14AE523EAC276005F0AF3 /* SFUIText-Regular.ttf in Resources */,
   2.102  				151DE7E11FC5D3FA00CDC273 /* Handshake.storyboard in Resources */,
   2.103  				43980E2C1CBD0BC900A7FC3C /* Main.storyboard in Resources */,
   2.104 +				5BC14ADC23EAC276005F0AF3 /* SFUIText-Heavy.ttf in Resources */,
   2.105  				432E80FD2191AF5100359879 /* UniversLTStd.otf in Resources */,
   2.106 -				5BC14ABB23E1BDC6005F0AF3 /* SFUIText-Regular.ttf in Resources */,
   2.107  				15D3D48C239FC14700F2EBFB /* EmailDetailCollectionViewCell.xib in Resources */,
   2.108 +				5BC14AE323EAC276005F0AF3 /* SFUIText-MediumItalic.ttf in Resources */,
   2.109  				151DE7DE1FC5D3E200CDC273 /* Settings.storyboard in Resources */,
   2.110 +				5BC14AE023EAC276005F0AF3 /* SFUIText-Medium.ttf in Resources */,
   2.111  			);
   2.112  			runOnlyForDeploymentPostprocessing = 0;
   2.113  		};
     3.1 --- a/pEpForiOS/Info.plist	Tue Feb 04 12:16:29 2020 +0100
     3.2 +++ b/pEpForiOS/Info.plist	Wed Feb 05 11:38:43 2020 +0100
     3.3 @@ -73,6 +73,8 @@
     3.4  		<string>UniversLTStd.otf</string>
     3.5  		<string>UniversLTStd-Bold.otf</string>
     3.6  		<string>SFUIText-Regular.ttf</string>
     3.7 +		<string>SFUIText-Medium.ttf</string>
     3.8 +		<string>SFUIText-Semibold.ttf</string>
     3.9  	</array>
    3.10  	<key>UIBackgroundModes</key>
    3.11  	<array>
     4.1 --- a/pEpForiOS/KeySync/KeySyncDeviceGroupUtil.swift	Tue Feb 04 12:16:29 2020 +0100
     4.2 +++ b/pEpForiOS/KeySync/KeySyncDeviceGroupUtil.swift	Wed Feb 05 11:38:43 2020 +0100
     4.3 @@ -10,23 +10,24 @@
     4.4  import PEPObjCAdapterFramework
     4.5  
     4.6  protocol KeySyncUtilProtocol: class {
     4.7 -    static var deviceGroupState: DeviceGroupState { get }
     4.8      static func leaveDeviceGroup() throws
     4.9      static var isInDeviceGroup: Bool { get }
    4.10      static var isKeySyncEnabled: Bool { get }
    4.11      static func enableKeySync()
    4.12      static func disableKeySync()
    4.13 -
    4.14  }
    4.15  
    4.16 -class KeySyncUtil: KeySyncUtilProtocol {
    4.17 +class KeySyncUtil {
    4.18  
    4.19      /// Pure static API.
    4.20      private init() {}
    4.21  
    4.22 -    static var deviceGroupState: DeviceGroupState {
    4.23 +    static private var deviceGroupState: DeviceGroupState {
    4.24          return AppSettings.shared.lastKnownDeviceGroupState
    4.25      }
    4.26 +}
    4.27 +
    4.28 +extension KeySyncUtil: KeySyncUtilProtocol {
    4.29  
    4.30      static func leaveDeviceGroup() throws {
    4.31          try PEPSession().leaveDeviceGroup()
    4.32 @@ -47,6 +48,13 @@
    4.33      }
    4.34  
    4.35      static func disableKeySync() {
    4.36 +        if isInDeviceGroup {
    4.37 +            do {
    4.38 +                try leaveDeviceGroup()
    4.39 +            } catch {
    4.40 +                Log.shared.errorAndCrash(error: error)
    4.41 +            }
    4.42 +        }
    4.43          AppSettings.shared.keySyncEnabled = false
    4.44      }
    4.45  }
     5.1 --- a/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCell.swift	Tue Feb 04 12:16:29 2020 +0100
     5.2 +++ b/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCell.swift	Wed Feb 05 11:38:43 2020 +0100
     5.3 @@ -64,8 +64,9 @@
     5.4          let selectedRange = textView.selectedRange
     5.5          let attrText = NSMutableAttributedString(attributedString: textView.attributedText)
     5.6          attrText.replaceCharacters(in: selectedRange, with: text)
     5.7 +        let font = UIFont.pepFont(style: .body, type: .regular)
     5.8          attrText.addAttribute(NSAttributedString.Key.font,
     5.9 -                              value: UIFont.pepBody,
    5.10 +                              value: font,
    5.11                                range: NSRange(location: 0, length: attrText.length))
    5.12          textView.attributedText = attrText
    5.13          viewModel?.handleTextChange(newText: textView.text,
     6.1 --- a/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/NSAttributedString+RecipientTextUtils.swift	Tue Feb 04 12:16:29 2020 +0100
     6.2 +++ b/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/NSAttributedString+RecipientTextUtils.swift	Wed Feb 05 11:38:43 2020 +0100
     6.3 @@ -22,8 +22,10 @@
     6.4                                                                   maxWidth: maxWidth - margin)
     6.5              let attachString = NSAttributedString(attachment: textAttachment)
     6.6              attrText.replaceCharacters(in: selectedRange, with: attachString)
     6.7 +            let pepFont = UIFont.pepFont(style: .body, type: .regular)
     6.8 +
     6.9              attrText.addAttribute(NSAttributedString.Key.font,
    6.10 -                                  value: UIFont.pepBody,
    6.11 +                                  value: pepFont,
    6.12                                    range: NSRange(location: 0, length: attrText.length))
    6.13              return (NSAttributedString(attributedString: attrText), textAttachment)
    6.14      }
     7.1 --- a/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextViewModel+TextAttachment.swift	Tue Feb 04 12:16:29 2020 +0100
     7.2 +++ b/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextViewModel+TextAttachment.swift	Wed Feb 05 11:38:43 2020 +0100
     7.3 @@ -16,7 +16,7 @@
     7.4          private var font: UIFont
     7.5  
     7.6          init(recipient: Identity,
     7.7 -             font:  UIFont = UIFont.pepBody,
     7.8 +             font:  UIFont = UIFont.pepFont(style: .body, type: .regular),
     7.9               textColor: UIColor = .pEpGreen,
    7.10               maxWidth: CGFloat = 0.0) {
    7.11              self.recipient = recipient
     8.1 --- a/pEpForiOS/UI/EmailDisplay/EmailView/CellAndSections/MessageSenderCell.swift	Tue Feb 04 12:16:29 2020 +0100
     8.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailView/CellAndSections/MessageSenderCell.swift	Wed Feb 05 11:38:43 2020 +0100
     8.3 @@ -14,9 +14,11 @@
     8.4      public override func updateCell(model: ComposeFieldModel, message: Message) {
     8.5          super.updateCell(model: model, message: message)
     8.6          titleLabel?.text = message.from?.displayString
     8.7 -        titleLabel?.font = UIFont.pepFootnote
     8.8          
     8.9 -        let attributes = [NSAttributedString.Key.font: UIFont.pepFootnote,
    8.10 +        let font = UIFont.pepFont(style: .footnote, type: .semibold)
    8.11 +        titleLabel?.font = font
    8.12 +
    8.13 +        let attributes = [NSAttributedString.Key.font: font,
    8.14                            NSAttributedString.Key.foregroundColor: UIColor.lightGray]
    8.15          var temp: [String] = []
    8.16          message.allRecipients.forEach { (recepient) in
    8.17 @@ -24,6 +26,6 @@
    8.18              temp.append(recepient)
    8.19          }
    8.20          let toDestinataries = NSLocalizedString("To:", comment: "Compose field title") + temp.joined(separator: ", ")
    8.21 -        valueLabel?.attributedText = NSAttributedString(string: toDestinataries, attributes: attributes)
    8.22 +        valueLabel?.attributedText = NSAttributedString(string: toDestinataries, attributes: attributes as [NSAttributedString.Key : Any])
    8.23      }
    8.24  }
     9.1 --- a/pEpForiOS/UI/EmailDisplay/EmailView/CellAndSections/MessageSubjectCell.swift	Tue Feb 04 12:16:29 2020 +0100
     9.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailView/CellAndSections/MessageSubjectCell.swift	Wed Feb 05 11:38:43 2020 +0100
     9.3 @@ -13,8 +13,8 @@
     9.4      public override func updateCell(model: ComposeFieldModel, message: Message) {
     9.5          super.updateCell(model: model, message: message)
     9.6          titleLabel?.text = message.shortMessage
     9.7 -        titleLabel?.font = UIFont.pepFootnote
     9.8 -        valueLabel?.font = UIFont.pepFootnote
     9.9 +        titleLabel?.font = UIFont.pepFont(style: .footnote, type: .semibold)
    9.10 +        valueLabel?.font = UIFont.pepFont(style: .footnote, type: .semibold)
    9.11          if let originationDate = message.sent {
    9.12              UIHelper.putString((originationDate as Date).fullString(), toLabel: valueLabel)
    9.13          } else {
    10.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-Bold.ttf has changed
    11.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-BoldItalic.ttf has changed
    12.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-Heavy.ttf has changed
    13.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-HeavyItalic.ttf has changed
    14.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-Light.ttf has changed
    15.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-LightItalic.ttf has changed
    16.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-Medium.ttf has changed
    17.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-MediumItalic.ttf has changed
    18.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-Regular.ttf has changed
    19.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-RegularItalic.ttf has changed
    20.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-Semibold.ttf has changed
    21.1 Binary file pEpForiOS/UI/Fonts/SF/SFUIText-SemiboldItalic.ttf has changed
    22.1 Binary file pEpForiOS/UI/Fonts/SFUIText-Regular.ttf has changed
    23.1 --- a/pEpForiOS/UI/Settings/Setting/KeySyncSettings/KeySyncSwitchSettingViewModel.swift	Tue Feb 04 12:16:29 2020 +0100
    23.2 +++ b/pEpForiOS/UI/Settings/Setting/KeySyncSettings/KeySyncSwitchSettingViewModel.swift	Wed Feb 05 11:38:43 2020 +0100
    23.3 @@ -12,21 +12,21 @@
    23.4  
    23.5      // MARK: - SwitchSettingCellViewModelProtocol
    23.6  
    23.7 -    var cellIdentifier = "switchOptionCell"
    23.8 +    let cellIdentifier = "switchOptionCell"
    23.9      var delegate: keySyncActionsProtocol?
   23.10  
   23.11 -    var title = NSLocalizedString("p≡p Sync", comment: "pep sync title")
   23.12 +    private(set) var title = NSLocalizedString("p≡p Sync", comment: "pep sync title")
   23.13  
   23.14      func setSwitch(value: Bool) {
   23.15          delegate?.updateSyncStatus(to: value)
   23.16      }
   23.17  
   23.18 -    func switchValue() -> Bool {
   23.19 +    var switchValue: Bool {
   23.20          let keySyncEnabled = KeySyncUtil.isKeySyncEnabled
   23.21          return keySyncEnabled
   23.22      }
   23.23  
   23.24 -    func isGrouped() -> Bool {
   23.25 +    var isGrouped: Bool {
   23.26          return KeySyncUtil.isInDeviceGroup
   23.27      }
   23.28  }
   23.29 @@ -34,4 +34,3 @@
   23.30  protocol keySyncActionsProtocol {
   23.31      func updateSyncStatus(to: Bool)
   23.32  }
   23.33 -
    24.1 --- a/pEpForiOS/UI/Settings/Setting/OnOffSettings/ViewModel/PassiveModeViewModel.swift	Tue Feb 04 12:16:29 2020 +0100
    24.2 +++ b/pEpForiOS/UI/Settings/Setting/OnOffSettings/ViewModel/PassiveModeViewModel.swift	Wed Feb 05 11:38:43 2020 +0100
    24.3 @@ -20,7 +20,7 @@
    24.4          AppSettings.shared.passiveMode = value
    24.5      }
    24.6  
    24.7 -    func switchValue() -> Bool {
    24.8 +    var switchValue: Bool {
    24.9          return AppSettings.shared.passiveMode
   24.10      }
   24.11  }
    25.1 --- a/pEpForiOS/UI/Settings/Setting/OnOffSettings/ViewModel/UnecryptedSubjectViewModel.swift	Tue Feb 04 12:16:29 2020 +0100
    25.2 +++ b/pEpForiOS/UI/Settings/Setting/OnOffSettings/ViewModel/UnecryptedSubjectViewModel.swift	Wed Feb 05 11:38:43 2020 +0100
    25.3 @@ -20,7 +20,7 @@
    25.4          AppSettings.shared.unencryptedSubjectEnabled = !value
    25.5      }
    25.6  
    25.7 -    func switchValue() -> Bool {
    25.8 +    var switchValue: Bool {
    25.9          return !AppSettings.shared.unencryptedSubjectEnabled
   25.10      }
   25.11  }
    26.1 --- a/pEpForiOS/UI/Settings/SettingSwitchTableViewCell.swift	Tue Feb 04 12:16:29 2020 +0100
    26.2 +++ b/pEpForiOS/UI/Settings/SettingSwitchTableViewCell.swift	Wed Feb 05 11:38:43 2020 +0100
    26.3 @@ -29,7 +29,7 @@
    26.4  
    26.5      func setSwitchValue() {
    26.6          if let vm = viewModel {
    26.7 -            switchItem.setOn(vm.switchValue(), animated: false)
    26.8 +            switchItem.setOn(vm.switchValue, animated: false)
    26.9          }
   26.10      }
   26.11  }
    27.1 --- a/pEpForiOS/UI/Settings/ViewModel/SettingCellViewModelProtocols.swift	Tue Feb 04 12:16:29 2020 +0100
    27.2 +++ b/pEpForiOS/UI/Settings/ViewModel/SettingCellViewModelProtocols.swift	Wed Feb 05 11:38:43 2020 +0100
    27.3 @@ -18,7 +18,7 @@
    27.4      func setSwitch(value: Bool)
    27.5  
    27.6      /// - Returns: Current value of the switch
    27.7 -    func switchValue() -> Bool
    27.8 +    var switchValue: Bool { get }
    27.9  }
   27.10  
   27.11  /// Rather complex settings cell that offers more than a simple ON/OFF switch only
    28.1 --- a/pEpForiOS/UI/Settings/ViewModel/SettingsViewModel.swift	Tue Feb 04 12:16:29 2020 +0100
    28.2 +++ b/pEpForiOS/UI/Settings/ViewModel/SettingsViewModel.swift	Wed Feb 05 11:38:43 2020 +0100
    28.3 @@ -19,11 +19,10 @@
    28.4  final class SettingsViewModel {
    28.5      private(set) var sections = [SettingsSectionViewModel]()
    28.6      weak var delegate: SettingsViewModelDelegate?
    28.7 -    var isGrouped: Bool {
    28.8 +    public var isGrouped: Bool {
    28.9          return KeySyncUtil.isInDeviceGroup
   28.10      }
   28.11  
   28.12 -
   28.13      // MARK: - Life Cycle
   28.14  
   28.15      init(delegate: SettingsViewModelDelegate? = nil) {
   28.16 @@ -84,13 +83,6 @@
   28.17          if value {
   28.18              KeySyncUtil.enableKeySync()
   28.19          } else {
   28.20 -            if isGrouped { //BUFF: move to keySyncUtil
   28.21 -                do {
   28.22 -                    try KeySyncUtil.leaveDeviceGroup()
   28.23 -                } catch {
   28.24 -                    Log.shared.errorAndCrash(error: error)
   28.25 -                }
   28.26 -            }
   28.27              KeySyncUtil.disableKeySync()
   28.28          }
   28.29      }
    29.1 --- a/pEpForiOS/Util/Appearance.swift	Tue Feb 04 12:16:29 2020 +0100
    29.2 +++ b/pEpForiOS/Util/Appearance.swift	Wed Feb 05 11:38:43 2020 +0100
    29.3 @@ -68,9 +68,12 @@
    29.4  
    29.5          appearance.configureWithOpaqueBackground()
    29.6  
    29.7 -        let font = UIFont.systemFont(ofSize: 17, weight: .regular)
    29.8 +        let font = UIFont.pepFont(style: .headline, type: .medium)
    29.9 +        
   29.10          let titleTextAttributes: [NSAttributedString.Key : Any] = [.foregroundColor: color,
   29.11 -                                                                   .font: font]
   29.12 +                                                                   .font: font,
   29.13 +                                                                   .baselineOffset: -2
   29.14 +        ]
   29.15          appearance.buttonAppearance.normal.titleTextAttributes = titleTextAttributes
   29.16          appearance.backButtonAppearance.normal.titleTextAttributes = titleTextAttributes
   29.17          appearance.titleTextAttributes = titleTextAttributes
    30.1 --- a/pEpForiOS/Util/Extensions/NSAttributedString+pEp.swift	Tue Feb 04 12:16:29 2020 +0100
    30.2 +++ b/pEpForiOS/Util/Extensions/NSAttributedString+pEp.swift	Wed Feb 05 11:38:43 2020 +0100
    30.3 @@ -113,9 +113,10 @@
    30.4                  let attachString = NSAttributedString(attachment: at)
    30.5                  new.append(attachString)
    30.6              }
    30.7 +            let pepFont = UIFont.pepFont(style: .body, type: .regular)
    30.8  
    30.9              new.addAttribute(NSAttributedString.Key.font,
   30.10 -                             value: UIFont.pepBody,
   30.11 +                             value: pepFont,
   30.12                               range: NSRange(location: 0, length: new.length)
   30.13              )
   30.14              new.addAttribute(NSAttributedString.Key.baselineOffset,
    31.1 --- a/pEpForiOS/Util/IdentityImageTool.swift	Tue Feb 04 12:16:29 2020 +0100
    31.2 +++ b/pEpForiOS/Util/IdentityImageTool.swift	Wed Feb 05 11:38:43 2020 +0100
    31.3 @@ -89,7 +89,6 @@
    31.4          return cache.image
    31.5      }
    31.6  
    31.7 -
    31.8      func identityImage(for identityKey: IdentityKey,
    31.9                         imageSize: CGSize = CGSize.defaultAvatarSize,
   31.10                         textColor: UIColor = UIColor.white,
    32.1 --- a/pEpForiOSTests/Models/Settings/PassiveModeViewModelTest.swift	Tue Feb 04 12:16:29 2020 +0100
    32.2 +++ b/pEpForiOSTests/Models/Settings/PassiveModeViewModelTest.swift	Wed Feb 05 11:38:43 2020 +0100
    32.3 @@ -23,13 +23,13 @@
    32.4          viewModel.setSwitch(value: true)
    32.5          XCTAssertTrue(AppSettings.shared.passiveMode)
    32.6  
    32.7 -        var switchValue = viewModel.switchValue()
    32.8 +        var switchValue = viewModel.switchValue
    32.9          XCTAssertTrue(switchValue)
   32.10  
   32.11          viewModel.setSwitch(value: false)
   32.12          XCTAssertFalse(AppSettings.shared.passiveMode)
   32.13  
   32.14 -        switchValue = viewModel.switchValue()
   32.15 +        switchValue = viewModel.switchValue
   32.16          XCTAssertFalse(switchValue)
   32.17      }
   32.18  }
    33.1 --- a/pEpForiOSTests/Models/Settings/UnencryptedSubjectViewModelTest.swift	Tue Feb 04 12:16:29 2020 +0100
    33.2 +++ b/pEpForiOSTests/Models/Settings/UnencryptedSubjectViewModelTest.swift	Wed Feb 05 11:38:43 2020 +0100
    33.3 @@ -22,13 +22,13 @@
    33.4          viewModel.setSwitch(value: true)
    33.5          XCTAssertFalse(AppSettings.shared.unencryptedSubjectEnabled)
    33.6  
    33.7 -        var switchValue = viewModel.switchValue()
    33.8 +        var switchValue = viewModel.switchValue
    33.9          XCTAssertTrue(switchValue)
   33.10  
   33.11          viewModel.setSwitch(value: false)
   33.12          XCTAssertTrue(AppSettings.shared.unencryptedSubjectEnabled)
   33.13  
   33.14 -        switchValue = viewModel.switchValue()
   33.15 +        switchValue = viewModel.switchValue
   33.16          XCTAssertFalse(switchValue)
   33.17      }
   33.18  }