File tree Expand file tree Collapse file tree 1 file changed +6
-31
lines changed
TeadsSampleApp/Controllers/InRead/SAS/ScrollView Expand file tree Collapse file tree 1 file changed +6
-31
lines changed Original file line number Diff line number Diff line change @@ -47,38 +47,13 @@ class InReadSASScrollViewController: TeadsViewController {
4747 guard let adView = banner else {
4848 return
4949 }
50- view . addSubview ( adView)
50+ slotView . addSubview ( adView)
5151 adView. translatesAutoresizingMaskIntoConstraints = false
52- view. addConstraints ( [
53- NSLayoutConstraint ( item: adView,
54- attribute: . top,
55- relatedBy: . equal,
56- toItem: slotView,
57- attribute: . top,
58- multiplier: 1 ,
59- constant: 0 ) ,
60- NSLayoutConstraint ( item: adView,
61- attribute: . leading,
62- relatedBy: . equal,
63- toItem: slotView,
64- attribute: . leading,
65- multiplier: 1 ,
66- constant: 0 ) ,
67- NSLayoutConstraint ( item: adView,
68- attribute: . trailing,
69- relatedBy: . equal,
70- toItem: slotView,
71- attribute: . trailing,
72- multiplier: 1 ,
73- constant: 0 ) ,
74- NSLayoutConstraint ( item: adView,
75- attribute: . bottom,
76- relatedBy: . equal,
77- toItem: slotView,
78- attribute: . bottom,
79- multiplier: 1 ,
80- constant: 0 )
81- ] )
52+ let margins = slotView. layoutMarginsGuide
53+ adView. leadingAnchor. constraint ( equalTo: margins. leadingAnchor, constant: 0 ) . isActive = true
54+ adView. topAnchor. constraint ( equalTo: margins. topAnchor, constant: 0 ) . isActive = true
55+ adView. trailingAnchor. constraint ( equalTo: margins. trailingAnchor, constant: 0 ) . isActive = true
56+ adView. bottomAnchor. constraint ( equalTo: margins. bottomAnchor, constant: 0 ) . isActive = true
8257 }
8358
8459}
You can’t perform that action at this time.
0 commit comments