All Projects → zonghongyan → Evncustomsearchbar

zonghongyan / Evncustomsearchbar

Licence: mit
🔍Born for iOS 11 and iPhone X SearchBar

Projects that are alternatives of or similar to Evncustomsearchbar

Vhlnavigation
导航栏切换之颜色过渡切换,导航栏背景图片切换,微信红包两种不同颜色切换,导航栏透明度,有无导航栏切换
Stars: ✭ 210 (+303.85%)
Mutual labels:  iphone-x, ios11, navigationbar
iOS-ARKit
Basic Concepts and Projects using ARKit on iOS.
Stars: ✭ 18 (-65.38%)
Mutual labels:  xcode9, ios11
Swiftmessages
A very flexible message bar for iOS written in Swift.
Stars: ✭ 6,363 (+12136.54%)
Mutual labels:  iphone-x, ios11
Visual-Effects-Shadow
Add a drop shadow to a UIVisualEffectView using a 9-part UIImage.
Stars: ✭ 56 (+7.69%)
Mutual labels:  xcode9, ios11
DailyFeed
iOS client for newsapi.org
Stars: ✭ 128 (+146.15%)
Mutual labels:  ios11, iphone-x
RichNotifications
No description or website provided.
Stars: ✭ 44 (-15.38%)
Mutual labels:  xcode9, ios11
ARKitPhysics
ARKit Demo for Physics
Stars: ✭ 21 (-59.62%)
Mutual labels:  xcode9, ios11
Cs193p Fall 2017 Demo
Stanford CS193P Fall 2017 Demo
Stars: ✭ 157 (+201.92%)
Mutual labels:  xcode9, ios11
FacefARt
The world's most advanced fart app. Ever.
Stars: ✭ 13 (-75%)
Mutual labels:  ios11, iphone-x
Visionfacedetection
An example of use a Vision framework for face landmarks detection in iOS 11
Stars: ✭ 258 (+396.15%)
Mutual labels:  xcode9, ios11
Ios 11 By Examples
👨🏻‍💻 Examples of new iOS 11 APIs
Stars: ✭ 3,327 (+6298.08%)
Mutual labels:  xcode9, ios11
Measure
Using ARKit to make calculate the distance of real-world objects
Stars: ✭ 357 (+586.54%)
Mutual labels:  xcode9, ios11
Measurearkit
An example of measuring app with ARKit in iOS 11
Stars: ✭ 220 (+323.08%)
Mutual labels:  xcode9, ios11
Swatch
Watcher for Unit Tests written in Swift
Stars: ✭ 55 (+5.77%)
Mutual labels:  xcode9, iphone-x
Textdetection
Vision Framework Demo on Text Detection
Stars: ✭ 173 (+232.69%)
Mutual labels:  xcode9, ios11
iOS11-Demos
Collection of samples and demos of features introduced in iOS 11
Stars: ✭ 16 (-69.23%)
Mutual labels:  xcode9, ios11
Ios.blog.swiftui search bar in navigation bar
🔍 SwiftUI search bar in the navigation bar.
Stars: ✭ 124 (+138.46%)
Mutual labels:  navigationbar, searchbar
Swift Articles
Monthly Series - Top 10 Angular Articles
Stars: ✭ 139 (+167.31%)
Mutual labels:  xcode9, ios11
BabelCamera
Find out how to describe the things around you in another language with Core ML and the Vision framework in iOS 11! 👀
Stars: ✭ 13 (-75%)
Mutual labels:  xcode9, ios11
Instagram
A simple imitation of Instagram  app .
Stars: ✭ 346 (+565.38%)
Mutual labels:  iphone-x, ios11

EVNCustomSearchBar

🔍Born for iOS 11 and iPhone X SearchBar

Build Status CocoaPods Compatible License

预览图

other iPhone iPhone

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build EVNCustomSearchBar.

To integrate EVNCustomSearchBar into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
#use_frameworks!

target '<Your Target Name>' do

pod 'EVNCustomSearchBar', '~> 0.1.2'

end

Then, run the following command:

$ pod install

Use

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    [self initSearchBar];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark: 设置顶部导航搜索部分
- (void)initSearchBar
{
    self.navigationItem.titleView = self.searchBar;
    if (@available(iOS 11.0, *))
    {
        [self.searchBar.heightAnchor constraintLessThanOrEqualToConstant:kEVNScreenNavigationBarHeight].active = YES;
    }
    else
    {

    }


}

#pragma mark: getter method EVNCustomSearchBar
- (EVNCustomSearchBar *)searchBar
{
    if (!_searchBar)
    {
        _searchBar = [[EVNCustomSearchBar alloc] initWithFrame:CGRectMake(0, kEVNScreenStatusBarHeight, kEVNScreenWidth, kEVNScreenNavigationBarHeight)];

        _searchBar.backgroundColor = [UIColor clearColor]; // 清空searchBar的背景色
        _searchBar.iconImage = [UIImage imageNamed:@"EVNCustomSearchBar.bundle/searchImageBlack.png"];
//        _searchBar.iconImage = [UIImage imageNamed:@"EVNCustomSearchBar.bundle/searchImageTextColor.png"];
        _searchBar.iconAlign = EVNCustomSearchBarIconAlignCenter;
        [_searchBar setPlaceholder:@"请输入关键字"];  // 搜索框的占位符
        _searchBar.placeholderColor = TextGrayColor;
        _searchBar.delegate = self; // 设置代理
        [_searchBar sizeToFit];
    }
    return _searchBar;
}

#pragma mark: EVNCustomSearchBar delegate method
- (BOOL)searchBarShouldBeginEditing:(EVNCustomSearchBar *)searchBar
{
    NSLog(@"class: %@ function:%s", NSStringFromClass([self class]), __func__);
    return YES;
}

- (void)searchBarTextDidBeginEditing:(EVNCustomSearchBar *)searchBar
{
    NSLog(@"class: %@ function:%s", NSStringFromClass([self class]), __func__);
}

- (BOOL)searchBarShouldEndEditing:(EVNCustomSearchBar *)searchBar
{
    NSLog(@"class: %@ function:%s", NSStringFromClass([self class]), __func__);
    return YES;
}

- (void)searchBarTextDidEndEditing:(EVNCustomSearchBar *)searchBar
{
    NSLog(@"class: %@ function:%s", NSStringFromClass([self class]), __func__);
}

- (void)searchBar:(EVNCustomSearchBar *)searchBar textDidChange:(NSString *)searchText
{
    NSLog(@"class: %@ function:%s", NSStringFromClass([self class]), __func__);
}

- (BOOL)searchBar:(EVNCustomSearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    NSLog(@"class: %@ function:%s", NSStringFromClass([self class]), __func__);
    return YES;
}

- (void)searchBarSearchButtonClicked:(EVNCustomSearchBar *)searchBar
{
    NSLog(@"class: %@ function:%s", NSStringFromClass([self class]), __func__);
}

- (void)searchBarCancelButtonClicked:(EVNCustomSearchBar *)searchBar
{
    NSLog(@"class: %@ function:%s", NSStringFromClass([self class]), __func__);
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.searchBar resignFirstResponder];
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].