{"id":10818,"date":"2024-08-27T17:46:20","date_gmt":"2024-08-27T15:46:20","guid":{"rendered":"https:\/\/refinery89.com\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/"},"modified":"2024-08-27T17:53:20","modified_gmt":"2024-08-27T15:53:20","slug":"creating-a-wrapper","status":"publish","type":"docs","link":"https:\/\/refinery89.com\/de\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/","title":{"rendered":"Creating a Wrapper"},"content":{"rendered":"<p data-renderer-start-pos=\"1\">The SDK uses the wrapper to put the ad in it. The wrapper is a <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">UIView<\/code> from the <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">UIKit<\/code> framework, the <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">UIView<\/code> can be linked from the XCode\u2019s UI builder or be created programmatically in the view controller.<\/p>\n<p data-renderer-start-pos=\"207\">Here is a short example that demonstrates the wrapper usage by creating it in the XCode\u2019s UI Builder.<\/p>\n<div class=\"rich-media-item mediaSingleView-content-wrap image-center cc-1eo4so5\" data-layout=\"center\" data-width=\"760\" data-width-type=\"pixel\" data-node-type=\"mediaSingle\" data-renderer-start-pos=\"311\">\n<div class=\"cc-jx55bv\">\n<div data-context-id=\"1027014821\" data-type=\"file\" data-node-type=\"media\" data-width=\"592\" data-height=\"361\" data-id=\"4952db61-8d79-4e49-9cc1-577918eac6bc\" data-collection=\"contentId-1027014821\" data-file-name=\"file\" data-file-size=\"1\" data-file-mime-type=\"\" data-alt=\"Screenshot 2024-06-19 at 10.35.18-20240619-063530.png\" data-renderer-start-pos=\"312\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone  wp-image-10282\" src=\"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png\" alt=\"\" width=\"877\" height=\"535\" \/><\/div>\n<\/div>\n<\/div>\n<p data-renderer-start-pos=\"314\">The <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">adContainer<\/code> is linked with the <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">AdViewController<\/code>, and provided to the <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">RefineryAdFactory.shared.createBanner(...)<\/code> method as a <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">wrapper<\/code> parameter.<\/p>\n<div class=\"code-block\">\n<pre>\r\n    class AdViewController: UIViewController {\r\n        @IBOutlet var adContainer:UIView!\r\n        override func viewDidLoad() {\r\n            super.viewDidLoad()\r\n            let configurationID = ConfigBuilder.companion.BANNER_TEST_R89_CONFIG_ID\r\n            RefineryAdFactory.shared.createBanner(\r\n            configurationID: configurationID,\r\n            wrapper: adContainer,\r\n            lifecycleCallbacks: nil)\r\n        }\r\n    }\r\n    <\/pre>\n<\/div>\n<div class=\"code-block cc-15qwbrk\"><\/div>\n<p data-renderer-start-pos=\"877\">Now the ad will be placed inside the <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">adContainer<\/code>.<\/p>\n<p data-renderer-start-pos=\"928\">Here is an equivalent example that demonstrates how to create the wrapper programmatically and display an ad in it.<\/p>\n<div class=\"code-block\">\n<pre>\r\n        class AdViewController: UIViewController {\r\n\r\n            let adContainer:UIView = {\r\n                let view = UIView()\r\n                view.translatesAutoresizingMaskIntoConstraints = false\r\n                return view\r\n            }()\r\n            \r\n            override func viewDidLoad() {\r\n                super.viewDidLoad()\r\n                \/\/ Add and center the adContainer in it\u2019s parent\r\n                view.addSubview(adContainer)\r\n                NSLayoutConstraint.activate([\r\n                    adContainer.centerXAnchor.constraint(equalTo: view.centerXAnchor),\r\n                    adContainer.centerYAnchor.constraint(equalTo: view.centerYAnchor),\r\n                ])\r\n                \/\/ Provide the adContainer as a wrapper parameter\r\n                let configurationID = ConfigBuilder.companion.BANNER_TEST_R89_CONFIG_ID\r\n                RefineryAdFactory.shared.createBanner(configurationID: configurationID,\r\n                wrapper: adContainer, lifecycleCallbacks: nil)\r\n            }\r\n        }\r\n    <\/pre>\n<\/div>\n<div class=\"code-block cc-15qwbrk\"><\/div>\n<p data-renderer-start-pos=\"1929\">Now the <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">adContainer<\/code> has been created programmatically. It is added and centered in its parent. The next step is the same, the instance of <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">adContainer<\/code> is provided to the <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">RefineryAdFactory.shared.createBanner<\/code> via <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">wrapper<\/code> argument, so the SDK will display the ad in it.<\/p>\n","protected":false},"featured_media":0,"parent":10813,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-10818","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating a Wrapper | Refinery89<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/refinery89.com\/de\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a Wrapper | Refinery89\" \/>\n<meta property=\"og:description\" content=\"The SDK uses the wrapper to put the ad in it. The wrapper is a UIView from the UIKit framework, the UIView can be linked from the XCode\u2019s UI builder or be created programmatically in the view controller. Here is a short example that demonstrates the wrapper usage by creating it in the XCode\u2019s UI [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/refinery89.com\/de\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/\" \/>\n<meta property=\"og:site_name\" content=\"Refinery89\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Refinery89\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-27T15:53:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@refinery89\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/\",\"url\":\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/\",\"name\":\"Creating a Wrapper | Refinery89\",\"isPartOf\":{\"@id\":\"https:\/\/refinery89.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png\",\"datePublished\":\"2024-08-27T15:46:20+00:00\",\"dateModified\":\"2024-08-27T15:53:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#primaryimage\",\"url\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png\",\"contentUrl\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/refinery89.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IOS &#8211; Monetize App SDK Documentation\",\"item\":\"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Privato: User Manual\",\"item\":\"https:\/\/refinery89.com\/it\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Creating a Wrapper\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/refinery89.com\/#website\",\"url\":\"https:\/\/refinery89.com\/\",\"name\":\"Refinery89\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/refinery89.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/refinery89.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/refinery89.com\/#organization\",\"name\":\"Refinery89\",\"alternateName\":\"R89\",\"url\":\"https:\/\/refinery89.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/refinery89.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\",\"contentUrl\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\",\"width\":200,\"height\":200,\"caption\":\"Refinery89\"},\"image\":{\"@id\":\"https:\/\/refinery89.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Refinery89\/\",\"https:\/\/x.com\/refinery89\",\"https:\/\/www.linkedin.com\/company\/refinery89\/\",\"https:\/\/www.youtube.com\/@refinery89\",\"https:\/\/www.instagram.com\/refinery_89\/\",\"https:\/\/www.reddit.com\/user\/Refinery89\/\",\"https:\/\/share.google\/K8hFf3ktmUrTi1XCa\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a Wrapper | Refinery89","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/refinery89.com\/de\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/","og_locale":"de_DE","og_type":"article","og_title":"Creating a Wrapper | Refinery89","og_description":"The SDK uses the wrapper to put the ad in it. The wrapper is a UIView from the UIKit framework, the UIView can be linked from the XCode\u2019s UI builder or be created programmatically in the view controller. Here is a short example that demonstrates the wrapper usage by creating it in the XCode\u2019s UI [&hellip;]","og_url":"https:\/\/refinery89.com\/de\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/","og_site_name":"Refinery89","article_publisher":"https:\/\/www.facebook.com\/Refinery89\/","article_modified_time":"2024-08-27T15:53:20+00:00","og_image":[{"url":"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@refinery89","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/","url":"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/","name":"Creating a Wrapper | Refinery89","isPartOf":{"@id":"https:\/\/refinery89.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#primaryimage"},"image":{"@id":"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#primaryimage"},"thumbnailUrl":"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png","datePublished":"2024-08-27T15:46:20+00:00","dateModified":"2024-08-27T15:53:20+00:00","breadcrumb":{"@id":"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#primaryimage","url":"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png","contentUrl":"https:\/\/refinery89.com\/wp-content\/uploads\/2024\/07\/30f3e010-befd-4942-a7cc-23d16d9d19c1-300x183.png"},{"@type":"BreadcrumbList","@id":"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/creating-a-wrapper\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/refinery89.com\/"},{"@type":"ListItem","position":2,"name":"IOS &#8211; Monetize App SDK Documentation","item":"https:\/\/refinery89.com\/it\/docs\/ios-monetize-app-sdk-documentation\/"},{"@type":"ListItem","position":3,"name":"Privato: User Manual","item":"https:\/\/refinery89.com\/it\/"},{"@type":"ListItem","position":4,"name":"Creating a Wrapper"}]},{"@type":"WebSite","@id":"https:\/\/refinery89.com\/#website","url":"https:\/\/refinery89.com\/","name":"Refinery89","description":"","publisher":{"@id":"https:\/\/refinery89.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/refinery89.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/refinery89.com\/#organization","name":"Refinery89","alternateName":"R89","url":"https:\/\/refinery89.com\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/refinery89.com\/#\/schema\/logo\/image\/","url":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","contentUrl":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","width":200,"height":200,"caption":"Refinery89"},"image":{"@id":"https:\/\/refinery89.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Refinery89\/","https:\/\/x.com\/refinery89","https:\/\/www.linkedin.com\/company\/refinery89\/","https:\/\/www.youtube.com\/@refinery89","https:\/\/www.instagram.com\/refinery_89\/","https:\/\/www.reddit.com\/user\/Refinery89\/","https:\/\/share.google\/K8hFf3ktmUrTi1XCa"]}]}},"comment_count":0,"_links":{"self":[{"href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/docs\/10818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/comments?post=10818"}],"version-history":[{"count":0,"href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/docs\/10818\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/docs\/10813"}],"next":[{"title":"Anzeigenformate","link":"https:\/\/refinery89.com\/de\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/ad-formats\/","href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/docs\/10819"}],"prev":[{"title":"Initialization Types","link":"https:\/\/refinery89.com\/de\/docs\/ios-monetize-app-sdk-documentation\/user-manual\/initialization-types\/","href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/docs\/10817"}],"wp:attachment":[{"href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/media?parent=10818"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/refinery89.com\/de\/wp-json\/wp\/v2\/doc_tag?post=10818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}