Skip to content

Commit

Permalink
Revert "Feat/max_mrec_support (#14)"
Browse files Browse the repository at this point in the history
This reverts commit ac888a9.
  • Loading branch information
tiandrew committed Jan 28, 2020
1 parent 21163ac commit f9b9fe5
Show file tree
Hide file tree
Showing 15 changed files with 89 additions and 1,055 deletions.
22 changes: 2 additions & 20 deletions DemoApp-ObjC/DemoApp-ObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
1D992FE6231FA1C400C472F8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D992FE4231FA1C400C472F8 /* Main.storyboard */; };
1D992FE8231FA1C500C472F8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1D992FE7231FA1C500C472F8 /* Assets.xcassets */; };
1D992FEB231FA1C500C472F8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D992FE9231FA1C500C472F8 /* LaunchScreen.storyboard */; };
371C9BD323CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 371C9BD223CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m */; };
37C7E1EB2328904E002165B5 /* ALAutoLayoutBannerAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D0CB33523204D120076AAAA /* ALAutoLayoutBannerAdViewController.m */; };
37C7E1EC2328904E002165B5 /* ALFrameLayoutBannerAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 37C7E1E823285E94002165B5 /* ALFrameLayoutBannerAdViewController.m */; };
37C7E1ED2328904E002165B5 /* ALInterstitialAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D0CB32F23204CE70076AAAA /* ALInterstitialAdViewController.m */; };
Expand All @@ -19,8 +18,6 @@
37C7E1F3232892CF002165B5 /* ALAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D992FDF231FA1C400C472F8 /* ALAppDelegate.m */; };
37C7E1F523297423002165B5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D992FED231FA1C500C472F8 /* main.m */; };
37C7E1F62329742E002165B5 /* ALHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D992FE2231FA1C400C472F8 /* ALHomeViewController.m */; };
37DD986423DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 37DD986323DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m */; };
37DD986723DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 37DD986623DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m */; };
C0DE8BB3234E8A86004B0CFC /* ALBaseAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C0DE8BB2234E8A86004B0CFC /* ALBaseAdViewController.m */; };
/* End PBXBuildFile section */

