Skip to content

Commit

Permalink
v11.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Sep 26, 2023
1 parent 2db8d93 commit dff5717
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 37 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E590CB21-B6E8-43FF-B296-071EADB3A7B7"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Sources/ObjCSources/GleapFrameManagerViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "263"
endingLineNumber = "263"
landmarkName = "-userContentController:didReceiveScriptMessage:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
Expand Down Expand Up @@ -400,8 +384,8 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "402"
endingLineNumber = "402"
landmarkName = "Gleap"
landmarkType = "3">
landmarkName = "-startFeedbackFlow:withOptions:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
Expand Down Expand Up @@ -845,8 +829,8 @@
filePath = "../Sources/ObjCSources/GleapFeedbackButton.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "231"
endingLineNumber = "231"
startingLineNumber = "233"
endingLineNumber = "233"
landmarkName = "-setupClassicButton"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -861,8 +845,8 @@
filePath = "../Sources/ObjCSources/GleapFeedbackButton.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "233"
endingLineNumber = "233"
startingLineNumber = "235"
endingLineNumber = "235"
landmarkName = "-setupClassicButton"
landmarkType = "7">
<Locations>
Expand Down Expand Up @@ -924,8 +908,8 @@
filePath = "../Sources/ObjCSources/GleapFeedbackButton.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "267"
endingLineNumber = "267"
startingLineNumber = "269"
endingLineNumber = "269"
landmarkName = "-updateConstraintsForOrientation"
landmarkType = "7">
<Locations>
Expand Down Expand Up @@ -994,5 +978,37 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "35CD02F3-CB09-4494-BA33-196FDB592A6C"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Sources/ObjCSources/GleapFrameManagerViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "293"
endingLineNumber = "293"
landmarkName = "-userContentController:didReceiveScriptMessage:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "168EF313-7B97-4271-A28A-39D17CF12314"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Sources/ObjCSources/GleapFrameManagerViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "79"
endingLineNumber = "79"
landmarkName = "-viewDidLoad"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
2 changes: 1 addition & 1 deletion Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, GleapDelegate {

// Gleap.setApiUrl("http://localhost:9000")
// Gleap.setFrameUrl("http://localhost:3001/appnew.html")
Gleap.initialize(withToken: "ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV")
Gleap.initialize(withToken: "X5C0grjFCjUMbZKi131MjZLaGRwg2iKH")

Gleap.sharedInstance().delegate = self

Expand Down
2 changes: 1 addition & 1 deletion Gleap.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "Gleap"
s.version = "11.2.0"
s.version = "11.2.1"
s.summary = "In-App Bug Reporting and Tes2ting for Apps. Learn more at https://gleap.io"
s.homepage = "https://gleap.io"
s.license = { :type => 'Commercial', :file => 'LICENSE.md' }
Expand Down
44 changes: 33 additions & 11 deletions Sources/ObjCSources/GleapFeedbackButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ - (void)setupClassicButton {
context:nil];
int buttonWidth = feedbackButtonFrame.size.width + 40;

// Set the anchor point.
self.layer.anchorPoint = CGPointMake(0, 0);

// Find the perfect position.
float rotation = -90;

Expand All @@ -206,17 +203,20 @@ - (void)setupClassicButton {

// Set the auto layout constraints depending on the button position
if ([feedbackButtonPosition isEqualToString: @"BUTTON_CLASSIC_LEFT"]) {
self.layer.anchorPoint = CGPointMake(0.5, 0.5);
rotation = 90;
[window addConstraint: [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeCenterY multiplier:1 constant: -(buttonWidth / 2)]];

_edgeConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeLeading multiplier:1 constant: -(buttonHeight + 6)];
[window addConstraint: [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeCenterY multiplier:1 constant: 0]];

_edgeConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeLeading multiplier:1 constant: -(buttonHeight - 6)];

if (@available(iOS 11, *)) {
UILayoutGuide *guide = window.safeAreaLayoutGuide;
_safeAreaConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:guide attribute:NSLayoutAttributeLeading multiplier:1 constant: -(buttonHeight)];
_safeAreaConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:guide attribute:NSLayoutAttributeLeading multiplier:1 constant: -(buttonHeight - 6)];
}
} else if ([feedbackButtonPosition isEqualToString: @"BUTTON_CLASSIC_BOTTOM"]) {
rotation = 0;
self.layer.anchorPoint = CGPointMake(0, 0);

_edgeConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeBottom multiplier:1 constant: -(buttonHeight / 2)];

Expand All @@ -228,13 +228,15 @@ - (void)setupClassicButton {
[window addConstraint: [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:guide attribute: NSLayoutAttributeRight multiplier:1 constant: -((buttonWidth / 2) + 20)]];
}
} else {
[window addConstraint: [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeCenterY multiplier:1 constant: (buttonWidth / 2)]];
self.layer.anchorPoint = CGPointMake(0.5, 0.5);

_edgeConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeRight multiplier:1 constant: buttonHeight + 6];
[window addConstraint: [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeCenterY multiplier:1 constant: 0]];

_edgeConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeRight multiplier:1 constant: buttonHeight - 6];

if (@available(iOS 11, *)) {
UILayoutGuide *guide = window.safeAreaLayoutGuide;
_safeAreaConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:guide attribute: NSLayoutAttributeRight multiplier:1 constant: buttonHeight];
_safeAreaConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:guide attribute: NSLayoutAttributeRight multiplier:1 constant: buttonHeight - 6];
}
}

Expand Down Expand Up @@ -360,8 +362,28 @@ - (void)updateConstraintsForOrientation {
}
}

self.safeAreaConstraint.active = shouldActivateSafeAreaConstraint;
self.edgeConstraint.active = shouldActivateEdgeConstraint;
NSMutableArray *toActivate = [[NSMutableArray alloc] init];
NSMutableArray *toDeactivate = [[NSMutableArray alloc] init];

if (shouldActivateSafeAreaConstraint) {
[toActivate addObject: self.safeAreaConstraint];
} else {
[toDeactivate addObject: self.safeAreaConstraint];
}

if (shouldActivateEdgeConstraint) {
[toActivate addObject: self.edgeConstraint];
} else {
[toDeactivate addObject: self.edgeConstraint];
}

if (toDeactivate.count > 0) {
[NSLayoutConstraint deactivateConstraints: toDeactivate];
}

if (toActivate.count > 0) {
[NSLayoutConstraint activateConstraints: toActivate];
}
} @catch (id anException) {

}
Expand Down

0 comments on commit dff5717

Please sign in to comment.