I’m attempting to implement methodology swizzling in Swift to intercept touchesBegan and touchesEnded strategies throughout all UIResponder situations. Nonetheless, I am encountering points the place the unique strategies contained in the UIViewContoller usually are not being known as,
In brief
The swizzled strategies usually are not calling the unique touchesBegan and touchesEnded strategies in my UIViewController
Right here is the code I am utilizing:
extension UIResponder {
static let swizzleTouchMethods: Void = {
let originalBeganSelector = #selector(touchesBegan(_:with:))
let swizzledBeganSelector = #selector(xxx_touchesBegan(_:with:))
guard let originalBeganMethod = class_getInstanceMethod(UIView.self, originalBeganSelector),
let swizzledBeganMethod = class_getInstanceMethod(UIView.self, swizzledBeganSelector) else {
return
}
method_exchangeImplementations(originalBeganMethod, swizzledBeganMethod)
let originalMovedSelector = #selector(touchesMoved(_:with:))
let swizzledMovedSelector = #selector(xxx_touchesMoved(_:with:))
guard let originalMovedMethod = class_getInstanceMethod(UIView.self, originalMovedSelector),
let swizzledMovedMethod = class_getInstanceMethod(UIView.self, swizzledMovedSelector) else {
return
}
method_exchangeImplementations(originalMovedMethod, swizzledMovedMethod)
let originalEndedSelector = #selector(touchesEnded(_:with:))
let swizzledEndedSelector = #selector(xxx_touchesEnded(_:with:))
guard let originalEndedMethod = class_getInstanceMethod(UIView.self, originalEndedSelector),
let swizzledEndedMethod = class_getInstanceMethod(UIView.self, swizzledEndedSelector) else {
return
}
method_exchangeImplementations(originalEndedMethod, swizzledEndedMethod)
}()
@objc func xxx_touchesBegan(_ touches: Set, with occasion: UIEvent?) {
if let contact = touches.first {
print("Swizzled contact started at: radius (contact.majorRadius)")
}
// Name the unique methodology (which is now swizzled)
self.xxx_touchesBegan(touches, with: occasion)
}
@objc func xxx_touchesMoved(_ touches: Set, with occasion: UIEvent?) {
if let contact = touches.first {
print("Swizzled contact moved at: radius (contact.majorRadius)")
}
// Name the unique methodology (which is now swizzled)
self.xxx_touchesMoved(touches, with: occasion)
}
@objc func xxx_touchesEnded(_ touches: Set, with occasion: UIEvent?) {
if let contact = touches.first {
print("Swizzled contact ended at: radius (contact.majorRadius)")
}
// Name the unique methodology (which is now swizzled)
self.xxx_touchesEnded(touches, with: occasion)
}
}
ultimate class MyViewController: UIViewController {
override func viewDidLoad() {
tremendous.viewDidLoad()
UIResponder.swizzleTouchMethods
}
override func touchesBegan(_ touches: Set, with occasion: UIEvent?) {
tremendous.touchesBegan(touches, with: occasion)
print("unique touchesBegan occasion")
}
override func touchesEnded(_ touches: Set, with occasion: UIEvent?) {
tremendous.touchesEnded(touches, with: occasion)
print("unique touchesEnded occasion")
}
}
EV gross sales in the USA rose 11 % throughout the first quarter of 2025, to about 300,000 vehicles and lightweight vans, in keeping with Cox Automotive. That’s a lot better than the general new automobile market, which confirmed no enhance from 2024. General, about 8 % of latest home automobile gross sales have been electrical, Cox mentioned, a slight enhance from 2024. “Regardless of many obstacles — and what chances are you’ll learn elsewhere — electrical car gross sales proceed to develop at a wholesome tempo within the US market,” Cox mentioned.
One electrical automobile firm that’s not experiencing progress is Tesla. It nonetheless is the electrical automobile gross sales chief within the US, with 44 % of the market in keeping with Cox Automotive, however a 12 months in the past within the first quarter it had 51 % of the market. Its efficiency within the US mirrors its efficiency globally. Tesla gross sales in March have been 337,000 vehicles worldwide, 13 % fewer than in March of 2024. CleanTechnica readers know the explanations — an growing old choice of fashions, poor gross sales of the Cybertruck, rising competitors, retooling manufacturing traces for the brand new Mannequin Y, and Musk’s embrace of MAGAlomaniac insurance policies which has led to protests at Tesla dealerships and alienated many patrons.
Gross sales of the Cybertruck have been 6,400 within the first quarter — double the overall from a 12 months in the past — however the firm was simply ramping up manufacturing final 12 months, so any comparability is skewed. The true check of what’s occurring with the Cybertruck is the truth that Tesla now refuses to simply accept them as trade-ins for brand new Tesla automobiles, a coverage no different producer has ever instituted. If Tesla doesn’t need its personal automobiles, why would anybody else? It’s now trying to spice up gross sales by reducing costs on decontented fashions, however would you purchase any car for those who knew the producer would refuse to offer you ten cents for it after you’re taking supply?
The large winner seems to be GM, which delivered 10,300 Chevy Equinox EV vehicles within the first quarter, a robust exhibiting for a automobile went on sale towards the tip of final 12 months. The Chevy Blazer EV is now in showrooms and having fun with robust curiosity from prospects. All collectively, gross sales of GM electrical vehicles, together with Cadillac and GMC, accounted for 11 % of the electrical car market within the first quarter — up from 6 % a 12 months earlier. Whereas GM suffered by means of sluggish and typically painful product launches for its electrical vehicles in 2023 and 2024, these fashions are actually beginning to see important numbers of gross sales.
GM Is An EV Gross sales Chief
Greater than 30,000 EVs from Basic Motors manufacturers have been bought final quarter, almost doubling the amount from a 12 months in the past and passing each Ford and Hyundai alongside the way in which. Whereas the Ford Mustang Mach-E was the perfect promoting EV within the US that was not a Tesla, Honda and Acura added greater than 14,000 EVs to the US market final quarter. That’s up from zero a 12 months in the past. Anybody who tries to say the EV revolution within the US is useless is both misinformed or mendacity.
The remainder of 2025 will probably be a risky one for EV gross sales within the US, regardless of the introduction of latest fashions. If the brand new auto tariffs maintain, they’ll pose a monumental problem for a lot of automakers, notably as a result of tariffs on metal and aluminum. About two thirds of the EVs bought within the U.S. final 12 months have been assembled within the US, however like all fashionable vehicles, the required elements and parts are sourced from across the globe. China is the world’s main provider of EV battery supplies, which suggests the present tariff conflict between the US and China will distort the market considerably.
The present so-called president loves nothing greater than forcing others to “kiss his ass,” as he’s so fond of claiming. How elegant. Add to that the heavy hypothesis that the brand new administration will reverse Biden-era EV gross sales incentives and the story for EV gross sales in Q2 and past is murky at greatest. Cox Automotive analyst Stephanie Streaty mentioned, “The 12 months definitely began robust, however the highway forward will likely be something however easy.”
EV Gross sales Are Up Worldwide
Per week in the past, my colleague Jose Pontes reported that gross sales of EVs — each plug-in hybrids and battery electrics — have been up 49 % in February 2025 in comparison with February 2024 and now account for 19 % of the worldwide new automobile market. In Norway, effectively over 95 % of all new vehicles have plugs and Pontes speculated that Singapore will probably be the subsequent new automobile market to change into just about all EVs. It needs to be famous that EV incentives in lots of nations have been lowered or eradicated lately. Germany particularly has sharply curtailed its incentive program, which led to a steep drop in EV gross sales in 2024.
Nevertheless, within the first few months of this 12 months, EV gross sales in Europe have been up strongly — up 17 % in February regardless of the general market being down 3 %. That final stat ought to seize your consideration. Globally, new automobile gross sales are declining. Fewer new vehicles are being bought and extra of them are battery electrics or plug-in hybrids.
And but, the temper in America about electrical vehicles remains to be fairly chilly. The key US automakers have a plan to counter the brand new tariff madness from the Moron of Mar-A-Loco and it’s this — construct extra pickup vans and huge SUVs. The furor over Elon Musk’s fascist diatribes has had a knock on impact on all electrical vehicles as a result of for the previous decade or extra America has related electrical vehicles with Tesla. In my condominium group in DeSantistan, a modest proposal so as to add two EV chargers is going through opposition from homeowners who’re satisfied they’ll make their insurance coverage premiums go up and topic their pets to electrocution. We’ve neighbors who nonetheless inform us we can’t drive our Tesla by means of a puddle or take it to a automobile wash.
Thankfully, regardless of their mania for larger, heavier automobiles, Ford and GM have saved their electrical automobile applications alive with Chevrolet now the main electrical automobile firm not named Tesla. The Equinox EV is promoting effectively and the Blazer EV is now available after a rocky begin attributable to software program glitches pressured the corporate to droop manufacturing for some time to determine issues out. The brand new up to date Chevy Bolt will likely be in manufacturing quickly. Hyundai now has its first devoted EV manufacturing unit in operation close to Savannah, Georgia and continues — together with Kia — to supply Individuals a choice of interesting electrical and plug-in hybrid fashions at reasonably priced costs.
The EV revolution within the US could also be taking longer than many people hoped but it surely continues to construct momentum. EV advocates prefer to tout an extended listing of advantages that come from proudly owning an electrical automobile — no oil adjustments, no smelly fuel pumps, no transmission repairs, fewer brake jobs, and so forth — however the perfect purpose to personal one is the driving expertise. Folks have to really feel the easy move of immediate energy, the enjoyment of regenerative braking, and the quietness of the trip for themselves. It’s just like the distinction between an quaint propeller pushed airplane and a jet. When you expertise it, there isn’t a going again.
Boumarang has added floor and subsurface robots to its drone lineup. Supply: Wavedrone
Boumarang Inc., a pacesetter in hydrogen-powered autonomous aerial drones, final week mentioned it has acquired all mental property rights to the Wavedrone platform from Shore Home IVF, a expertise developer primarily based within the Faroe Islands.
“This acquisition aligns with our mission to guide in autonomous, sustainable options,” acknowledged Dánial Hoydal, director of Shore Home IVF. “Boumarang’s imaginative and prescient and capabilities place Wavedrone for speedy commercialization and international deployment.”
Wavedrone is an autonomous system designed for aquatic environments, providing twin above-and-below-surface filming capabilities, modularity, and plug-and-play usability. Developed to deal with real-world challenges in marine commentary, search operations, and environmental intelligence, the uncrewed floor vessel (USV) has already garnered sturdy curiosity throughout various sectors, mentioned Shore Home.
Wavedrone extends attain from sky to sea
The worldwide drone market may surpass $100 billion by 2030 with growing demand for hybrid and water-based options, in line with Market.Us. Boumarang claimed its hydrogen-powered drones “have set new requirements in efficiency and sustainability.”
The Irvine, Calif.-based firm has designed multi-purpose, AI-driven robots to deal with industrial, infrastructural, humanitarian, and army challenges. From autonomous last-mile product supply to emergency response and infrastructure restore, Boumarang mentioned its customizable methods provide efficiency, patented stability, and superior lifting capability.
Boumarang added that its integration of Wavedrone positions it to seize important market share past aerial drones. The corporate mentioned it’ll lengthen its attain into aquatic purposes together with:
Environmental monitoring – Actual-time information for water high quality, local weather affect, and air pollution mapping
Media and leisure – Cinematography above and beneath the floor for movie, sports activities, and exploration
Search and rescue – Fast aquatic surveillance for life-saving operations
Aquaculture and fisheries – Monitoring marine well being, infrastructure, and fish shares
BioKey additionally invests in Boumarang
The $3.5 million acquisition was executed solely in Boumarang widespread inventory and marks a big step in Boumarang’s strategic enlargement from air to sea.
In a concurrent transaction, BioKey Worldwide (Nasdaq: BKIY) invested in Boumarang by buying 5 million shares in change for 20% of BKIY’s issued and excellent shares. The businesses mentioned this strategic fairness swap strengthens their synergy, aligning their long-term objectives within the quickly evolving autonomous expertise sector.
“The partnership not solely enhances Boumarang’s capitalization and visibility, but in addition supplies BioKey with direct publicity to Boumarang’s cutting-edge hydrogen-powered drone improvements throughout aerial and maritime purposes,” the corporate asserted.
Boumarang mentioned it’s in search of companions, traders, and trade stakeholders concerned about exploring Wavedrone’s potential. Demonstrations, prototypes, and partnership alternatives are actually obtainable upon request.