pkluz / PKHUD

A Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8.
MIT License
3.79k stars 494 forks source link

iOS 11 assertion failure in FrameView #187

Closed hpeikemo closed 7 years ago

hpeikemo commented 7 years ago

iOS 11 SDK introduces an assertion failure when a subview is added directly onto a UIVisualEffectView and not its contentView The following patch resolves the issue

diff --git a/PKHUD/FrameView.swift b/PKHUD/FrameView.swift
index 5ef1769..787f72e 100644
--- a/PKHUD/FrameView.swift
+++ b/PKHUD/FrameView.swift
@@ -57,7 +57,7 @@ internal class FrameView: UIVisualEffectView {
             _content.clipsToBounds = true
             _content.contentMode = .center
             frame.size = _content.bounds.size
-            addSubview(_content)
+            contentView.addSubview(_content)
         }
     }
 }
PGLongo commented 7 years ago

You should use the swift4 branch