Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TapTalk.io Public
TapTalk.io SDK for iOS
Commits
abaae4a2
Commit
abaae4a2
authored
6 years ago
by
Dominic Vedericho
Browse files
Options
Download
Plain Diff
Merge branch 'release/0.2.5'
parents
c6360a36
f4165f6a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
18 deletions
+70
-18
TapTalk.xcworkspace/xcuserdata/dominicvedericho.xcuserdatad/UserInterfaceState.xcuserstate
...minicvedericho.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
TapTalk/View Controllers/TAPPopUpInfoViewController.h
TapTalk/View Controllers/TAPPopUpInfoViewController.h
+3
-0
TapTalk/View Controllers/TAPPopUpInfoViewController.m
TapTalk/View Controllers/TAPPopUpInfoViewController.m
+66
-17
TapTalk/Views/TAPPopUpInfoView.m
TapTalk/Views/TAPPopUpInfoView.m
+1
-1
No files found.
TapTalk.xcworkspace/xcuserdata/dominicvedericho.xcuserdatad/UserInterfaceState.xcuserstate
View file @
abaae4a2
No preview for this file type
This diff is collapsed.
Click to expand it.
TapTalk/View Controllers/TAPPopUpInfoViewController.h
View file @
abaae4a2
...
...
@@ -27,8 +27,11 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
weak
,
nonatomic
)
id
<
TAPPopUpInfoViewControllerDelegate
>
delegate
;
@property
(
strong
,
nonatomic
)
TAPPopUpInfoView
*
popUpInfoView
;
@property
(
nonatomic
)
TAPPopUpInfoViewControllerType
popUpInfoViewControllerType
;
@property
(
strong
,
nonatomic
)
NSString
*
titleInformation
;
@property
(
strong
,
nonatomic
)
NSString
*
detailInformation
;
-
(
void
)
setPopUpInfoViewControllerType
:(
TAPPopUpInfoViewControllerType
)
popUpInfoViewControllerType
withTitle
:(
NSString
*
)
title
detailInformation
:(
NSString
*
)
detailInfo
;
-
(
void
)
showPopupInfoView
:(
BOOL
)
isShow
animated
:(
BOOL
)
animated
completion
:(
void
(
^
__nullable
)(
void
))
completion
;
@end
...
...
This diff is collapsed.
Click to expand it.
TapTalk/View Controllers/TAPPopUpInfoViewController.m
View file @
abaae4a2
...
...
@@ -18,40 +18,89 @@
@implementation
TAPPopUpInfoViewController
#pragma mark - Lifecycle
//- (void)loadView {
// [super loadView];
//}
-
(
void
)
loadView
{
[
super
loadView
];
_popUpInfoView
=
[[
TAPPopUpInfoView
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
];
[
self
.
popUpInfoView
.
leftButton
addTarget
:
self
action
:
@selector
(
popUpInfoViewHandleDidTappedLeftButton
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
popUpInfoView
.
rightButton
addTarget
:
self
action
:
@selector
(
popUpInfoViewHandleDidTappedRightButton
)
forControlEvents
:
UIControlEventTouchUpInside
];
self
.
popUpInfoView
.
alpha
=
0
.
0
f
;
[
self
.
view
addSubview
:
self
.
popUpInfoView
];
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
_popUpInfoView
=
[[
TAPPopUpInfoView
alloc
]
initWithFrame
:[
TAPBaseView
frameWithoutNavigationBar
]];
[
self
.
view
addSubview
:
self
.
popUpInfoView
];
self
.
view
.
backgroundColor
=
[
UIColor
clearColor
];
[
self
.
popUpInfoView
.
leftButton
addTarget
:
self
action
:
@selector
(
popUpInfoViewHandleDidTappedLeftButton
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
popUpInfoView
.
rightButton
addTarget
:
self
action
:
@selector
(
popUpInfoViewHandleDidTappedRightButton
)
forControlEvents
:
UIControlEventTouchUpInside
];
if
(
self
.
popUpInfoViewControllerType
==
TAPPopUpInfoViewControllerTypeErrorMessage
)
{
[
self
.
popUpInfoView
setPopupInfoViewType
:
TAPPopupInfoViewTypeErrorMessage
withTitle
:
self
.
titleInformation
detailInformation
:
self
.
detailInformation
];
[
self
.
popUpInfoView
isShowTwoOptionButton
:
NO
];
}
}
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
{
[
super
viewDidAppear
:
animated
];
[
self
showPopupInfoView
:
YES
animated
:
YES
completion
:^
{
}];
}
#pragma mark - Custom Method
-
(
void
)
popUpInfoViewHandleDidTappedLeftButton
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
popUpInfoViewControllerDidTappedLeftButton
)])
{
[
self
.
delegate
popUpInfoViewControllerDidTappedLeftButton
];
}
[
self
showPopupInfoView
:
NO
animated
:
YES
completion
:^
{
[
self
dismissViewControllerAnimated
:
NO
completion
:
^
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
popUpInfoViewControllerDidTappedLeftButton
)])
{
[
self
.
delegate
popUpInfoViewControllerDidTappedLeftButton
];
}
}];
}];
}
-
(
void
)
popUpInfoViewHandleDidTappedRightButton
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
popUpInfoViewControllerDidTappedSingleButtonOrRightButton
)])
{
[
self
.
delegate
popUpInfoViewControllerDidTappedSingleButtonOrRightButton
];
}
[
self
showPopupInfoView
:
NO
animated
:
YES
completion
:^
{
[
self
dismissViewControllerAnimated
:
NO
completion
:
^
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
popUpInfoViewControllerDidTappedSingleButtonOrRightButton
)])
{
[
self
.
delegate
popUpInfoViewControllerDidTappedSingleButtonOrRightButton
];
}
}];
}];
}
-
(
void
)
setPopUpInfoViewControllerType
:(
TAPPopUpInfoViewControllerType
)
popUpInfoViewControllerType
withTitle
:(
NSString
*
)
title
detailInformation
:(
NSString
*
)
detailInfo
{
_popUpInfoViewControllerType
=
popUpInfoViewControllerType
;
if
(
self
.
popUpInfoViewControllerType
==
TAPPopUpInfoViewControllerTypeErrorMessage
)
{
[
self
.
popUpInfoView
setPopupInfoViewType
:
TAPPopupInfoViewTypeErrorMessage
withTitle
:
title
detailInformation
:
detailInfo
];
[
self
.
popUpInfoView
isShowTwoOptionButton
:
NO
];
_titleInformation
=
title
;
_detailInformation
=
detailInfo
;
}
-
(
void
)
showPopupInfoView
:(
BOOL
)
isShow
animated
:(
BOOL
)
animated
completion
:(
void
(
^
)(
void
))
completion
{
if
(
animated
)
{
if
(
isShow
)
{
[
UIView
animateWithDuration
:
0
.
2
f
animations
:
^
{
self
.
popUpInfoView
.
alpha
=
1
.
0
f
;
}
completion
:^
(
BOOL
finished
)
{
completion
();
}];
}
else
{
[
UIView
animateWithDuration
:
0
.
2
f
animations
:
^
{
self
.
popUpInfoView
.
alpha
=
0
.
0
f
;
}
completion
:^
(
BOOL
finished
)
{
completion
();
}];
}
}
else
{
if
(
isShow
)
{
self
.
popUpInfoView
.
alpha
=
1
.
0
f
;
completion
();
}
else
{
self
.
popUpInfoView
.
alpha
=
0
.
0
f
;
completion
();
}
}
}
...
...
This diff is collapsed.
Click to expand it.
TapTalk/Views/TAPPopUpInfoView.m
View file @
abaae4a2
...
...
@@ -81,7 +81,7 @@
self
.
rightButton
.
frame
=
CGRectMake
(
CGRectGetMinX
(
self
.
rightButton
.
frame
),
CGRectGetMaxY
(
self
.
detailLabel
.
frame
)
+
16
.
0
f
,
CGRectGetWidth
(
self
.
rightButton
.
frame
),
CGRectGetHeight
(
self
.
rightButton
.
frame
));
self
.
leftButton
.
frame
=
CGRectMake
(
CGRectGetMinX
(
self
.
leftButton
.
frame
),
CGRectGetMinY
(
self
.
rightButton
.
frame
),
CGRectGetWidth
(
self
.
leftButton
.
frame
),
CGRectGetHeight
(
self
.
leftButton
.
frame
));
CGFloat
popupInfoViewHeight
=
CGRectGetMaxY
(
self
.
rightButton
.
frame
)
+
16
.
0
f
;
self
.
popupWhiteView
.
frame
=
CGRectMake
(
CGRectGetMinX
(
self
.
popupWhiteView
.
frame
),
(
CGRectGetHeight
(
self
.
frame
)
-
popupInfoViewHeight
)
/
2
.
0
f
,
CGRectGetWidth
(
self
.
popupWhiteView
.
frame
),
popupInfoViewHeight
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment