1659125940
When implementing peek, pop and preview actions with 3D Touch, you may want to support such features for users accessing your app from older devices that don't provide 3D Touch capibility. PeekView hence can be used as an alternative in such case.
Things that need improving
swift23
Just add the following line in to your pod file:
pod 'PeekView'
Drag and drop folder named Source
in your project and you're done.
UILongPressGestureRecognizer
to the view you want to peek (i.e table view cell, image, hypertext, etc.)UIViewController
instance as the content of your peek view; then set your desired frame for the content view. It's recommended to leave a 15px padding for both left and right margin of your content view.Sample snippet:
let options = [
PeekViewAction(title: "Option 1", style: .Destructive),
PeekViewAction(title: "Option 2", style: .Default),
PeekViewAction(title: "Option 3", style: .Selected) ]
PeekView().viewForController(
parentViewController: self,
contentViewController: controller,
expectedContentViewFrame: frame,
fromGesture: gestureRecognizer,
shouldHideStatusBar: true,
withOptions: options,
completionHandler: { optionIndex in
switch optionIndex {
case 0:
print("Option 1 selected")
case 1:
print("Option 2 selected")
case 2:
print("Option 3 selected")
default:
break
}
})
Be sure to check out the demo code for better understanding of the usage.
As for Objective-C integration, a slightly different static function should be used, in which the menuOptions
array is expected to be an NSArray
of NSDictionary
's. Please check the snippet below:
NSArray *options = @[@{@"Option 1": @(PeekViewActionStyleDefault)},
@{@"Option 2": @(PeekViewActionStyleDestructive)}];
UIViewController *contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"previewVC"];
[PeekView viewForControllerWithParentViewController:self
contentViewController:contentViewController
expectedContentViewFrame:CGRectMake(0, 0, 280, 400)
fromGesture:gesture
shouldHideStatusBar:YES
withOptions:options
completionHandler:nil];
PeekView uses ARC. If you are using PeekView in a non-arc project, you will need to set a -fobjc-arc
compiler flag on every PeekView source files. To set a compiler flag in Xcode, go to your active target and select the "Build Phases" tab. Then select PeekView source files, press Enter, insert -fobjc-arc and then "Done" to enable ARC for PeekView.
Contributions for bug fixing or improvements are welcome. Feel free to submit a pull request.
Author: itsmeichigo
Source Code: https://github.com/itsmeichigo/PeekView
License: MIT license
1659125940
When implementing peek, pop and preview actions with 3D Touch, you may want to support such features for users accessing your app from older devices that don't provide 3D Touch capibility. PeekView hence can be used as an alternative in such case.
Things that need improving
swift23
Just add the following line in to your pod file:
pod 'PeekView'
Drag and drop folder named Source
in your project and you're done.
UILongPressGestureRecognizer
to the view you want to peek (i.e table view cell, image, hypertext, etc.)UIViewController
instance as the content of your peek view; then set your desired frame for the content view. It's recommended to leave a 15px padding for both left and right margin of your content view.Sample snippet:
let options = [
PeekViewAction(title: "Option 1", style: .Destructive),
PeekViewAction(title: "Option 2", style: .Default),
PeekViewAction(title: "Option 3", style: .Selected) ]
PeekView().viewForController(
parentViewController: self,
contentViewController: controller,
expectedContentViewFrame: frame,
fromGesture: gestureRecognizer,
shouldHideStatusBar: true,
withOptions: options,
completionHandler: { optionIndex in
switch optionIndex {
case 0:
print("Option 1 selected")
case 1:
print("Option 2 selected")
case 2:
print("Option 3 selected")
default:
break
}
})
Be sure to check out the demo code for better understanding of the usage.
As for Objective-C integration, a slightly different static function should be used, in which the menuOptions
array is expected to be an NSArray
of NSDictionary
's. Please check the snippet below:
NSArray *options = @[@{@"Option 1": @(PeekViewActionStyleDefault)},
@{@"Option 2": @(PeekViewActionStyleDestructive)}];
UIViewController *contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"previewVC"];
[PeekView viewForControllerWithParentViewController:self
contentViewController:contentViewController
expectedContentViewFrame:CGRectMake(0, 0, 280, 400)
fromGesture:gesture
shouldHideStatusBar:YES
withOptions:options
completionHandler:nil];
PeekView uses ARC. If you are using PeekView in a non-arc project, you will need to set a -fobjc-arc
compiler flag on every PeekView source files. To set a compiler flag in Xcode, go to your active target and select the "Build Phases" tab. Then select PeekView source files, press Enter, insert -fobjc-arc and then "Done" to enable ARC for PeekView.
Contributions for bug fixing or improvements are welcome. Feel free to submit a pull request.
Author: itsmeichigo
Source Code: https://github.com/itsmeichigo/PeekView
License: MIT license
1626088193
iOS app development in Singapore
iOS has become the first priority for most smartphone users because of the security it offers compares to the Android operating system. Due to this reason, it is suggested to launch an app in iOS before other platforms.
Want to develop an iOS app in Singapore?
WebClues Infotech with its worldwide reach has already offered its iOS app development services to customers in Singapore. With a highly-skilled development team of 120+ members, WebClues Infotech has got the required resources an agency needs to fulfil client requirements around the world.
Want to know more about our iOS app development services in Singapore?
Visit: https://www.webcluesinfotech.com/iphone-app-development/
Share your requirements https://www.webcluesinfotech.com/contact-us/
View Portfolio https://www.webcluesinfotech.com/portfolio/
#ios app development in singapore #ios app development company #ios app development #ios #ios app #hire ios developer
1626088709
iOS App Development in the United Arab Emirates
Developed and Developing nations have seen a rapid rise in the demand for iOS app development and the United Arab Emirates is no exception. The use of on-demand apps has increased drastically in the last decade and business is leveraging this demand with launching iOS mobile apps.
Want to develop the iOS app in the United Arab Emirates?
WebClues Infotech after serving multiple clients in UAE has become well aware of the people’s needs in the region. With a highly experienced development team that has completed more than 950+ projects, we are prepared to serve you with your iOS app development needs.
Want to know more about our iOS App Development Services in UAE?
Visit: https://www.webcluesinfotech.com/iphone-app-development/
Share your requirements https://www.webcluesinfotech.com/contact-us/
View Portfolio https://www.webcluesinfotech.com/portfolio/
#ios app development in the united arab emirates #ios app development #ios app #ios #ios app development company #hire ios developer
1625914039
iOS app development company in India
India is considered the IT hub of the world because of n number of IT infrastructure development services offering companies. In this whole market iOS app development is the leading service offered by agencies across India
Want to develop the iOS app in India
WebClues Infotech with its head office in India has created a huge presence across the world over time and has served clients in all of the major countries around the world. WebClues Infotech with a highly skilled development team of 120+ members can help you deliver a better result at a reasonable cost.
Want to know more about our iOS app development services in India?
Visit: https://www.webcluesinfotech.com/iphone-app-development/
Share your requirements https://www.webcluesinfotech.com/contact-us/
View Portfolio https://www.webcluesinfotech.com/portfolio/
#ios app development company in india #ios app development company #ios app development #ios app #ios #hire ios app developer
1625742351
iOS App Development Agency in the USA
Whenever a start-up in the USA launch an MVP version of the app they prefer to launch it only for iPhone user because the US has a large market of iPhone users in comparison to Android. The recent phenomenon of Clubhouse is the biggest example.
Want to develop an iOS app in the USA?
With 2 office locations across the USA and 6 worldwide, WebClues Infotech has the experience of serving a huge client base of 600+. After such a satisfied client base, WebClues Infotech is prepared to serve you with and iOS App Development Services in the USA.
Want to know more about our iOS App Development Services in the USA?
Visit: https://www.webcluesinfotech.com/iphone-app-development/
Share your requirements https://www.webcluesinfotech.com/contact-us/
View Portfolio https://www.webcluesinfotech.com/portfolio/
#ios app development agency in the usa #ios app development agency #ios app development #ios app #ios #hire ios app developer