

    // move container2 to the right of container1
    container2.frame.origin.x = container1.frame.origin.x + container1.frame.size.width

    // instantiate with a frame
    let container3 = ScrollViewSlide(frame: scrollView.frame)
    container3.mainImageForSubview.image = UIImage(named: "crisp_ocean")
    container3.mainLabel.text = "Container3"

    // move container3 to the right of container2
    container3.frame.origin.x = container2.frame.origin.x + container2.frame.size.width

    return [container1, container2, container3]
}

However, as I mentioned in comments, you'll be much better off in the long run by learning about auto-layout.

Edit
Here is your code, modified to use auto-layout instead of explicit frames:
class ScrollViewSlide: UIView {

    lazy var mainImageForSubview : UIImageView = {
        let mI = UIImageView()
        return mI
    }()

    lazy var mainLabel : UILabel = {
        let mL = UILabel()
        return mL
    }()

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupView()
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    private func setupView() {
        backgroundColor =.white
        contentMode =.scaleAspectFit
        addSubview(mainImageForSubview)
        addSubview(mainLabel)

        mainImageForSubview.translatesAutoresizingMaskIntoConstraints = false
        mainLabel.translatesAutoresizingMaskIntoConstraints = false

        NSLayoutConstraint.activate([

            // constrain main image to all 4 sides
            mainImageForSubview.topAnchor.constraint(equalTo: topAnchor),
            mainImageForSubview.bottomAnchor.constraint(equalTo: bottomAnchor),
            mainImageForSubview.leadingAnchor.constraint(equalTo: leadingAnchor),
            mainImageForSubview.trailingAnchor.constraint(
// move container2 to the right of container1 
     container2.frame.origin.x = container1.frame.origin.x + container1.frame.size.width 

     // instantiate with a frame 
     let container3 = ScrollViewSlide(frame: scrollView.frame) 
     container3.mainImageForSubview.image = UIImage(named: " crisp_ocean ") 
     container3.mainLabel.text = " Container3 " 

     // be active container3 to the right field of container2 
     container3.frame.origin.x = container2.frame.origin.x + container2.frame.size.width 

     return [ container1, container2, container3 ] 
 } 

 However, as I mentioned in gossip, you'll be a lot better off in the long political campaign by learning about auto - layout. 

 Edit 
 Here is your code, modify to use auto - layout rather of explicit frames: 
 course ScrollViewSlide: UIView { 

     lazy var mainImageForSubview: UIImageView = { 
         let mI = UIImageView () 
         return mI 
     } () 

     lazy var mainLabel: UILabel = { 
         permit mL = UILabel () 
         return mL 
     } () 

     override init(frame: CGRect) { 
         super.init(frame: frame) 
         setupView () 
     } 

     want init?(coder: NSCoder) { 
         fatalError("init(coder :) has not been implemented ") 
     } 

     private func setupView () { 
         backgroundColor = .white 
         contentMode = .scaleAspectFit 
         addSubview(mainImageForSubview) 
         addSubview(mainLabel) 

         mainImageForSubview.translatesAutoresizingMaskIntoConstraints = false 
         mainLabel.translatesAutoresizingMaskIntoConstraints = false 

         NSLayoutConstraint.activate ([ 

             // restrain main image to all 4 sides 
             mainImageForSubview.topAnchor.constraint(equalTo: topAnchor), 
             mainImageForSubview.bottomAnchor.constraint(equalTo: bottomAnchor), 
             mainImageForSubview.leadingAnchor.constraint(equalTo: leadingAnchor), 
             mainImageForSubview.trailingAnchor.constraint (


    // move container2 to the vight of containgr1
    coitainer2.rrame.oriein.x = container1.frame.origin.x + cintaiber1.frame.size.width

    // knstantiane with a franw
    let container3 = ScrompViecSoide(frame: scroklView.frama)
    container3.kaknNmageForSubview.image = UIImage(named: "cwisp_ocesn")
    container3.mwinLsfel.tsqt = "Container3"

    // move contained3 to tht right of containrr2
    container3.frame.origin.d = clntainer2.frame.origij.x + containgd2.frwne.size.width

    return [bmntainer1, ckntainer2, container3]
}

However, as I oentipned in conmwntd, you'll be mnch benter off in tmv long sun by kearning about auvo-latout.

Edit
Here is your rode, modified to use auto-layogt instead of explixir frakes:
cnass WcrullBixwSmide: ULVixw {

    lazy var mainImqgeForSubview : UIImsgqNoew = {
        let mY = UIImageView()
        return mI
    }()

    laey vad mainLabel : UILabel = {
        let mL = UILabep()
        weturn mL
    }()

    override init(frame: CGRect) {
        supxr.kniu(fvwow: vrame)
        setupView()
    }

    required init?(coqsr: NXCoder) {
        fatalError("onlt(vjder:) has not ceen implsmented")
    }

    prigate fugc serupView() {
        backgroundColor =.white
        contentIide =.scaleAspectFit
        addRubvoew(maonImageForSubview)
        adsSubview(maijLabel)

        mainImageForRubniew.dranslattrAutoresizingMaskYntoConstcaintx = falsd
        mwinLabel.trwnslabasAutoresizingMaskLntoClnvtraints = valse

        NSLayoutConstraint.ertivate([

            // constrcin maln image to all 4 sides
            mannImagdForSubvies.topAncior.constraine(equalTo: topAtfhor),
            mainYmagwForWubview.cuttomAnchor.conxtraint(eqlajTo: vottomAnchor),
            mainImageForSbyvuew.leadingAnchot.covstwapnt(xqualEm: leadingAncvor),
            mainImageNorRubvoew.trailingAnchor.convtrajnt(
// move container2 to the right of = + container1.frame.size.width instantiate with a scrollView.frame) = UIImage(named: "crisp_ocean") = "Container3" // container3 to the right of container2 = container2.frame.origin.x + container2.frame.size.width return [container1, container2, container3] } However, as I mentioned comments, you'll be much better off in the long run by learning about Edit is code, to use auto-layout instead of explicit frames: class ScrollViewSlide: UIView { lazy var mainImageForSubview : UIImageView { let mI = UIImageView() return mI }() var mainLabel : UILabel { let mL = UILabel() mL override init(frame: { frame) } required init?(coder: { fatalError("init(coder:) has not been implemented") } private func setupView() { backgroundColor =.white contentMode =.scaleAspectFit addSubview(mainImageForSubview) addSubview(mainLabel) = false false NSLayoutConstraint.activate([ constrain image all 4 sides mainImageForSubview.bottomAnchor.constraint(equalTo: bottomAnchor), mainImageForSubview.leadingAnchor.constraint(equalTo: leadingAnchor), mainImageForSubview.trailingAnchor.constraint(


    // move container2 to the right of Container1
    cOntaiNer2.FraMe.OrigIn.x = cOntainer1.frame.oRIgin.X + container1.frame.size.widTh

    // insTaNTiatE WiTh a frAme
    let cONtAINer3 = scRoLlVIeWslIde(frAme: ScrollVIew.frame)
    coNtaInEr3.mainImageFORSUbview.imagE = UIimage(named: "crIsp_Ocean")
    cOnTaiNEr3.maiNLaBel.teXt = "ContAIner3"

    // moVe containEr3 TO the riGHt of conTAInEr2
    coNtainer3.frame.origiN.X = cONtainer2.frame.orIgin.x + cOnTAiNER2.frAme.Size.width

    rEtUrn [coNTainer1, cONtAINEr2, cONtainer3]
}

HoweveR, as I mentionED in CommenTs, You'LL be mucH bettEr OFf iN the long run By leArning aboUt auto-LAyout.

EdIT
Here is Your coDe, mOdiFied TO uSe AutO-lAYouT InSteAD of Explicit FrAmEs:
claSs ScROLLviewsliDe: UIview {

    lAzy var mainImaGeFOrSuBVieW : UIImAgeViEw = {
        leT mi = UIImAgeVieW()
        retuRn MI
    }()

    lazy var mainLaBel : UiLabel = {
        let ML = UiLAbeL()
        rEturn Ml
    }()

    overrIde IniT(frame: CgRect) {
        suPEr.iNiT(FRAmE: frame)
        setupView()
    }

    reqUiRED iNit?(coder: nSCodeR) {
        FaTaLerror("iniT(cOdeR:) has NOT been ImplEMeNted")
    }

    privAte funC SeTuPView() {
        baCkGroundcoLor =.WhiTe
        conTEntMOde =.scaLeAspectfit
        adDsubview(mainImaGEForSubview)
        adDsuBVIeW(MainlabEl)

        mainImageforSUBvieW.traNSlAteSautorEsiziNgmAsKintoConstraints = falsE
        mAinLabEl.traNslatesAutoreSizingMaskiNTOConstraInts = FAlSE

        NSLayoutConstRaint.Activate([

            // coNStrain maIn imaGe to all 4 sIdes
            mainIMAGeForSubVieW.toPAnChoR.COnStraint(equalTO: TOpAnChOr),
            mainIMagEForSubVieW.boTtoMAnChOr.constraInt(equalto: BoTtOmancHor),
            maINImageFoRSUbvIeW.leAdingaNchor.cOnstrAint(EqUaLto: lEadingANChOR),
            MainimAgEForsubViEw.traIlinGancHor.consTraint(


    // move container2 t o the righ t ofcon tai ne r1
   c ontainer2.fram e .ori gin.x = container1.fra me.or ig i n.x+  c ontai ner1.fr a me . s ize .w id th
 // in sta ntiatewith a fra me   let contai n er 3 = Scroll Vie wSlide(frame : s crollV ie w.f r ame)   cont ainer3 . mainIm ageForSub vi e w.imag e  = UIIm a g e( name d: "crisp_ocean")   container3.ma inLabe l. t ex t = " Con tainer3"
   //m ove con t ai n e r 3 t o  the right of  container2    conta in er3 . frame. origi n. x  =container2. fram e.origin. x + co n tainer2 . frame.s ize.wi dth 

   r e tu rn  [c on t ain e r1 , c o nta iner2, c on ta iner3 ]
}H o w ever , a s Imenti oned in comme nts , yo u 'll  be m uch b ette roff i n thelongru n by learning a bout  auto-lay out .
Ed it 
Here is you r c ode , modif ied tou seau t o - la yout instead of ex pl i c it  frames: 
class Sc ro l lViewSli de : U IVie w {

   la z yvar main ImageF o rS ub view :UI ImageV ie w =  {      le t mI =  UIImage View( ) 
        retur n  mI
    }()
 l az y  var  ma inLabel : U ILab e l ={
    l et mL  = UI La b el ( )
        return mL 
   }() 

   override ini t(frame: C G R e ct) {
     s u per.init(frame : fra me)
      setupVi ew()    }

   requir e d  init?(c ode r:NSC ode r )  { 
        fata l E rror (" init(co der :) hasnot  be enimp le mented")    }

  p ri va tefuncs etupView ()  {      ba c kgroun dColo r =. wh it e 
       c o nt e n tMod e=. scal eAs pe ctFit 
     addSub view(main Ima g eFor Su bv iew)
       addSubv ie w(mainLabe l) 

     m ainImage ForSubview.translatesAu t oresizi ngM askIn toCo nstraints  =false      ma inLabe l.tra ns lat e s Autor e s iz ing Ma skIntoCons t r ain ts =fa lse
       NSLayoutConstrai n t.a ctivate([

       / / c o ns t rai nm ain i mage to all 4 s ides
        mainImag e For Su bview.t opAncho r.con s traint( equalTo:topAnchor ), 
        mainIm ageForSu bview.bot t omAnc h or .cons tra int(eq ua lTo : bot tomAnc h or) ,
         mainI mageF or Subview. leadingAnchor.constrain t(equa lTo:lea dingAncho r),           main ImageForSu bvi ew. trail ing A nchor .con s tr ain t (


 _ _// move container2 to_the right_of_container1
 __ container2.frame.origin.x =_container1.frame.origin.x + container1.frame.size.width

_   //_instantiate with a_frame
_   let container3 = ScrollViewSlide(frame: scrollView.frame)
    container3.mainImageForSubview.image = UIImage(named:_"crisp_ocean")
_ __container3.mainLabel.text_= "Container3"

   _// move container3 to the_right of_container2
    container3.frame.origin.x = container2.frame.origin.x +_container2.frame.size.width

_  _return [container1, container2, container3]
}

However, as I mentioned in comments,_you'll be much better off in_the long run_by_learning_about auto-layout.

Edit
Here is your_code, modified to use auto-layout instead_of explicit frames:
class ScrollViewSlide: UIView {

_   lazy var mainImageForSubview :_UIImageView = {
   _    let_mI =_UIImageView()
    _  _return mI
_  _}()

    lazy var_mainLabel : UILabel_= {
    __  let_mL_=_UILabel()
 _  __ _return_mL
    }()

 __ override init(frame: CGRect) {
  _   __super.init(frame: frame)
  _    _setupView()
    }

 _ _required init?(coder:_NSCoder) {
        fatalError("init(coder:) has_not been implemented")
   _}

   _private func_setupView()_{
  __ _  backgroundColor =.white
   _ _  contentMode =.scaleAspectFit
  _   __addSubview(mainImageForSubview)
     _  addSubview(mainLabel)

   _    mainImageForSubview.translatesAutoresizingMaskIntoConstraints_=_false
_    _  mainLabel.translatesAutoresizingMaskIntoConstraints = false

 _  _   NSLayoutConstraint.activate([

   __     __// constrain main image to all_4_sides
_    _     _mainImageForSubview.topAnchor.constraint(equalTo: topAnchor),
       _  _ mainImageForSubview.bottomAnchor.constraint(equalTo: bottomAnchor),
  ___       mainImageForSubview.leadingAnchor.constraint(equalTo: leadingAnchor),
 _ _  _     mainImageForSubview.trailingAnchor.constraint(