Parcourir la source

Merge branch 'master' into lukeredpath/swift-5.7

Pierre-Marc Airoldi il y a 3 ans
Parent
commit
4720a296ec

+ 6 - 0
ChartsDemo-iOS/Objective-C/AppDelegate.m

@@ -24,6 +24,12 @@
     
     DemoListViewController *vc = [[DemoListViewController alloc] init];
     UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
+    if (@available(iOS 13.0, *)) {
+        UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
+        [appearance configureWithOpaqueBackground];
+        nvc.navigationBar.standardAppearance = appearance;
+        nvc.navigationBar.scrollEdgeAppearance = appearance;
+    }
     
     _window.rootViewController = nvc;
     [_window makeKeyAndVisible];

+ 6 - 0
ChartsDemo-iOS/Swift/AppDelegate.swift

@@ -22,6 +22,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         
         let vc = DemoListViewController()
         let nav = UINavigationController(rootViewController: vc)
+        if #available(iOS 13.0, *) {
+            let appearance = UINavigationBarAppearance()
+            appearance.configureWithOpaqueBackground()
+            nav.navigationBar.standardAppearance = appearance
+            nav.navigationBar.scrollEdgeAppearance = appearance
+        }
         
         window?.rootViewController = nav
         window?.makeKeyAndVisible()

+ 1 - 1
README.md

@@ -36,7 +36,7 @@ I've chosen to write it in `Swift` as it can be highly optimized by the compiler
 In order to correctly compile:
 
 1. Drag the `Charts.xcodeproj` to your project  
-2. Go to your target's settings, hit the "+" under the "Embedded Binaries" section, and select the Charts.framework  
+2. Go to your target's settings, hit the "+" under the "Frameworks, Libraries, and Embedded Content" section, and select the Charts.framework  
 3. `@import Charts`  
 4.  When using Swift in an ObjC project:
    - You need to import your Bridging Header. Usually it is "*YourProject-Swift.h*", so in ChartsDemo it's "*ChartsDemo-Swift.h*". Do not try to actually include "*ChartsDemo-Swift.h*" in your project :-)

+ 1 - 2
Source/Charts/Data/Implementations/Standard/ChartDataSet.swift

@@ -435,8 +435,7 @@ extension ChartDataSet: RandomAccessCollection {
 
 // MARK: RangeReplaceableCollection
 extension ChartDataSet: RangeReplaceableCollection {
-    public func replaceSubrange<C>(_ subrange: Swift.Range<Index>, with newElements: C) where C : Collection, Element == C.Element
-    {
+    public func replaceSubrange<C>(_ subrange: Swift.Range<Index>, with newElements: C) where C : Collection, Element == C.Element {
         entries.replaceSubrange(subrange, with: newElements)
         notifyDataSetChanged()
     }