Wednesday, September 25, 2019

iOS returns a temporary IP address if wifi is turned off and airplane mode is on 196.254.x.x

this article talks about the different ip ranges
https://kb.iu.edu/d/aoyj

How to create a custom header in tableview section that stretch when orientation changes

    override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        if section == TableSections.OtherDevices.rawValue {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: tableView.bounds.width, height: SetupConstants.DEFAULT_HEADER_HEIGHT))

            self.spinner.center = CGPoint(x:(tableView.bounds.size.width - (SetupConstants.DEFAULT_HEADER_HEIGHT / 2)), y:SetupConstants.DEFAULT_HEADER_HEIGHT/2)
            spinner.hidesWhenStopped = true
            spinner.startAnimating()
            spinner.color = UIColor.blue
            
            v.addSubview(spinner)
            spinner.autoresizingMask = .flexibleLeftMargin
            v.autoresizingMask = .flexibleWidth
            return v
        }
        return nil
    }

Monday, September 23, 2019

Print c++ map to logs

// TODO: (ravij): remove this code after testing is complete >>>
  long unsigned mySize = static_cast<long unsigned>(parameterMap.size());
  ZF_LOGD("number of items in teh config map %lu", mySize);
  for ( auto it = parameterMap.begin(); it != parameterMap.end(); ++it )
    std::cout << " " << it->first << ":" << it->second;

  std::cout << std::endl;