Expand All @@ -41,16 +38,10 @@
1D992FEA231FA1C500C472F8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
1D992FEC231FA1C500C472F8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1D992FED231FA1C500C472F8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
371C9BD223CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALAutoLayoutMrecAdViewController.m; sourceTree = "<group>"; };
371C9BD423CE8AAC0010DE84 /* ALAutoLayoutMrecAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALAutoLayoutMrecAdViewController.h; sourceTree = "<group>"; };
37C7E1E523285B4E002165B5 /* ALInterfaceBuilderBannerAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALInterfaceBuilderBannerAdViewController.m; sourceTree = "<group>"; };
37C7E1E723285B6A002165B5 /* ALInterfaceBuilderBannerAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALInterfaceBuilderBannerAdViewController.h; sourceTree = "<group>"; };
37C7E1E823285E94002165B5 /* ALFrameLayoutBannerAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALFrameLayoutBannerAdViewController.m; sourceTree = "<group>"; };
37C7E1EA23285EDF002165B5 /* ALFrameLayoutBannerAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALFrameLayoutBannerAdViewController.h; sourceTree = "<group>"; };
37DD986323DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALFrameLayoutMrecAdViewController.m; sourceTree = "<group>"; };
37DD986523DA6D4D00704AA5 /* ALFrameLayoutMrecAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALFrameLayoutMrecAdViewController.h; sourceTree = "<group>"; };
37DD986623DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALInterfaceBuilderMrecAdViewController.m; sourceTree = "<group>"; };
37DD986823DA701A00704AA5 /* ALInterfaceBuilderMrecAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALInterfaceBuilderMrecAdViewController.h; sourceTree = "<group>"; };
C0DE8BB1234E8A86004B0CFC /* ALBaseAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALBaseAdViewController.h; sourceTree = "<group>"; };
C0DE8BB2234E8A86004B0CFC /* ALBaseAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALBaseAdViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand All @@ -71,20 +62,14 @@
children = (
1D0CB33423204D120076AAAA /* ALAutoLayoutBannerAdViewController.h */,
1D0CB33523204D120076AAAA /* ALAutoLayoutBannerAdViewController.m */,
371C9BD423CE8AAC0010DE84 /* ALAutoLayoutMrecAdViewController.h */,
371C9BD223CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m */,
37C7E1EA23285EDF002165B5 /* ALFrameLayoutBannerAdViewController.h */,
37C7E1E823285E94002165B5 /* ALFrameLayoutBannerAdViewController.m */,
37DD986523DA6D4D00704AA5 /* ALFrameLayoutMrecAdViewController.h */,
37DD986323DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m */,
1D0CB32E23204CE70076AAAA /* ALInterstitialAdViewController.h */,
1D0CB32F23204CE70076AAAA /* ALInterstitialAdViewController.m */,
1D0CB33123204CF70076AAAA /* ALRewardedAdViewController.h */,
1D0CB33223204CF70076AAAA /* ALRewardedAdViewController.m */,
37C7E1E723285B6A002165B5 /* ALInterfaceBuilderBannerAdViewController.h */,
37C7E1E523285B4E002165B5 /* ALInterfaceBuilderBannerAdViewController.m */,
37DD986823DA701A00704AA5 /* ALInterfaceBuilderMrecAdViewController.h */,
37DD986623DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m */,
);
path = Ads;
sourceTree = "<group>";
Expand Down Expand Up @@ -113,9 +98,9 @@
1D992FDF231FA1C400C472F8 /* ALAppDelegate.m */,
1D992FE1231FA1C400C472F8 /* ALHomeViewController.h */,
1D992FE2231FA1C400C472F8 /* ALHomeViewController.m */,
1D993015231FA39000C472F8 /* Supporting Files */,
C0DE8BB1234E8A86004B0CFC /* ALBaseAdViewController.h */,
C0DE8BB2234E8A86004B0CFC /* ALBaseAdViewController.m */,
1D993015231FA39000C472F8 /* Supporting Files */,
);
path = "DemoApp-ObjC";
sourceTree = "<group>";
Expand Down Expand Up @@ -203,17 +188,14 @@
buildActionMask = 2147483647;
files = (
C0DE8BB3234E8A86004B0CFC /* ALBaseAdViewController.m in Sources */,
37DD986423DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m in Sources */,
37C7E1F62329742E002165B5 /* ALHomeViewController.m in Sources */,
37C7E1F523297423002165B5 /* main.m in Sources */,
37C7E1F3232892CF002165B5 /* ALAppDelegate.m in Sources */,
37C7E1EB2328904E002165B5 /* ALAutoLayoutBannerAdViewController.m in Sources */,
37C7E1EC2328904E002165B5 /* ALFrameLayoutBannerAdViewController.m in Sources */,
371C9BD323CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m in Sources */,
37C7E1ED2328904E002165B5 /* ALInterstitialAdViewController.m in Sources */,
37C7E1EE2328904E002165B5 /* ALRewardedAdViewController.m in Sources */,
37C7E1EF2328904E002165B5 /* ALInterfaceBuilderBannerAdViewController.m in Sources */,
37DD986723DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
32 changes: 24 additions & 8 deletions DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutBannerAdViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,34 @@ - (void)viewDidLoad

[self.view addSubview: self.adView];

// Anchor the banner to the left, right, and top of the screen.
[[self.adView.leadingAnchor constraintEqualToAnchor: self.view.leadingAnchor] setActive: YES];
[[self.adView.trailingAnchor constraintEqualToAnchor: self.view.trailingAnchor] setActive: YES];
[[self.adView.topAnchor constraintEqualToAnchor: self.view.topAnchor] setActive: YES];

[[self.adView.widthAnchor constraintEqualToAnchor: self.view.widthAnchor] setActive: YES];
[[self.adView.heightAnchor constraintEqualToConstant: UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad ? 90 : 50 ] setActive: YES];

// Center the banner and anchor it to the top of the screen.
CGFloat height = (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) ? 90 : 50; // Banner height on iPhone and iPad is 50 and 90, respectively
[self.view addConstraints: @[[self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeLeading],
[self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeTrailing],
[self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeTop],
[NSLayoutConstraint constraintWithItem: self.adView
attribute: NSLayoutAttributeHeight
relatedBy: NSLayoutRelationEqual
toItem: nil
attribute: NSLayoutAttributeNotAnAttribute
multiplier: 1.0
constant: height]]];

// Load the first ad
[self.adView loadAd];
}

- (NSLayoutConstraint *)constraintWithAdView:(MAAdView *)adView andAttribute:(NSLayoutAttribute)attribute
{
return [NSLayoutConstraint constraintWithItem: adView
attribute: attribute
relatedBy: NSLayoutRelationEqual
toItem: self.view
attribute: attribute
multiplier: 1.0
constant: 0.0];
}

#pragma mark - MAAdDelegate Protocol

- (void)didLoadAd:(MAAd *)ad
Expand Down
88 changes: 0 additions & 88 deletions DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMRecAdViewController.m

This file was deleted.

17 changes: 0 additions & 17 deletions DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMrecAdViewController.h

This file was deleted.

17 changes: 0 additions & 17 deletions DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.h

This file was deleted.

88 changes: 0 additions & 88 deletions DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.m

This file was deleted.

This file was deleted.

Loading

0 comments on commit f9b9fe5

Please sign in to comment.